This is connected to 
[https://forum.nim-lang.org/t/4964](https://forum.nim-lang.org/t/4964), but I 
think it merits its own thread

I've been away from Nim and this forum for some time so excuse me if the 
questions asked in this post have been asked before. One of the things I love 
about Nim and attracted me to it is the unique, customisable GC. This allows 
Nim to be used on all 3 main programming use-cases:

  1. High-level applications, like desktop apps, web-development, etc. In these 
cases, I don't want to be managing memory at all, so full-on GC is perfect.
  2. Performance-conscious / soft real time apps, like games, simulators, etc. 
I can then customise the GC frequency and duration to control performance.
  3. Hard real time, MCU, etc. This is where I want full control, so I turn-off 
the GC and I manage memory myself.



Now, @Arak is working on the newruntime, which -the way I understand it (and 
please correct me if I'm wrong)- is a kind of memory-borrowing mechanism, 
similar to Rust's. My understanding is that this will cover, for now, use-case 
#3 above. However, the plan is to expand this in the future so that it covers 
all 3 use-cases and completely replaces the GC.

Here's the thing. I've played with Rust a little bit and one of things that put 
me off it, apart from the syntax, is the ownership/borrowing mechanism. This is 
great for use-case #3 as you can have safe memory management, an annoyance for 
use-case #2 and a huge overhead for use-case #1 where I mostly work. When I 
write solutions for my clients, I want to use my time and effort for creating 
those solutions, not worrying about which lifetime owns which pointer. The GC 
is great for that.

So my question is this: If my understanding is correct, then why should I 
invest in Nim when I won't have the advantage of the GC and instead I could use 
another language with the same memory-management mechanism as Nim but with a 
huge community behind it, backed by Mozilla?

Reply via email to