I have high expectations from Odin going forward, but there are some pain points hopefully will get resolved in the future. - The toolchain is alright at best (I know this is being worked on right now). - Discord only communication with the community. They're all very nice but sometimes I wish a lot of these discussions should be indexed by a search engine.
And they have a very polished language server https://github.com/DanielGavin/ols That helped me learn Odin in few hours only
Give it a try, you might like it!
Well, that’s incorrect: https://www.sobyte.net/post/2021-12/golang-garbage-collector...
Or maybe I misunderstand your comment?
A Review of the Odin Programming Language - https://news.ycombinator.com/item?id=32799499 - Sept 2022 (140 comments)
I like Odin - https://news.ycombinator.com/item?id=32626543 - Aug 2022 (204 comments)
Odin Programming Language - https://news.ycombinator.com/item?id=30394000 - Feb 2022 (42 comments)
Looking into Odin and Zig - https://news.ycombinator.com/item?id=28440579 - Sept 2021 (27 comments)
The Odin Programming Language - https://news.ycombinator.com/item?id=22199942 - Jan 2020 (141 comments)
The Odin Programming Language - https://news.ycombinator.com/item?id=20075638 - June 2019 (3 comments)
In 2023, tooling is at the point where RTFM is secondary for mainstream lang libraries (TFM being embedded into the editor in intelligent ways). I will not go back.
It is not just about getting a function from an object and then executing that function.
It is executing that function in the context of the object from which you get it, by utilizing the pseudo-variable "this" (or 'self' in Smalltalk) which refers to that object from which you got that function (a.k.a "method" in this case).
But definitely the ability to have editor-support for lookup of argument-types etc. is a great benefit too.
Ignoring runtime polymorphism for the moment, there's nothing special about "this" or "self". It's just another function parameter. Consider how in Python it is actually explicitly declared as a parameter in the method declaration.
It is special in that when a method executes say in JavaScript, the 'this' has a very specific value even though you did not pass in an argument of that name nor did you ever assign a value to a local variable of that name. Depending on the language you use trying to assign to the (pseudo-) variable 'this' may or may not cause an error.
The "automatic" value 'this' has makes it special, different from other variables and arguments. That automatic value ties the method-call-syntax into the semantics of what it means to call a method as opposed to calling a free function.
This can be exemplified in JavaScript easily:
let funk = myOb.funk;
let v = myOb.funk();
let v2 = funk(); // throws error
In this case the error gets thrown if
myOb.funk internally refers to 'this'
and tries to access some field of it.
That causes an error because 'this' is
undefined inside 'funk' when it is called
as a plain function.When you call myOb.funk() there is NO error in the same case, because 'this' is then NOT undefined, its value is 'myOb'.
You can access any field of myOb inside the code of myOb.funk when you call it as myOb.funk().
That is a big semantic difference, not just "syntactic sugar".
Also lots of languages have syntactic sugar around the corresponding object e.g. implicitly dereference it for attribute access and method calls, or even give it exclusive(ish) properties like @ in Ruby (or straight up instance variable access in smalltalk).
Even Python treats it specially, given a method `foo`, `obj.foo` actually returns a proxy object which partially applies `foo` to `obj`. This only works on functions defined on the class object, mere callables set on the instance don't get that treatment.
No, method syntax is just syntax. In some languages methods are more than just syntax sugar, but there's nothing special about the syntax itself.
I've been using Odin for about a year now, many of the pain-points I've had have just been knowledge gaps. Odin's docs and debug info have slowly gotten better over time, and little discord-community tips here and there have made a huge difference for my quality of life.
Also for the record I just noticed I wrote @disable everywhere instead of @disabled. That's been fixed now
I'm confused about this caller_location thing in tests. It looks like you're just passing `loc = loc` a bunch of times for no good reason. Why can't the language automatically or implicitly implement that functionality? Having to write `loc = loc` at the end of every assertion just seems silly.
Totally tangential, but am I the only one that was taught to put punctuation inside of quotes and now despises that rule?
Seems more natural to have the period after the closing quote, at least in cases like this sentence of yours from above:
>I can't imagine someone named their language "of", "programming", or "in".
But I think there may be cases where period inside and before closing quote may seem better, e.g. if quoting what someone said, like a quoted sentence inside another sentence.
But I'm not an English grammar expert.
4: Small(talk), Joy, Pro(log) and D (from Odin).
I had explicitly excluded Odin above. :)