Earlier quoted context omitted.
Nim compiles to C and then runs GCC (not LLVM) to compile the binary. Overall, it's much faster than Go and Rust.
I get that Nim can be faster than Go but I don't see how it can be faster than Rust, could you please elaborate as to why?
Nim 2.0 thoughts
101–110 of 150 posts
Re: Nim 2.0 thoughts
#102Earlier quoted context omitted.
Then you end up with an ecosystem with mixed conventions. Not good IMO.
You can literally do whatever you want with any library you use in your own codebase and have a consistent convention in your own code regardless of what your dependencies' authors preferences are. In other words, if the library authors used camelCase but you want to use snake_case in your code, you just do it. It's very strange at first, and I had the same reaction as you, but it's actually quite nice. (I say that a…
Or do you just mean use a mixture just like you could in most other languages?
Re: Nim 2.0 thoughts
#103Earlier quoted context omitted.
Then you end up with an ecosystem with mixed conventions. Not good IMO.
Actually, in Nim "functionName", "function_name" and "functionname" are equivalent and interchangeable
Re: Nim 2.0 thoughts
#104Earlier quoted context omitted.
Nim has a garbage-collector right? In that case I don't see how you can compare Nim and Rust. The Go comparison makes more sense.
It has a garbage collector by default, though it can be disabled (--gc:none) and then you can manage memory manually. In the future, Nim's default memory management will use reference counting with destructors and move semantics inspired by Rust and C++. https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc... https://nim-lang.org/docs/destructors.html https://nim-lang.org/docs/nimc.html
Re: Nim 2.0 thoughts
#105Earlier quoted context omitted.
I started using it for parsing heavy files, just for the speed. Slowly I replaced Python with Nim for almost everything, even when it doesn't make much sense (e.g. for controlling Selenium), and only use Python when I need graphics (Matplotlib) or some other libraries that I cannot replace. IMO the main case is when you need C speed but you don't want to code in C.
Nim as a replacement for Python makes sense to me. We often hear that many Python developers went on to choose Go when needing more performance, but Nim feels like an easier move.
Re: Nim 2.0 thoughts
#106Earlier quoted context omitted.
What's the main use case of Nim, would you say? Is it good for personal project/automation, for desktop or web apps? Etc.
I started using it for parsing heavy files, just for the speed. Slowly I replaced Python with Nim for almost everything, even when it doesn't make much sense (e.g. for controlling Selenium), and only use Python when I need graphics (Matplotlib) or some other libraries that I cannot replace. IMO the main case is when you need C speed but you don't want to code in C.
Re: Nim 2.0 thoughts
#107Earlier quoted context omitted.
I started using it for parsing heavy files, just for the speed. Slowly I replaced Python with Nim for almost everything, even when it doesn't make much sense (e.g. for controlling Selenium), and only use Python when I need graphics (Matplotlib) or some other libraries that I cannot replace. IMO the main case is when you need C speed but you don't want to code in C.
This sounds cool, I would be very interested if you had any public code on how to control Selenium using Nim.
Re: Nim 2.0 thoughts
#108I started using Nim recently and have been very impressed. It feels like a better Rust than Rust, and a better Go than Go. Why doesn’t Nim get more attention?
I think one reason is that there's no big corporation behind it, for Rust it was Mozilla and now the members of the Rust Foundation, for Go it is Google. But I totally agree, Nim is an awesome language and definitely deserves more attention!
Re: Nim 2.0 thoughts
#109Earlier quoted context omitted.
What made me pick Go over Nim is a bigger standard library. For my use Nim is missing a good http server package/module and templating. If those two things had been present I would pick Nim over Go, it’s just a nice language for some like me, who have mostly done Python. I’m not sure if this was a bug in a third party module, but I also struggled a little with unicode support.
Templating as in Jinja? I'm using Karax ( https://github.com/karaxnim/karax#server-side-html-rendering ) and it's awesome.
Re: Nim 2.0 thoughts
#110Earlier quoted context omitted.
What made me pick Go over Nim is a bigger standard library. For my use Nim is missing a good http server package/module and templating. If those two things had been present I would pick Nim over Go, it’s just a nice language for some like me, who have mostly done Python. I’m not sure if this was a bug in a third party module, but I also struggled a little with unicode support.
Something like: https://nim-lang.org/docs/asynchttpserver.html https://github.com/zendbit/nim.zfblast
It might just be to low level.