Live data from Hacker News

Reasonable Scala Compiler

github.com

81–90 of 161 posts

Re: Reasonable Scala Compiler

#81
post #79

This truly means we still lack a programming language with: 1. reasonable support of object oriented programming. 2. reasonable support of functional programming. 3. solid concurrency features. 4. runs comparable to native code. 5. simple to learn. Even though it is not difficult to create such a language but we see a new language poping out every now and then and none of them try to solve these issues.

What I'm looking for in a language: 1. Solid mix of functional programming and Object oriented programming (though FP is more important - I'd gladly give up inheritance if I get good support for interfaces and traits instead) 2. Static type checking 3. Good support for efficient immutable data structures. 4. Solid concurrency features 5. Easy cross-compilation to and interaction with JS 5a. Cross-compilation to iOS a…

I think you've covered the main options. At a guess: Maybe F# if you're willing to go with a smaller open-source community. Maybe Rust or Idris if you're willing to deal with something a bit less mature with less tooling. Maybe Swift, Crystal or Nim, though I know less about them and their communities seem smaller.

Re: Reasonable Scala Compiler

#82
post #57

Earlier quoted context omitted.

These all exist, you just don't agree with them being reasonable: Scala, Common Lisp, C++, D, Clojure, F#, OCaml, Kotlin, etc. Those could all count or not depending on your subjective opinion. The truth is, it is difficult to create the perfect language, and any sufficiently complete language will always start to have part of it that suffer in exchange.

> Scala, Common Lisp, C++, D, Clojure, F#, OCaml, Kotlin, etc. Out of those, only OCaml really provides “reasonable” support for functional programming. The ability to manipulate compound values (say, lists or trees) directly, without using objects having a queryable physical identity, is of course a prerequisite. > it is difficult to create the perfect language, and any sufficiently complete language (...) Maybe the…

While OCaml might be the most reasonable in theory, AFAIK opam on Windows still doesn't work. Also its standard library is too minimal for my liking.

Re: Reasonable Scala Compiler

#83
post #40

This truly means we still lack a programming language with: 1. reasonable support of object oriented programming. 2. reasonable support of functional programming. 3. solid concurrency features. 4. runs comparable to native code. 5. simple to learn. Even though it is not difficult to create such a language but we see a new language poping out every now and then and none of them try to solve these issues.

Kotlin? 1. OOP: https://www.packtpub.com/mapt/book/application_development/9... 2. FP: https://blog.plan99.net/kotlin-fp-3bf63a17d64a 3. Concurrency: https://kotlinlang.org/docs/reference/coroutines.html 4. Native: https://github.com/JetBrains/kotlin-native 5. Simple: https://try.kotlinlang.org/

Kotlin doesn't really support FP in the modern sense of the term; effects are all special cases in the language (null, async), so you can't abstract over them generically (e.g. you could never implement "traverse" in Kotlin because you can't even write the type signature it's supposed to have) and you can't use a custom effect if you want to do something the language designers haven't thought of. E.g. there's no nice way to do validation where you want to have a message in the case of failure (in some ways this is actually a regression from Java, which at least had checked exceptions for this kind of use case, not that they're a great solution).

Re: Reasonable Scala Compiler

#85
post #67
post #40

Earlier quoted context omitted.

Kotlin? 1. OOP: https://www.packtpub.com/mapt/book/application_development/9... 2. FP: https://blog.plan99.net/kotlin-fp-3bf63a17d64a 3. Concurrency: https://kotlinlang.org/docs/reference/coroutines.html 4. Native: https://github.com/JetBrains/kotlin-native 5. Simple: https://try.kotlinlang.org/

Scala has scala-native: https://github.com/scala-native/scala-native Any myriad of FP (scalaz, cats), concurrency libraries (rx, akka) scastie: https://scastie.scala-lang.org/ scala.js: https://www.scala-js.org/ This FP-focused fork of the Scala compiler: http://typelevel.org/scala/ The next gen Scala compiler called dotty: http://dotty.epfl.ch/ Twitter doesn't mention scala-native...

[deleted]

Re: Reasonable Scala Compiler

#86

> Identify a subset of Scala that can be compiled with reasonable speed I am afraid of Scala fragmentation. There is no way new compiler can be 100% compatible. Hopefully it will be tested on major projects, or there will be some official Scala Language spec. It would be nice to add a switch into old scalac, which downgrades its features, to make it compatible with new scalac. I believe Scala has too many features, a…

> There is no way new compiler can be 100% compatible. Hopefully it will be tested on major projects, or there will be some official Scala Language spec. I, for one, think that an official language spec would do the language a lot of good. As it stands, it is sometimes difficult to separate bugs from features in scalac...

I am not sure how complete/correct it is, but there is one for 2.9 [1]

Martin Odersky & co have been focusing most of their effort the last few years on Dotty (aka Scala 3), which succeeded in giving in giving Scala a proven theoretical basis in exchange for a few esoteric typesystem features they couldn't prove. [2]

[1]: http://www.scala-lang.org/old/sites/default/files/linuxsoft_...

[2] http://www.scala-lang.org/blog/2016/02/03/essence-of-scala.h...

Re: Reasonable Scala Compiler

#87
post #79

This truly means we still lack a programming language with: 1. reasonable support of object oriented programming. 2. reasonable support of functional programming. 3. solid concurrency features. 4. runs comparable to native code. 5. simple to learn. Even though it is not difficult to create such a language but we see a new language poping out every now and then and none of them try to solve these issues.

What I'm looking for in a language: 1. Solid mix of functional programming and Object oriented programming (though FP is more important - I'd gladly give up inheritance if I get good support for interfaces and traits instead) 2. Static type checking 3. Good support for efficient immutable data structures. 4. Solid concurrency features 5. Easy cross-compilation to and interaction with JS 5a. Cross-compilation to iOS a…

Besides the options you mentioned I really think Typescript is a high contender on that list. Even though it's just Javascript with typing it ticks most boxes you mention. Depending on how you value some features (e.g. nr. 5) it might even be the best option.

Re: Reasonable Scala Compiler

#89

Earlier quoted context omitted.

> it's insane to write your own language > switch to Java or kotlin ah yes rewriting in a new language, the classic not-insane approach

I offered several alternatives and I made it clear they belong in a spectrum. Don't make it sound like I claimed it was binary. If the options are "Keep writing in Scala", "Port to Kotlin" and "Write a Scala compiler", the latter is clearly the worst and most costly of all.

It worked out for Facebook and PHP so maybe that is why they want to give it a try.

Re: Reasonable Scala Compiler

#90

This truly means we still lack a programming language with: 1. reasonable support of object oriented programming. 2. reasonable support of functional programming. 3. solid concurrency features. 4. runs comparable to native code. 5. simple to learn. Even though it is not difficult to create such a language but we see a new language poping out every now and then and none of them try to solve these issues.

Common Lisp comes to mind (ducks) ;)
Post reply on HN