Live data from Hacker News

Nim in 2020: A Short Recap

nim-lang.org

1–10 of 121 posts

Re: Nim in 2020: A Short Recap

#2
Very interesting. Is the memory model essentially a middle ground between GC-based and manual memory management?:

> Scope-based memory management (destructors are injected after the scope) - generally reduces RAM usage of the programs and improves performance.

How does Nim handle references? How similar is this to Rust's lifetimes GC-ed instead of manually managed?

Is this essentially like Rust, with the main difference that lifetimes (references) are handled via reference counting?

> Shared heap - different threads have access to the same memory and you don’t need to copy variables to pass them between threads - you can instead move them

I think this is the same as Rust thread move semantics?

Re: Nim in 2020: A Short Recap

#3
post #2

Very interesting. Is the memory model essentially a middle ground between GC-based and manual memory management?: > Scope-based memory management (destructors are injected after the scope) - generally reduces RAM usage of the programs and improves performance. How does Nim handle references? How similar is this to Rust's lifetimes GC-ed instead of manually managed? Is this essentially like Rust, with the main differe…

Swift

Re: Nim in 2020: A Short Recap

#5
post #4

In what cases is Nim a better option than Rust? Would be great if anyone with more experience can share more information.

For me, it's a full stack language, write the frontent with karax https://github.com/pragmagic/karax or react bindings https://github.com/kristianmandrup/react-16.nim and backend in pure nim with any of the available web frameworks (jester/prologue/looper) and orms (ormin/norm) and share code and type declaration between the two.

Re: Nim in 2020: A Short Recap

#6
post #2

Very interesting. Is the memory model essentially a middle ground between GC-based and manual memory management?: > Scope-based memory management (destructors are injected after the scope) - generally reduces RAM usage of the programs and improves performance. How does Nim handle references? How similar is this to Rust's lifetimes GC-ed instead of manually managed? Is this essentially like Rust, with the main differe…

Previous discussion: https://news.ycombinator.com/item?id=25345770

Re: Nim in 2020: A Short Recap

#7
post #4

In what cases is Nim a better option than Rust? Would be great if anyone with more experience can share more information.

I think the main difference (benefit?) is that Nim has the convenience of a garbage collected language while retaining good and predictable performance (e.g. via ARC/ORC and thread-local GC). Rust has no GC so requires more from the programmer. Personally, I'd rather use a GC language to have less complexity in the code even though I have to spend some more time learning to use the GC correctly.

Re: Nim in 2020: A Short Recap

#10
post #5
post #4

In what cases is Nim a better option than Rust? Would be great if anyone with more experience can share more information.

For me, it's a full stack language, write the frontent with karax https://github.com/pragmagic/karax or react bindings https://github.com/kristianmandrup/react-16.nim and backend in pure nim with any of the available web frameworks (jester/prologue/looper) and orms (ormin/norm) and share code and type declaration between the two.

How does karax run Nim client side? Cross compile to js or a wasm blob? Or something else entirely?
Post reply on HN