News for hackers. Stuff that matters.
Re:Nim 2.0 thoughts by Oreb on Saturday May 15, 2021 @12:06PM (#27166411)
I started using Nim recently and have been very impressed. It feels like a better Rust than Rust, and a better Go than Go. Why doesn’t Nim get more attention?
Re:Nim 2.0 thoughts by davidkunz on Saturday May 15, 2021 @12:12PM (#27166468)
I think one reason is that there's no big corporation behind it, for Rust it was Mozilla and now the members of the Rust Foundation, for Go it is Google.

But I totally agree, Nim is an awesome language and definitely deserves more attention!

Re:Nim 2.0 thoughts by open-source-ux on Saturday May 15, 2021 @01:16PM (#27167021)
"I think one reason is that there's no big corporation behind it"

I agree. The popularity of some programming languages is undoubtedly buoyed by corporate sponsorship or the association with a company. This is not a bad thing, but it means other languages struggle to generate as much interest.

Also, without a generous benefactor, open source languages have to scrape funding together piecemeal from different sources. For example, both Rust and Go have had (or still have) dedicated staff writing documentation for the language. This is a luxury that other languages cannot fund or afford.

I actually posted a Ask HN question of this very topic recently: Can new programming languages attract developers without funding?"

https://news.ycombinator.com/item?id=27043717

Re:Nim 2.0 thoughts by darthrupert on Sunday May 16, 2021 @10:43AM (#27174049)
> For example, both Rust and Go have had (or still have) dedicated staff writing documentation for the language.

And PR most importantly.

Re:Nim 2.0 thoughts by m_mueller on Sunday May 16, 2021 @02:45AM (#27171723)
Didn't python start this way 25ish years ago? It then has slowly and steadily gained developers. Nim might also be there in another 15 years.
Re:Nim 2.0 thoughts by pjmlp on Sunday May 16, 2021 @04:22AM (#27172121)
Python did had a couple of smallish killer applications like Zope, being used as scripting language in 3D applications, and gaining adoption among Perl users after Perl 6 never ending story.

Additionally Guido has always worked in well known companies, and Microsoft and IBM have toyed with Python on their products as well.

Re:Nim 2.0 thoughts by m_mueller on Monday May 17, 2021 @01:46AM (#27180404)
I think that‘s a possible path for Nim to develop. Win over a trickle of python devs who‘ve learned the problems arising once you hit a certain performance ceiling / scale. This is being accentuated by hardware & cloud developments - startup time & compute efficiency becoming increasingly important (containerization/serverless driving one, I/O performance outgrowing CPU perf. driving the other). If those trends continue, Python will increasingly be ill fitted. And I‘m saying this as a Python dev.
Re:Nim 2.0 thoughts by pjmlp on Monday May 17, 2021 @02:19AM (#27180534)
Except that Guido went to Microsoft to work on their new JIT project, while Instagram is also pursuing their own, and there is Cython which follows the same compile to native code workflow (C based backed) as Nim.

The biggest problem in Python slowness isn't that solutions don't exist, rather the community at large tends not to embrace them as other ecosystems do.

Re:Nim 2.0 thoughts by m_mueller on Monday May 17, 2021 @03:20AM (#27180832)
My experience with optimizing Python code after ~10y is that after a certain point it's just not worth it and you'd be better off rewriting in a more performant runtime once you hit that. That includes experiments I did with pypy, Cython and Numba for various projects.
Re:Nim 2.0 thoughts by nimmer on Sunday May 16, 2021 @07:22AM (#27172888)
At the time no companies were heavily marketing FOSS projects. Also, today large companies have a fanbase.
Re:Nim 2.0 thoughts by forgotpwd16 on Saturday May 15, 2021 @03:04PM (#27167932)
It may be better than Go but I don't see how it is comparable to Rust. Rust's biggest selling point is compilation-checked memory and thread safety guarantee without garbage collection. Nim instead uses a garbage collector, or a reference counter similar (but deterministic) to Swift which can cause memory leaks, or manual memory management.
Re:Nim 2.0 thoughts by nimmer on Saturday May 15, 2021 @03:29PM (#27168132)
Nim is getting very close to Rust in terms of safety (but without the verbose ownership management)

https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc...

https://nim-lang.org/blog/2020/12/08/introducing-orc.html

Re:Nim 2.0 thoughts by searealist on Saturday May 15, 2021 @07:49PM (#27169989)
Memory safety with GC is easy. Rust is novel because it offers memory safety without GC. Your links mention GC.
Re:Nim 2.0 thoughts by planetis on Sunday May 16, 2021 @04:36AM (#27172185)
Can Rust deal with linked lists as well? Nim has a cycle collector based on the trial deletion algorithm https://researcher.watson.ibm.com/researcher/files/us-bacon/... It's different than the usual GC algorithms.
Re:Nim 2.0 thoughts by planetis on Saturday May 15, 2021 @03:31PM (#27168161)
It was discussed recently: https://forum.nim-lang.org/t/7905

> to Swift which can cause memory leaks

The Nim compiler can detect cycles and warn you. And --gc:orc collects them successfully at runtime. Orc is going to be the default.

Re:Nim 2.0 thoughts by mrweasel on Saturday May 15, 2021 @03:33PM (#27168175)
What made me pick Go over Nim is a bigger standard library. For my use Nim is missing a good http server package/module and templating.

If those two things had been present I would pick Nim over Go, it’s just a nice language for some like me, who have mostly done Python.

I’m not sure if this was a bug in a third party module, but I also struggled a little with unicode support.

Re:Nim 2.0 thoughts by sigzero on Saturday May 15, 2021 @07:10PM (#27169784)
Re:Nim 2.0 thoughts by planetis on Sunday May 16, 2021 @04:45AM (#27172230)
Re:Nim 2.0 thoughts by mrweasel on Sunday May 16, 2021 @02:51AM (#27171746)
Zfblast seems new, so maybe. The asynchttpserver does work, but it’s simply not as good or complete as the one in Go.

It might just be to low level.

Re:Nim 2.0 thoughts by otherme123 on Saturday May 15, 2021 @05:00PM (#27168961)
Templating as in Jinja? I'm using Karax (https://github.com/karaxnim/karax#server-side-html-rendering) and it's awesome.
Re:Nim 2.0 thoughts by mrweasel on Sunday May 16, 2021 @02:47AM (#27171728)
That’s nothing like Jinja, it’s more like React. I just want text templating and not a virtual dom and I don’t want to build my HTML in Nim.
Re:Nim 2.0 thoughts by xigoi on Sunday May 16, 2021 @02:20PM (#27175802)
Re:Nim 2.0 thoughts by planetis on Sunday May 16, 2021 @03:10AM (#27171833)
We have many https://nimble.directory/search?query=template

Also karax can also work as on server side, no virtual dom in that scenario. People prefer it because of type checking over string templates.

Re:Nim 2.0 thoughts by mrweasel on Sunday May 16, 2021 @03:58AM (#27172009)
I think I tried most of those templating options, but some seems to have been abandoned, many try to abstract the html away and most are incomplete.

Nwt seemed like the most promising, but it don’t even allow loops in your template.

Re:Nim 2.0 thoughts by planetis on Sunday May 16, 2021 @04:38AM (#27172202)
I really don't understand what your requirements are. Again karax is well known and better alternative than all these (i.e loops and other control flow work as expected).
Re:Nim 2.0 thoughts by mrweasel on Sunday May 16, 2021 @05:01AM (#27172307)
Understandably, I don't think I explained it all that well.

If I look at the Karax example, it seems more like a way of building the HTML in Nim, but I want to write HTML. If you look at Jinja2, then it's HTML, but with a bit of embedded syntax to do loops, conditionals and string replacement, plus a few handy functions.

The built in templates in Go is a bit simplistic, but it's enough for my needs. So something like it would be nice.

As you pointed out the Karax it has type safety, which my suggestions doesn't have. It's also not required, because HTML/text templates doesn't need type safety, it's all just text.

Basically I want nwt, with loops and control statements implemented.

Re:Nim 2.0 thoughts by planetis on Sunday May 16, 2021 @05:29AM (#27172436)
Re:Nim 2.0 thoughts by sp33der89 on Saturday May 15, 2021 @12:13PM (#27166472)
"a better Go than Go", this is exactly how I use Nim currently, and I couldn't have said it better myself!
Re:Nim 2.0 thoughts by eikenberry on Saturday May 15, 2021 @02:50PM (#27167840)
How is the compiler, speed wise? One thing I really like about Go and really don't like about Rust are their relative compiler speeds. I think it makes a big different for the language and Nim has a chance to get this right as they didn't make the mistake of using LLVM and it's bad compiler UX.
Re:Nim 2.0 thoughts by nimmer on Saturday May 15, 2021 @03:25PM (#27168106)
Nim compiles to C and then runs GCC (not LLVM) to compile the binary. Overall, it's much faster than Go and Rust.
Re:Nim 2.0 thoughts by isubasinghe on Saturday May 15, 2021 @07:43PM (#27169961)
I get that Nim can be faster than Go but I don't see how it can be faster than Rust, could you please elaborate as to why?
Re:Nim 2.0 thoughts by FridgeSeal on Saturday May 15, 2021 @09:12PM (#27170376)
They probably mean the compilation is much faster than Rust.
Re:Nim 2.0 thoughts by nimmer on Sunday May 16, 2021 @07:30AM (#27172926)
I was referring to compilation time... given the question.
Re:Nim 2.0 thoughts by iamcreasy on Saturday May 15, 2021 @08:43PM (#27170246)
Is transpiled C readable?
Re:Nim 2.0 thoughts by nimmer on Sunday May 16, 2021 @07:28AM (#27172921)
It is. It's just not very pleasant to read due to the autogenerated variable names.
Re:Nim 2.0 thoughts by planetis on Sunday May 16, 2021 @04:57AM (#27172296)
If you disable all runtime checks, like integer overflows, range checks, etc..., stack traces and debug information (-d:danger) it's readable yes.
Re:Nim 2.0 thoughts by mrweasel on Saturday May 15, 2021 @03:43PM (#27168288)
For my small learning projects, on old hardware, I’d say about the same as Go.
Re:Nim 2.0 thoughts by TylerE on Saturday May 15, 2021 @03:18PM (#27168038)
Pretty good. The actual compilation is via clang, so there's a lot of heavy lifting done by that.

So basically nim actually compiles .nim -> .c -> binary

Re:Nim 2.0 thoughts by elcritch on Saturday May 15, 2021 @06:48PM (#27169684)
It’s good to note that the C/C++ generated by Nim compiles much faster than normal C/C++ code since they don’t include a lot of headers.
Re:Nim 2.0 thoughts by serverholic on Saturday May 15, 2021 @01:15PM (#27167011)
Nim has a garbage-collector right? In that case I don't see how you can compare Nim and Rust. The Go comparison makes more sense.
Re:Nim 2.0 thoughts by michaelsbradley on Saturday May 15, 2021 @01:35PM (#27167211)
It has a garbage collector by default, though it can be disabled (--gc:none) and then you can manage memory manually.

In the future, Nim's default memory management will use reference counting with destructors and move semantics inspired by Rust and C++.

https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc...

https://nim-lang.org/docs/destructors.html

https://nim-lang.org/docs/nimc.html

Re:Nim 2.0 thoughts by staticassertion on Saturday May 15, 2021 @10:12PM (#27170632)
This is really cool. I really want a language that has GC, but lets me be explicit about memory usage as well / leverage move semantics to optimize. I use Rust, and I suspect I'll always have it as a driver, but I wouldn't mind another higher level language to take the place of Python, which I use for prototyping.
Re:Nim 2.0 thoughts by fastball on Saturday May 15, 2021 @01:34PM (#27167205)
Yes garbage-collected, with a caveat. From the website:

> Nim's memory management is deterministic and customizable with destructors and move semantics, inspired by C++ and Rust. It is well-suited for embedded, hard-realtime systems.

Re:Nim 2.0 thoughts by michaelsbradley on Saturday May 15, 2021 @01:50PM (#27167338)
The reference counter with "destructors and move semantics..." is not presently the default, though it will be in the future. The OP mentions that.

The current default GC involves a somewhat unusual memory model that can make certain kinds of multi-threaded programming difficult: each thread has its own heap and independent GC; memory subject to GC cannot be read/written across threads and locks can't be used to remedy the situation; if you force the compiler to accept code that violates the "no shared" rule, the ref count of the GC on one thread or another will eventually get corrupted and the program will crash with SIGSEGV.

However, by allocating on and copying to/from the shared heap (which is never subject to garbage collection) you can do message passing across threads.

Re:Nim 2.0 thoughts by elcritch on Saturday May 15, 2021 @07:05PM (#27169764)
Note I’m using Nim with the new GC (both ARC & ORC) on dual core esp32’s.

Locks do work with ARC, though some care needs to be taken. Both the Nim and free-rtos multi-threaded queues work well with the correct move/sink annotations.

The design of ARC allows you to move entire memory graphs between separate heaps. It works fine, but what’s not working is the compile time verification that a given memory graph is only owned/aliased by the top pointer. So there’s a lot of work to do in making it “safer and easy” to use.

Here’s an example: https://github.com/elcritch/nesper/blob/f54fff8b240e94684ae8...

Re:Nim 2.0 thoughts by kaba0 on Saturday May 15, 2021 @04:10PM (#27168546)
I think Erlang has something similar.
Re:Nim 2.0 thoughts by throwaway894345 on Saturday May 15, 2021 @01:47PM (#27167311)
This is interesting. The hard-realtime folks are a conservative bunch (understandably so); I wonder how much traction Nim is getting in that space.
Re:Nim 2.0 thoughts by elcritch on Saturday May 15, 2021 @07:27PM (#27169876)
There’s a few of us working in this area, well rather Nim on embedded microcontrollers. :-)

It works fantastically, though most of us aren’t traditional hard real time folks. Nevertheless Nim’s new ARC is excellent for this area. The overhead of the GC basically is just an increment/decrement on an integer (no atomic). That means it’s fast and predictable for modern MCUs and plays well with C code. If you want a tight interrupt function you can stick an object in global variable and know it won’t incur GC overhead.

It’s relatively easy to reason about where and when you want memory to be free’ed (actually easier than Rust). Also allocator pools are easy to utilize.

On a side note, as the Nim compiler improves moves and sinks analysis, the runtime overhead of ARC approaches that of Rust’s compile time memory management, especially with a lot of Rust code that use lots of Rc wrappers.

P.S. I’m planning to write a Nim wrapper for Zephyr RTOS when I get time later in the summer, and improve the existing FreeRTOS support too.

Re:Nim 2.0 thoughts by throwaway894345 on Sunday May 16, 2021 @01:28PM (#27175324)
This sounds really cool. I'm glad to hear that there's something rivaling Rust.
Re:Nim 2.0 thoughts by Zababa on Saturday May 15, 2021 @03:02PM (#27167921)
Would comparing it to Swift be fair? At least on the memory management side.
Re:Nim 2.0 thoughts by ilaksh on Saturday May 15, 2021 @03:33PM (#27168179)
You can avoid it if you want. That is what a lot of the recent changes are about.
Re:Nim 2.0 thoughts by one2three4 on Saturday May 15, 2021 @01:20PM (#27167066)
How's Nim faring with regards to easy programming for multicores? (I think that's the main selling point of Go).
Re:Nim 2.0 thoughts by cb321 on Saturday May 15, 2021 @03:25PM (#27168103)
First, I like that you said "multicores" and not "multithreads". Default-sharing of all memory is overrated. Sometimes it is useful/necessary, but people reach for threads too readily, IMO.

For multiprocessing (like Python's module of that name), you can roll your own little system in probably 100 lines of code or use something like this [1] with an example program [2]. For me, that toy program runs 1.5-2x faster than ripgrep on the same (admittedly limited) problem on Linux. { I suspect this perf diff is due to mmap IO being faster than syscall IO due to SIMD register use as discussed here [3], but this deserves deeper investigation than I have time for right now. If my hunch is right, that may constitute further argumentative support for not leaping to threads even if the programming language "makes them 'easy'", though. }

As for threads/parallelism with shared memory in Nim..Honestly, there is probably too much to recap. Weave [4] would be a good place to start reading, though, or searching the Nim Forum.

  [1] https://github.com/c-blake/cligen/blob/master/cligen/procpool.nim

  [2] https://github.com/c-blake/cligen/blob/master/examples/grl.nim

  [3] https://news.ycombinator.com/item?id=24842648

  [4] https://github.com/mratsim/weave
Re:Nim 2.0 thoughts by burntsushi on Tuesday May 18, 2021 @07:10PM (#27202491)
Is it possible to share the commands/inputs you used to run a benchmark with your code against ripgrep? (Including commands to compile your Nim program.)
Re:Nim 2.0 thoughts by cb321 on Thursday May 20, 2021 @08:04AM (#27220052)
This has some Zsh-isms but should get you going, assuming it is even reproducible across machines.

    $ cd cligen-github-root/examples
    # default system nim.cfg
    $ nim c -d:danger --gc:arc -d:useMalloc --passC:-flto --passL:-flto grl

    # best to fetch this while you can as they get updated regularly
    # oh yeah, just unpacked; not configured/anything.
    $ cd /dev/shm/linux-5.12.5
    # Zsh-ism to eliminate file tree traversal variation
    $ fs=(**.[ch])
    # On an Intel i7-6700K
    $ repeat 5 utime ~1/grl -sburntsushi $fs
    0.143836198              0.23              0.21             305.9%
    0.137177744              0.22              0.22             320.8%
    0.136714417              0.22              0.22             321.8%
    0.149867097              0.23              0.22             300.3%
    0.139042282              0.22              0.22             316.5%

    # make sure there is no ripgreprc file.
    $ repeat 5 utime rg burntsushi $fs
    0.204383740              0.33              0.26             288.7%
    0.200495993              0.34              0.25             294.3%
    0.205767854              0.37              0.22             286.7%
    0.200485116              0.33              0.25             289.3%
    0.201692769              0.34              0.24             287.6%

    $ rg --version
    ripgrep 12.1.1
    -SIMD -AVX (compiled)
    +SIMD +AVX (runtime)

    200.5/136.7 =~ 1.47x
OS for the above is Linux 5.12 running on bare metal. When I do a gcc PGO build I can squeeze about another 7 ms off that 136.7 time, but this is probably not very informative. Honestly, even 1.5x is kinda small, too.

Anyway, were I to study this in more detail, as it sounds like you may be wanting to do, my recommendation would be to just factor out the substring/regex search (rg's vs glibc memmem, etc.) and study a more "pure IO" case. E.g., just switch to memchr(non-existent char) or such (e.g. Daniel Lemire's Faster 64-bit universal hashing using carry-less multiplications, Journal of Cryptographic Engineering is very fast or maybe even a SIMD-summation) to force all the IO but do other things SIMD-efficiently/at the highest GB/sec easily achievable. Then try that same simplified program with ripgrep's file size heuristics with threads vs the grl N-kid processes + always mmap. Just fewer moving parts/better isolation of behaviors.

This also might lead to more general/re-applicable knowledge for the best way to do read-only multi-core file IO, not only tuning ripgrep or only Rust or only any PL. If it all holds up, and that same "test setup" could be applied to differing OS contexts like OSX/Win/etc. and then maybe it might be worthwhile re-jiggering ripgrep IO. (It is not a foregone conclusion the answer will be the same across OSes or CPUs, or even that my hunches/hypotheses are correct. I am trying to help here without making strong, general claims to be cross-examined upon, as is the Internet's way...)

Re:Nim 2.0 thoughts by burntsushi on Thursday May 20, 2021 @09:30AM (#27220868)
Thanks! Appreciate it. For clarity, this is the corpus I downloaded: https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.12.5.ta...

And I used

    fs=(**/*.h)
since including the C files caused the argument list to be too long on my system.

My CPU is a bit dated, but is a i7-6900K @ 3.2 GHz.

My Nim version:

    $ nim --version
    Nim Compiler Version 1.4.6 [Linux: amd64]
    Compiled at 2021-04-26
    Copyright (c) 2006-2020 by Andreas Rumpf

    active boot switches: -d:release -d:nativeStackTrace
With those caveats, this is what I get on my system:

    $ TIMEFMT=$'%*E'

    $ repeat 5 time ~/clones/cligen/examples/grl -sburntsushi $fs
    0.093
    0.079
    0.083
    0.083
    0.082
    $ repeat 5 time rg --no-config burntsushi $fs
    0.088
    0.088
    0.086
    0.082
    0.083
We can somewhat control for substring search by using 'zzzzzzzz'. It won't control for everything, but it should be close I think.

    $ repeat 5 time ~/clones/cligen/examples/grl -szzzzzzzz $fs
    0.086
    0.073
    0.080
    0.078
    0.075
    $ repeat 5 time rg --no-config zzzzzzzz $fs
    0.085
    0.087
    0.084
    0.084
    0.086
If I run with jobs=1 for both tools, I get:

    $ repeat 5 time ~/clones/cligen/examples/grl -j1 -szzzzzzzz $fs
    0.204
    0.201
    0.188
    0.214
    0.190
    $ repeat 5 time rg --no-config -j1 zzzzzzzz $fs
    0.261
    0.239
    0.231
    0.226
    0.256
Here's where it gets interesting. If I force ripgrep to use memory maps, then I get (first with parallelism, and then without):

    $ repeat 5 time rg --no-config --mmap zzzzzzzz $fs
    0.399
    0.328
    0.354
    0.343
    0.357
    $ repeat 5 time rg --no-config --mmap -j1 zzzzzzzz $fs
    0.312
    0.278
    0.280
    0.266
    0.245
I think on the one hand, I'm confused as to why I can't reproduce your result. But the more interesting thing to me is why ripgrep is so slow when it uses memory maps, but your program is not.

The strace output for ripgrep also shows more syscalls than I would expect, so I'll be investigating that as well.

There are also lots of 'pselect6' syscalls in your program. Do you know what those are from?

Anyway, thanks for the interesting benchmark! Some interesting bits to investigate!

Re:Nim 2.0 thoughts by cb321 on Thursday May 20, 2021 @10:41AM (#27221711)
Sorry. In my kernel build script I patch _STK_LIM in include/uapi/linux/resource.h and MAX_ARG_PAGES in include/linux/binfmts.h to boost my command line lengths. There was a short time when Rob Pike had some patch that fixed this with a fun comment like "dynamic memory allocation is a done deal, guys". It could be that .h files are smaller than .c files (or just fewer/less total data) making it harder to reproduce. Another element to add to my suggested research program above besides eliminating string search algos would be to standardize file sizes to all 100 KiB or something. Generate them with random data or some such. Play around with file sizes in your experiments, etc. Besides that, your CPU has twice the cores as mine and we may have pretty different memory bandwidths as mine has very low latency and high BW RAM. Reproduction is actually not generally very easy which is why I said 1.5x was not so big. I often find it hard to reproduce ratios <2..3x, but it does look like a number of cases of the min of 5 `grl` beating `ripgrep` in your tests. Anyway, this is all really just the start of some project, not the end.

`grl` is really just a demo program for the 8-bit clean message passing variant in `procpool` (similar to Python's multiprocessing module). `procpool` uses parent-kid pipes for its communication. The pselect6's come from using select on those N pipes. And, yeah, a lot of selects are expected since the filename passing-answer receiving happens a lot with a lot of files. { Yes, yes...I know past 1024 fd's select will be a problem, but TSMC only just hit that 1nm mark. So, we probably still have a few years before I personally can access 1024 core-thread machines.. ;-) ;-) }

mmaps and threads was discussed already in [3] linked in my first post of this thread with a brief summary. To recap briefly - since threads share all memory and since mmap alters those page tables, it is plausible the kernel just locks the whole process out of simplicity, blocking execution of other threads. It is also possible OS-? can use devious tricks/semantics to avoid that locking, but I am unaware of an exhaustive survey or proof of impossibility. Because in `procpool`/`grl` the kids which are what do the per-file mmaps, are their own processes there is no suspension of the other kids when they mmap. So, they can realize the faster IO (from SIMD register use, done by Linux for context switch optimization or "performance in the large/system-wide"). This is (perhaps) why your last test has better performance without any parallelism. I had meant to test this last time we discussed mmap & threads, but didn't at the time. `grl` is just a very preliminary test along those lines.

This is all at least partly theoretical. Someone ought to study it and write a nice blog article about it. I do not have that kind of time right now (or a blog). Or, for all I know, nice academic paper(s) already study this somewhere. I have not looked. Sadly, as old as this thread is, the general HN pool will probably not see any of this to crowd source such wisdom with direct pointers for you. I almost missed your question in my old threads checking, and I have kind of used up my time budget for this right now. You can email if you want. I get better notifies that way.

Re:Nim 2.0 thoughts by burntsushi on Thursday May 20, 2021 @12:09PM (#27223004)
Just a small follow-up:

Oh, I think I missed the fact that grl is spawning processes and not threads. That's very interesting.

With respect to extra syscalls, ripgrep is actually doing a lot more stat'ing than you might expect because it is "recursive" by default. So for each file it gets, it has to at least check if it's a directory. And there's some symlink behavior to handle. I think I can get rid of one of them per file given, and others are harder because of abstraction boundaries. Sigh. Anyway, that could be impacting an I/O-only comparison here as well.

Re:Nim 2.0 thoughts by skynet-9000 on Saturday May 15, 2021 @03:38PM (#27168230)
and channels... extremely useful for network servers.
Re:Nim 2.0 thoughts by ilaksh on Saturday May 15, 2021 @03:32PM (#27168165)
It would be interesting to see a compilation of all of the times people asked that question. Like literally every time anything about Nim is posted, someone asks that.
Re:Nim 2.0 thoughts by ferdowsi on Saturday May 15, 2021 @08:27PM (#27170178)
Including inheritance in nim was a design mistake and is enough to make me pass on it. Go and Rust were correct in avoiding inheritance in the language.
Re:Nim 2.0 thoughts by xigoi on Sunday May 16, 2021 @04:10PM (#27176619)
In idiomatic Nim, you don't have inheritance. It's mostly there for the people who love their OOP.