Decided to make this subspace for the Odin Programming Language, in case anybody wants to discuss it. Odin is a systems programming language influenced by C, Pascal, and Golang, with an emphasis on manual memory management via allocators, and zero automatic-allocation by the language features (with only exception being map literals, which must be toggled on).
Some of my personal favorite features are the following:
- Strings are defined as u8 slices (a pointer and a length), and for loops automatically iterate over utf-8 byte starting positions. String literals are automatically encoded in utf-8, and the core library has great strings, utf8, and utf16 support.
- Don't worry, cstrings are also a thing builtin to Odin for people who want that.
- Allocators! Along with Zig, these are one of Odin's best features - allocators are integral to the language and its features, and this significantly simplifies manual memory management, and makes memory allocations so much faster.
- Bit sets are part of the language and can be used with enums. Enums can also be used as the index to arrays.
- Array programming (you can add two or more arrays of length 2 to 4 with a simple addition operator)
- The package system is similar to Golang's, but without the reliance on cloning things from version control. This separates the package system from code distribution (package management). Note that Odin does not have an official package management system.
- Library collections. Odin comes with 3 main collections: base, core, and vendor. Core is the collection of standard libraries. Vendor is a collection of bindings for common libraries. Base is for runtime introspection and a few other things.
- Foreign interfaces. Seriously, you can just write up a list of function declarations and a path to a shared library (or the name of a system library) and it just works. The compiler and the language already handles dynlib under the hood. Literally the best foreign interface system of any language I've ever used, especially compared to Golang's godawful cgo system! Odin also supports multiple calling conventions.
- Emphasis on zero values; everything is zeroed by default; It's just a better way to program than have default values and uninitialized values, because the zero value is always the default and you can then set the zero value to do a default thing so your program doesn't break or get random values during runtime (I'm looking at you, Zig).
- For-loop iteration by-reference. Seriously, why does Golang not have this?!? Gaah!
Downsides:
- Someone for gosh sakes make an openssl binding or an ssl library. Please, for the love of God! :D
- No goroutines or green threads. Thread pools are in the core (standard) library, however.
- No Golang-like timer/ticker, unfortunately. Someone can make something like this though, if they wanted! Odin does have precise time functions that rely on platform/OS APIs.
- No VT100 stuff in the core library.
Special mention:
- If you like Golang's channels, I believe Odin still has channels in its core (standard) library.
Visit the website below for an overview of the language:
Odin Programming Language Website
A language server for Odin can be found at the link below, and is automatically downloaded by the VS Code and Zed Odin extensions:
Please note that OLS is very buggy, so it kinda sucks. But there's nothing better. If you can contribute to OLS or make a fork of it, that would help everyone that uses Odin.
๐
๐ clseibold [mod, ๐ Code of Conduct rule 1 violations]
2025-05-20 ยท 1 year ago ยท ๐ lucas, LucasMW, robert, aks
3 Comments โ
๐ฆ aks ยท 2025-05-24 at 16:56:
Awesome, love Odin.
๐ง the_mantelman ยท 2025-05-27 at 08:06:
Him. What is your experience with regards to binary size or static linking?
๐ clseibold [OP/mod, ๐] ยท 2025-05-27 at 14:09:
@the_mantelman Odin has a very small "runtime" that has no GC or other fancy stuff (no builtin coroutines or closures), and it uses llvm in the backend, so the binary size should, afaik, be comparable to something like clang, and also comparable to zig.
The "runtime" is really just a set of builtin functions and types that are integral to both the compiler and language. It's all included in the "base:runtime" package.
The only other major runtime thing is the context, which is this struct that gets passed to all Odin functions by default, and it stores some info like the default allocator to use, etc. It's explained better in the Odin Overview.
The more parametric polymorph functions you use, though, the bigger your binary size (since the compiler duplicates the function for each distinct parameter typings that are used), so be aware of that. It shouldn't increase it *that* much more though unless you're using a crazy amount of them, afaik.
I have no experience in static linking with Odin. I'm sure there's a way to do it, though, I just wouldn't know what that is. Sorry I can't be more help on that.