Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling LLJS to C #34

Open
akrymski opened this issue Nov 27, 2013 · 2 comments
Open

Compiling LLJS to C #34

akrymski opened this issue Nov 27, 2013 · 2 comments

Comments

@akrymski
Copy link

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.

@mbebenita
Copy link
Owner

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

@akrymski
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants