logoalt Hacker News

dboontoday at 7:45 PM0 repliesview on HN

I am making Cargo for C. I have 3/4 of a working demo; the tool can build itself, including some non-trivial dependencies which I've ported to build natively with the tool (instead of wrapping their Make or CMake or whatever). The pitch: It's insane that we have to pull in Python or Lua to build C code. CMake is an abomination against god that has become usable in spite of itself. Zig cc is proof that this entire ecosystem is an embarrassment. My tool gives C projects a TOML manifest, and builds scripts written in C and JIT compiled by the tool. Now, you can write build scripts in the language itself, pull in dependencies you wanted to use anyway. It also provides a stable ABI. There's an HTTP-backed index and a Git-backed index. And it generally does the same thing for C that, say, Bun did for JS/TS. You'll be able to run C files from source and have the entire ecosystem available. You'll be able to trivially generate single file static binaries, or dynamically link to an older glibc without arcane tricks. It will fix C.

I'm also still working on my "what if we wrote a real standard library for C"; I added some feedback I got from the release.

Also, some side projects: I'm making something that's a mixture of chezmoi, Omarchy, and Unraid, for Arch. It has a nice web UI installer. You store everything about your machine as a Git repo, and it brings it up. I wanted to make a system where you could install things manually as you're learning, and once you know what you want have the configuration system naturally absorb it back in. Unraid was great, but once I had real infrastructure running on it the ad-hoc nature made it a huge pain to do it right.

I am also experimenting with a new UI framework that is like HTMX but can also target native apps. UI trees are JSON, not HTML. The runtime is a small core of WASM which takes in JSON patches and applies them. Each backend just translates the UI tree to native calls (e.g. DOM calls, or GTK calls, or...). It's kind of like React Native, but the point is that RN is insane because it synthesizes complex widgets and pretends that the abstraction is clean, and when it isn't it causes problems. There's...a lot more nuance to where this sits among all the UI frameworks, but the best way to describe it is "I wanted something that renders UI server-side for simple apps, and I wanted to be able to run it on the web or natively without bundling a browser". It's very much a sketch to see if this is even possible, and very much missing critical features still, but I have two nice examples that show a plain C backend and a TypeScript backend.

C standard library: https://github.com/tspader/sp

A route from the UI framework: https://github.com/tspader/spry/blob/main/examples/form/nati...

A UI tree from the UI framework: https://github.com/tspader/spry/blob/main/examples/form/ui/t...

A TSX version of the same app: https://github.com/tspader/spry/blob/main/examples/form/web/...