30 ms·
Dotty: a next generation compiler for Scala
- troels 10y agoThat's going to cause some confusion ... http://www.graphviz.org/ http://www.graphviz.org/
- nrinaudo 10y agoWell, dot already stands for both graphviz and Microsoft DOc Template, so there already is some level of confusion there.
- cranium 10y agoDOT is just the name of the calculus used to prove the core of the language (and Dotty the name of the new compiler). It won't appear often in the literature meant for the general public so I don't think there will be much confusion.
- smegel 10y ago> Is it the future Scala? Yes, it will be - eventually. I thought, that's a big claim -- then saw who is working on it.
- nrinaudo 10y agoIt also means that the main designer of the Scala language is not working on Scala but on a language that will "eventually" become the future of Scala, which means that, right now, dotty is not the future of Scala. A lot of very smart people seem to be very excited about that, I can't help but find it ominous.
- enlait 10y agoAside from very much needed java 8 support in 2.12, Scala, IMO, has little need for more bells and whistles. Making a sound and coherent foundation instead would be much appreciated. Will it break a lot of codebases? Yes, it will.
- grogs 10y agoWhich is what Dotty is attempting to do, but hopefully with minimal codebase breakage. There's a tradeoff between breakage and improvement, but I'd like not to wait 10 years before I can use dotty (like python 2 to python 3). We can always have another dotty in 5 years time for another round of rationalisation/simplification.
- sandisk5 10y ago> It also means that the main designer of the Scala language is not working on Scala No, it means that person is not working only on Scala, or rather the current implementation of Scala. People can work on multiple projects over the course of a year/years. > on a language that will "eventually" become the future of Scala You changed "Is it the future Scala? Yes, it will be - eventually" (I think can best be reworded "eventually be the future Scala") to "eventually become the future of Scala." To me, those have different connotations. The former means that it's not finished yet, but when it is it will be the base of Scala at that time. The latter implies, to me, that at some time in the future this will be the base of Scala at some time further in the future. > which means that, right now, dotty is not the future of Scala And here's where that different meaning leads you wrong. dotty is the future of Scala right now, but it's not that future Scala yet. > A lot of very smart people seem to be very excited about that, I can't help but find it ominous. People are generally happy to have to the creator of something they like working on its future. Scala is being maintained. Improvements and releases are being made in the meantime. More than one person can work on Scala, and a single person can work on multiple aspects of Scala. Big changes like dotty are being carefully planned and executed at the same time other changes are made. People are excited that Scala is continuing to evolve and becoming a better language, and that a beloved innovator/creator is playing a significant role in that.
- nrinaudo 10y agoRight, yes, I read "the future of Scala" but that isn't what it said at all. My mistake entirely, you're absolutely correct. On the other hand, I stand by my "not working on Scala" comment. This is based on commit history, which I admit might not give the whole picture but is certainly a fairly strong indication: https://github.com/scala/scala/graphs/contributors https://github.com/scala/scala/graphs/contributors Odersky's activity has drastically diminished towards the end of 2012, with his last Scala commit in July, 2014. I've no issue with him doing exactly what he wishes, he owes the community (or at least, me) absolutely nothing and if he's more excited to work on Dotty than on Scala, then there is no doubt that's what he should be doing. My concern is that the more I look at Dotty, the more it looks like a very promising language that looks a lot like Scala, but that adds and removes some features to it - that is to say, not actually Scala. I've no trouble imagining a future where the differences grow enough that they stay / become entirely distinct, and seeing a large chunk of the brains behind Scala busy on Dotty doesn't feel me with confidence in the former's future.
- darkdimius 10y agoHi. I'm one of main developers of Dotty. I've gave answers to similar concerns here: https://www.reddit.com/r/programming/comments/44um2l/fear_uncertainty_and_doubt_in_scala_land/cztb6zx https://www.reddit.com/r/programming/comments/44um2l/fear_un...
- nrinaudo 10y agoThanks. I'll give this a thorough read - I think it deserves more than the cursory read I can afford to give it right now - and appreciate the time investment this no doubt represents.
- virtualwhys 10y ago> Dotty is not in conflict with Scala, like Valhalla is not in conflict with Java. from the linked thread that takes about 1/100 of the time to read as you've written casting doubt on the Scala to Dotty transition ;-)
- nrinaudo 10y agoWell, two answers to that. The first is that the linked post answers a lot of points, but not the ones I made. It makes Dotty sounds really exciting, which it is. It makes it sound as if everybody working on Dotty believes it to be the future of Scala, and I believe that to be true, too. What it does not do (that I could see) is give reassurance that Dotty and Scala will not drift appart and become two similar but incompatible languages. I felt it'd be rude to point this out, since there really is no way to provide such guarantees (just like there really is no way for me to back up my worries with anything concrete). The second part is, I'm not casting doubts, but expressing worries. I'm not saying it will happen, I fear it might. I'm sorry if this offends - I really am, my goal is not to insult anyone or demean anyone's work. I have no hidden agenda, and I'm not trying to be one of these anti-Scala trolls that sometime crop up. I love Scala. Look at my github profile, most of my public work is in Scala, and some of my libraries represent a lot of work (which obviously does not mean they're actually any good). I really, really hope everything works out the way people mean it to - as I said, Dotty sounds really exciting. I've seen too many "let's rewrite this from scratch and then make it backward compatible, it'll be amazing" projects to be able to believe it blindly, though.
- bad_user 10y agoWhy do you find it ominous? Scala 2.12, the next version that's currently at milestone 4, is going to be a huge release, having a new backend, optimizations, Java 8 interop, improvements for the type system, refactorings, basically the real deal. But Scala needs to be production quality and stable enough for real work TM. Like when they were pushing experiments in Scala, people were complaining that Scala breaks too often. Apparently now people are afraid that the experiments have moved to Dotty. You can't please everybody.
- nrinaudo 10y agoMy fear is that the feature sets diverge enough that we get two very similar but distinct languages and a split community. I'm not afraid that the experiments have moved to Dotty. That's an ideal scenario, if successful ones are indeed ported to Scala. I'm just not convinced they will be.
- premium-concern 10y agoThe plan is to get the feature sets closer together, not to diverge.
- nrinaudo 10y agoAbsolutely. I'm saying I fear reality and theory might diverge and we find ourselves with a split language / community. I highly doubt anybody set out to write Python 3 thinking "it'll mess with the community for years to come, muhahaha".
- premium-concern 10y agoScala devs have the tools to make sure it doesn't happen, Python didn't.
- adriaanm 10y agoWithout getting too philosophical, I don't see what's so ominous about the present not being the future or vice versa. All we have is the present, really. It's easy to verify for yourself who's working on Scala right now: https://github.com/scala/scala/graphs/contributors https://github.com/scala/scala/graphs/contributors (work on Dotty started around 2012, when I moved from EPFL to Typesafe). Myself, retronym & lrytz are on the Scala team at Lightbend. I'm proud of what we've accomplished with 2.10, 2.11 (8 minor releases!) and 2.12 (RC1 coming soon -- see my comment above), and excited about what the future holds for Scala! We work together closely with Martin's Dotty team, exchanging ideas about compiler performance and convergence of language features in Scala 2 and Dotty (the incubator for the future of Scala).
- nrinaudo 10y agoIf you feel my comments were dismissive of your work, or your team's work, then I owe you an apology. You're right to be proud of what you've done, it's quite a list of achievements and I can only hope I ever produce work of that quality.
- adriaanm 10y agoThanks, I appreciate it! Also, thank you for sharing your feedback & concerns. I acknowledge we need to communicate more.
- salex89 10y agoNot directly related, but: do the world a favor and build a new SBT! This <<= one += is a bit -> """strange""" .
- evacchi 10y agoStrongly agree. SBT really is puzzling and (IMO) overcomplicated. Someone is working on an experimental alternative called CBT which is pure Scala (as in: less DSL like syntax)
- imtringued 10y agoI'm not even sure why the acronym stands for simple build tool.
- evacchi 10y agoI think they refitted the acronym into "Scala Build Tool" a few years ago
- tycondryus 10y agoindeed, they did!
- agumonkey 10y agoWhat was the original meaning then ? sluggish bloat transducer ?
- choward 10y agoSucks big time
- deleted 10y ago[deleted]
- skrebbel 10y agoI'm bummed that CBT doesn't stand for "Complex Build Tool"
- dschiptsov 10y agoSimplification instead of piling up, clarifying and redoing right, as understanding grows, instead of adding extensions (like crippled lambdas to Java) and reduction to closest approximation to the [unattainable] optimum (smallest possible, well balanced set of mutually complementing each other features, like in R5RS) in general - is the right way. I hope Swift will eventually stop piling up features and will try to get back to the right fundamentals too.)
- jpliska 10y agoHave you all seen Kotlin?
- premium-concern 10y agoYes, it's like they reinvent all the things that were considered but discarded in Scala and believe they found something nobody ever thought about before.
- partisan 10y agoI am not sure that Kotlin competes with Scala in any way. They are trying to remove the pain from Java by providing a concise and safe language (see the quotes from their website below). What are "all the things" they reinvented that were discard in Scala? > Kotlin is a pragmatic programming language for JVM and Android that combines OO and functional features and is focused on interoperability, safety, clarity and tooling support. > Being a general-purpose language, Kotlin works everywhere where Java works: server-side applications, mobile applications (Android), desktop applications.
- ionforce 10y agoKotlin competes with Scala in that they are both alternatives to Java.
- premium-concern 10y ago> What are "all the things" they reinvented that were discard in Scala? Extension methods, properties, special syntax for everything, final by default, short constructor syntax, trying to put band-aid around Java's broken collection types, ...
- codecamper 10y agolooking forward to seeing (reading about) how fast it is.
- jinst8gmi 10y agoAccording to Odersky's recent talk [1, 2] it's about twice as fast as the current Scala compiler and should still improve significantly. [1] https://www.youtube.com/watch?v=_2oGY8l67jk https://www.youtube.com/watch?v=_2oGY8l67jk [2] http://www.slideshare.net/Odersky/scala-days-nyc-2016 http://www.slideshare.net/Odersky/scala-days-nyc-2016 (slide 21)
- wereHamster 10y ago> I think we can do better than Monads to achieve this. (slide 52) Looking forward to their solution.
- Blaisorblade0 10y agoFor anybody curious, I think he's hinting at modern effect systems, on which there's lots of research these days. He advised for instance Lukas Rytz PhD thesis at EPFL (and Lukas Rytz is still working on Scala, now at Lightbend).
- jakozaur 10y agoPrevious discussion: https://news.ycombinator.com/item?id=10482585 https://news.ycombinator.com/item?id=10482585
- youjiuzhifeng 10y agoThere are many evolutions for Scala. Here is a compiler to compile scala code to native: https://github.com/scala-native/scala-native https://github.com/scala-native/scala-native
- johncolanduoni 10y agoWow, this looks like exactly what I've been looking for. What is the interop story as far as Java/existing Scala code?
- hepta 10y agoInterop with Java seems unlikely unless they keep a JVM tucked away somewhere.
- johncolanduoni 10y agoNow that I look at it, they essentially do, it's just that they implement it from a more Scala-centric point of view (e.g. implementing traits directly instead of being layered on top of a Java variant). It seems like it shouldn't be too hard to compile JVM bytecode to run on the same runtime.
- dmit 10y agoA subset of the Java standard library will be reimplemented, so most Scala code that only relies on that subset will just work. Java libraries and Scala code relying on Java dependencies will not work. This is similar to the current state of Scala.js.
- duaneb 10y agoAs of now, virtually non-existent.
- phischu 10y agoThe linked page links to a set of slides: http://www.slideshare.net/Odersky/compilers-are-databases http://www.slideshare.net/Odersky/compilers-are-databases I have a question regarding slides 29 to 31. The author says an untyped tree is represented as Tree[Nothing]. This leads to undesired variance behavior which is in turn overriden. But there cannot be any instances of type Tree[Nothing] because there are no instances of type Nothing. Wouldn't an untyped tree be better represented as Tree[Unit]?
- modersky 10y agoThere can be instances of Tree[Nothing], just like there can be instances of List[Nothing]. It just means that in a scenario like this: class Tree[T] { def elem: T } if t is a Tree[Nothing] then t.elem will not return normally (it might throw an exception instead).
- phischu 10y agoThank you.
- wereHamster 10y agoOk, so there are instances, which throw exceptions, fine, we're in Java land after all, where anything can happen. But why is Tree[Nothing] more useful than Tree[Unit]? Both contain the same amount of information (both Nothing and Unit convey zero bits of information), but one throws an exception while the other is safe at runtime.
- duhace 10y agoTree[Nothing] is a subtype of all Tree[_] types. This is similar to Nil in scala, which is really a singleton implementation of List[Nothing] or None, which is a singleton implementation of Option[Nothing]. Unit does not have this property, it is just a subtype of AnyVal/Any. Basically, Tree[Nothing] allows you to indicate that a Tree is empty via the type system while still allowing you to use that same type to build an actual tree from. If Nil was List[Unit] instead of List[Nothing], 1 :: Nil would be a compile time error instead of a List[Int]. Oh, and Unit does have an implementation in scala called "()", so if you had a Tree[Unit] you would not be able to tell if it was actually empty or not. You can see this in scala with () :: Nil. It produces a non-empty List[Unit]. Nothing has no such implementation. As for the exceptions, there's not much you can do wrt that. What should happen if you call head on an empty List? That's a straight-out error. headOption or a match block is the safe way to deal with lists if you don't want to have exceptions ever.
- cryptos 10y agoCan't help, but I don't like these click a button to scroll down to relevant content presentations. That is the new style of the doomed splash screens.
- walkingolof 10y agoLooking forward to this, its a bold step to start from "scratch", but in return the Scala community will get a compiler that have solid theoretical foundation, better performance and more utility for development tools. Scala's Road Ahead - by Martin Odersky https://www.youtube.com/watch?v=_2oGY8l67jk https://www.youtube.com/watch?v=_2oGY8l67jk
- agounaris 10y agoI build a tool, for the tool, which is a better tool of the tool to create bytecode. Seriously adding up stack in order to solve complexity, actually creates more complexity.
- bad_user 10y agoI don't really understand your point. Is that a truism? Is it related to the freaking article? Also, have you built a tool or was that sarcasm?
- Blaisorblade0 10y agoAssuming I get him correctly, that's bad sarcasm. I'd recommend instead this joke on JavaScript toolchain: http://cube-drone.com/comics/c/relentless-persistence http://cube-drone.com/comics/c/relentless-persistence Compilers are huge beasts, but good ones are worthwhile, and Dotty is a better Scala compiler, so this criticism seems misdirected.
- insulanian 10y agoWhat's the chance for this to become a new Python 3 story?
- premium-concern 10y agoZero. People are actively aware of what happened in Python 2/3. The good thing is that Scala is a typed language, so they can a) provide tooling for migrating code b) compile things and get clear information about how much differences there are I think somebody said that necessary lines of change from Scala 2 -> Scala 3 should be below 0.1% to be acceptable.
- jinst8gmi 10y agoOdersky gave some details of language features being removed for Scala 3 in his talk and it seemed to be really obscure features I don't use anyway.
- rbonvall 10y agoPython may not be statically typed, but they still have an automated tool for migrating from 2 to 3.
- jonstewart 10y ago...which covers only a subset of conversion issues and offers no guarantees.
- outworlder 10y ago... and that is different from Scala how?
- Blaisorblade0 10y agoUnlike Scala, you can't figure out what Python code means correctly and statically — you have little idea what will be called by a function without running the code up to that point, so it's hard to do semantics-preserving refactorings. But Python changed Strings to use Unicode, and that's something everybody uses and that is insanely hard to refactor automatically even with types. For Dotty, instead, there are some hard-to-refactor-for changes, but they're in really advanced Scala things, so I expect they'll affect fewer users — mostly the kind of users who can write shapeless-like stuff.
- joneholland 10y agoWe are a big scala shop at Expedia and it's concerning that Martin is more interested in Dotty. Scala 2.12 is late, and not having easy java8 interoperability is becoming more and more of an issue. I love the language but it is becoming harder to recommend it for new things due to the ambiguous roadmap.
- hocuspocus 10y agoI fail to see how this is concerning. Scala isn't a one-man project. Martin is a university professor, i.e. someone supposed to work on education and academic research. It's already pretty remarkable that so many students and researchers at LAMP/EPFL (funded by Swiss taxpayers) are working on real-world projects, that you can use in production at your commercial company.
- oelang 10y agoOne small correction, they're funded by the Swiss taxpayers and the European union.
- vatican_banker 10y agoI fail to see why the "funded by Swiss taxpayers" is relevant. For instance, you are using the internet, funded by US taxpayers. So stop the Swiss circlejerk :)
- norswap 10y agoDotty is Scala. It's an experimental project with the aim to clean up stuff and be eventually mainlined. And I think a bit of simplification and formalization is exactly what Scala needs, in the long run.
- jondot 10y agoWhen I read this, I can't think of anything else but Scala fatigue. As a CTO migrating a company from .NET to the JVM, I found there's already a mess of conforming to a subset of Scala within real (and more importantly - ordinary) teams. What subset of Scala? what libraries? what build system? apparently if things worked well, there would be at just one true - and well respected - answer for these. So now I ask, honestly, why not go with Kotlin (https://kotlinlang.org/ https://kotlinlang.org/)? a language that IMHO didn't try to rule the world from day one (a Good Thing), but scores high on aesthetics, abstraction, power, IDE, compilation speed, and Java integration. I have been following (and playing with) Scala since a bit before the Yammer thing exploded, I've been following Odersky as a student listening to the OOPSLA podcasts, and I never got to convince myself Scala is worth it. Can someone convince me to still use Scala when Kotlin is around?
- polskibus 10y agoCan you share the reasons for migration?
- jondot 10y agoWe bought a company, and that company had a technology that was based on the JVM. We were on .NET. The domain dictated that we needed a 'heavy lifting' framework like .NET or the JVM. We did also work with Ruby, nodejs, and Go for certain microservices. So now, decision making time: - Do you reimplement in .NET ? - Do you live with both .NET and JVM bases? - Do you migrate existing systems from .NET to Java? The .NET system was aging in any case, people needed a fresh breath of air, and it was nice to get rid of all of the Microsoft licensing and closed garden. It is then when I decided the new-gen stack would be Java8 and Kotlin, side-by-side. Kotlin was (and still is) amazing.
- romanovcode 10y ago>all of the Microsoft licensing and closed garden You mean the horrors of MIT[0] license? [0] - https://github.com/Microsoft/dotnet/blob/master/LICENSE https://github.com/Microsoft/dotnet/blob/master/LICENSE
- HypeInference 10y ago"@adriaanm our plan for Scala is to declare JIRA bankruptcy and run for the githubs. Maybe take the top half of the open issues with us." https://twitter.com/adriaanm/status/571073842434547712 https://twitter.com/adriaanm/status/571073842434547712
- monocasa 10y agoIs this enough to run chisel?
- oconnor0 10y agoWhat is the relationship between Dotty and Scala Native?
- malcolmgreaves 10y agoDoes anyone know if structural typing is not coming to dotty without the need for runtime reflection?