Hacker News new | ask | show | jobs
by gilrain 1929 days ago
In my case, I actually prefer my languages to be more opinionated. Nim implements just about every paradigm it can think of, and if there are multiple ways to implement a paradigm, it implements them all. It feels like a sophomore college student who keeps switching majors.

Some people prefer "There is Only One Way to Do It" languages.

Some people prefer "There is More Than One Way to Do It" languages.

Nim is more like a "There Are Seven Ways to Do It and the Eighth Way is Planned" language.

3 comments

Nim seems pretty opinionated to me: use imperative style, minimal or none OOP (preference for macro built DSLs over OOP), functional allowed for those who like it.

Also looking code around I think style and usage is pretty consistent and Nim idiomatic code is certainly a thing. Overall I think it is a definitely consistent language. It is definitely evolving but you can go a long (loong way) with 1.0 features.

I also believe “there is only on way to do it” is more of a slogan/goal than a real thing.

Nim is a very flexible language where things that would, in almost any other language (besides Lisp/Racket/etc) require direct compiler support (like async/coloring) can be done as libraries.

Consequently, people disagreeing the way they do in their opinions, even if there were not seven ways to do something in the core language/stdlib, libraries would add those ways. So, the ecosystem would still have them all and more (eventually).

Personal opinion, but I would say Nim is remarkable in being able to support & manage all this diversity. One does not see Nim style guides like C++ style guides where you are only supposed to use the 5..10% or whatever of the specified language that everyone on a team understands, for example. { Yet! Famous last words... :-) }

> Nim implements just about every paradigm it can think of, and if there are multiple ways to implement a paradigm, it implements them all.

any examples?

The first one most people run into: Nim is roughly as performant as Rust, but it's easier to learn because it's garbage collected. But it's also not garbage collected, if you prefer (with caveats). Want a different flavor of garbage collected? We have three (with caveats)!
thats not a different way of doing same thing, its doing different thing. this not even an argument, if language can provide multiple memory management strategies, in what world is that a bad thing?

and if you somehow confused about choice (of gc), you should stick to default.

also, there is no such thing as "There is Only One Way to Do It" languages. your entire argument is just a circlejerk point.

Is Nim garbage collected? There is no simple answer to that.

When it is garbage collected, how is it garbage collected? There is no simple answer to that.

As stated in my original comment, I prefer languages which are more opinionated than that. Nim is a Swiss Army knife; some people like that, but I prefer choosing a fixed-blade knife to suit my current purpose.

Is C garbage collected? There is no simple answer to that. Link with Boehm (or something similar) and it is. These things are often (with almost any language) aspects of the implementation & deployment, and most mature languages have multiple answers as well. Is Python "compiled"? Well, with Pypy or Cython or etc. it is. (Or maybe it's always at least "compiled" to byte codes run by a slow byte code interpreter.) Etc., etc. I think your standards for "simplicity" or univalence may be, as @SolitudeSF alluded to, unsatisfied by even prog.lang's you like (which you gave no concrete examples of).
> Is Nim garbage collected? There is no simple answer to that.

Yes, Nim v1 is a garbage collected language. It also shipped with custom destructors support https://nim-lang.github.io/Nim/destructors.html.

Nim v2, which is hopefully two releases away, will ship with a memory management scheme called "orc" https://nim-lang.org/blog/2020/12/08/introducing-orc.html

However right now, it is recommended that all new code is written with the `--gc:orc` switch.