The Scala team continues to refine Scala 3, fixing bugs, refining existing features, and introducing some experimental features for Scala 3.1. Here are a few highlights.
Programming Scala, Third Edition is now available. It provides a comprehensive introduction to Scala 3 for experienced Scala developers, as well as a complete introduction to Scala for new Scala developers.
This patch release mostly fixes bugs and makes small refinements that don’t impact the book’s contents, with two exceptions I’ll discuss here.
During my recent trip to the Ruby Mountains in Nevada, I tried out the inexpensive and compact Move Shoot Move star tracker. This isn’t a full review, just my initial impressions, as I didn’t have a lot of time to try it out (for reasons I’ll mention below).
Here is the MSM setup for star tracking I used (recreated in the lab!):
A star tracker rotates the attached camera or telescope to continue pointing at the same part of the sky, if properly aligned! This allows for much longer exposures without movement of the objects in the sky. …
I spent a week in the Ruby Mountains of Nevada last month. I’ve posted my best pictures to Flickr.
I just purchased the Syrp Genie Micro and several of their motion control devices. You can see the Micro below mounted in my camera’s hot shoe.
The compatibility list says the Syrp Genie Micro and Genie Mini II can control the Sony A7RIV, but I had a little trouble getting it to work. Hence, this quick post discusses what I learned.
The first thing you do with any new Syrp product is connect to it with the iOS or Android Syrp…
Last time I introduced one of the new metaprogramming features in Scala 3, the
inline keyword and how it affects source code. The example I used also contained a macro definition, using quoting and splicing. This post introduces those concepts.
Programming Scala, Third Edition is now available. It provides a comprehensive introduction to Scala 3 changes for experienced Scala developers, as well as a complete introduction to Scala for new Scala developers.
Here is the previous example, which ensures that an invariant holds before and after a block of code is executed.
Quotation and splicing are the key components…
I haven’t blogged yet about the new metaprogramming system in Scala 3, so let’s start that now. First, let’s look at the new
inline keyword, which causes the compiler to “inline” the decorated code.
Programming Scala, Third Edition is now published! It provides a comprehensive introduction to all the new features in Scala 3, while also introducing the Scala 2 features you’ll still need to know for working with an existing code base. Programming Scala, Third Edition is aimed at experienced Scala developers who want to learn what’s new, as well as professional developers getting started with Scala.
Scala 3.0.0 is now final!
After 8+ years of effort, Scala 3 was officially released this week. This blog post on the Scala language website provides some details, along with a cool visualization of the evolving git tree over that time.
Programming Scala, Third Edition is almost finished, too. We’re in the final production steps with a planned ebook release early in June. Print copies will be available a few weeks later.
I’ll return with more posts about Scala 3 features soon.
For a concise summary of most of the notable changes in Scala 3, see my new Scala 3 Highlights page.
Late in the Scala 3 development process, a new type
scala.Matchable was introduced to fix a loophole in pattern matching. This post discusses that loophole, how
Matchable fixes it, and implications of this change.
For an even more concise summary of most of the notable changes in Scala 3, see my new Scala 3 Highlights page.
For a long time, Scala has supported a useful “trick” called infix operator notation. If a method takes a single argument, you can call it without the period after the instance and without parentheses around the argument. This post describes changes in Scala 3.
For example, if I have a
Matrix class and a
+ method to add matrices, element by element, I can write
matrix1.+(matrix2) or use the less cluttered and more intuitive syntax,
matrix1 + matrix2. The intention was to support true operators, like
+ in intuitive contexts like this. …
Type lambdas are the type analog of “value lambdas”, also known as functions 🤓. This post explores them. The discussion naturally leads to the new ability to parameterize the types of functions, which was previously only supported for methods. While I’m at it, I’ll mention another method feature that’s now supported for functions, dependent function types.
March 8, 2021: Updated the Functor example after helpful feedback from Sergei Winitzki.
Let’s suppose we wanted to…
(With apologies to Bob Dylan.)
This post covers how some uses in Scala 2 of the underscore,
_, are being replaced with alternatives. The contexts include import and the new export statements and type parameter wild cards. Along the way, I’ll discuss other changes for import statements, the new export statement, and a syntax change for repeated parameter lists (a.k.a., variable argument lists).
Scala 3.0.0-RC1 is out! This means the language changes should be done. The discussion of import syntax changes below was the last major change. …