News for hackers. Stuff that matters.
Re:Nim partners with Status.im by dom96 on Tuesday August 07, 2018 @06:52PM (#17711645)
That's why I started using it.

But Nim is much more than just this, it's more like "We like Python, but we also like static typing, efficient and dependency-free programs, super easy C/C++ FFI and metaprogramming. We also like to write all our software in the same programming language so we compile to JavaScript" :)

Re:Nim partners with Status.im by wuschel on Tuesday August 07, 2018 @07:20PM (#17711821)
How is the concurrency story with Nim. I know that this is a repeating question, just wondering how well it works and how safe it is.

I am still eyeballing Pony-lang for it's design choices, but development seems to have slowed down there.

Re:Nim partners with Status.im by dom96 on Tuesday August 07, 2018 @07:27PM (#17711861)
Concurrency is achieved via async await. For parallelism each thread has its own GC so that makes things a lot safer, but sadly less efficient if your algorithm wants to share data between threads a lot (you can copy data between threads). You can also allocate shared memory but that's considered unsafe, this will hopefully be improved in the future.

As for how well this all works, well, I recently implemented a high performance parallel HTTP server [1]. It's currently hosting the Nim Forum[2] and has been doing so for the past few months. Also it's proving very performant[3].

1 - https://github.com/dom96/httpbeast

2 - http://forum.nim-lang.org/

3 - https://www.techempower.com/benchmarks/#section=test&runid=b...

Re:Nim partners with Status.im by michaelsbradley on Tuesday August 07, 2018 @10:10PM (#17712676)
It would be amazing if Pony Lang's[+] concurrency model could be realized in Nim, or if Nim could be extended as a language to optionally and cleanly support it. That's easier said than done, of course, since Pony's concurrency model is deeply wedded to its type system ("reference capabilities").

[+] https://www.ponylang.org/discover/#what-makes-pony-different

Re:Nim partners with Status.im by wuschel on Tuesday August 07, 2018 @07:48PM (#17711978)
Many thanks for the detailed answer & ref.links.
Re:Nim partners with Status.im by spooneybarger on Tuesday August 07, 2018 @08:53PM (#17712305)
We are still going strong in Pony land. There an ebb and flow to publicly seen development.
Re:Nim partners with Status.im by mcintyre1994 on Wednesday August 08, 2018 @08:02AM (#17715140)
The writing style in your documentation is awesome! I haven't come across Pony before but it looks really nice, definitely going to give it a try. :)
Re:Nim partners with Status.im by jhasse on Wednesday August 08, 2018 @07:29AM (#17714948)
> super easy C/C++ FFI

There's a HUGE difference between a C FFI and a C++ FFI. I doubt that Nim makes the latter easy (name mangling, exceptions, STL, ...).

Re:Nim partners with Status.im by dom96 on Wednesday August 08, 2018 @08:09AM (#17715182)
You're very right to doubt me. But it does make it easy, Nim compiles to C/C++/Objective C (exceptions are mapped to C++ exceptions in C++ mode). This gives it the ability to wrap all C++ libraries, Nim takes advantage of this to make wrapping easy, here is a (very) barebones wrapper for sfml as an example: https://github.com/dom96/nim-in-action-code/blob/master/Chap...
Re:Nim partners with Status.im by jhasse on Wednesday August 08, 2018 @08:16AM (#17715228)
Thanks for the link, I stand corrected! :)
Re:Nim partners with Status.im by ilovecaching on Tuesday August 07, 2018 @08:10PM (#17712102)
This is literally Go, save the fact that it compiles to WA instead of JS.
Re:Nim partners with Status.im by kevin_thibedeau on Tuesday August 07, 2018 @08:56PM (#17712326)
> This is literally Go, save the fact that it compiles to WA instead of JS.

Except Nim compiles to C and JS, no official WASM yet (though you can Emscriptenize the C output). Nim has macros, generics, inheritance, exceptions, deterministic GC, and more. Otherwise, yeah, exactly the same.

Re:Nim partners with Status.im by ilovecaching on Thursday August 09, 2018 @03:35PM (#17727699)
I was responding to the comment... the things they mentioned are available in Go. You're taking my comment out of context.
Re:Nim partners with Status.im by klibertp on Wednesday August 08, 2018 @06:58AM (#17714780)
Go and Nim are as different as it gets in programming language design. Nim is kitchen-sink type language, while Go builds on a small set of well-defined features. It's the difference between Scheme and Common Lisp, or JavaScript and Python - the look&feel of programming in Nim is unlike Go in almost all respects, aside from perhaps quick compilation.
Re:Nim partners with Status.im by dom96 on Wednesday August 08, 2018 @08:13AM (#17715206)
Nim isn't a kitchen sink language. It is a language that has been designed to be small at its core but extremely extensible through macros.
Re:Nim partners with Status.im by klibertp on Wednesday August 08, 2018 @09:24AM (#17715696)
Yes, and from what I see it worked, so the number of useful extensions became large over the years. I don't mean "kitchen-sink" in any pejorative sense, maybe "batteries included" would be the better word here.
Re:Nim partners with Status.im by jensvdh on Tuesday August 07, 2018 @08:19PM (#17712158)
Go is nowhere near as expressive/high-level as Nim or Python.

The learning curve is significantly steeper.

Re:Nim partners with Status.im by TylerE on Tuesday August 07, 2018 @09:33PM (#17712500)
It is literally un-go. Great support for meta programming and generics, and actual non-foot gun error handling
Re:Nim partners with Status.im by qaq on Tuesday August 07, 2018 @10:01PM (#17712633)
It's way nicer than Go (features and syntax) tooling and libs are not as developed obviously.
Re:Nim partners with Status.im by Fukkaudeku on Tuesday August 07, 2018 @08:35PM (#17712221)
Except Nim doesn't make you copy/paste constantly.
Re:Nim partners with Status.im by k__ on Wednesday August 08, 2018 @06:38AM (#17714678)
Or write code gens, haha