Live data from Hacker News

Pros and Cons of Nim

onlinetechinfo.com

11–20 of 86 posts

Re: Pros and Cons of Nim

#11

Earlier quoted context omitted.

People complain about lack of generics and proper try/except/finally in Go. Nim has both.

And no native concurrency.

It's not my area but, surely concurrency can be added, and why does it need to be native? Surely a library is fine.

(I chose not to learn go because of it's lack of generics and exceptions. It seemed like a huge step backwards)

Re: Pros and Cons of Nim

#12

Oh! I have another use-case; first-class (easier-than-others?) cross-compilation support. I had to build a one-off tool that was a a glorified "curl wrapper" with validations, for Windows; on a Mac. Wrote a simple nim script, cross-compiled for Windows, and it's been fine and dandy for a year now :) I'm sure other languages support this (golang?), but Google's SEO suggested nim-lang.org

This, for sure. For my work I wrote a dynamic library in Nim. The library is loaded by an application written in C, and I needed it to work on both Windows and Linux (Windows for customers, Linux for myself and the server back-end). Setting up a Docker container that runs the entire build and integrates well into the existing build-system we had was fairly straight forward. All Nim needs to cross-compile is a C compiler that can do it (in my case that was MinGW). So now I'm happily running the same Nim dynamic library compiled to both a DLL and a .so.

Re: Pros and Cons of Nim

#13

Earlier quoted context omitted.

People complain about lack of generics and proper try/except/finally in Go. Nim has both.

And no native concurrency.

Nim has thread support natively. And an async implementation in it's standard library which is made entirely as a library, so you're free to write your own, in fact there exists alternative implementations of async/await in Nim. Just the fact that a feature like this _can_ be implemented as a library is a testament to how powerful of a language Nim is.

Re: Pros and Cons of Nim

#14
post #12

Oh! I have another use-case; first-class (easier-than-others?) cross-compilation support. I had to build a one-off tool that was a a glorified "curl wrapper" with validations, for Windows; on a Mac. Wrote a simple nim script, cross-compiled for Windows, and it's been fine and dandy for a year now :) I'm sure other languages support this (golang?), but Google's SEO suggested nim-lang.org

This, for sure. For my work I wrote a dynamic library in Nim. The library is loaded by an application written in C, and I needed it to work on both Windows and Linux (Windows for customers, Linux for myself and the server back-end). Setting up a Docker container that runs the entire build and integrates well into the existing build-system we had was fairly straight forward. All Nim needs to cross-compile is a C compi…

To confirm, that’s two dynamic libraries, right?

Re: Pros and Cons of Nim

#15
He missed two that I think are really important.

1. Arraymancer https://github.com/mratsim/Arraymancer

2. The new version of the garbage collector understands move semantics to optimize its reference counting so unlike Rust where you have to deal with it yourself Nim will handle it for you at the expense of a reasonable amount of memory. https://youtu.be/yA32Wxl59wo?t=855 Watch the whole video for more context if you care.

I think it's a really nice language, too many pragmas but still really nice.

Re: Pros and Cons of Nim

#16
post #12

Earlier quoted context omitted.

This, for sure. For my work I wrote a dynamic library in Nim. The library is loaded by an application written in C, and I needed it to work on both Windows and Linux (Windows for customers, Linux for myself and the server back-end). Setting up a Docker container that runs the entire build and integrates well into the existing build-system we had was fairly straight forward. All Nim needs to cross-compile is a C compi…

To confirm, that’s two dynamic libraries, right?

Yes, it's compiled into two different libraries. Nim hasn't magically made cross-platform dynamic libraries. But the code for both libraries is the same, just compiled for two different platforms.

Re: Pros and Cons of Nim

#19
These pros and cons appear to have been curated from around the web; this is a secondary source. If the final selection has passed throught the filters of passion and bitter experience, the author doesn't say. The parent site aims to fill itself with "Useful Tech Content", and this article reads like an assignment completed by a strong student.

So anyone can dress like Moses, come down off the mountain with tablets, and we'll debate the scriptures without considering the provenance? Good to know. California ballot initiatives often work that way.

Re: Pros and Cons of Nim

#20

These pros and cons appear to have been curated from around the web; this is a secondary source. If the final selection has passed throught the filters of passion and bitter experience, the author doesn't say. The parent site aims to fill itself with "Useful Tech Content", and this article reads like an assignment completed by a strong student. So anyone can dress like Moses, come down off the mountain with tablets,…

It's a mix of research from the web (and I don't mean copy & paste), questions I and others have asked, and my own experience with Nim. This is not simply copy/paste. The rest of the comment I won't even bother to address as you sound like a troll.
Post reply on HN