Live data from Hacker News

Nim 2.0

nim-lang.org

91–100 of 213 posts

Re: Nim 2.0

#91

Earlier quoted context omitted.

And I'm surprised by how terribly it ranks – basically dead last against everything, even the Python frameworks, which is impressive.

Nim's default json library is terrible in performance, but there're much faster drop-in replacements like jsony[1]. I'm not sure that's the main issue for low rank, but it's definitely one of them. 1. https://github.com/treeform/jsony

I would not call std/json it "terrible in performance" probably still way faster then what you get in many other languages (like python). But yes the JSON lib I wrote is faster due to avoiding branches and allocations.

Re: Nim 2.0

#92
post #89

Had a look a Nim few months ago - feature wise is a lot of I wish Python had (easy interop with C/C++, static typed, compiled, can be transcompiled and executed on android/iOS), but ecosystem is small even though the language is not new. There is not many high quality libraries such a numpy, scipy, pandas, opencv in python. They lack some big player adopting it - it's too bad Unreal Engine didn't try to adopt Nim ins…

To be fair to Nim, only Python has the huge ML ecosystem of numpy, scipy, pandas, opencv, pytorch, tensorflow, keres... Doing ML/AI style work in anything but python is really hard!

That said Nim does have the nimpy library that allows for pretty seamless interop with python. Which means you can just import PyTorch, or scipy, or opencv and use them in Nim.

Re: Nim 2.0

#94

If someone at Manning Publications is reading this, it would be great to have a book on the newer Nim version, but please consider using a different typesetting with more readable fonts. I purchased the great book by Dominik Picheta, but am forced to use the .pdf because the dead tree version uses thin fonts that I find extremely hard to read even with the right pair of glasses. Font components (arms, lines, stems, e…

araq/Andreas Rumpf, the project lead, has also published a book: https://nim-lang.org/blog/2022/06/29/mastering-nim.html

Re: Nim 2.0

#95
I loved Nim when I used it first.

But I left it because of recursive imports. I had to basically put all my types into one file and use them from various others. For a relatively medium sized project (~10LOC), its a but of a hassle. Refactoring is an issue.

That being said, the language is fantastic. Can anybody with experience suggest me what HTTP library/framework do they prefer for servers?

Re: Nim 2.0

#96
It seems almost too good to be true. Well done!

Could someone share some bad experiences when adopting Nim so I can weight that in? I'm seriously considering it.

Re: Nim 2.0

#97

Been happily crunching away at Nim in production. I'm working on what is mainly a data analysis and report generation tool, compiled as a CLI executable that gets called by server scripts. Nim makes fast, small executables. It has an excellent heterogenous JSON data structure and a good dataframe library. It prefers the stack so strongly that dynamic data structures (sequences and tables, basically its lists and dict…

You have convinced me to look in to Nim! Can you speak to the build system(s)? CMake is the bane of my existence.

Another Nim user here. Typically you just build the project by `nim c `, since Nim has such a strong macro system a lot of typical build stuff is just done with macros. Of course there's also the default Nimble package manager which allows you to list dependencies and tasks using Nim itself. This means that if you know how to write Nim managing the build system is a breeze.

Re: Nim 2.0

#98

If someone at Manning Publications is reading this, it would be great to have a book on the newer Nim version, but please consider using a different typesetting with more readable fonts. I purchased the great book by Dominik Picheta, but am forced to use the .pdf because the dead tree version uses thin fonts that I find extremely hard to read even with the right pair of glasses. Font components (arms, lines, stems, e…

araq/Andreas Rumpf, the project lead, has also published a book: https://nim-lang.org/blog/2022/06/29/mastering-nim.html

unfortunately there is no ebook version and it seems araq is against publishing ebook (probably because of worrying about piracy) - for me who is travelling a lot, hard copy is a no go.

Re: Nim 2.0

#99
post #90
post #57

Looking forward to trying out this release! After programming professionally for 25 years, IMO Nim really is the best of all worlds. Easy to write like Python, strongly typed but with great inference, and defaults that make it fast and safe. Great for everything from embedded to HPC. The language has an amazing way of making code simpler. Eg UFCS, generics, and concepts give the best of OOP without endless scaffoldin…

>Then writing a web app with backend and frontend in the same efficient language. How does that work? What i mean specifically is how convenient is it to use js interop in dev time, and not just compile nim to js as a standalone lib? Can we simply call something like browser API directly from Nim (Or with fairly simple wrapper)?

Since Nim compiles to JS and C you just have to tell Nim what is available dn the target language and you can call stuff just as if it was a Nim function. These definitions can be auto generated, and they can live in a package you can simply import.

Re: Nim 2.0

#100
post #89

Had a look a Nim few months ago - feature wise is a lot of I wish Python had (easy interop with C/C++, static typed, compiled, can be transcompiled and executed on android/iOS), but ecosystem is small even though the language is not new. There is not many high quality libraries such a numpy, scipy, pandas, opencv in python. They lack some big player adopting it - it's too bad Unreal Engine didn't try to adopt Nim ins…

To be fair to Nim, only Python has the huge ML ecosystem of numpy, scipy, pandas, opencv, pytorch, tensorflow, keres... Doing ML/AI style work in anything but python is really hard! That said Nim does have the nimpy library that allows for pretty seamless interop with python. Which means you can just import PyTorch, or scipy, or opencv and use them in Nim.

for me (mobile developer) interop with python is not enough because of really poor python story on mobile devices (iOS / android) when using native modules. I think if Nim had a seamless interop with Rust or even Zig it could piggyback on those communities to get some libraries for free.
Post reply on HN