Get the latest tech news

'Compile and Run C in JavaScript', Promises Bun


The JavaScript runtime Bun is a Node.js/Deno alternative (that's also a bundler/test runner/package manager). And Bun 1.1.28 now includes experimental support for ">compiling and running native C from JavaScript, according to this report from The New Stack: "From compression to cryptography ...

But both are suboptimal... WebAssembly can do this but its isolated memory model comes with serious tradeoffs, the team wrote, including an inability to make system calls and a requirement to clone everything. "This makes it easier to return JavaScript strings, objects, arrays and other non-primitive values from C code," wrote Sumner. "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," Sumner wrote.

Get the Android app

Or read this on Slashdot

Read more on:

Photo of promises

promises

Photo of javascript

javascript

Photo of compile

compile

Related news:

News photo

Compile and Run C in JavaScript

News photo

Rio: Web apps in pure Python

News photo

Oracle urged again to give up JavaScript trademark