top | item 42398296

(no title)

kalekold | 1 year ago

I'm not particularly impressed by Odin but maybe i'm not the audience. If you like strictly procedural languages (or a die hard C fan) it's probably fine but it feels like a 'My First Language™' kind of project.

What I really miss are methods on structs a'la Go. Just simple receivers would be a great addition imho. Because of this choice, it's affected the entire stdlib and boy does it look old. Creating a typed variable to pass it to a stdlib init function (for allocation, etc) is terrible decision and it's everywhere. The stdlib looks muddled too.

Odin is obviously heavily inspired by Go (among others) but it's learned nothing of the lessons of the Go authors. For example, Odin is a larger language and has fewer features.

I got an ICE while compiling once and it reported something like `TODO(bill) support this`. Not a good look.

discuss

order

thag12|1 year ago

i think you probably just aren't the audience. most of the things you miss are things i either am neutral on or actually enjoy (having written about ~20K lines of odin).

the creating a variable and passing to the `init` procedure is something i actually like since it allows me to decouple my allocations and initializations in most cases (barring things that are backed by dynamic arrays like `core:container/queue`). it also ensures that the memory allocated by `init` procedures can outlive the structure that it was tied to, which is especially useful in the case of something like the string builder.

if you simply want "method-style" autocomplete (i'm neutral on that), ols also does support that with `fake_method_completion` where you type `<variable>.<whatever>` and all procedures that take a `T` or `^T` as the first parameter show up as options.

as far as having fewer features, i think it just depends on which ones you're talking about. imo, the odin generic system is much nicer to work with and the presence of real enums, bit_sets, enumerated arrays, `or_return` + friends, and a proper scoped-based defer (instead of go's function based) make it really nice to program in compared to go for me. that being said, the `core:thread` `Thread_Pool` is not a complete replacement for goroutines and i will say that the concurrency model of go works really well for a garbage-collected language. of course, the garbage-collected part there shows why something like goroutines don't really fit well in odin.

on internal compiler errors, unfortunately, in a pre-1.0 language, those are bound to happen. fortunately, the time to fix can often be measured in a matter of hours rather than days/weeks.

gingerBill|1 year ago

Regarding internal compiler errors, I still hit on in MSVC every other month, and that's a compiler that has been in production for many decades at this point.

But as I said to him, did he file an issue and when was this? Because it was probably fixed by now, and if not, we'll try to fix it straightaway.

baranul|1 year ago

Odin appears to only recently have been pressing the claim of Go alternative, as a new direction in its marketing hype. There are Go and Pascal influences, but Odin is arguably much more similar to and an alternative of Jai[1][2] (from Jon Blow). Maybe the strategy is to try to distance itself from the label of Jai-clone or Jai-lite.

If Jai goes public beta or releases books (upcoming from Ivo Balbaert), then Jai has the potential to kill off Odin, which appears to only been able to keep a smallish following (relatively fewer GitHub stars and lack of Wikipedia page) since its birth in 2015 or 2016. Odin's popularity, seems dependent on Jai not being public yet.

The languages which are truly close to Go, are: Go+ (goplus)[3], V (vlang)[4], and Borgo[5]. V has the methods on structs, as you have mentioned. Go+ and Borgo compile to Go. V compiles to C, along with other backend options, and has a Go2V transpiler. These languages are more of an evolution of Go, that provide additional features and functionality, and where the influence is much more obvious.

[1]: https://github.com/Jai-Community/Jai-Community-Library/wiki

[2]: https://youtu.be/M763xHjsPk4 (Jai vs Odin)

[3]: https://goplus.org

[4]: https://vlang.io

[5]: https://borgo-lang.github.io (note- weird issues over lack of license)

gingerBill|1 year ago

Thank you for your comment.

Odin isn't trying to be "impressive", it's trying to be productive as an alternative for C on modern systems.

Odin isn't my "First Language" and closer to my 20th.

Odin is just not for you. Your complaint about the lack of methods means you don't want a C alternative, and that is absolutely fine. I have nothing inherently against methods but I believe that if you are to add them, you cannot just have _mere methods_ but also have something to take advantage of them. But by the time you need such a feature (like typeclasses/traits), it becomes far from being a C alternative now and being something closer in the realm of Rust.

And what about the core library is muddled?

What lessons from Go did I not learn?—I'll take "fewer features" as a compliment too.

> I got an ICE while compiling once and it reported something like `TODO(bill) support this`. Not a good look.

Did you make an issue for this? And how long ago was this? Because this most likely fixed/implement now, and was probably fixed very quickly too.