Nim Language Support #206

Open
Varriount opened this Issue Dec 15, 2016 · 3 comments

Projects

None yet

2 participants

@Varriount

How much work would it take to support Nim? The main language backend can use pretty much any C compiler, and it would be interesting to observe the assembly output.

@mattgodbolt
Owner

If it's a simple call to a NIM compiler, it'll fit straight in. If it's a two-step process (NIM->C, C->asm) then that'd be a bunch more work, though a hacky solution would be to specify a shell script that does both.

If you have thoughts, the scripts to install all the compilers used by CE are in https://github.com/mattgodbolt/gcc-explorer-image/ (update_compilers and whatnot), and the configuration for CE is in etc/config.

mattgodbolt/compiler-explorer-image#7 is an example of a pull request that added LDC

@Varriount
Varriount commented Dec 16, 2016 edited

Well, the Nim compiler calls the C backend automatically (although it's possible to manually compile as well). It also has the ability to put #line directives in the C source code which correspond to lines in the Nim source code (which is primarily used for debuggers, but might be helpful here as well).

The biggest pitfall I can see is that the language has a heavy emphasis on compile-time mechanisms, so much so that it's quite possible for external files to be read at compile-time.

@mattgodbolt
Owner

That's great: then the code<->asm highlighting would work. Of course, the backend compiler gives another degree of freedom (nim vX with GCC Y as back end) but I guess we can manage that with just "latest GCC Y"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment