Things are still mostly pretty quiet on the Dotty-repo front, with folks focused on readying Scala 3 for release. But there are some fun bits still happening in the background.
One of those is this PR from a couple of days ago, which is getting some active discussion. It would add a new
@experimental annotation, basically lifting the notion of “experimental” features up into language-space, rather than being hardcoded in the compiler.
IMO this is a great idea, at least in principle — it extends Scala’s usual “no magic” ethos into yet another aspect of the language. They’re still discussing…
Spreading the word for the other software-law geeks: the decision has come down on Oracle v Google, and it went the right way.
Summarizing very briefly (and possibly a little inaccurately — IANAL, and I haven’t read the ruling in detail yet): the Android phone operating system, like a large fraction of the software world, is more or less built on top of the Java Virtual Machine, which was invented by Sun decades ago and bought by Oracle. Google decided to reimplement the API for the JVM to suit their needs — basically, providing a new implementation for the existing…
Just when I think the Dotty project is completely settling down into staid boring bugfixes, a new experiment comes along.
Let’s note upfront: even more than usual, this is super-duper experimental — just a draft PR, far from merged, much less being seriously discussed for inclusion in Scala 3. I suspect that, at the earliest, we might wind up talking about something like this in stdlib for 3.1.
That said, check out this fascinating PR from Martin. It is basically kicking the tires with a way that you could implement typesafe checked Exceptions in Scala, with no runtime overhead, with…
I’ve been busy with other things lately, so haven’t been paying as much attention to the Dotty News column. And really, you would think that not much would be happening in Dotty right now, as things move towards release. But there’s still some ferment, so here are a few of the more interesting things currently going on.
In general, Martin has been trying to reduce the number of strange uses of
_ in Dotty. We’re all familiar with the fact that Scala uses underscore as what I usually call the “enh” operator — it’s used for a wide variety of…
Readers here know that I’m not entirely a fan of Scala 3’s optional-braces feature. (I don’t entirely despise it, but I don’t like it, and personally I think it’s been pushed too hard in the leadup to 3.0.)
Anyway, Martin has opened a discussion around it on the Contributors Forum. Folks who have thoughts should give that a read, and consider chiming in. (I’m still gathering my own thoughts.)
One meta-comment around that — this issue has raised a lot of passions, and discussions about it have recently become excessively heated. So please, keep it civil: a frank discussion of the pros and cons are in order, but flamewars aren’t. Thanks!
I haven’t been writing much here lately (mostly because I’ve been very busy with my day job), but there’s a really interesting conversation going on right now in the Dotty repo.
It’s well worth reading the thread if you are interested in the fine details of Scala, and especially if you care about the type system. The high concept is to make the language more precise and correct by introducing a
Top type above
Any, or possibly modifying
Any, or other possibilities — it’s a deep discussion, and pretty fascinating.
ETA: here is a thread over on the Contributors Forum about the proposed
Matchable trait, which is the current version of the proposal — discussion is best on the Forum.
For those who have been following the saga of making Scala 3 more null-safe, I recommend checking out this new PR, which introduces a new approach.
Reminder of the context: for Scala 3 (whether 3.0 or possibly a later release), the desire is to no longer allow
null as a valid value for arbitrary
AnyRefs. Instead, you would need to treat it explicitly — if your value might be nullable, you have to use a type of
Foo | Null. This would reduce the scope of possible null pointer exceptions even more than is traditional in Scala.
But if you…
Things have gotten fairly quiet on the Dotty News front, as the team has in recent months refocused away from new features and towards solidifying the Dotty compiler in time for a Scala 3 launch late this year. (Solidifying the compiler is terribly important, but tends not to produce “news” that the community mostly cares about.)
But here’s an interesting bit of news: Martin has proposed a small syntax change to pattern-matching. Where we currently would see:
case s @ Success(x, in1) => ...
case f @ Failure(_, in1) => ...
it would instead become:
Latest on the Dotty front: Martin has begun a draft PR to significantly rewrite the way Extension Methods work.
This is far from complete at this point; the most interesting bit is the rewrite of the documentation, which gives you a sense of the new design. I recommend reading through that. (The examples are all written using the new significant-spacing design, which I still find hard to read, but they make more sense when I mentally translate them to include the missing braces.)
My personal reaction is slightly mixed: the proposal removes the infix syntax for defining extension methods, which…
The Dotty project is doing fewer big user-visible changes these days, and focusing more on fixing bugs and making everything consistent. But once in a while, a significant change still pops up.
So for those following along at home, I call your attention to this PR that just got opened. It’s still a draft, so it’s way, way early, but worth paying attention to. It’s a major change to the long-standing project of making Scala more null-safe, by making nulls more explicit.
The complication there is, how do you work with external APIs that might produce nulls? …
Lifelong programmer and software architect, specializing in online social tools and (nowadays) Scala. Architect of Querki (“leading the small data revolution”).