Hacker News new | ask | show | jobs
by benhoyt 3234 days ago
Counterpoint I wrote a while back that focuses on compilation speed: http://benhoyt.com/writings/language-speed/

I've used Scala a fair bit recently, and the compiler is so dog slow it's painful. Maybe it's just my relative fluency with Python, but I find I'm much more productive with Python's almost instant edit-compile-run sequence.

Edit: I do like many of the benefits of static typing, though. I think mypy is coming into its own in the Python community, especially now with Guido behind it. Maybe this kind of optional typing is the best of both worlds...

4 comments

There's no reason why a statically typed language cannot also use an interpreter and avoid expensive optimisation and code generation upfront. For example, GHC Haskell has an interpreter, runHaskell, that will run a Haskell program straightaway with little delay (type checking is fast).
Check out D (https://dlang.org/). It has a reasonably powerful static type system and the dmd compiler is lighting fast.
I would prefer mandatory typing with a dev mode that makes it optional for speed. With optional typing, you end up with the third party ecosystem not having typing, which makes it hard to enforce type safety with a codebase that is fully type safe itself.
that's one of the things go got right - they had fast compilation speed as a first-class goal right from the beginning.
They also have a really, really simple type system that can't play very many of the games that type system experts would like to play, so it doesn't cost them a lot of runtime at compile time.

I'm sort of curious what the abstract minimum penalty is for the very advanced type systems. Are GHC (Haskell) and rustc already within, say, 5x of the optimal possible speed, or might we be able to have a very advanced type system and faster compiling? Time shall tell, I suppose.