Hi everyone! Today we’ve released Dotty 0.14.0-RC1. This release brings some new features such as the export keyword meant as a dual of import, the creator applications syntax and a bunch of others.
I am glad about the update, but what bothers me is that you introduce new keywords. I had hopes that Dotty would focus on simplification instead, as complexity is the main barrier for switching to Scala and we see that Scala’s popularity is declining (see latest TIOBE index). I understand that new keywords can be useful for experienced Scala developers but they can scare others off.
Having said this, I’m not a huge fan of introducing new keywords to Scala. I really would like to see the language be simplified as much as possible, but I think we have also seen that the “small set of orthogonal features” can lead to confusion as there are potentially too many ways to accomplish certain things.
What I would really want to preserve in Scala is the idea of having “levels” to Martin described many years ago. I teach Scala to novice programmers and it works well because you can do all the introductory programming stuff with scripts and a fairly non-complex subset of the language. There really is a version of Scala that is mostly self-contained that is almost like statically typed Python. This is what I think we need to maintain. As long as the new keywords and added complexity go at different levels and can possibly even be spread out across levels, I think that we are fine.
What needs to happen then is having materials that present Scala to new people in an appropriate way, growing in complexity as the developer needs it and not trying to throw the whole language at them right off the bat.
I think this is the wrong way to think about it. One of the main problems I’ve seen with inexperienced Scala developers is that the catch-all keyword “implicit” means a number of different related concepts, which both confuses and scares people. Breaking that out into more-focused concepts seems likely to make it a bit easier to learn, IMO.
Besides, I don’t think there is any clear evidence that number of keywords is related to either the popularity or ease of learning a language. Conceptual simplicity matters, but folks tend to pick up keywords without even noticing them.
Agreed. I’ve actually been toying with the idea of drafting a strawman version of updated levels (both adding new stuff and removing several things that IMO don’t belong there any more), for us to discuss – while they’re not hard-and-fast, I think they make a useful shorthand, especially when teaching folks and discussing pedagogy, and help emphasize that “learning Scala” generally should not mean learning all of Scala in most cases…
As far as a beginner is concerned println might as well be a keyword. The number of keywords in the language is most certainly not a pressing concern for beginners.
IMO this is definitional to what Scala is. Sure there’s a tradeoff between buying a ready-made item and a DIY kit. It’s the tradeoff between convenience and freedom. If I didn’t value flexibility I might not be using Scala.
I don’t understand the issue with having multiple ways to do something, as long as all the ways work, unless we’re talking about a perfectionist struggling with choice paralysis. (Personally I hit this more when writing prose than writing Scala, though). Excluding that, if there are two ways to do something and you can’t decide, just flip a coin or something. The real problem is when there are too many paths to take and you don’t know which of them even lead to where you need to get to at all. Yes this is more of an issue in a “small set of orthogonal features” language (hence the importance of “small” in that phrase), but IMO it ultimately comes down to a good understanding of the features, which comes down to good documentation, as well as ensuring those features are as simple as possible and interact as unsurprisingly as possible.
Of course, it’s not a binary choice; we could make the features somewhat less orthogonal. But if you turn the dial too far, you’re talking about a fundamentally different language, even if it has mostly the same syntax as Scala.
In any case, I’m not clear how this relates to the thread – does Export affect feature orthogonality?