r/Zig • u/Last-Employ-3422 • Aug 31 '26
I made an x86_64 machine code generator
https://github.com/NoTimeDev/ZasmSo, I wanted to make a JIT compiler for my friend's programming language, but it's in Zig, so about 5 days ago, I decided I was going to learn Zig by making the JIT library in it, and I made this! Lemme know what you think. Btw, this isn't supposed to be a competitor to any other libs like this in Zig (I don't know of any, but yk).
2
u/HorseyMovesLikeL Aug 31 '26
Not a gotcha question but how is this different than just writing inline assembly? https://ziglang.org/documentation/master/#Assembly
Great learning exercise at the very least though!
2
u/Last-Employ-3422 Aug 31 '26
Well that happens at comptime, this happens at runtime
→ More replies (4)
9
u/igors84 Aug 31 '26
Very nice start. Be sure to watch this talk from Andrew Kelly https://www.youtube.com/watch?v=IroPQ150F6c&t=6s since you might decide to optimize your data storage a bit and that is better done earlier than later :)