Live data from Hacker News

Nim 1.0

nim-lang.org

131–140 of 308 posts

Re: Nim 1.0

#131
I would have never thought to live long enough to see this happening! I started using Nim in 2014, but abandoned it after a few years, frustrated by the instability of the language and what I perceived as a lack of vision. (In 2014, release 1.0 was said to be "behind the corner".)

This release makes me eager to try it again. I remember that the language impressed me a lot: easy to learn, well-thought, and very fast to compile.

Congratulations to the team!

Re: Nim 1.0

#132
What’s Nim’s concurrency story? Since it’s compuled via C, I suspect the answer is “shitty” as in I expect it to inherit all of C’s issues with undefined behaviour, values out of thin air, and so on...

Re: Nim 1.0

#133
post #104

Earlier quoted context omitted.

Nim performance is really really good. Like, maybe C - 5%. Comparable with stuff like Rust or D... way way faster than Go or anything interpreted.

I think it depends on the nature of the code. For a side project of mine, I recently re-wrote the same code in a dozen or so languages. The application reads input data from text file and does a bunch of conversions to integers and floats (atoi and atof). It then runs through an algorithm that does calculations and identifies proper actions. Finally, it writes the output data as formatted text file. Regardless of imp…

Replying to my own post to provide better formatting of execution times.

  1. C++     0.04  (gcc version 5.4.0)
  2. Rust    0.11  (version 1.37.0)
  3. Go      0.13  (version 1.12.7)
  4. D       0.16  (tied with Pascal) (DMD64 D Compiler v2.073.2-devel)
  5. Pascal  0.16  (tied with D) (fpc 3.0.2)
  6. C#      0.25  (mono 4.8.1)
  7. Nim     0.50  (1.0.0)
  8. Kotlin  0.81  (Kotlin version 1.3.50-release-112, JRE 1.8.0_222)
  9. Java    0.95  (openjdk version "1.8.0_131")
  10. Scala  1.79  (version 2.12.2, running on 1.8 openjdk)

Re: Nim 1.0

#134
post #95

Question (genuine, not trolling): what's the use-case for Nim regarding other languages? What are its pros/cons?

For me, personally, the biggest points for Nim are: - "Transpiled" to C, with some options regarding runtime library, which means you can target any uController out there - Good metaprogramming support - Static and _strong_ typing - Consequently, precise type aware function dispatch - Type inference - Good generics Also, more stuff like covariants and contravariants and... maybe you just have a look-see? ;-)

I'm already quite invested in Kotlin, and having a look at Elixir... on top of my regular work. Time is a limiting factor :-)

Re: Nim 1.0

#135
post #104

Earlier quoted context omitted.

Nim performance is really really good. Like, maybe C - 5%. Comparable with stuff like Rust or D... way way faster than Go or anything interpreted.

I think it depends on the nature of the code. For a side project of mine, I recently re-wrote the same code in a dozen or so languages. The application reads input data from text file and does a bunch of conversions to integers and floats (atoi and atof). It then runs through an algorithm that does calculations and identifies proper actions. Finally, it writes the output data as formatted text file. Regardless of imp…

Obviously, if you measure cold starts, JVM-based languages will be slower...

Re: Nim 1.0

#136

Question (genuine, not trolling): what's the use-case for Nim regarding other languages? What are its pros/cons?

Those are valid questions when evaluating an unknown technology. How could anyone consider this trolling? Not to digress but have we become too sensitive?

Communication by writing is harder because you miss facial expressions. Because of this, a lot of it is subject to interpretation on the part of the reader. The tone can be inferred from a lengthy piece, but not so much from a small paragraph.

So, in order to avoid bias on the reader part, I preferred to explicitly tell it was not trolling.

Re: Nim 1.0

#137

Earlier quoted context omitted.

I think it depends on the nature of the code. For a side project of mine, I recently re-wrote the same code in a dozen or so languages. The application reads input data from text file and does a bunch of conversions to integers and floats (atoi and atof). It then runs through an algorithm that does calculations and identifies proper actions. Finally, it writes the output data as formatted text file. Regardless of imp…

Obviously, if you measure cold starts, JVM-based languages will be slower...

Agreed. I include them in the list as a matter of completeness.

Re: Nim 1.0

#139
post #132

What’s Nim’s concurrency story? Since it’s compuled via C, I suspect the answer is “shitty” as in I expect it to inherit all of C’s issues with undefined behaviour, values out of thin air, and so on...

That's kinda jumping the gun - just because something is compiled to C, doesn't mean that it has all of the characteristics of C. That's like saying that because something is compiled to assembly, it has all the complexities and dangers of assembly.

For example, take a look at Cython, CGo etc.

Regarding concurrency, Nim has cross-platform thread support in the standard library. Concurrency, at least right now, is more memory safe than other languages, but also more restrictive. Each thread has its own heap, and and memory from one thread's heap cannot be referenced by another thread's heap without use of unsafe pointers. One can, however, copy memory from one heap to another.

There are more abstract currency mechanisms detailed in the manual (primarily for work that is well-suited for threadpool use cases)

Re: Nim 1.0

#140

I noticed that Araq's personal post about v1.0 mentioned a powerful macro system as a top priority. I wonder if Nim's macro system is now expressive enough that a front-end web framework like Svelte [1] could be implemented using Nim macros, as opposed to Svelte's HTML template language and custom compiler. COuld be useful for developing isomorphic web apps with something lighter than Node on the server side. [1]: ht…

I think this is what you're looking for: https://github.com/pragmagic/karax
Post reply on HN