3 ms·
I'd recommend going through https://odin-lang.org/docs/overview https://odin-lang.org/docs/overview, as most of my points will be directly from there. Keep in m
by thegeekpirate 1y ago
I'd recommend going through https://odin-lang.org/docs/overview https://odin-lang.org/docs/overview, as most of my points will be directly from there. Keep in mind it doesn't show _every_ feature (for instance, there are more built-in comptime procedures than shown https://odin-lang.org/docs/overview/#built-in-procedures-1 https://odin-lang.org/docs/overview/#built-in-procedures-1), but does do a good job at displaying most.
Odin has all the features Go has (even struct tags https://odin-lang.org/docs/overview/#struct-field-tags https://odin-lang.org/docs/overview/#struct-field-tags), but adds:
- proper enums
- unions https://odin-lang.org/docs/overview/#unions https://odin-lang.org/docs/overview/#unions
- built-in optional https://odin-lang.org/docs/overview/#maybet https://odin-lang.org/docs/overview/#maybet
- or_else/or_return/or_continue/or_break https://odin-lang.org/docs/overview/#or_else-expression https://odin-lang.org/docs/overview/#or_else-expression (scroll down for the others)
- distinct types https://odin-lang.org/docs/overview/#distinct-types https://odin-lang.org/docs/overview/#distinct-types
- named arguments https://odin-lang.org/docs/overview/#named-arguments https://odin-lang.org/docs/overview/#named-arguments
- built-in matrix type https://odin-lang.org/docs/overview/#matrix-type https://odin-lang.org/docs/overview/#matrix-type
- built-in quaternions
- ternary operator, but you can use `bar := 1 if condition else 42` instead of ? and : if you'd like https://odin-lang.org/docs/overview/#ternary-operator https://odin-lang.org/docs/overview/#ternary-operator
- default parameter values https://odin-lang.org/docs/overview/#default-values https://odin-lang.org/docs/overview/#default-values
- fantastic C integration
- forced in/exclusive range operators ..< and ..= https://odin-lang.org/docs/overview/#range-based-for-loop https://odin-lang.org/docs/overview/#range-based-for-loop
- can get the zero value of any type using `{}` https://odin-lang.org/docs/overview/#zero-values https://odin-lang.org/docs/overview/#zero-values
- defer if <condition> https://odin-lang.org/docs/overview/#defer-if https://odin-lang.org/docs/overview/#defer-if
- explicit procedure overloading https://odin-lang.org/docs/overview/#explicit-procedure-overloading https://odin-lang.org/docs/overview/#explicit-procedure-over...
- bunch of vendored libraries https://pkg.odin-lang.org/vendor https://pkg.odin-lang.org/vendor
- bit_set/bit_field https://odin-lang.org/docs/overview/#bit-sets https://odin-lang.org/docs/overview/#bit-sets https://odin-lang.org/docs/overview/#bit-fields https://odin-lang.org/docs/overview/#bit-fields
- proper slices (not the Go monster which combines a dynamic array along with slices) https://odin-lang.org/docs/overview/#slices https://odin-lang.org/docs/overview/#slices
- `for x in xs` instead of `for _, x := range xs`, and `for &x in xs` if you want `x` to be addressable
- implicit selector expressions `.Member_Name` https://odin-lang.org/docs/overview/#implicit-selector-expression https://odin-lang.org/docs/overview/#implicit-selector-expre...
- parametric polymorphism with a ton of intrinsics https://odin-lang.org/docs/overview/#parametric-polymorphism https://odin-lang.org/docs/overview/#parametric-polymorphism
- - along with `where` clauses (similar to Rust) https://odin-lang.org/docs/overview/#where-clauses https://odin-lang.org/docs/overview/#where-clauses
Language cohesion has been _incredibly_ well thought out.
- lucb1e 1y agoJust to note: you're responding to a chat bot. Your comment is such a contrast to the level of effort that the parent poster put into theirs :(
- thegeekpirate 1y agoAll good, I contribute for everyone reading ^_^
- drannex 1y agoYou're not kidding, I knew they were here, but the amount of effort on this is pretty subpar. cc: @dang