I recently translated the ZForth Forth interpreter into Zig for fun. I would not say that my implementation is complete or full matches the original, but the general structure of the dictionary, the word layout, and the code were written as a translation from the original C.

I will leave my README.md as the main discussion of the project, but I wanted to put something on my blog as well since I did spend a few evenings playing around with this.

Overall, I think Zig shines in this kind of thing. I felt like its more diverse pointer concepts, its control over memory and control flow, and generally its slightly extended functionality over C makes this kind of thing nicer in Zig, while keeping in the general level of language complexity as C.

In principal Zig allows some functionality that C does not (or, doesn't make easy) such as parametrizing the "cell" type. In zForth you change the type by editing the code, which is a normal C convention, but in Zig you could instantiate interpreters with different cell types quite easily.

As a final note, Zig just feels good to program in as a systems language- the easy testing, compile time asserts and compile time information, the smooth error handling (compared to C)- it all just comes together and creates a nice practical tool that you use without fighting.