Live data from Hacker News

Nim 2.0 thoughts

forum.nim-lang.org

71–80 of 150 posts

Re: Nim 2.0 thoughts

#71
post #35

I 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?

How's Nim faring with regards to easy programming for multicores? (I think that's the main selling point of Go).

and channels... extremely useful for network servers.

Re: Nim 2.0 thoughts

#72
post #61
post #21

Earlier 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

[deleted]

Re: Nim 2.0 thoughts

#73
post #35

I 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?

How is the compiler, speed wise? One thing I really like about Go and really don't like about Rust are their relative compiler speeds. I think it makes a big different for the language and Nim has a chance to get this right as they didn't make the mistake of using LLVM and it's bad compiler UX.

For my small learning projects, on old hardware, I’d say about the same as Go.

Re: Nim 2.0 thoughts

#74

Earlier 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.

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

#75

Earlier 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.

Nim code also tends to run faster than Go code (in my experience).

Re: Nim 2.0 thoughts

#76
post #75

Earlier quoted context omitted.

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.

Nim code also tends to run faster than Go code (in my experience).

I didn’t meassure, but I also don’t have any experience saying otherwise. Both are great languages and depending on the problem I’d be happy to use either.

Re: Nim 2.0 thoughts

#77

Earlier quoted context omitted.

Yes garbage-collected, with a caveat. From the website: > Nim's memory management is deterministic and customizable with destructors and move semantics, inspired by C++ and Rust. It is well-suited for embedded, hard-realtime systems.

The reference counter with "destructors and move semantics..." is not presently the default, though it will be in the future. The OP mentions that. The current default GC involves a somewhat unusual memory model that can make certain kinds of multi-threaded programming difficult: each thread has its own heap and independent GC; memory subject to GC cannot be read/written across threads and locks can't be used to reme…

I think Erlang has something similar.

Re: Nim 2.0 thoughts

#78

One thing people don't often bring up is how great nim is for writing DSLs. DSLs really matter in the hardware and digital design space - a space that seems to be completely devoid of innovation when it comes to tooling. A couple languages that try to bring RTL into the 21st century are nMigen-Python and Chisel-Scala. I'm currently writing an RTL in Nim. Nim's macro system allows you to do really cool things like ins…

Yep, one of the main things I did with nim for the month or 2 I was really into it was write a duktape wrapper[0] (in retrospect, I should have made the name a pun related to wrapping with tape...). It was pretty interesting given the stack-based nature of almost every duktape operation.

[0]: https://github.com/coolreader18/duk

Re: Nim 2.0 thoughts

#79

Potentially unpopular opinion, please go easy on me, I'm a python lover: I find a lot of Nim syntax just unnecessarily noisy. I wish that it had stuck much closer to Python syntax. I'm really excited about Nim, don't get me wrong. I like Araq, he's got a real hacker spirit not oft found at the head of big projects. Anyhow. I'm sure the experts in that topic will sort it all out. ORC is wildly impressive all around.

I agree. The syntax is the main reason I don't use it.

Completely fair, syntax is something that resonate differently from person to person. I love the idea of Rust, it’s speed, capabilities, it’s politics and it’s independence, but I cannot stand it’s syntax.

That’s fine, I can use other languages and it doesn’t take anything away from Rust or the people who love the syntax.

Re: Nim 2.0 thoughts

#80

One thing people don't often bring up is how great nim is for writing DSLs. DSLs really matter in the hardware and digital design space - a space that seems to be completely devoid of innovation when it comes to tooling. A couple languages that try to bring RTL into the 21st century are nMigen-Python and Chisel-Scala. I'm currently writing an RTL in Nim. Nim's macro system allows you to do really cool things like ins…

Isn’t the bottleneck there the core software being proprietary? I think even verilog (which is quite old) doesn’t have a mature FOSS compiler+IDE.

There are also probably not that many hardware designers in the world?

Post reply on HN