News for hackers. Stuff that matters.
Re:Nim Community Survey 2019 Results by jarredkenny on Sunday February 23, 2020 @05:59PM (#22400149)
Very happy to see Nim gaining some adoption. I started using Nim about a year ago and could not be happier with the language.

I do wonder what it might take to take Nim towards "main stream" status.

Re:Nim Community Survey 2019 Results by gavinray on Sunday February 23, 2020 @06:43PM (#22400393)
I keep looking for a good excuse to learn it, but it does not fit my domain or my language-style preferences very well.

I primarily develop web services, and it is really difficult to beat Typescript due to the fact I can write my front-end, backend, and mobile apps in it (via NativeScript or React Native).

I use uWebsockets.js, which has both an HTTP API that is nearly-identical to Express, and a Websocket API that is identical to Socket.io, but performance ~x10 faster than Express and ~x2 faster than the top-performing Go/Rust/C web libraries due to being a C++ library exposed as Node V8 bindings.

If I really need performance outside the context of handling web requests, I will write small functions or services in Go/Rust and compile to WASM and invoke it through Node, or just throw it up on OpenFaaS.

I like a lot of what Nim does, but I have had a difficult time since finding it two years ago ever coming up with an adequate reason for using it.

Edit: I want to make one clarification. I think that Nim may actually have a bright future in ML, primarily due to the work of Mamy Ratsimbazafy. He has some libraries for HPC, Laser [0] and Arraymancer [1] that can smoke C by several orders of magnitude. Combined with Weave [2], the multi-threaded runtime he built for Nim, that opens the doors for ridiculously performant ML. I think the only the other language that would give Nim a run for its money here is Julia, I really dig the work that has been going on there for ML as well.

[0] https://github.com/numforge/laser

[1] https://github.com/mratsim/Arraymancer

[2] https://github.com/mratsim/weave

Re:Nim Community Survey 2019 Results by kungtotte on Sunday February 23, 2020 @10:16PM (#22401343)
Well, Nim compiles to JS and cross-compilation to iOS and Android are both possible (I don't know how tricky those last two are).

So you could write your entire stack in Nim too the same way you do with TS. :)

Re:Nim Community Survey 2019 Results by bloomer on Sunday February 23, 2020 @09:29PM (#22401162)
Smoke C by several orders of magnitude? Citation needed.
Re:Nim Community Survey 2019 Results by gavinray on Sunday February 23, 2020 @11:29PM (#22401651)
Entirely reasonable doubt, you can find well-commented benchmark output of the Laser High-Performance Computing lib and Arraymancer lib in their source:

https://github.com/numforge/laser/blob/d1e6ae6106564bfb350d4...

https://github.com/mratsim/Arraymancer/blob/6fddfa9a734ac01c...

To qualify the statement, it would be more accurate to say that Nim can smoke C by several orders of magnitude unless you devote significant engineering efforts into replicating the equivalent Nim (as Nim targets C/C++ regardless, so this is just heavy lifting and optimizations)

Re:Nim Community Survey 2019 Results by nimmer on Monday February 24, 2020 @08:30AM (#22403791)
While all you say is true, "on order of magnitude" mean 10x and "several orders of magnitude" mean 1000x or more.
Re:Nim Community Survey 2019 Results by ac29 on Sunday February 23, 2020 @06:18PM (#22400270)
I think it needs a "killer library". The core language is pretty easy to learn if you've used Python, but there aren't a ton of third party libraries, and the ones that do exist seem to be incomplete, poorly documented, buggy, abandoned, or some combination thereof.
Re:Nim Community Survey 2019 Results by blackrock on Monday February 24, 2020 @12:44AM (#22401953)
I got annoyed when it didn’t have a decent standard library to handle command line flags and arguments.

The examples given so far, are mediocre.

parseopt is incredibly cumbersome.

docopt is an incredibly poor design, that I can’t believe anyone thought this was a good idea.

And failing to have such basic libraries, I realized, this language has a long way to go.

I contemplated building my own library to handle such a need, but why, this doesn’t solve my problem of building something. And if it’s missing such basic libraries, then what else is it missing? The odds were too great, and too risky for me to commit my time to it.

Re:Nim Community Survey 2019 Results by pathsjs on Monday February 24, 2020 @02:05AM (#22402204)
There are many libraries for that, but I suggest cligen. It is the simplest command line parser I have found across all programming languages.
Re:Nim Community Survey 2019 Results by s_gourichon on Monday February 24, 2020 @03:05AM (#22402429)
What if the Nim maintainers made some kind of continuous popularity measurement to let good libraries bubble up? Opens other problems I know, but may fix such scenario and accelerate Nim adoption?
Re:Nim Community Survey 2019 Results by pathsjs on Monday February 24, 2020 @03:15AM (#22402465)
There was an attempt a few months ago, but it was a little weird. But if you just want to find libraries relevant for your task (e.g. parsing the command line), there is https://nimble.directory where all Nim libraries are listed
Re:Nim Community Survey 2019 Results by greggirwin on Monday February 24, 2020 @07:57PM (#22410006)
I hadn't seen docopt before, but am curious why you think it's such a bad design.
Re:Nim Community Survey 2019 Results by alehander42 on Monday February 24, 2020 @05:55AM (#22403048)
you can try cligen and then argparse https://github.com/iffy/nim-argparse
Re:Nim Community Survey 2019 Results by gameswithgo on Sunday February 23, 2020 @06:37PM (#22400360)
making clones of the top 50 python libraries would make it attractive. familiar syntax! way more speed!
Re:Nim Community Survey 2019 Results by Random_ernest on Sunday February 23, 2020 @07:28PM (#22400595)
Many of the top 50 python libraries are wrapping a lot of code that is actually c, c++ or fortran. So I doubt that there is a lot of performance to be gained. Numpy is a good examples for that.
Re:Nim Community Survey 2019 Results by gameswithgo on Sunday February 23, 2020 @08:56PM (#22401003)
I have applied for a job at a company where they were switching from Python to Rust, because even though they were using Numpy, there was a lot of overhead in setting the data up to send to Numpy.
Re:Nim Community Survey 2019 Results by airstrike on Sunday February 23, 2020 @08:57PM (#22401008)
It's not those libraries' performances, but allowing people to port their own code with less friction for a presumed gain in performance.
Re:Nim Community Survey 2019 Results by sergiotapia on Sunday February 23, 2020 @11:36PM (#22401680)
How would one find these "top 50 python libraries" list?
Re:Nim Community Survey 2019 Results by shimst3r on Monday February 24, 2020 @01:23AM (#22402076)
I’d suggest based on PyPI download numbers, see https://hugovk.github.io/top-pypi-packages/
Re:Nim Community Survey 2019 Results by greggirwin on Monday February 24, 2020 @07:45PM (#22409934)
Re:Nim Community Survey 2019 Results by staticassertion on Sunday February 23, 2020 @06:50PM (#22400427)
This would be super compelling.
Re:Nim Community Survey 2019 Results by beagle3 on Monday February 24, 2020 @02:26AM (#22402268)
I'll place my chips on mratism (Arraymancer, Weave, Laser) being the killer librarian. But it will take a decade or two to unseat Python.