Comment by Jarred

Comment by Jarred 2 days ago

4 replies

This was an unplanned feature I worked on mostly a month ago on a Saturday for fun. Happy to answer any questions

To get it out the door, ended up adding some patches to TinyCC to support .framework on macOS and fix a few things with dlopen and include paths. Also added support for parsing the deprecated attribute used in lots of Darwin headers. C parsers seem a lot simpler than JavaScript which is nice

candleknight a day ago

Awesome work on this, it looks like a game changer!

From my (admittedly limited) knowledge on this space, it seems like this is a straight upgrade over WASM, with the only limiting factor being that your stack is limited to Bun + C. Are there any downsides of this feature when compared with the alternatives mentioned at the start of the article? There are some tradeoffs listed at the bottom but I'm not sure how napi/WASM perform in those aspects either.

  • NoahKAndrews a day ago

    NAPI and WASM let you use optimizing compilers, so they're suitable for use with larger C and C++ codebases

hiccuphippo a day ago

This is very cool. Is the code compiled on every run or does it get cached?

jll29 a day ago

Cool - if this was an unplanned "accident" then I want to see how your planned projects look like.