News for hackers. Stuff that matters.
Re:Advent of Nim by thatsaguy on Thursday November 29, 2018 @07:18AM (#18559652)
Nim is actually great. The syntax is streamlined and you can pick it up in a few hours if you have some basic experience with python.

Because it's effectively a transpiler and it's way less opinionated than (say) Rust, I managed to use nim in embedded controllers without any special support from the compiler.

Nim suffers because it doesn't have the big push of a corporation such as Mozilla behind.

Re:Advent of Nim by rijoja on Thursday November 29, 2018 @07:23AM (#18559668)
Cool! I'm working on a project that uses javascript and a C backend so it actually might be a good fit for me.
Re:Advent of Nim by mratsim on Thursday November 29, 2018 @08:03AM (#18559857)
Here is an example of such for neural network training[1]:

- Nim JS for browser display

- Nim C as a backend

[1]: https://github.com/Vindaar/NeuralNetworkLiveDemo

Re:Advent of Nim by alehander42 on Thursday November 29, 2018 @08:13AM (#18559908)
It might be indeed: e.g. I've implemented validation for game moves before for a web game, and reusing everything on the backend and frontend was nice
Re:Advent of Nim by vram22 on Thursday November 29, 2018 @10:21AM (#18560816)
In what ways is it less opinionated than Rust?
Re:Advent of Nim by jibal on Thursday November 29, 2018 @08:10AM (#18559890)
" 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.

Re:Advent of Nim by dom96 on Thursday November 29, 2018 @08:33AM (#18560019)
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.

Re:Advent of Nim by jibal on Friday November 30, 2018 @03:43AM (#18567662)
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.

Re:Advent of Nim by dom96 on Friday November 30, 2018 @05:48AM (#18568170)
> 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.