Live data from Hacker News

Nim 1.4

nim-lang.org

121–130 of 144 posts

Re: Nim 1.4

#121

Earlier quoted context omitted.

Statement on performance is surprising, I haven't personally benchmarked Nim against Go so couldn't say about that. But I started using Go for the same reasons pointed out in parent and after being tired of changing Python code to C to resolve performance issues. How about concurrency?

Nim is on par with C in a lot of benchmarks, e.g. https://github.com/kostya/benchmarks . Go is the king of concurrency, so whatever you compare to it loses. That said, Nim has async/await for concurrency, and I find threads and threadpools easy to use for paralelism.

Lets not get carryied away with Go advocacy,

https://www.techempower.com/benchmarks/#section=data-r19&hw=...

Re: Nim 1.4

#122
post #39

Earlier quoted context omitted.

> Java's high memory usage I would rather optimize for performance and energy use at the cost of higher memory use. See recent SN: https://news.ycombinator.com/item?id=24642134 https://greenlab.di.uminho.pt/wp-content/uploads/2017/10/sle... Memory is a one time capital cost and gets cheaper over time.

> Memory is a one time capital cost and gets cheaper over time. Except if you're operating in the cloud.

True, yet not everyone is trying to be the next FAANG.

Besides, plenty of GC enabled languages support value types and ways to do deterministic deallocation, use the tools Luke.

Re: Nim 1.4

#123
post #32

An economic argument for GC instead of ARC/ORC. Commercial web application in Java. Java GC is concurrent, on other cpu cores than the cores processing customer requests. Modern GCs such as Red Hat's Shenandoah or Oracle's ZGC have 1 ms or lower pause times on heap sizes of terabytes (TB). Java 15 increased max heap size from 4 TB to 16 TB of memory. Now the argument. A thread running on a cpu core which processes an…

The majority of all GC research goes to java and (primarily the hotspot) jvm. ZGC and kin are like the zfs of garbage collectors: insanely good, but also insanely complex and not readily replicable. It's not practical to expect somebody with fewer resources than oracle to create something similar. Reference-counting strategies are much easier to optimize; so if you have fewer resources available to throw at your comp…

You mean tracing GC, as reference counting is still GC.

Adding value types and deterministic deallocation doesn't require endless GC research and was already available in languages like Mesa/Cedar and Oberon, features that Nim also has anyway.

Re: Nim 1.4

#125

Earlier quoted context omitted.

In my mind, and be aware of my bias here, these languages split up into three different categories: * Has a GC, but you can remove it. This is Nim and D. * Relies on pervasive refcounting. This is Nim if you choose that implementation, Swift. * Has no GC. This is Zig and Rust. (Though obviously you can use refcounting in these languages, but it is as a library.) While this focuses on a specific aspect of these langau…

How many of those 48,197 have over 50 lines of code? How many of them have had changes in the last 1 or 3 years? Same questions apply to Nim too of course, but I believe Rust's focus on newbies and pretty much trivial crates/cargo new pkg addition has led to a lot of cruft in there. Not to mention squatters (even if those are probably not a majority). Also, I would challenge your classification of ARC being in the sa…

I agree that sheer package count is a weak metric especially for very hyped up "can I put it on my resume" prog.langs, and in the context of "maturity" (as opposed to "popularity"). I also agree that programmer attrition rate (or its complement retention rate) are a bit better.

While I cannot speak to Rust's packages, as part of testing a new Nim package manager against the published ecosystem, I happened to just a week or three ago be surveying the freshness of Nim's ecosystem. About 80% of those 1400 Nim packages have been updated in the past 2 years. By last git update, 50% have not changed since 2019/October and 30% have not had a commit since 2018/November. 50..80% fresh (with apologies to Rotten Tomatoes!) is much higher than I would have guessed naively. I am not sure even Python would score so highly. I realize these above numbers are but a start down a more real analytical road. Maybe someone could measure Rust in this way.

