News for hackers. Stuff that matters.
Re:Understanding the Odin Programming Language by andyfilms1 on Sunday July 12, 2026 @10:10AM (#48881360)
I've been using Odin for about 6 months now, and to be honest, it's hard to find fault with it. I've used it for STM32 microcontroller firmware, web and desktop applications, and all are performant and compile quickly.

My one issue is (and I'm fully aware it will never happen) I do wish there was some sort of first-class solution to inheritance. I've grown to love procedural programming, but some problems really are just better solved with a more OOP approach. Just because classes exist does not mean they need to be used.

But as far as a language to "get stuff done" with as few tradeoffs as possible, Odin is about as good as I can imagine a language being.

Re:Understanding the Odin Programming Language by clumsysmurf on Sunday July 12, 2026 @12:02PM (#48882166)
I'd like to hear more about Odin + STM32 MCU firmware, do you have any good resources? I'm also curious how difficult it may be to get work with it on ESP32 (ESP-IDF) / RP2350.
Re:Understanding the Odin Programming Language by andyfilms1 on Sunday July 12, 2026 @12:53PM (#48882544)
You can look at my repo here: https://github.com/MadlyFX/odin-embedded-boilerplate

I don't believe Xtensa (ESP32) is supported yet, but people have been asking for it, so it may happen at some point. ARM is well supported now though, obviously.

Re:Understanding the Odin Programming Language by RetroTechie on Sunday July 12, 2026 @12:45PM (#48882477)
Out of curiosity:

In your opinion, could a minimal system to develop in Odin be squeezed into a device like the one(s) you targeted?

That's assuming maybe some tweaks to the toolset, doing without some niceties, but not cutting core features out of the language.

Asking 'cause I have a passing interest in programming languages that allow for native development on really small implementations (think sub-1MB on bare metal). The list of candidates doesn't seem long.

Re:Understanding the Odin Programming Language by andyfilms1 on Sunday July 12, 2026 @12:57PM (#48882578)
Odin is not like JS or something where you'd need a VM or transpilation process to target an embedded system. It's just C with nicer syntax and modern data structures, there's no "squeezing" required. You just compile for the target you want to run on.

Here's a UI framework, if you scroll down you'll see it on a Raspi Pico: https://github.com/MadlyFX/Ansuz

Re:Understanding the Odin Programming Language by RetroTechie on Sunday July 12, 2026 @02:10PM (#48883136)
I think you missed "native development". I'll rephrase:

Could a toolset to develop in Odin be made to run on (not just target) an STM32 microcontroller like you used?

> It's just C with nicer syntax and modern data structures

That suggests the above would (in theory) be possible for any device that's roughly in the same class as "can run a C compiler". Correct?

Re:Understanding the Odin Programming Language by fatty_patty89 on Sunday July 12, 2026 @03:00PM (#48883569)
> It's just C with nicer syntax and modern data structures

it's not, it's llvm

Re:Understanding the Odin Programming Language by andyfilms1 on Sunday July 12, 2026 @03:47PM (#48884033)
Okay, I mean obviously :D I was more trying to convey the feeling of it.
Re:Understanding the Odin Programming Language by gingerBill on Sunday July 12, 2026 @04:52PM (#48884672)
> STM32 microcontroller

The answer is "yes" depending on what you mean by STM32 :D

But if it's one we don't currently support officially, it should be pretty easy to support too, with probably a little extra assembly.

Re:Understanding the Odin Programming Language by christophilus on Sunday July 12, 2026 @12:56PM (#48882565)
I’d be interested in reading about your experience building web applications with it. Last I looked, its stdlib didn’t have great support for that.
Re:Understanding the Odin Programming Language by sarchertech on Sunday July 12, 2026 @01:53PM (#48883004)
There’s an official http package coming out and native tls support as well.
Re:Understanding the Odin Programming Language by christophilus on Sunday July 12, 2026 @03:06PM (#48883641)
Yeah, but OP has built web applications without those. So, I wonder how they went about it.
Re:Understanding the Odin Programming Language by andyfilms1 on Sunday July 12, 2026 @03:48PM (#48884044)
I used WASM
Re:Understanding the Odin Programming Language by pjmlp on Monday July 13, 2026 @07:49AM (#48891229)
Personally, I have a certain Turbo Pascal feeling while playing around with it, yep I am aware of the influences.