# odinlang: Odin looks like a promising C replacement

I used to write a lot of C code. But after working with Go, C felt antiquated and error-prone. Odin is picking up steam so I wanted to try it and share my experience. The result? I like it.

Ordinarily I use Go everywhere I can. But there are cases where having a runtime and GC would be too annoying. One case would be compiling Go to WASM and running it in a browser. In a browser I don't want any background work (such as the GC) running unless absolutely necessary. (Though TinyGo's simple runtime does address this issue somewhat.)

What should I use in a limited environment? C? Managing separate header and source files? Error-prone pointer arithmetic? Ugh. It's 2025, surely we can do better!

# My requirements

I want something that gives me a similar feeling to Go. I want simple but convenient syntax, minimal reliance on symbols (I prefer words), very little magic, low potential for errors, and a fast compiler.

Sidenote: why not Rust? I do believe Rust is a strong language and critical stuff like kernels/browsers should be written in it. I tried it multiple times but I struggled to be effective in it. Furthermore, my software would require careful design to accommodate its restrictions. My use cases are not critical but rather experimental like writing a tool for myself or a small demo game. I often make large redesigns as I work on my project which I feel would be expensive in Rust. Also, I find the Rust compiler very slow for bigger projects, I can't iterate quickly with it. I'm looking for something where the language gets out of the way and lets me do whatever crazy thing I want.

A non-Rust, non-GC language means that my language won't be a memory-safe language. I'm willing to accept this tradeoff in exchange for simplicity if the language makes it easy to be careful. Having slices and defer would be a big help already. Those constructs make it much easier to write safe code compared to traditional C. Fortunately most modern languages have those so I just need to pick one. https://vfoley.xyz/hare/ lists some options.

# Likes

I learned about Odin (https://odin-lang.org/) after seeing it recommended multiple times on forums like Reddit and Hacker News. I was already itching to try a modern C replacement so I decided to try it because it looked really close to what I was looking for based on my requirements above. I started playing with it and grew fond of it. Here are the things I like:

# Dislikes

There are certain things I miss or don't like though:

# Tradeoff acceptance

While no language is perfect, Odin's drawbacks are tradeoffs I'm willing to make. For me, the simplicity and directness it offers far outweigh the features it lacks. It's easy to use and gets out of the way, letting me get results. It's definitely an improvement over C. If you are looking for a practical GC-free language, then I recommend giving Odin a try.

published on 2025-08-04


Add new comment:

(Adding a new comment or reply requires javascript.)


to the frontpage