Get the latest tech news

Compile and Run C in JavaScript


Bun now supports compiling and running C from JavaScript to make using systems libraries easier.

From compression to cryptography to networking to the web browser you're reading this on, the world runs on C. If it's not written in C, it speaks the C ABI (C++, Rust, Zig, etc) and is available as a C library. To workaround the N-API build complexity and performance issues, some projects choose to compile their native addon to WebAssembly and import it in JavaScript. TinyCC compiles to decently performant C, but it won't do advanced optimizations that Clang or GCC does like autovectorization or very specialized CPU instructions.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of javascript

javascript

Photo of compile

compile

Related news:

News photo

Rio: Web apps in pure Python

News photo

Oracle urged again to give up JavaScript trademark

News photo

Oracle, it's time to free JavaScript