3 ms·
It's closer to Go than Rust since it is garbage collected. It's statically typed, has OO features and first-class functions. It compiles to C making it pretty p
by guelo 12y ago
It's closer to Go than Rust since it is garbage collected. It's statically typed, has OO features and first-class functions. It compiles to C making it pretty portable.
- andolanra 12y agoYou can have manual control over memory if you want, though. This worked the last time I looked at the language, at least: foo = cast[ptr Foo](alloc(sizeof(Foo))) # do stuff with foo dealloc(foo) EDIT: Here's the documentation on the site itself. Most things are 'traced' by the GC, but by using alloc and dealloc you can work with 'untraced' (i.e. manually allocated) memory: http://nim-lang.org/0.11.0/manual.html#types-reference-and-pointer-types http://nim-lang.org/0.11.0/manual.html#types-reference-and-p...
- pcwalton 12y agoGo has unsafe.Pointer too.
- rdtsc 12y agoHas generics, meta-programming and GC can be disabled (or tuned to run up to some max # of milliseconds). So it is Go++ if you wish. But I am not sure about its concurrency. Go does have channels which are nice abstractions for doing concurrency right.
- dom96 12y agoNim has channels too (although I think they need replacing). There is also spawn which is similar to Goroutines in some ways: http://nim-lang.org/0.11.0/manual.html#parallel-spawn-spawn-statement http://nim-lang.org/0.11.0/manual.html#parallel-spawn-spawn-...