Skip to content

Comment on Marketing the Odin programming language is weird

Comments

And before people say: “Odin’s ‘killer feature’ is that it has none”, how the heck do you market that? That seems like an anti-marketing feature.

Correct me if i'm wrong but it seems to me that there are Zig, Nim, Dart, Carbon, C3, ooc, (maybe Eiffel?) too in this space, and that only counting C/C++ replacements that you can compile in a way or another.

IMO, Nim's killer feature is it's syntax. It's even in it's slogan "Efficient, Expressive, Elegant".

HN crowd would not agree with me, but indentation-based syntax is easier to read, less cluttered and more intuitive than multiple nested ()'s or {}'s . And the success of python, despite it's countless flaws is the proof.

I hate python's syntax, it might be less cluttered but it's a pain to refactor or play around, because a lot of times you have to re-indent everything before it will work again. And then I also tend to find it harder to find the end of blocks. I think the success of C-style bracket syntax in most other languages apart from Python is the proof of how superior it is.

Looking over the Odin docs, it seems to me that a short summary might be: Nim provides almost all the same sorts of things as Odin, but with more Python-y syntax, more meta-programming, automatic memory management with opt-out, and less (no) built-in support for multi-dimensional arrays {EDIT: though, of course, Nim has multiple external impls like ArrayMancer, etc. and having flexible syntax makes this mostly a rendezvous-on-one-thing problem}.

I also like the way Nim with its command calls and so on is even more compact and "to the point" than Python is. Whenever I go back to Python from Nim, I think to myself "Why all this clutter?" :-)

I love everything Nim but that. Spaces-only indentation forces you to write with an at least mediocre code editor and that's a gripe, for the rest it's just me that i'm C-brain-damaged, i even wrote an awk preprocessor for writing multi-line blocks with curly braces delimitation. I don't recommend my habits as the right way, they are probably the wrongest of ways.

Spaces-only indentation forces you to write with an at least mediocre code editor

I don't understand how is that an issue, unless you write your code in notepad =).

And even if you do use dumb text editor, you can quickly write code with 1-space indentation and reformat it with nph[0].

There's also a neat trick for people who like C-style languages. If you use sufficiently enough parenthesis and semicolons - you don't need indentation at all:

  import os;proc main = (let file = paramstr(1);(for line in file.lines:(echo line; if line == "": return)))
Random thought: it shouldn't be too hard to write a formatting tool that translates braces to indentation and vice versa. But I have yet to see a project like this for Nim.

0 - https://github.com/arnetheduck/nph

import os;proc main = (let file = paramstr(1);(for line in file.lines:(echo line; if line == "": return)))

Yeah, bliss-style, you know in docs it isn't made clear that that works but i sensed that would.

Random thought: it shouldn't be too hard to write a formatting tool that translates braces to indentation and vice versa. But I have yet to see a project like this for Nim.

It's a hour-long "project" if you don't care about how to treat pragma annotations. I did just that.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.