4 ms·
‘Growing a Language’ and the ‘Are We There Yet’ presentations changed the way I look at languages, so right now I would say my “perfect” high-level PL would be
by kaba0 4y ago
‘Growing a Language’ and the ‘Are We There Yet’ presentations changed the way I look at languages, so right now I would say my “perfect” high-level PL would be a Java-like language (possibly running on the JVM due to ecosystem-reuse and the killer GCs and performance) where immutable “objects”/values are the first-class citizens, but method implementations can use local, mutable semantics. I would also very much add a ‘pure’ keyword marking side-effectless functions/methods.
It sort of sounds like Scala though, but I would probably settle for a weaker type system but with constraints (like JML or Clojure’s spec) that are tried to be proven at compile time but will fall-back to be checked at runtime in debug mode (and if marked so, even in prod). Also, would probably make Clojure’s atom/ref/etc concurrency primitives the “most first-class”, so other than the possibly mutable method implementations, everything would be safe+ concurrency-wise.
It is pretty much a mix between Scala and Clojure, or a non-lisp clojure with some types, so not really original..
Oh, and Haskell’s target typing for number literals, I honestly don’t understand why don’t we use that everywhere.
+ AFAIK, deadlocks can’t be statically guaranteed
- hyperswine 4y agoHm, a weaker type system? I dont really see much of a point in that, though type inference is quite good
- kaba0 4y agoWell, it would have been probably more clear to say I wouldn’t go all-in on the type system and if something would have to get a tradeoff I’m okay with the type system being weakened for that. I’m quite okay with e.g. Haskell’s type system up to a point (including monads), but some even more exotic feature and borderline dependent types are not something I would put into the language (I will let other languages be the testing grounds for these ideas!), as I think that most interesting properties will not be provable either way and that a constrain-based approach may scale better.
- cpurdy 4y agoGuy Steele was in the office next to mine at Oracle. We had a lot of long chats about language design, and I've tried to keep him up to date on the work we've done with Ecstasy including * Java-like language * immutable “objects”/values are the first-class citizens * method implementations can use local, mutable semantics (including mutable captures)