I remember doing some basic IO using clib. There’s is a flag, like —link-clib or something. Then you can include header files as you would in C. I created a basic example a while ago doing some basic IO, epoll, timers, and linking in a C obj file, just to try out how to do embedded in zig. It’s really good.
Another upside with Zig coming from the embedded world is Zigs idea of doing async/await - since you define the building blocks yourself, it’s really easy to create an async/await-implementation e.g. on top of epoll, but for those times when your hacking on bare metal, you can just write an implementation which fits that particular hardware. It’s really, really good.
Oh damn I should have realised importing C files would be a solution and I will definitely try that. However, I would still much prefer a native Zig way.
Another upside with Zig coming from the embedded world is Zigs idea of doing async/await - since you define the building blocks yourself, it’s really easy to create an async/await-implementation e.g. on top of epoll, but for those times when your hacking on bare metal, you can just write an implementation which fits that particular hardware. It’s really, really good.