What's everybody working on? (October edition)

I made a simple debugger I use for my editor I’m making in zig. I was annoyed by gdb lldb limitations with zig, I was inspired by the std debug print versitality, and a suggestion Andrew made during a ZLS talk. It just creates a dbg version of your app, captures the variables in scope and reads stdin.. It’s that’s basically it for every breakpoint. It finds your first breakpoint. does that then launches the app. from there uses a dylib to instrument around it. works suprisingly well, mostly just thanks to zig, ast features it gives you for parsing easy, and syntax really lended itself to this pretty naive approach.It’s fast but still pretty rough and not a priority, but any advice or whatnot would be appreciated. GitHub - jlwiza/zdb: an extremely lightweight source-level debugger for Zig that works through compile-time preprocessing. · GitHub

13 Likes

Btw, I’ve tried this. I implemented a Zig interpreter in OCaml that treats Zig as a dynamic language. It works, it was not super hard, it was able to run the Zig compiler, but extremely slow. Zig code is really written with comptime optimizations in mind. I’ve then tried to shift the design to more like a real Zig compiler with sema step, monomorphization, but that’s a different beast and I’d end up building the same thing as the Zig compiler itself, so I abandoned the project.

2 Likes

Working on Slap (, my Lean Applicative Painter).
I have recently smoothed out background computation after adding masks (selection and transparency).
The next thing is to pick back the work on UX so switching masks, displaying them etc feels nice.

  • green means selected
  • blue means transparent
  • cyan means both

(the painting itself was done in Slap)

14 Likes

Oh nice! I’ve been working with this stuff in my Animation Editor. I’ve been reading through the vulkan spec trying to decipher it, and It’s been fascinating. But also pretty annoying..

Thanks! In my case I’m using sidecar single channel textures to store the masks. I’m working on Metal, but I hope this is portalbe to Vulkan when the time comes…

1 Like

Hi everyone! :waving_hand:

I’m working on zig-term, a small cross-platform terminal library for Zig, inspired by Go’s golang.org/x/term.

The goal is to make common terminal functionality easier to use without requiring newcomers to deal directly with platform-specific APIs.

https://github.com/hmleal/zig-term

The initial API includes things like:

  • isTerminal()
  • getSize()
  • getState()
  • makeRaw()
  • restore()
  • readPassword()

I’m starting with POSIX support and plan to add Windows support as the library develops.
It’s still early work, and I’m mainly interested in keeping the API small, simple, and idiomatic for Zig.

Feedback and suggestions are very welcome! :rocket:

7 Likes

I’m currently writing a layout generator in zig for river compositor. The code is messy as I am learning but its fun to write some interesting project in zig.

https://codeberg.org/abhinaya-aryal/riztile

This monthly thread is always a fun to follow.

1 Like

I am currently doing 2 projects. During the week I am working on writing a HAL and BSP for mips microcontroller (pic32 mz ef for those interested). Messing about with ESP8266 and ESP32 as well, trying out the upstream xtensa target in LLVM (it’s really barebones still, but a lot of fun to mess around). The goal would be to make a homebrew console to play the game I am working in my weekends:

During the weekend I am working on rewriting an mmo that I used to play as a child in the early 2000’s (Tales of Pirates). Did multiple tries already: started in C++ but quickly found out that I just kept on refactoring my code because the ergonomics were atrocious to work with. Learned about Zig and have been hooked ever since. Started with some small application to get the basics. The IO interface is what sold me on fully committing to the rewrite in Zig.

Hopefully next time something substantial I can share :folded_hands: .

9 Likes

I decided to improve my zls auto downloader and add ability to download Zig from mirrors. I’d like to stop downloading if the speed is too low(and use next mirror), so investigating how to cancel in-flight HTTP request in new IO interface.

2 Likes

