actonlang / acton

The Acton Programming Language
https://www.acton-lang.org/
BSD 3-Clause "New" or "Revised" License
80 stars 7 forks source link

Switch from C to Zig #1899

Open plajjan opened 2 months ago

plajjan commented 2 months ago

ziggazigg aaahhh

There are many benefits to Zig over C. Overall it largely plays in the same arena as C but it seems to me that Zig offers improvements in most areas, simply being a better C.

However, that said I don't have the same level of experience writing Zig as I do writing C (not that I'm a very seasoned C-coder). How do we determine the negative sides of Zig? Can we somehow start small and that way gain some experience and possibly revert this decision before it's too late?

I think the most important aspect to plan out is how to transition from the current structs, like B_str, to something more Zig idiomatic. I don't want to end up with loads of casts so like in phase 1 we stick to current C structs, which necessitates @intCast etc on Zig side, then switch to idiomatic Zig struct after which we need to remove casts.

TODO