4 ms·
It is painful but inevitable. There is no single language that does the garbage collection great on behalf of you. However we are getting closer and closer to f
by majidazimi 9y ago
It is painful but inevitable. There is no single language that does the garbage collection great on behalf of you. However we are getting closer and closer to find smarter ways to do manual garbage collection.
- adrianN 9y agoModern garbage collectors are actually okay for most workloads. "Great" is not necessary for almost all applications.
- pjmlp 9y agoMy only complaint is that if Java and .NET were AOT compiled to native code since the beginning, instead of leaving it to third parties while taking about 20 years to adopt it, C and C++ would be less relevant than they turned out to be. Tracing GC is not an issue for the majority of applications, and just because a language has a GC doesn't mean it lacks support for value types, e.g. Modula-3, System C#, ... Regarding affine types, while a great approach, the ergonomics still need to be improved.
- Sandman 9y agoThe whole point (or rather, one of the points) of Java and .net are that they are NOT compiled to native code but to bytecode so that you can write code once and then run it on many different systems without having to compile it again.
- pjmlp 9y agoOne does not preclude the other, it is only a matter of distribution, like the mainframes taught us eons ago, by combining JIT/AOT on their toolchains. The fact that Oracle, Microsoft, Google and Apple are now on the JIT/AOT train, tells it all. To be fair, .NET always had AOT native compilation support from the early days, but NGEN is a simple AOT compiler only meant for faster startup.
- majidazimi 9y agoEven hello world programs tend to show different performance characteristics on different OS/platforms. The idea of write once, run everywhere is over. In a moderately complex software, changing the OS/platform is a non trivial problem. Recompiling the code (which is mostly automated) is the least problematic part of it.
- adrianN 9y agoAre you familiar with the joys of autoconf, cmake and friends? Have you tried writing a non-trivial application that simply compiles on different flavors of Linux and Windows? Compiling on different platforms is also a non-trivial problem. Having a virtualised platform that abstracts away differences between OS makes it vastly easier to write portable applications. For many applications running on a VM on different platforms Just Works. The idea is most definitely not over, in fact it is becoming ever more popular. Just look at the rise of abominations like Electron.
- pjmlp 9y agoThose joys are only enjoyed for those that insist into using C with POSIX APIs covering for lack of a rich standard library. We don't need VMs, what we need is rich libraries and there are plenty of languages with support for AOT compilation to native code with such libraries. Something that even C++ is finally adopting. Regarding Electron, I hope it joins MSHTML in a couple of years.