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.
Patten Matching in Nim
41–50 of 54 posts
Re: Patten Matching in Nim
#42Earlier quoted context omitted.
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.
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.
Re: Patten Matching in Nim
#43I 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…
They just offer convenience on top of it, most common example is the `=>` lambda operator from the `sugar` module. I do agree, that the pattern matching macro presented in the article is a bit hard to get used to, but you don't have to, if you don't like pattern matching. And of course there are plenty of alternatives available as well, the simplest one imo is https://github.com/andreaferretti/patty
Re: Patten Matching in Nim
#44NIM 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…
fwiw this is plain wrong, a garbage collected language in general is memory safe, just with a different scheme (a garbage collector) than rust's memory model. Both are better options from one that is unmanaged.
I hate to attract negative attention from rust fanboys. But none likes Rust's borrow checker and hopefully language developers can come up with a better design.
Re: Patten Matching in Nim
#45Earlier quoted context omitted.
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
#46The amount of power that Nim has is absolutely obscene. I don't really have a good use-case for it right now, but it's a language that I know I'd enjoy if I got into it.
Does Nim solve the "what color is your function" problem?
Of course, the downside is that it relies on library authors to use this mechanism.
Re: Patten Matching in Nim
#47I 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…
Macros are not different than functions: one can create readable or crazy spaghetti code in any language.
If you find a codebase full of unreadable macros it's not different than any other type of bad code: stay away from it or simplify it.
Personally, I'm yet to find a macro that makes the code less readable or more difficult to understand.
Re: Patten Matching in Nim
#48Earlier 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…
> I ended up appreciating the guardrails it provides around safety that Nim doesn't... fwiw this is plain wrong, a garbage collected language in general is memory safe, just with a different scheme (a garbage collector) than rust's memory model. Both are better options from one that is unmanaged. I hate to attract negative attention from rust fanboys. But none likes Rust's borrow checker and hopefully language develo…
Re: Patten Matching in Nim
#49Earlier 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…
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
#50Earlier quoted context omitted.
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.