Hacker News new | ask | show | jobs
by synergy20 1279 days ago
among nim, zig and rust, I'm most likely to learn nim, it has been there for a while and it is solid and has so many good stuff in it, it just needs more 'marketing'. in particular, python really should help its popularity as their syntax are similar and both are very expressive.
2 comments

Is syntax really that big of an obstacle to learning a first programming language? The semantics of a C-like language like Nim could hardly be more different to Python's, they're pretty much at opposite ends in the stack.
It can be. I would've loved to pick up Rust, the patterns for code structuring etc. that are evolving from it seem interesting to me. But getting the syntax right is just fairly difficult compared to other languages and at some point you just lose your patience. At the same time there's not enough learning material that works for me to dive into the deeper contexts to make it "click" for me.

Contrasting that to my experience with nim, I could get going almost immediately and thus didn't get held up much with the basics, which gave me more time to dive into more interesting concepts that it provides, like templates, compile-time-evaluation (new for me as a pythonista back then), macros etc.. I still got stuck here and there, mind you, but that was for more complex question than "How do I get a config from place X without the compiler yelling at me", and the discord was very helpful for that.

Nim feels much more like python than c to me, and the minimal number of non-alphanumeric characters in source is a big part of that.
> Is syntax really that big of an obstacle to learning a first programming language?

Of course. Compare, at the extremes, languages like APL or Brainfuck to something like Python or Scratch. Syntax is a huge factor in people wanting to learn to code or not.

Those languages have actually very different semantics too. I would say lisp is a better example of the importance of syntax.

People obsess (wrongly) about superficial details in my opinion.

I know of an example first hand where syntax only mattered: OCaml vs ReasonML. ReasonML is merely a syntactic change from OCaml as it's simply OCaml underneath, but people, especially coming from web languages like Javascript, liked ReasonML more than OCaml and were more willing to use it.

Another example, Gleam (an Erlang BEAM based language like Elixir) [0]:

> Shot in the wind, but is there a plan for different syntax? For those who've become comfortable in different fp camps, I can't really see myself picking up curly brackets and C-style code again. I really like the idea(s) of this project, but it's the thought of staring at that kind of code that's just a bit too much. I'd rather do something like [Nim,Scala,Clojure,F#]->JS if I needed to have that.

> > Unlikely I'm afraid. We used to have an ML style syntax but once we switched to a more mainstream syntax we had a big surge in popularity and interest.

> > I am very fond of the ML syntax, but I think it is the semantics and type system that really matter, so I am very happy to sacrifice syntax in order to make Gleam more widely accessible.

[0] https://news.ycombinator.com/item?id=27063049

Syntax is pretty much the entire reason that people stay away from languages like Erlang and Lisp
Or you know, types. Or too much expressivity.
Nim community is pretty much against python developers. The founder is vocal about that.
This is not really true, most of the times the discussion goes like this

Q: "Why haven't you implemented feature X -- python has it, so nim should too"

A: "Nim is not python, it is a different language, not all things implemented there are good, so we don't implement everything"

So this is not "against python" it is against specific attitude towards nim where people think it should be a python clone instead of a separate language

Given I used to be a python dev myself before I picked up nim and since then have helped out a fair bit of python-folks picking up nim, I'm not sure what that's based on.

The fact that nim doesn't have exactly the same stdlib defined as python (though there's a package for that)? That Araq has said that nim isn't a variation of python?

No one is against Python developers, you're clearly exaggerating, I would ask for a source but we both know it doesn't exist. What people try to convey the whole time to people coming from python, which I was years ago, is that nim is not compiled python. It's a totally different language. I am sorry that message sometimes gets lost in translation but I don't know what would be clearer than this recent thread.

https://forum.nim-lang.org/t/9737

There's my problem with nim. I was really excited about it two years ago and tried to get into it. Unfortunately I found the community not very welcoming. All the issues I had, had been raised before and dismissed.

I've since switched to Rust. The syntax isn't quite as nice but it's outweighed by the fact that the community is great and the memory safety is a game changer!

My problem with rust, is that community is overzealous to promote their language, even in the cost of spreading lies and misinformation and harassment. I was routinely attacked by anonymous accounts. The common thing they say is people using other language than rust are dumb. A few weeks ago some people joined the nim discord and besides promoting rust, they started name calling. I stay miles away from rust, it has by far the worst community. It's shameful.
There is an entire wiki page to welcome developers coming from python, and show where the two languages differ: https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programm...