News for hackers. Stuff that matters.
Re:Nim Community Survey 2021 Results by k__ on Friday January 14, 2022 @12:24PM (#29937258)
I still wish for a Rust with Nim syntax.
Re:Nim Community Survey 2021 Results by arc776 on Friday January 14, 2022 @02:23PM (#29939065)
What things do you wish for in Nim from Rust?
Re:Nim Community Survey 2021 Results by lostdog on Saturday January 15, 2022 @11:02PM (#29953157)
Rust's Result type and `?` operator makes error handling kinda fun. Every language should strive to be this clean.
Re:Nim Community Survey 2021 Results by elcritch on Saturday January 15, 2022 @11:26PM (#29953320)
Nim’s got an Option type, though it’s not as popular as exceptions. There’s also third party option libraries that provide ‘?’ like features.
Re:Nim Community Survey 2021 Results by lostdog on Sunday January 16, 2022 @06:11PM (#29961394)
Having a single Result type as standard has a huge benefit. You can do error handling for every library you use in exactly the same way. You also get decent stack traces because the runtime can reason about a single error type. Unified error handling is, IMO, necessary for making a language a pleasant experience.
Re:Nim Community Survey 2021 Results by k__ on Saturday January 15, 2022 @07:05AM (#29945752)
Less clutter.

I like ML and Python syntax.

Re:Nim Community Survey 2021 Results by arc776 on Saturday January 15, 2022 @10:11AM (#29946888)
The syntax is what attracts me to Nim too.

Why use Rust over Nim in this case?

Is it Rust's static lifetime constraints? Is there some feature you would miss if you used Nim instead? Or would you prefer to use Rust because more organisations are using it?

Re:Nim Community Survey 2021 Results by k__ on Sunday January 16, 2022 @08:58AM (#29956009)
I like the lifetimes, the traits, the pattern matching, but also that it's used by more people, yes
Re:Nim Community Survey 2021 Results by arc776 on Monday January 17, 2022 @06:50PM (#29973061)
Thanks for your reply.

It's interesting to know what the perceived weaknesses and strengths are. Nim does have pattern matching but it's rarely used, whereas it seems to be used a lot in Rust (probably because of the prominence of enums). Nim has static lifetime management, but it's mainly used for eliding and thread safety (for now). Traits are an interesting feature, and make a good example of why I'm so bullish on Nim: someone has already replicated them with a macro: https://github.com/haxscramper/nimtraits

The popularity critical mass thing is mainly getting eyes on the language, but I think Nim has a slight advantage in that it's incredibly cooperative with its compile targets and FFI. Like Python, it's great for good glue code and 'scripting' without the performance penalty, and I hope that helps it meld into people's toolboxes over time.

Re:Nim Community Survey 2021 Results by cb321 on Sunday January 16, 2022 @11:20AM (#29957237)
Nim's concepts [0] are sort of like Rust's traits or Haskell's typeclasses - maybe more expressive in some ways. Pattern matching can be added on as a simple library and has been done several times, maybe most pedagogically outlined here [1]. Lifetime annotations just seem unproductive to me. Nim with ARC/ORC does have safe [2], automatic memory management without "a GC" or need for lifetime annotations.

[0] https://nim-lang.org/docs/manual_experimental.html#concepts

[1] https://nim-lang.org/blog/2021/03/10/fusion-and-pattern-matc...

[2] https://uploads.peterme.net/nimsafe.html

Re:Nim Community Survey 2021 Results by arunc on Monday January 17, 2022 @11:37PM (#29975173)
They probably mean ownership?
Re:Nim Community Survey 2021 Results by odiroot on Friday January 14, 2022 @12:50PM (#29937594)
Same here, Rust and/or Golang with a Nim syntax would be my favourite.
Re:Nim Community Survey 2021 Results by The_rationalist on Friday January 14, 2022 @01:43PM (#29938363)
scala 3 is much more than this and has a modern syntax https://docs.scala-lang.org/scala3/guides/migration/tooling-...
Re:Nim Community Survey 2021 Results by k__ on Saturday January 15, 2022 @07:05AM (#29945753)
Scala ditched the JVM and has lifetimes now?
Re:Nim Community Survey 2021 Results by The_rationalist on Saturday January 15, 2022 @09:06AM (#29946417)
Lel 1) JVM languages can compile to ELF binaries with GraalVM 2) lifetimes are an antifeature that is not needed outside of niche performance critical purposes. Moreover in the real world it's much easier to produce slower code in low level and non gc based languages. Btw I'm pretty sure SOTA latency critical GCs such as ZGC (<0.1ms max pause time) has outperformed non-gc memory management for latency critical workloads. More importantly the jvm ecosystem has received order of magnitude more resources at optimisation for complex needs (drools,lucene, the whole Apache empire, etc) Rust is a joke compared to Scala featureset.
Re:Nim Community Survey 2021 Results by ewuhic on Friday January 14, 2022 @02:29PM (#29939149)
I wish for Nim with Rust syntax AND ecosystem.