Hacker News new | ask | show | jobs
by jibal 2759 days ago
" A source-to-source compiler translates between programming languages that operate at approximately the same level of abstraction, while a traditional compiler translates from a higher level programming language to a lower level programming language."

In other words, Nim is not a transpiler, it's a compiler that outputs C or Javascript. But the difference is just in terms of the readability and modifiability of the output. For the purpose of using it in embedded controllers, the difference doesn't matter, it's the fact that it generates C code that is of value. And yes, Nim is vastly less "opinionated" than Rust, thank goodness.

1 comments

It really depends on whether you think Nim and C are on the same level of abstraction. If they aren't then yes, Nim is a compiler.

I personally believe that they aren't. But I know of a lot of people who disagree.

It depends on whether the C code generated by Nim is at the same abstraction level as the Nim source code ... clearly that's not the case, because Nim is using C as an assembly language. People acting in bad faith can down vote me all they want (I know that wasn't you, Dominik; you're a great guy) but that's what "transpiler" means. Coffeescript is a transpiler; Nim is not at all ... it does a vastly more complex transformation of the Nim source in order to generate that C code ... as you, Dominik, are especially well aware.

And there are people who will disagree about just about anything, because they are ill informed or have poor judgment or are dishonest (looking at you, White House) ... the mere fact that there are people who disagree about something is not of significance.

> I know that wasn't you, Dominik; you're a great guy

Of course not :)

Yeah, to me Nim is a compiler. However, I can see why people might refer to it as "transpilation" if we are talking Nim->JS. But yeah, please don't call Nim a transpiler, it makes us Nimians all sad.