Frectonz
3.45K subscribers
1.91K photos
82 videos
32 files
1.64K links
A place for me to talk about my projects, stuff i find on the internet and what I am currently thinking about.

By @frectonz
Download Telegram
Designing nice library APIs is hard

I am trying to write a safe wrapper around chafa-sys so that people don't have to use unsafe all over the place.

I also wanted to make the api more rusty and easier to use.

First image = using chafa-sys straight out of the box.
Second image = the safe wrapper i am working on (heavily simplified)
who the fuck is downloading my crates.io packages, there must be some service that just goes over every package in crates.io and downloads it, like these can't be real people.
πŸ‘4
I have just achieved the ultimate FFI threesome.

OCaml + Rust + C = ❀️

What you are seeing in the images is OCaml code calling out to Rust which in turn is calling out to C.

The actual flow
(->) this means calls into

OCaml project -> chafa-ocaml (Rust to OCaml bindings) -> chafa (safe Rust wrapper) -> chafa-sys (unsafe FFI rust) -> chafa (the c lib)

You know complexity gets such a bad rep but it's actually cool when you actually understand it. Feeling pretty proud of myself to have achieved this 😁.

As always the code is on GitHub
πŸ”₯14
peaking.mkv
24.1 MB
Here is a vid to help you guys understand what you have just witnessed 😁.
πŸ”₯2😁1
Going all in on e/acc because it mostly aligns with my convictions.
😁
😁9
Frectonz pinned a photo
Frectonz
😳 https://fxtwitter.com/nullpointered/status/1726065661389287856
They should have played this at the candle light event 😁

https://t.me/bekacru_c/158
😁4