> With your backend, would it be possible, to also compile nimscript and macro 
> code to native istructions and throw out the distinction of runtime and 
> compiletime behavior?

Even if you are not using C as an intermediate step it is still essential to 
distinguish between compile time and run time behavior.

There are compilers for other languages that compile/assemble/link on the fly 
into RAM, then write out the image when done.

If Nim were to evolve into something like that, it would still be necessary to 
make runtime and compiletime separate.

  * If you have compile time procs and global variables that macros use. (I 
have a lot of this in code I write) (ok, I guess something like dead code/data 
elimination _could_ get rid of those, but I believe it is better to be explicit 
about what is compile time, and what is runtime).
  * You are targeting a different architecture or operating system that your 
compiler is running on. (For example, building windows applications from Linux, 
or building applications for an embedded system).



Nimscript is essentially "compile time only" which is why it does not have 
macros (as macros are for what will be the run time code). Nim would need 
something more than a new backend to compile to native code and use that doing 
compile time.

Reply via email to