3 ms·
> Not sure compiling to C as an extra step is going to do to reliablity or performance in Nim but we'll see. Interesting times. At least as far as Rust is conc
by pcwalton 12y ago
> Not sure compiling to C as an extra step is going to do to reliablity or performance in Nim but we'll see. Interesting times.
At least as far as Rust is concerned, I firmly believe that compiling to LLVM IR was the right choice. When you compile to C, you're limited by what the language gives you, so you're out of luck if you want to annotate the IR with optimization info like GC metadata, precise aliasing info, or tail call annotations. Most importantly, though, in order to integrate well with debuggers like GDB and LLDB, you need exact control over the contents of the DWARF DIEs so that you can present your data structures to the user properly. LLVM IR gives you this capability, but the best you can do in C is #line.
- renox 12y agoAlso it allowed Rust devs to define an interesting semantic for integer overflow (trap on debug, on release either trap or contain an undefined value) I don't think that they would have been able to use the 'undefined value' vs 'undefined whole program' if they had chosen to generate C.