Live data from Hacker News

Patten Matching in Nim

nim-lang.org

31–40 of 54 posts

Re: Patten Matching in Nim

#31
post #30
post #27

Earlier quoted context omitted.

I tried out Nim. My first reaction was that I absolutely loved it. Second reaction was when I needed to look up how to do something and I realised that the docs aren't amazing. Third reaction was when I first ran into a problem I couldn't find anything on Google, and had to post on the Nim forums. The forums were great but there's an inevitable time lag between posting and getting a response. Then I started looking a…

> The forums were great but there's an inevitable time lag between posting and getting a response. FWIW the core devs and many others are present on the #nim channel on Freenode with bridges to Discord, Gitter, and (non-Gitter) Matrix.

Many people find just searching the big index [1] to be enough. Besides the Forum and the IRC (often more immediate), there is also a Wiki [2] where you can maybe contribute documentation for "what you would have liked to have seen" and numerous other documentation things off of [3].

It's true the "just web search it" approach may be weaker than other programming languages. That's a late stage network effect (as is lower latency of Forum/IRC responses).

[1] https://nim-lang.org/docs/theindex.html

[2] https://github.com/nim-lang/Nim/wiki

[3] https://nim-lang.org/documentation.html

Re: Patten Matching in Nim

#32
post #20

NIM seems like this unicorn of a language of having great performance, amazing balance between being both high-level and low-level, extremely approachable due to syntax ... yet very few have actual discovered and use NIM. I wonder why.

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 li…

> 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?

Re: Patten Matching in Nim

#33
I played with Nim a little bit, loving it for a while, and I quickly ran into the same issue I had with Julia, which was that I had trouble staying in the basic language. Both Nim and Julia's documentation, and many modules/imports/includes/whatever of those languages, immediately jump to "holy shit we have macros! Importing this module changes the syntax! Isn't that awesome?!" And I'm like, no, it's not awesome. New syntax, new syntactic sugar, etc. is a learning curve every time for me. I'm often skeptical of operator overloading in C++ and python, so macro crazy languages are even worse. I feel like I must be in the minority, or I haven't hit that programming nirvana.

Re: Patten Matching in Nim

#34
post #20

Earlier quoted context omitted.

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 li…

> 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)!

Re: Patten Matching in Nim

#35
post #34

Earlier quoted context omitted.

> 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.

Re: Patten Matching in Nim

#36
post #34

Earlier quoted context omitted.

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.

Re: Patten Matching in Nim

#37
post #34

Earlier quoted context omitted.

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.

> your entire argument is just a circlejerk point

Ah yes, thanks for reminding me: much of its most engaged community members seem to be abrasive edgelords.

Re: Patten Matching in Nim

#38
post #27

NIM seems like this unicorn of a language of having great performance, amazing balance between being both high-level and low-level, extremely approachable due to syntax ... yet very few have actual discovered and use NIM. I wonder why.

I tried out Nim. My first reaction was that I absolutely loved it. Second reaction was when I needed to look up how to do something and I realised that the docs aren't amazing. Third reaction was when I first ran into a problem I couldn't find anything on Google, and had to post on the Nim forums. The forums were great but there's an inevitable time lag between posting and getting a response. Then I started looking a…

What exactly is wrong with Nim's docs, in your opinion? They seem fine after perusing the ones at the following link a bit just now:

https://nim-lang.org/documentation.html

Re: Patten Matching in Nim

#39

I played with Nim a little bit, loving it for a while, and I quickly ran into the same issue I had with Julia, which was that I had trouble staying in the basic language . Both Nim and Julia's documentation, and many modules/imports/includes/whatever of those languages, immediately jump to "holy shit we have macros! Importing this module changes the syntax! Isn't that awesome?!" And I'm like, no, it's not awesome. Ne…

I totally agree with you, that's why I started Nimlings to help new Nim engineers get familiar with the language. Let's face it, you probably won't need macros WELL into your Nim lifecycle.

https://github.com/sergiotapia/nimlings

Re: Patten Matching in Nim

#40

NIM seems like this unicorn of a language of having great performance, amazing balance between being both high-level and low-level, extremely approachable due to syntax ... yet very few have actual discovered and use NIM. I wonder why.

One of my knocks against it is using white space for scoping/blocks a la Python. While it may be great for beginners or for short scripts, over time it becomes a real pain when refactoring. Editors mess up indentation all the time when copying and pasting. You only have to inadvertently make a statement either incorrectly part of, or not part of an if a few times, before you become leery of that choice.

I've been coding for 14 years and I've never had a "whitespace" problem. This just seems like a nitpick from nitpickers.

Coded in C#, python, go, ruby, elixir, nim, rust, javascript, typescript. Not once felt this.

Post reply on HN