Many years ago, through a Fireship video, I discovered V; a Go-ish language, that compiles (or rather, transpiles) to C and then compiles. I do have my gripes with it, but it is overall a sick language all things considered. But, it lacks something... an ecosystem.
The biggest ecosystem it should be able to tap into is C itself, but there was no real way to just generate a list of functions, symbols and defines and alike. So we experimented with dumping the AST from clang. It... worked... kinda.
Today, I was bored at work and just prompted ChatGPT about it on my company account - both to scare the first-level-support people out of their mind for the occasion they ever intend to use that account - and also because I just felt like it... and it turned out, that there WAS a library.
`sparse` is actually a hosted project on the Linux Kernel Git but it's c2xml tool does E!X!A!C!T!L!Y! what I need, to a T. So I forked that bitch and now I am working on adding win32 support, natively.
It has been years, and I absolutely cheated a lot, but... this is my first bit of CMake in years. It builds, and runs, just fine, and should even allow proper exporting. And further, turning it into a V-module should be stupidly simple once I have a win32 port (compat-win32.c, downsizing unistd.h usage). #devstr
π.txt
So if you are still reading, you may think, "ok cool, but for what"? Well, fiatjaf decided that part of Nostr was to use the Bitcoin cyphersuite - you know, secp...something... i keep forgetting it's name - but, that thing that nsecs are based off of. I would love to write a relay in V, but I am NOT going to re-implement a crypto library (and if I was forced to, I'd rather quit being an IT person before I ever deal with highly mathematical algorythmns such as this - fuck, no, ever, never, bloody hell nope). So, using libsparse, I could just scan through the public headers, build a list of structs, functions and such, generate a V binding out of that and then proceed to make a lovely, proper V implementation (with nice structs, methods and whatnot) out of that AND THEN write a relay.
In the process, I would be testing libsparse against a pretty battletested source tree and since I do not intend to change the actual source much, I hope to actually upstream parts or all of my changes, allowing the peeps that use it "over there" in the LKML to take advantage of that. Y'know, open source and what not.
.......and I could claim to have contributed to the Linux kernel - eventhough I actually didn't, but my commit message would pop up under the kernel git server - and iunno, that'd be kinda kewl. :D (13-year-old, inner-edgelord-hakz0rkid, intensified!1!!111!!!!!111!)