Live data from Hacker News

Nim 1.4

nim-lang.org

91–100 of 144 posts

Re: Nim 1.4

#91
post #63
post #60

It is nice with a lot of innovation now in the ahead-of-time compiled languages camp. What worries me is the fragmentation, and the fact that no one language seems to check all of the (subjective set of) boxes for a general purpose high-speed, ahead-of-time compiled language [0]. E.g, Crystal seems to be the only one supporting a modern concurrency story (similar to Go), but has a huge problem with compile times. Nim…

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

Thanks! This is interesting, although I'd be worried about how stable this is for the long term. Would be happy to have my worries annihilated of course :)

Re: Nim 1.4

#92
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 compiler it's the way to go.

Re: Nim 1.4

#93
post #3

There are a lot of gotchas with the new GC that make me nervous about this release: > As far as we know, ARC works with the complete standard library except for the current implementation of async... That's not a great endorsement... > If your code uses cyclic data structures, or if you’re not sure if your code produces cycles, you need to use --gc:orc and not --gc:arc. Seems like this is a big onus to put on the use…

At an ELI5 level, does anyone know why Swift can have ARC and async but Nim's ARC doesn't work with async? Is it just implementation details of Nim's async specifically instead of anything more fundamental to ARC? Just asking out of curiosity.

Note that what we're referring to as "async" for Nim is actually "async await". AFAIK Swift doesn't support that, does it?

Re: Nim 1.4

#94

Maybe my lack of lower level language knowledge will show here, but how does that compare to Rust? I keep seeing and hearing about these new-ish languages Rust, Nim, Zig, etc. that all claim to be C/C++ perf lvl but better developper experience. Any of these is preferred for API/Web development? Does it yield much advantage over something like Elixir that already provides significant perf increase over a Python(Djang…

Sibling talks about memory management. Some other notes:

- Nim and rust have macros.

- D has very high-quality metaprogramming (probably better than any other language without macros).

- (Afaik swift and zig have fairly normal templates. I don't know as much about those.)

- D and zig have compile-time function execution (think c++ constexpr on steroids on steroids).

- Swift is likely to be the slowest of the bunch; like go, though it's technically compiled to native code, its performance profile is closer to that of a managed language. The others should be generally on par with each other and with c.

Re: Nim 1.4

#95
post #91
post #63

Earlier quoted context omitted.

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

Thanks! This is interesting, although I'd be worried about how stable this is for the long term. Would be happy to have my worries annihilated of course :)

It depends how good/low level a programmer you are, but it's really not that hard to spin up your own impl. I did an (incomplete) Python multiprocessing like dealio in like 100 lines of code (https://github.com/c-blake/cligen/blob/master/cligen/procpoo...) just to make my `only.nim` run faster because libmagic/file are so CPU intensive. So, one way to annihilate your worries is to just roll your own.

Re: Nim 1.4

#96

Maybe my lack of lower level language knowledge will show here, but how does that compare to Rust? I keep seeing and hearing about these new-ish languages Rust, Nim, Zig, etc. that all claim to be C/C++ perf lvl but better developper experience. Any of these is preferred for API/Web development? Does it yield much advantage over something like Elixir that already provides significant perf increase over a Python(Djang…

> Any of these is preferred for API/Web development?

I often wonder why anyone would use a language like Zig or Rust for Web development. I am very much biased in favour of Nim here, but to me in general a non-GC'd language seems like overkill for web development. So I would rule those languages out straight away.

I can't speak to Elixir, likely the main difference will be the lack of a mature Django-like framework. I'm assuming that Elixir has one, whereas Nim doesn't. If you're looking for a fun project, I would love to see that made for Nim and happy to give pointers if you need them :)

Re: Nim 1.4

#97

Maybe my lack of lower level language knowledge will show here, but how does that compare to Rust? I keep seeing and hearing about these new-ish languages Rust, Nim, Zig, etc. that all claim to be C/C++ perf lvl but better developper experience. Any of these is preferred for API/Web development? Does it yield much advantage over something like Elixir that already provides significant perf increase over a Python(Djang…

Sibling talks about memory management. Some other notes: - Nim and rust have macros. - D has very high-quality metaprogramming (probably better than any other language without macros). - (Afaik swift and zig have fairly normal templates. I don't know as much about those.) - D and zig have compile-time function execution (think c++ constexpr on steroids on steroids). - Swift is likely to be the slowest of the bunch; l…

I would say that Nim has one of, if not the, highest quality metaprogramming among these languages. Indeed, compile-time function execution, AST manipulating macros, declarative templates and term rewriting macros are some of the metaprogramming features in Nim.

Re: Nim 1.4

#98
I am using nim this week on a data file scraping project. If you can Google and write python you can just start with nim and learn as you go, very easy.

I am super bummed that there is (effectively) no debugging. I am too lazy to mess with VS code to get gdb working, it should just work already. Someday, I guess. Maybe jetbrains will save us. With real IDE support nim would sweep the nations.

Re: Nim 1.4

#100
I'm going to do a little bit of a shameless plug as a way to show off just what Nim is capable of. If you've ever played one of the many IO games, it might seem familiar to you. Basically I have used Nim to create a multiplayer game that can be played in the browser[1].

I'm planning to write up a more detailed post outlining the architecture of this. But suffice it to say, Stardust is written 100% in Nim. Both the servers and the client running in your browser is written in Nim. The client uses Nim's JS backend and the server Nim's C backend. The two share code to ensure the game simulation is the same across both. Communication happens over websockets.

It's been a lot of fun working on this and I cannot imagine another language being as flexible as Nim to make something like this possible. I already have an Android client up and running too, it also is built from the same code and I plan to release it soon.

1 - https://stardust.dev/play

Post reply on HN