by indulona · 2y ago · 0 comments
PS: this is just off the cuff comment, not too thought out. also, Odin has a chance to beat Zig, due to better syntax and being essentially complete, beside having official spec. Which is not the case of Zig. Zig has traction but lacks in areas where Odin does not. So I would focus on Zig as the competitor, Rust as second. The simplified go-like syntax is one of the main selling points. But there must be more to the language.
PPS: I think the choice of ^ to handle pointers is one of the worst decision in the syntax. The * and & are the norm and should not be messed with.
At best you get support in the standard lib, but whether things like this should go into the stdlib or 3rd party libs is a decision that isn't set in stone forever, and probably doesn't even matter if it is easy to integrate 3rd party libs into Odin projects. AFAIK Odin has the concept of vendor libraries, which live somewhere between stdlib and 3rd party - so networking could go there).
Compared to Zig specifically, Odin has a couple of language features that might make it less pure from an academic language designers pov, but more convenient from the user's pov and only the last one matters for getting shit done. I wouldn't dismiss Odin only because it doesn't have features XYZ, because it does some other things very right compared to other languages.
Re IDE integration, google for "Odin language server".
Erlang has cluster aware message passing built in as a fundamental aspect of the language.
C++ before the days of C++98, when each C++ compiler vendor provided a nice C++ framework alongside their compiler.
Funny that's my favourite aspect of Odin's syntax.
p: ^int
Easy on the eyes.I also like the convention of the type on the left and its usage on the right:
p: ^int // ^ on the left
x := p^ // ^ on the right
Very similar to languages of the Pascal family, but less verbose.And with structs:
p^.x // not necessary
p.x // this will doOdin uses curly braces which (in QWERTY) are shifted and typed with your pinky—the worst possible combination. Are there layouts where ^ is worse than that?
I was surprised by this since all I need on Linux is llvm and clang, but looking at the official getting started page, it does indeed say "MSVC compiler and windows SDK" are required. Is that really the only way to run it on windows, or is that just the path most familiar to a typical windows developer?
I personally disagree with saying it requires IDE support. I want to write a ctags parser for it, but that's all I would ever use; as a die-hard vim user, I never liked all the language server stuff people are so reliant on these days. But if that's what people want to use, it's available for Odin as well: https://odin-lang.org/showcase/ols/ -or- https://github.com/DanielGavin/ols
IIRC there are slimmer packages to get it but you’re still talking a gigabyte, not tens of megs.
But anyway, if you're in the Odin target audience on Windows you most likely have Visual Studio installed anyway. Also IIRC even Clang and Rust depend on the MSVC linker on Windows, Zig is really an "outlier" (in a good way) in that regard.
As for IDE, people who use plain editors like vim, emacs... exist but their numbers are merely a statistical error compared to people that use IDEs(i am counting VS code into this category even though it's just electron). Of course we could debate what is and what is not IDE, but the point here is that we need syntax highlighting, refactoring, jumping to definitions, finding usages and other functionality that IDEs provide.
Odin had no such block to improvement. Props to them.
Not much of a problem for people who are used to C syntax of course, but may be confusing to anybody else, especially in expressions which have both pointer dereference and multiplication, for instance this is entirely valid C:
int a = 3 ** int_ptr;
The '^' is the pointer symbol in Pascal, so it's not a new thing either, it just fell a bit out of fashion.(No, it's not a real operator, it's another case of weird but allowed spacing causing confusion)
int a = powl(3,int_ptr);
edit: The parent's code does a dereference and then a multiplcation. This is because of (imho) bizarre parsing rules for a dereference asterisk. I'm saying that's so horrifying that I would be less horrified if it really was an exponent (as it might seem by mixing languages)."Persona oriented development" (POP) when?