Compiling LLJS to C #34

akrymski opened this Issue Nov 27, 2013 · 2 comments


None yet

2 participants

Given that LLJS is nearly C, would be great to have C as a potential compile target (using stdlib & malloc instead of ArrayBuffer). Or even Objective C.

Having one language to target the web as well as native would just be plain awesome. Plus, adding language features such as Classes, forEach loops etc (ES6?) would be a lot easier with LLJS. There's no reason it needs to be as plain as C.


LLJS is a superset of JS, so compiling it to C would be very difficult. You need a VM as well, GC, etc ..

That's not quite how I saw it but sure. At first glance it seemed to me that LLJS is effectively a C-like language that can be compiled to javascript, not a superset of javascript. I see no advantages of using dynamic types when writing LLJS. If dynamic typing isn't supported, then it shouldn't be hard to transform LLJS into C. You could support hashes with a simple hash data structure in C, but ideally you'd implement ES6 Map, Array etc in LLJS itself.

Imagine the examples on your homepage being converted to C and compiled to native, very do-able right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment