Working Notes: a commonplace notebook for recording & exploring ideas.
Home. Site Map. Subscribe. More at expLog.
A long delayed update: I've been trying to improve the site generation and structure for some time, but have been stuck in the unhappy zone of not reflecting on what I've been learning and thinking about every week while trying to make progress across several projects.
I'm beginning to like and dislike zig a bit: I enjoy working in it and having access to low level primitives; but the lack of batteries sometimes annoys me -- particularly because I still have significantly more muscle memory in most of the other languages I would be using. I've also wasted unfortunate amounts of time trying to write code that feels like good Zig without actually making anything functional, which is the root of my frustration.
This is one of the places that feels somewhat strange: the default recommendation is to accept an object that then becomes the interface and relies on aggressively casting pointers, and I haven't felt particularly comfortable with it yet.
I've been relying on passing around structs and relying on comptime to figure out what the struct does instead. To make error handling a little bit more explicit I've also been using a comptime function to assert that the fields between the structs I'm using match the template interface object, but I don't have it quite perfect yet.
After spending a lot of time refactoring I still don't have a particularly good or reusable interface for SQLite modules, though I've come closer over time.
For TermDex, I'm looking for a way to quickly render different snapshots of my notes, tasks, and changes over time. Both for review and for quickly exploring my notes around a topic. Implementing a webserver in zig has been reasonably minimal, but I've been struggling with finding ways to have it exit cleanly, etc. -- I think I'll need to spend a lot more time reading different guides and incoroporating C libraries to get better here.
Particularly for using event loops appropriately.
Given the dependencies I'm using for TermDex, I also need to figure out a way to statically compile everything and see the results. My current plan is to add git submodules to the libraries I need and then build and statically link them as I need to.
The other thing that's been stuck in my head is using simulations for multiple purposes:
For the second, I've been reading SimGrid documentation but the setup is fairly involved and I'm not sure how far I'll be able to get; on the other hand, I expect to learn a lot trying to make effective simulations that I can actually use for distributed systems. I'm a bit surprised it isn't a more common approach to explore architecture, particularly for backends like AWS and Azure.
Finally, I've been wanting to feel more comfortable with writing and observing transformers, so I've been picking up llm.c and trying to rewrite it in zig. There's a lot here, but dealing with all the small parts by hand should make me much more comfortable understanding and working with LLMs.
— Kunal