3 ms·
Garbage collection is orthogonal to "native", by which I take you to mean compiled to native machine code as opposed to something like Java's bytecode compilati
by Jtsummers 2y ago
Garbage collection is orthogonal to "native", by which I take you to mean compiled to native machine code as opposed to something like Java's bytecode compilation or an interpreted language.
Go, D, Common Lisp (implementation dependent), and others offer GC and native compilation.
If you count automatic reference counting like Objective-C's ARC, you can add it and Swift to the list of natively compiled languages with GC.
- superjan 2y agoI don’t disagree, but I was responding to a claim that the JVM has _all_ the advantages of fully native languages. Fully native allows you to choose to have no runtime, or a garbage collector, and in some environments (realtime, OS kernel, AAA games) that is overwhelmingly the preferred option.
- deleted 2y ago[deleted]
- blibble 2y agoin Java you can turn off the GC completely and you can also compile to native code
- shizzy0 2y agoYou can in theory turn off gc but in practice no one does this because nearly everything is written with the assumption that allocations will be cleaned up by the gc. The compiler has no switches to help you run in a non-gc’d state. At best you can control when you run the gc.
- blibble 2y ago> nearly everything is written with the assumption that allocations will be cleaned up by the gc zero garbage Java it is relatively common in algorithmic trading > but in practice no one does this that's funny, I could swear we do
- CRConrad 2y ago> Fully native allows you to choose to have no runtime, or a garbage collector, Are you quite sure of that? I think you're getting stuff mixed up here. AFAICS, a native-compiled language might very well have mandatory garbage collection. Not that any such language immediately springs to mind, and I'm not even sure any do actually exist, but surely they could exist. The concepts "native compilation" and "garbage collection" are, AIUI, orthogonal.
- actionfromafar 2y agoThere were/are a bunch of Java to native compilers.