I agree with everything said here, Odin is a language that feels like it was made for me, in fact I am writing some of the core components of my WIZRD automation language and operating system in...
I agree with everything said here, Odin is a language that feels like it was made for me, in fact I am writing some of the core components of my WIZRD automation language and operating system in it. Def a valuable, easy to write, systems language with wonderful defaults to help in memory safety and allocations (without a GC, reference counter, or explicit pointer locations - such as with Zig, another pseudo-favorite of mine). I write in/for a lot of embedded systems, and it just works.
For those who don't know: Odin is a typed, statically compiled, procedural language. Easy to read, easy to write, compiles insanely fast, and is just about as fast as C with better memory management (in fact, some of my Odin code is faster than the C version), syntax, and defaults. Seriously, it's a beautiful language to read and use:
package cat_simulation
import "core:fmt"
import "core:math/rand"
Cat :: struct {
name: string,
age: int,
}
add_cat_of_random_age :: proc(cats: ^[dynamic]Cat, name: string) {
random_age := rand.int_max(12) + 2
append(cats, Cat {
name = name,
age = random_age,
})
}
print_cats :: proc(cats: []Cat) {
for cat in cats {
fmt.printfln("%v is %v years old", cat.name, cat.age)
}
}
mutate_cats :: proc(cats: []Cat) {
for &cat in cats {
cat.age = rand.int_max(12) + 2
}
}
main :: proc() {
all_the_cats: [dynamic]Cat
add_cat_of_random_age(&all_the_cats, "Klucke")
add_cat_of_random_age(&all_the_cats, "Pontus")
print_cats(all_the_cats[:])
mutate_cats(all_the_cats[:])
print_cats(all_the_cats[:])
}
By far one of the best languages I have ever used professionally and as a hobbyist, which is why I donate every month to keep the project alive.
I am dropping the link here so for those who can, should donate, and even if you don't use it, you should consider supporting this and other similar endeavors so they can't stop the signal, and keep it going: https://github.com/sponsors/odin-lang
Glad to hear you donate to Odin! I haven’t consciously thought about it before your comment. I’m sort of on the other end of the spectrum, Odin is a pseudo-favorite and I feel more at home with...
Glad to hear you donate to Odin! I haven’t consciously thought about it before your comment.
I’m sort of on the other end of the spectrum, Odin is a pseudo-favorite and I feel more at home with Zig. That said, I have to agree Odin’s syntax is gorgeous and remarkably easy to read. I might enjoy reading it more than writing it, lol.
I took a look through your website and github, are your odin repos public? I couldn’t find any, maybe I missed them on mobile.
You didn't miss them, I don't have any public code written in Odin right now. I had a few when I started writing in it a few years back and first trying my hand, archived them away, but sadly I...
You didn't miss them, I don't have any public code written in Odin right now.
I had a few when I started writing in it a few years back and first trying my hand, archived them away, but sadly I have not been a useful member to the growing ecosystem - sorry about that! I do plan on changing that soon though.
I have to agree Odin’s syntax is gorgeous and remarkably easy to read.
Reading Odin is incredible, makes it impossible for me to read Rust these days. It's just so clean and easy, even when you get into the weeds of it all, its just a clean easy system, putting the procedure/function names as the first item? perfect, so much better, makes it so much easier to get through a work place. On the surface it kind of feels like a toy, without realizing just how deep and complex it can go, while still being manageable.
You should look through the Odin core and vendor libraries for examples if you need them, they are truly fantastic - one of the best languages I have ever looked through to understand the ins and outs of the core code.
Even though the language compiler is not written in Odin (and won't be for a long time - as the creator believes it is 'masturbatory pleasure' to write your own language in your own language before reaching 1.0, even though it absolutely could be now.) the entire standards/core/internals are written in odin, all incredibly easy to grok through, easy to modify, and incredibly well documented.
I'm somewhat on a similar journey of finding a programming language I would like. As a base I already know JS, Python, Java and C/C++/C#, but the way I was taught Java as "OOP" in school just...
I'm somewhat on a similar journey of finding a programming language I would like. As a base I already know JS, Python, Java and C/C++/C#, but the way I was taught Java as "OOP" in school just seems too complicated to me.
I went down the question of "how best to model data in a project?" and came across the type system in F#. Still learning it but just seeing the complier working with me instead of leaving me to crash at runtime just makes me very happy. Heard a lot of praises for Odin as a modern C too (positive articles on Rust, and negative on Python, Golang,... as well)
That said I learned quite a bit about the economics of a growing language - Big conpanies really has a huge influence, they can afford to push langs into the mainstream, develop in house tooling, and set off a self propagating chain. Highly recommend this talk by the creator of Elm.
F# is an amazing language, but its tied to the .Net ecosystem which is a bit of a massive (slow...) runtime, and I say that as I find the Powershell language one of the most advanced and...
F# is an amazing language, but its tied to the .Net ecosystem which is a bit of a massive (slow...) runtime, and I say that as I find the Powershell language one of the most advanced and wonderfully designed languages, which is why I based the design of my language WIZRD/script (a statically compiled, GC/RC-free, automation language) on the original ethos of Powershell, when it was first called Monad in the early 2000s.
But, Elixir? One of the most beautiful, fascinating, easy to use, radically advanced, languages in existence. Erlang is a beast, and Elixir is a fantastic addition to learn (Elixir runs on Erland/The Beam), if you are morer particular to ML, then Gleam is where you need to be. Such an amazing community and language. If I wasn't an embedded systems architect, I would be using it for everything.
Elixir doesn't really have a type system, although one is in the works, so I suppose more towards python and javascript. There's tooling to do some of the work, like dialyzer (which works off of...
Elixir doesn't really have a type system, although one is in the works, so I suppose more towards python and javascript.
There's tooling to do some of the work, like dialyzer (which works off of the user defined @spec annotations that have to manually be added to code), but it sucks, its slow, its garbage, don't use it, also its not a real type system, it depends on the correctness of user defined type annotations, its bad.
There's pattern matching which can do some of the work of typing, but only at runtime, and you just end up with a half baked system of runtime typing that doesn't give you that much benefit.
Thaaats probably a no go for me then. I dunno, maybe it works better than python or JS, but god I cannot stand having runtime errors because of some hidden type coercion that happened forever ago...
Thaaats probably a no go for me then.
I dunno, maybe it works better than python or JS, but god I cannot stand having runtime errors because of some hidden type coercion that happened forever ago rather than just having the compiler say "uh hey, tell me what to do or else I'm not doing it."
With F# it's trivial to quickly add types to the things it can't infer, and otherwise you don't really need to worry about it. Does elixir solve this somehow?
That's a big part of the motivation behind Gleam. It has static typing, definitely give it a peek with the caveat it's still early days for that language.
That's a big part of the motivation behind Gleam. It has static typing, definitely give it a peek with the caveat it's still early days for that language.
Actually the type system was first introduced with 1.17 and it's the biggest thing in 1.18. It's not done yet afaik and they're adding more things as they go, but parts of it are definitely there...
Actually the type system was first introduced with 1.17 and it's the biggest thing in 1.18. It's not done yet afaik and they're adding more things as they go, but parts of it are definitely there already.
Eh, odd, we're using 1.18 at work and I can't say I've noticed anything changing from it. Guess it's slowly seeping in there but not yet as noticeable. edit: we're still using dialyzer at work...
Eh, odd, we're using 1.18 at work and I can't say I've noticed anything changing from it. Guess it's slowly seeping in there but not yet as noticeable.
edit: we're still using dialyzer at work though so I'm revising my earlier statement to a more jovial but heated: Elixir has a type system but its nowhere near good enough because I have to use dialyzer, the next few releases will expand on it and bring me one step closer to dialyzer freedom but until then, fuck it.
Digging into F# was the first time in a while that programming actually felt fun again. It’s trusty and stable. But there’s just.. nothing going on in that space, sadly.
Digging into F# was the first time in a while that programming actually felt fun again. It’s trusty and stable. But there’s just.. nothing going on in that space, sadly.
I use F# for work, so some points/thoughts: It's the best language I ever used and it's worst feature is having to ever use something else. One of it's strengths and weaknesses is you can leverage...
I use F# for work, so some points/thoughts:
It's the best language I ever used and it's worst feature is having to ever use something else.
One of it's strengths and weaknesses is you can leverage the entire dotnet environment easily. This means that there's zillions of libraries ready to use, but you have to write thin wrappers for them or briefly drop out of idiomatic F# and instead use C# style syntax. There's very easy ways to do this, but it's something more F# devs should be making videos and tutorials on as it's a huge part of the process, since rewriting the world of dotnet in F# would be mostly pointless.
All this said, I'm in a position where I don't need to care about performance too much. Lots of one off CRUD apps and moving large amounts of data around. I don't need to measure in milliseconds as if I just follow good practices most things run in seconds or less. Of note however FSharp does have a lot of toys to improve performance. Sprinkling Array.Parallel everywhere you can makes using multithreading very simple, and if you want to get into heavier performance improvements check out FSharp.Core.Extended
Other good resources include https://fsharpforfunandprofit.com/ and the discord/slack/forums. It's a small community but an extremely talented and dedicated one, and most of them are quite friendly and willing to help around corners, especially if you're coming from another language.
If you've got any questions feel free to poke me as well. I'm probably objectively the worst professional F# developer, but I can maybe help point you in the right direction. The RoP pattern especially is SUCH a nice thing for orchestrating your code and making your life so much easier.
I love typescript for being JavaScript compatible, which makes it compatible with lots of products that produce js bindings. Typescript takes things you hate about JavaScript and fixes them.
I love typescript for being JavaScript compatible, which makes it compatible with lots of products that produce js bindings. Typescript takes things you hate about JavaScript and fixes them.
I haven't had a really fantastic language for me since LabVIEW when I was working with FIRST Robotics, so everything text based feels like a second language I have to learn, because it's intuitive...
I haven't had a really fantastic language for me since LabVIEW when I was working with FIRST Robotics, so everything text based feels like a second language I have to learn, because it's intuitive for me to think of wires that connect boxes that transfer data from left to right. Is there much of an advantage with learning and loving a more boutique language as opposed to something more standard when all the code and API you could ask for is already native to it?
Odin, for example, has native capability to run foreign operations, and additionally has native interop capabilities w/ C and with a tiny wrapper, C++ code and resources, so almost all existing...
Is there much of an advantage with learning and loving a more boutique language as opposed to something more standard when all the code and API you could ask for is already native to it?
Odin, for example, has native capability to run foreign operations, and additionally has native interop capabilities w/ C and with a tiny wrapper, C++ code and resources, so almost all existing tools will work rather well in Odin! You can even build your code to run inside C/C++ as a library if you so want (as a dll). There is also a wonderful resource that will build C ABI bindings from any C-package for Odin, automatically.
I haven't yet gotten around to trying Odin, but I have written some stuff in Jai, which has (potentially even had first?) most of the features mentioned in this post, along with quite similar...
I haven't yet gotten around to trying Odin, but I have written some stuff in Jai, which has (potentially even had first?) most of the features mentioned in this post, along with quite similar syntax. The context and allocator features work pretty much the same. It even used to have a similar SOA feature, though it now is a module included with the compiler instead of an in-built language feature, since the metaprogramming is powerful enough to implement it as such.
Odin does have the advantage of... well, actually being publicly available, though. Jai's closed beta comprises about 800 people now (going off the member count in the Discord server), and I don't think it's all that hard to get in anymore if you have at least somewhat significant programming experience, but that's still far from a large user base. That means there's not much tooling (though there's more than I would've expected from a language in closed beta - there's a mostly working LSP, even, and a nice text editor written in Jai itself!), and not a ton of support outside of the Discord, as well as occasional breaking changes. With Odin, there are more places to turn to if you need help. At least GitHub finally started recognizing and highlighting Jai code recently!
Odin also has some different ideals than Jai, such as deliberately not including compile-time execution. That's a fair choice - Jai's extensive metaprogramming can certainly be very useful at times, but also has the capability of being used to make code opaque and difficult to work with.
Jai's creator (Jonathan Blow) is also somewhat controversial for, well, I'd say fair reasons. I find I often agree with his takes on programming (though not always), and The Witness is one of my all-time favorite games, but in more recent years he's formed a habit of sharing... less than savory opinions on Twitter. I do find it disappointing to see him fall down that rabbit hole.
Either way, I should try more of these C-alternative languages at some point. Odin and Zig both look interesting to me. The reason I tried Jai first was just because I happened to be accepted into the beta, so thought I may as well take the opportunity to learn the language. I'm glad there are several options in this space now, though. For a while it seemed the only alternative people were talking about was Rust, and while certainly a well-architected language, it does not mesh well with my brain for some reason.
I agree with everything said here, Odin is a language that feels like it was made for me, in fact I am writing some of the core components of my WIZRD automation language and operating system in it. Def a valuable, easy to write, systems language with wonderful defaults to help in memory safety and allocations (without a GC, reference counter, or explicit pointer locations - such as with Zig, another pseudo-favorite of mine). I write in/for a lot of embedded systems, and it just works.
For those who don't know: Odin is a typed, statically compiled, procedural language. Easy to read, easy to write, compiles insanely fast, and is just about as fast as C with better memory management (in fact, some of my Odin code is faster than the C version), syntax, and defaults. Seriously, it's a beautiful language to read and use:
By far one of the best languages I have ever used professionally and as a hobbyist, which is why I donate every month to keep the project alive.
I am dropping the link here so for those who can, should donate, and even if you don't use it, you should consider supporting this and other similar endeavors so they can't stop the signal, and keep it going: https://github.com/sponsors/odin-lang
Glad to hear you donate to Odin! I haven’t consciously thought about it before your comment.
I’m sort of on the other end of the spectrum, Odin is a pseudo-favorite and I feel more at home with Zig. That said, I have to agree Odin’s syntax is gorgeous and remarkably easy to read. I might enjoy reading it more than writing it, lol.
I took a look through your website and github, are your odin repos public? I couldn’t find any, maybe I missed them on mobile.
You didn't miss them, I don't have any public code written in Odin right now.
I had a few when I started writing in it a few years back and first trying my hand, archived them away, but sadly I have not been a useful member to the growing ecosystem - sorry about that! I do plan on changing that soon though.
Reading Odin is incredible, makes it impossible for me to read Rust these days. It's just so clean and easy, even when you get into the weeds of it all, its just a clean easy system, putting the procedure/function names as the first item? perfect, so much better, makes it so much easier to get through a work place. On the surface it kind of feels like a toy, without realizing just how deep and complex it can go, while still being manageable.
You should look through the Odin core and vendor libraries for examples if you need them, they are truly fantastic - one of the best languages I have ever looked through to understand the ins and outs of the core code.
Even though the language compiler is not written in Odin (and won't be for a long time - as the creator believes it is 'masturbatory pleasure' to write your own language in your own language before reaching 1.0, even though it absolutely could be now.) the entire standards/core/internals are written in odin, all incredibly easy to grok through, easy to modify, and incredibly well documented.
I'm somewhat on a similar journey of finding a programming language I would like. As a base I already know JS, Python, Java and C/C++/C#, but the way I was taught Java as "OOP" in school just seems too complicated to me.
I went down the question of "how best to model data in a project?" and came across the type system in F#. Still learning it but just seeing the complier working with me instead of leaving me to crash at runtime just makes me very happy. Heard a lot of praises for Odin as a modern C too (positive articles on Rust, and negative on Python, Golang,... as well)
That said I learned quite a bit about the economics of a growing language - Big conpanies really has a huge influence, they can afford to push langs into the mainstream, develop in house tooling, and set off a self propagating chain. Highly recommend this talk by the creator of Elm.
F# is kind of poorly supported, not to discourage learning! That being said, I could see you liking BEAM languages like Gleam or Elixir
F# is an amazing language, but its tied to the .Net ecosystem which is a bit of a massive (slow...) runtime, and I say that as I find the Powershell language one of the most advanced and wonderfully designed languages, which is why I based the design of my language
WIZRD/script
(a statically compiled, GC/RC-free, automation language) on the original ethos of Powershell, when it was first called Monad in the early 2000s.But, Elixir? One of the most beautiful, fascinating, easy to use, radically advanced, languages in existence. Erlang is a beast, and Elixir is a fantastic addition to learn (Elixir runs on Erland/The Beam), if you are morer particular to ML, then Gleam is where you need to be. Such an amazing community and language. If I wasn't an embedded systems architect, I would be using it for everything.
Is Elixir typing like F# where it's actually statically typed but does type inference as much as possible, or is it like python/js?
Elixir doesn't really have a type system, although one is in the works, so I suppose more towards python and javascript.
There's tooling to do some of the work, like dialyzer (which works off of the user defined
@spec
annotations that have to manually be added to code), but it sucks, its slow, its garbage, don't use it, also its not a real type system, it depends on the correctness of user defined type annotations, its bad.There's pattern matching which can do some of the work of typing, but only at runtime, and you just end up with a half baked system of runtime typing that doesn't give you that much benefit.
A type system is coming, I haven't read much about it, here's probably some details on it and what it might end up being: https://hexdocs.pm/elixir/main/gradual-set-theoretic-types.html
Thaaats probably a no go for me then.
I dunno, maybe it works better than python or JS, but god I cannot stand having runtime errors because of some hidden type coercion that happened forever ago rather than just having the compiler say "uh hey, tell me what to do or else I'm not doing it."
With F# it's trivial to quickly add types to the things it can't infer, and otherwise you don't really need to worry about it. Does elixir solve this somehow?
That's a big part of the motivation behind Gleam. It has static typing, definitely give it a peek with the caveat it's still early days for that language.
Actually the type system was first introduced with 1.17 and it's the biggest thing in 1.18. It's not done yet afaik and they're adding more things as they go, but parts of it are definitely there already.
Eh, odd, we're using 1.18 at work and I can't say I've noticed anything changing from it. Guess it's slowly seeping in there but not yet as noticeable.
edit: we're still using dialyzer at work though so I'm revising my earlier statement to a more jovial but heated: Elixir has a type system but its nowhere near good enough because I have to use dialyzer, the next few releases will expand on it and bring me one step closer to dialyzer freedom but until then, fuck it.
Digging into F# was the first time in a while that programming actually felt fun again. It’s trusty and stable. But there’s just.. nothing going on in that space, sadly.
I use F# for work, so some points/thoughts:
It's the best language I ever used and it's worst feature is having to ever use something else.
One of it's strengths and weaknesses is you can leverage the entire dotnet environment easily. This means that there's zillions of libraries ready to use, but you have to write thin wrappers for them or briefly drop out of idiomatic F# and instead use C# style syntax. There's very easy ways to do this, but it's something more F# devs should be making videos and tutorials on as it's a huge part of the process, since rewriting the world of dotnet in F# would be mostly pointless.
All this said, I'm in a position where I don't need to care about performance too much. Lots of one off CRUD apps and moving large amounts of data around. I don't need to measure in milliseconds as if I just follow good practices most things run in seconds or less. Of note however FSharp does have a lot of toys to improve performance. Sprinkling Array.Parallel everywhere you can makes using multithreading very simple, and if you want to get into heavier performance improvements check out FSharp.Core.Extended
Other good resources include https://fsharpforfunandprofit.com/ and the discord/slack/forums. It's a small community but an extremely talented and dedicated one, and most of them are quite friendly and willing to help around corners, especially if you're coming from another language.
If you've got any questions feel free to poke me as well. I'm probably objectively the worst professional F# developer, but I can maybe help point you in the right direction. The RoP pattern especially is SUCH a nice thing for orchestrating your code and making your life so much easier.
I love typescript for being JavaScript compatible, which makes it compatible with lots of products that produce js bindings. Typescript takes things you hate about JavaScript and fixes them.
I haven't had a really fantastic language for me since LabVIEW when I was working with FIRST Robotics, so everything text based feels like a second language I have to learn, because it's intuitive for me to think of wires that connect boxes that transfer data from left to right. Is there much of an advantage with learning and loving a more boutique language as opposed to something more standard when all the code and API you could ask for is already native to it?
Odin, for example, has native capability to run foreign operations, and additionally has native interop capabilities w/ C and with a tiny wrapper, C++ code and resources, so almost all existing tools will work rather well in Odin! You can even build your code to run inside C/C++ as a library if you so want (as a dll). There is also a wonderful resource that will build C ABI bindings from any C-package for Odin, automatically.
I haven't yet gotten around to trying Odin, but I have written some stuff in Jai, which has (potentially even had first?) most of the features mentioned in this post, along with quite similar syntax. The context and allocator features work pretty much the same. It even used to have a similar SOA feature, though it now is a module included with the compiler instead of an in-built language feature, since the metaprogramming is powerful enough to implement it as such.
Odin does have the advantage of... well, actually being publicly available, though. Jai's closed beta comprises about 800 people now (going off the member count in the Discord server), and I don't think it's all that hard to get in anymore if you have at least somewhat significant programming experience, but that's still far from a large user base. That means there's not much tooling (though there's more than I would've expected from a language in closed beta - there's a mostly working LSP, even, and a nice text editor written in Jai itself!), and not a ton of support outside of the Discord, as well as occasional breaking changes. With Odin, there are more places to turn to if you need help. At least GitHub finally started recognizing and highlighting Jai code recently!
Odin also has some different ideals than Jai, such as deliberately not including compile-time execution. That's a fair choice - Jai's extensive metaprogramming can certainly be very useful at times, but also has the capability of being used to make code opaque and difficult to work with.
Jai's creator (Jonathan Blow) is also somewhat controversial for, well, I'd say fair reasons. I find I often agree with his takes on programming (though not always), and The Witness is one of my all-time favorite games, but in more recent years he's formed a habit of sharing... less than savory opinions on Twitter. I do find it disappointing to see him fall down that rabbit hole.
Either way, I should try more of these C-alternative languages at some point. Odin and Zig both look interesting to me. The reason I tried Jai first was just because I happened to be accepted into the beta, so thought I may as well take the opportunity to learn the language. I'm glad there are several options in this space now, though. For a while it seemed the only alternative people were talking about was Rust, and while certainly a well-architected language, it does not mesh well with my brain for some reason.