Hacker News new | past | comments | ask | show | jobs | submit login

That's kinda jumping the gun - just because something is compiled to C, doesn't mean that it has all of the characteristics of C. That's like saying that because something is compiled to assembly, it has all the complexities and dangers of assembly.

For example, take a look at Cython, CGo etc.

Regarding concurrency, Nim has cross-platform thread support in the standard library. Concurrency, at least right now, is more memory safe than other languages, but also more restrictive. Each thread has its own heap, and and memory from one thread's heap cannot be referenced by another thread's heap without use of unsafe pointers. One can, however, copy memory from one heap to another.

There are more abstract currency mechanisms detailed in the manual (primarily for work that is well-suited for threadpool use cases)




Note that what you’re describing here is Nim’s parallelism. Nim supports concurrency via a macro-implemented async await mechanism that is very mature (it runs in production at https://forum.nim-lang.org)


> and memory from one thread's heap cannot be referenced by another thread's heap without use of unsafe pointers

Are you sure about that? Your statement seems to conflict Nim's manual, which says

> Each thread has its own (garbage collected) heap and sharing of memory is restricted to global variables.

This does suggest it inherits all of C's memory (un)safety characteristics.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: