Odin release highlights #

  • Suggestion when assigning enum to bit_set.
  • Suggest -microarch:native if popcnt instruction is missing.
  • List the supported targets using odin build . -targets:?.
  • Fix: build_odin.sh always runs demo regardless of argument.
  • Report error when builtin min/max has only one numeric parameter.
  • Add which to shell.nix to build with --pure.
  • Only error with -vet-cast when it is actually castable.
  • vendor:raylib was updated to v5.5.

For the rest of the many compiler changes, read the monthly release notes.


Understanding the Odin Programming Language #

Karl Zylinski wrote the first book on Odin, “Understanding the Odin Programming Language”, and it is OUT NOW! ✨

If you want to learn Odin and demystify low-level programming, then this book is for you! It has something for both beginners and intermediate Odin programmers.

Read more or buy at: odinbook.com.

And also check out the interview with the author at the bottom of this newsletter!

Projects shared this month #

Project Name Description
fast-noise-lite An Odin port of FastNoiseLite
odin-pbt Property based testing in Odin
odin-wren Wren bindings
odin-arsenal Odin arsenal
sds Static data structures, now with SPSC
pathrc A tool to manage bashrc
lsystem L-systems in Odin
vst3 VST3 API in Odin
osdialog Cross-platform OS dialogs
d3d11 Odin rewrite of KevinMoran’s Beginner Direct3D11
odgpu General purpose GPU computing in Odin
raylib-ogmo Raylib OGMO importer
odin-jps Jump Point Search in Odin
nexa Game library by SabeDoesThings
chip8 Odin implementation of a Chip8 emulator
odin-slang Odin bindings for slang
game-of-life Game of Life in Odin
odin-tiled Tiled loader in Odin
lite-odin Odin port of rxi’s Lite editor
odin-mqtt mqtt-c binding for Odin
odin-pg_pool PostgreSQL Pool Manager in Odin

Further, Aks wrote a blogpost about moving a codebase from C to Odin.


Streams / Youtube Content #

Nefrace #

Ragnarökkr - a small game about piloting Thors chariot with the power of rockets and defeating Jormungandr. Made with Odin+Raylib in two days for game jam month ago.

SabeDoesThings #

Made a little devlog explaining my a game I am making.

Skytrias #

Short video on the tabulation project im doing & shows a bit of editing with some more notes. Been a really fun project so far.


Interview with Karl Zylinski #

An interview with Karl Zylinski, author of the first book about Odin

Q: Can you tell us how you discovered Odin, and what initially appealed to you about it?

A: Back when I discovered Odin I worked at a place called Our Machinery. We were making a video game engine completely in C. Our code relied a lot of these concepts:

  • Zero is initialized
  • Simplicity
  • Custom allocators
  • Temp allocators
  • Tracking allocators
  • Designated initializers
  • Data-oriented design

These are all great things. But working in C, there was no built-in support for some of it. We had to build a lot ourselves. And some of what we built ourselves was a bit cumbersome to use, due to the limitations of C.

For some reason I ended up on Odin’s website. And there it was: A language that came with good support for all those things! It was like my whole C programming philosophy had been distilled into a new language. It felt almost a bit like it was made for me. Thanks Bill for making me my language.

===

Q: On behalf of the Odin team, thank you for bringing the language to a wider audience. What prompted you to produce educational content (Videos & Book)?

A: Back when I was making my game CAT & ONION in Odin, I felt like it would be fun to do a live stream where I show how I set up my hot reloading workflow. So I did that! It was fun to give people an insight into how video games are made, and how you can make one with Odin. So I just kept making more such live streams and videos.

I also set up a blog where I wrote some articles about programming in Odin. On that blog I wrote an article called “Introduction to the Odin Programming Language”. It was my attempt at making an informal introduction to what I think are some important Odin concepts. It ended up being a quite popular article! So I toyed with the idea of expanding it into a book, which seems to have happened.

===

Q: What’s the intended audience for the Odin book, where can it be found, and what can a reader expect?

A: You can read a sample and buy the book at odinbook.com.

The audience is anyone with some programming experience, but it doesn’t have to be any deep knowledge. I don’t assume any knowledge about typical low-level concepts such as manual memory management and pointers. The book includes chapters on all those things.

It’s a book that both teaches you how to program in Odin, but it also gives insights into why things work the way they do. A programming language is a tool. By understanding your tools, you’ll be a better craftsperson.

Most chapters start out with the fundamentals, but many of them end up diving “under the hood” so to speak. It’s a book for both beginners and intermediate Odin users. I hope it can bridge the gap between the online documentation and all my experience of using the language.

===

Q: Do you expect to publish ongoing revisions as Odin nears v1.0, and perhaps a second book with a narrower focus (e.g. How to \Foo in Odin)?

A: If something big changes in Odin, or if the core collection changes in a substantial way, then I will update the book. I don’t have any plans on any follow-up books at this time. Writing this one, especially these last few weeks before shipping, was absolutely exhausting!

===

Q: What can you tell us about Cat & Onion’s inception, development, and reception?

A: I was flying home from GDC 2023. On my laptop I had Odin installed, because I had been playing around with the language every now and then. I had no internet connection. But Odin came with bindings for some library called raylib. So I tried that. I managed to open a window and move a box around. I popped open Aseprite (the best program in the world) and drew a cat animation (the ugliest cat in the world). I managed to load the animation into my game and did some simple running + jumping gameplay. When I came home I committed the result into a new git repository called “cat-game”, with the commit message “Things made on a plane.”

A few weeks later I opened this project up again and started playing around with making it possible to do “ledge grabs” when jumping around. While tweaking those gameplay mechanics, I got annoyed at having to restart my game all the time. That’s why I ended up playing around with hot reload, which brings us back to that first live stream I mentioned earlier.

A few months later I needed a new job. So I decided to try to ship this silly cat game. After all, it was very fun to work on and the furthest I had gotten on any game project.

Somehow I managed to finish the project. On that plane, when I started making it, I didn’t intend to ship anything. I was just playing around. It was just a happy accident. I need more happy accidents.

The reception for the game has been very good! At the time of writing I have over 200 reviews on Steam, and 99% of them are positive! I guess people liked my whimsical story about a cat who really wants pancakes, but the universe thought otherwise. The response has been very heartwarming. Sometimes I just scroll through the reviews and get a bit emotional. Everyone is so nice! Thanks everyone.

===

Q: What’s your favorite thing about Odin, and what do you think could use some love? This could be the language semantics, the packages that come with it, the community, anything.

A: I don’t have a specific favorite thing. My favorite thing is what I described at the start of this interview: How Odin point-for-point supported my C programming workflow, but in a much more comfortable way.

I think it’s mainly documentation that is missing from Odin. I would love to see someone try to put together some guide on how to make an Android or iOS game.

===

Q: Any closing remarks about your projects and/or Odin?

A: Now that the book is done, I’m gonna take take it real easy for a bit. It got a bit intense towards the end. I’d love to go back to working on some game again. Maybe. I’m not promising anything. I’m just waiting for my next happy accident.

Please check out my Odin book and my game CAT & ONION. I have spent an immense amount of energy on both, I hope you like them!

Have a nice day! /Karl Zylinski