In terms of package quality, the one time I re-wrote something that existed in Rust in Nim, my Nim version ran like 10x faster than Rust. That was a couple years ago (https://github.com/c-blake/suggest if anyone cares) and is just one data point. I do think Rust unfairly enjoys a presumption of performance when almost any language has ways to make code run fast. Less ambitious or knowledgeable programmers can always make things slow, but they also seem biased against picking up Rust. So, there is also a sample selection bias, but this has probably all been said before.

Re: Nim 1.4

#126
post #23

Earlier quoted context omitted.

Does ORC stand for something?

I could be wrong, but I believe the acronyms are: ARC = Automatic Reference Counting (NOTE: not Atomic) ORC = Optimized Reference Counting The loopy/circular character of the letter 'O' may be a secondary mnemonic since it collects cycles.

I meant "character" as in "nature" not as in the prog.lang "character type"..I just realized that in context this might be confusing. Lol.

Re: Nim 1.4

#127
post #125

Earlier quoted context omitted.

How many of those 48,197 have over 50 lines of code? How many of them have had changes in the last 1 or 3 years? Same questions apply to Nim too of course, but I believe Rust's focus on newbies and pretty much trivial crates/cargo new pkg addition has led to a lot of cruft in there. Not to mention squatters (even if those are probably not a majority). Also, I would challenge your classification of ARC being in the sa…

I agree that sheer package count is a weak metric especially for very hyped up "can I put it on my resume" prog.langs, and in the context of "maturity" (as opposed to "popularity"). I also agree that programmer attrition rate (or its complement retention rate) are a bit better. While I cannot speak to Rust's packages, as part of testing a new Nim package manager against the published ecosystem, I happened to just a w…

On the other hand, many many packages on https://pypi.org/ have not been updated in the last 5 years since they are essentially feature-complete. They don't need active development, the feature-set in the last published version still works.

Re: Nim 1.4

#128
post #125

Earlier quoted context omitted.

I agree that sheer package count is a weak metric especially for very hyped up "can I put it on my resume" prog.langs, and in the context of "maturity" (as opposed to "popularity"). I also agree that programmer attrition rate (or its complement retention rate) are a bit better. While I cannot speak to Rust's packages, as part of testing a new Nim package manager against the published ecosystem, I happened to just a w…

On the other hand, many many packages on https://pypi.org/ have not been updated in the last 5 years since they are essentially feature-complete. They don't need active development, the feature-set in the last published version still works.

It's a fair point that sometimes software is "just done". Combining the dependency graph with version freshness may yield even more informative retention/attrition metrics. { EDIT: as in "either updated in N months or a dependency of something which was". Of course, this can easily neglect reverse dependencies not in the package graph, but perfect can be the enemy of the good. :-) }

Re: Nim 1.4

#129
post #19
post #13

Earlier quoted context omitted.

Is there an msan/asan equivalent that can detect leaks in your test suite?

Yes, we use valgrind for the compiler and stdlib test suite. The testament tool supports this, however it's not in widespread use outside of the compiler and stdlib, so documentation is rather sparse. Since Nim uses the C compiler to generate executables, you should be able to use `--passC:-fsanitize=memory --passL:-fsanitize=memory` to enable msan. For maximum effectiveness the flags `-d:useMalloc --gc:orc` should a…

Please put this in the docs, if it is not there already

Re: Nim 1.4

#130

Earlier quoted context omitted.

In my mind, and be aware of my bias here, these languages split up into three different categories: * Has a GC, but you can remove it. This is Nim and D. * Relies on pervasive refcounting. This is Nim if you choose that implementation, Swift. * Has no GC. This is Zig and Rust. (Though obviously you can use refcounting in these languages, but it is as a library.) While this focuses on a specific aspect of these langau…

How many of those 48,197 have over 50 lines of code? How many of them have had changes in the last 1 or 3 years? Same questions apply to Nim too of course, but I believe Rust's focus on newbies and pretty much trivial crates/cargo new pkg addition has led to a lot of cruft in there. Not to mention squatters (even if those are probably not a majority). Also, I would challenge your classification of ARC being in the sa…

It's funny, because everyone wants different metrics. Some people would argue that no changes in the last 3 years is a sign of maturity!

Anyone can argue any metric, and that's 100% fine. Any of these things can only be a really rough measure of anything.

Post reply on HN