by socialdemocrat · 5y ago · 0 comments
Nim, Crystal and Swift all compile to native code and is designed for that.
Swift is not a GC language in the normal sense since it uses automatic reference counting. That is fully deterministic and with low latency. There is no stop the world to collect garbage like with Java and C#.
Swift is akin to C++ code with smart pointers.
VM vs native is one way, but you can also go by the level of abstraction they provide, which very much puts them in the same category.
Also, this debate comes up every time, but ARC is widely classified as a form of garbage collection, just not a tracing one. It is transparent and automatic to the user. (Well, apart from cycles)
FWIW Chris Lattner, the language creator, put Swift into a non-GC camp.
Widely acknowledged CS books see it differently,
LLVM, GIMPLE, TIMI, TenDRA,...
Java and C# also targeet native code,
.NET Native, CoreRT, IL2CPP, Mono AOT, SubstrateVM, GCJ, ExcelsiorJET, OpenJ9, PTC, Aicas,...
Languages and implementations are orthogonal.
Also, you can compile both Java and Kotlin to native images with Graal.