I’ve been working on a low-level optics-inspired data manipulation library for quite a while. And because I’ve inevitably used a lot of comptime which has far exceeded the capability of ZLS’ static analysis, I had little choice but to hard fork ZLS to explore ways for more comprehensive comptime value tracking. Since then I’ve learned a lot from hacking with ZLS’ Sema and tweaking its “IR”, I also came to the realization that Zig is underspecified when it comes to AST-based semantics.

5 Likes

Last week I started working on an async Lua runtime using ziglua. It is inspired by one of my favorite blog posts: How itch.io uses Coroutines for non-blocking IO. It makes me really happy to finally use ziglua for something more substantial! This is an example of how far I have gotten (sleep and waiting on multiple tasks with a scheduler written in Zig).

local first = task.spawn(sleep, 3000)

local waiters = {}
for i = 1, 5 do
  waiters[i] = task.spawn(function()
    first:wait() -- wait for first to complete
    sleep(100 * i)
  end)
end

task.waitall(waiters) -- wait for all tasks to finish

print("finished!")

Next I’m working on adding nonblocking sqlite as a module.

7 Likes

I’m working on a parser library I’ve named libatrus that parses MyST Markdown. I’ve been working on it nights and weekends for wayyy too long now but recently got it passing all the tests for version 0.0.5 of the MyST spec, which I’m thrilled about. I’d set myself a goal of getting all those tests passing before my daughter is born and it seems like I might have beat her by a week or two, we’ll see. You snooze, you lose, child!

I’m focusing now on expanding my test suite beyond the spec. I’m also eager at some point to overhaul how I’m handling memory. I don’t feel it’s very Zig-y, since I’m allocating and deallocating little nodes everywhere. Would appreciate any advice anyone can offer on how to handle representing an AST in a data-oriented way.

8 Likes

Still working on my CIMXML cli parser. I got some feedback that my target audience would never open a terminal lol. So now working on a basic html page with some buttons for all the functions so it could be used in the browser. Inspired by the zig build --webui look. Maybe later I want design to resemble those old school soviet control rooms.

It is amazing to me that I could just add .wasm as another build target and it worked (besides some small integer/size bugs on my end). Also the fact that I could run the unit tests on multiple targets from my machine is so cool. That’s how I discovered a bug on windows target that I would never find myself.

I already had several moments where I was kind of mind blown about how Zig supports me to pivot into new targets to run the code and to take this project further.

3 Likes

I wrote an event-based backlight brightness control command-line utility that uses sysfs (no polling). Check out the source code - GitHub - skdishansachin/backlightctl: Read and control device brightness · GitHub

2 Likes

Congrats on the incoming baby and i think you might be able to learn a thing or two on how to make an SOA/DOD ast by looking at the zig compiler or also at zirp

1 Like

I’ve started a prototype for an audio mixer, with firmware & software in Zig. I’ve got a lot of experience using mixers like this, but none at all building them, so I have a ton to learn! I expect to spend a lot of time learning and experimenting. I’m pairing with a friend who’s leaning more toward the hardware and embedded parts of the project, while I’m leaning a bit more toward the UI and system control parts. Should be a good time.

5 Likes

I’m working on finishing the Uxn VM I started in September (see What's everybody working on? (September Edition) - #55 by samuel-fiedler).
The “core” part (ISA work and basic system devices) is finished, I just need to work on implementing different kinds of “devices” (right now I’m implementing the “file” device with std.Io; I’ve gotta say, std.Io is great!)…

And maybe I’ll start coding in Uxn assembly (Uxntal) after I finished the interpreter.

4 Likes

I think that of all the more-fun-than-practical projects I’ve ever seen, this one puts the biggest, stupidest smile on my face.

I don’t know what it is exactly, but something about this way of displaying code that is so unorthodox, yet actually sort of completely makes sense just speaks to me :​)

2 Likes

Just watched the middle of your 3 videos. Not sure about the verticle video, but I like how relaxed and funny you are.

Keep it up.

1 Like

Thank you very much :blush: