3 ms·
I noticed Nim allows using the Go GC as an option. How does this work? Does it compile into Go as a target language? Or can it link with Go's (ever changing) AB
by nu11ptr 4y ago
I noticed Nim allows using the Go GC as an option. How does this work? Does it compile into Go as a target language? Or can it link with Go's (ever changing) ABI? Or is the Go GC available as a standalone C lib? I'm just curious how this works...anybody know?
EDIT: I think I found it - looks like it actually isn't new: https://forum.nim-lang.org/t/1278 https://forum.nim-lang.org/t/1278. Sounds like the answer is: Links via GCCGO to their channel implementation. Compatible GC was written in Nim to go with it.
- ok_dad 4y agoOK, so we have languages for nearly every niche now; Zig has it's allocator thing and goes with C very well, Go has goroutines and channels and CSP, Python has data science, Java has support/libraries for everything, etc. Let me suggest a new one: a language which is top-dog in it's language interoperability. Imagine a language that can do nearly nothing except glue together code from other languages. Maybe you want to call some Java code from some Go code from some Nim code from some Python code from your C program: this language would do that for you somehow.
- kaba0 4y agoThat’s just python, and I’m only half joking. Another idea for that would be GraalVM’s Truffle. It’s not a language, more of a universal VM, but it can actually already just eval some python code, use the resulting code from Java and pass it on to JS. It also has support for any LLVM language, so C can be invoked from/be invoked from any of the aforementioned languages. And it can even optimize across language boundaries, pretty incredible.
- elcritch 4y agoNim has an edge over Python as it can compile to C, ObjC, C++, JS. Meaning it can do native FFI in each of those. It can also compile to really fast and small WASM too. However it takes a long time to accrue enough good wrappers and bindings.
- SuaveSteve 4y agoRemember when Python was described as a glue language that was also good for prototyping? I guess business just ignored the prototyping part.
- nu11ptr 4y agoha - I've had my "interop" language in my head forever. FFI primarily by generating code directly into every lang (haxe-style), but ideally with a better lang behind it (imagine Python and Rust had a baby). Oh if I had the time...would be fun.