Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I finished this book, wrote the two implementations in Python and Zig, genuinely one of the best set of projects I've ever built.


Hmmm, I started the book once in powershell. I think, I finished chapter 2. Maybe I should finish the whole book with it finally. Just for the fun.

(Yes, powershell. Because I didn't have any other toolchain/compiler on the windows machine at some old work place and no admin rights to install anything. So I learned powershell.)


How was the Zig experience? I am looking for an intermediate Zig project to practice Zig. Does this require advanced features of Zig?


I’ve also ported the lox vm to Zig and had a great time working through it.

Since the project is designed in C, you can mostly write the exact same code in zig, with minimal modifications. If you want to use zig features, they’re easy to integrate, but Nystrom obviously won’t be giving you any hints.

But the language offers a lot of useful features (slices, optionals, error types) and makes some C paradigms syntactic realities (tagged enums, explicit pointer casts). Even more so, the standard library comes with very useful stuff (an ArrayList, a handful of different allocators, heck I replaced the trie of keywords with a StaticStringMap).

it’s a fun project, I would definitely recommend it!


I’m also implementing it in Zig right now (and haven’t done any project other than small snippets in zig before) and it’s fine.

You can actually appreciate how much nicer it is to write than in C, while still being a fairly 1-1 translation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: