<div dir="ltr"><div><div>Hello,<br><br></div>I'd like to introduce to the list a new, LLVM-based compiler for the Nim language (<a href="http://nim-lang.org">http://nim-lang.org</a>) - <a href="https://github.com/arnetheduck/nlvm">https://github.com/arnetheduck/nlvm</a>. <br><br>Nim itself is a nice little statically typed language with many handy features such as meta-programming, garbage collection, etc. Python programmers will also be happy to know that indentation is significant.<br><br></div><div>To say that I've written the compiler would of course be a gross overstatement. Nim's own compiler produces a semantically analyzed and simplified AST that it later translates to C, and with LLVM providing everything from intermediate representation to machine code generation, there's not much left to do for an aspiring compiler writer these days - I've merely glued together the Nim AST with LLVM, replacing the C output with LLVM bitcode.<br><br></div><div>The glue is written in Nim itself, and most of the LLVM translation fits in a single file. Of course, this file is pretty long, but at least it sounds cool ;)<br><br>One of the strengths of Nim is the easy integration with C, and consequently nlvm uses the llvm-c interface.<br><br></div><div>This has worked well, except that I can't seem to find the right incantations to bring about debugging / dwarf support. My confidence is somewhat restored by the fact that the rust devs failed to find them as well and therefore wrote their own wrappers, but I'd love to hear from you if you know of a better way.<br><br></div><div>I'd also love to hear from you if you have any feedback or questions, and contributors are warmly welcome.<br><br></div><div>Cheers,<br></div><div>Jacek<br><br></div><div>PS please cc me in replies for a quicker answer.<br></div></div>