4 ms·
From "Accurate Garbage Collection with LLVM" [1]: "LLVM’s intermediate representation provides garbage collection intrinsics that offer support for a broad cla
by AlexanderDhoore 14y ago
From "Accurate Garbage Collection with LLVM" [1]:
"LLVM’s intermediate representation provides garbage collection intrinsics that offer support for a broad class of collector models.
[...] We hope that the primitive support built into the LLVM IR is sufficient to support a broad class of garbage collected languages including Scheme, ML, Java, C#, Perl, Python, Lua, Ruby, other scripting languages, and more.
However, LLVM does not itself provide a garbage collector — this should be part of your language’s runtime library. LLVM provides a framework for compile time code generation plugins. The role of these plugins is to generate code and data structures which conforms to the binary interface specified by the runtime library. This is similar to the relationship between LLVM and DWARF debugging info, for example. The difference primarily lies in the lack of an established standard in the domain of garbage collection — thus the plugins.
[...]
On the plus side, this means that you should be able to integrate LLVM with an existing runtime. On the other hand, it leaves a lot of work for the developer of a novel language. However, it’s easy to get started quickly and scale up to a more sophisticated implementation as your compiler matures."
[1] http://llvm.org/docs/GarbageCollection.html http://llvm.org/docs/GarbageCollection.html