Are there any programming languages/runtimes/frameworks with a "garbage collection" strategy of just never collecting any garbage? (During program execution; obviously the memory would be freed when the process exited)
It wouldn't work for _most_ use cases, but for extremely short lived programs (e.g. CLI scripts) it seems like this would be an easy way to avoid the stop-the-world costs of a GC without any memory safety risks.
Does this exist? Or am I missing some reason it'd be dumb?
> Scala Native has a 'none' GC, and I think I've heard it recommended for such short-lived programs
Very interesting, thanks! As someone who has never used Scala, I had thought of it as pretty inappropriate for short-lived programs (see, e.g.,
https://github.com/bdrung/startup-time )
Is that wrong? Or wrong for Scala Native? (which I'm even less familiar with, but sounds like something that'd have better startup times)
@codesections (I'm not surprised Java/Scala perform poorly on a 'hello world', that's indeed definitely not what they're optimized for. I'm kinda surprised at the difference between Java and Scala - I wonder if that still holds on more recent versions. But it's largely academic interest, they will still not perform 'well' for this case ;) )
> I'm not surprised Java/Scala perform poorly on a 'hello world' [startup time benchmark], that's indeed definitely not what they're optimized for. I'm kinda surprised at the difference between Java and Scala - I wonder if that still holds on more recent versions.
I've actually been testing startup times locally, and I get 40ms for javac 11.0.10, and 516ms for scalac 2.11.12 (and 810ms for Clojure, for comparison). I should add Scala Native, though.
Does Scala work with nailgun?
@codesections indeed faster startup times are one of the main motivations for Scala Native :)