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

Support for ES6-style Classes #33

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

Support for ES6-style Classes #33

akrymski opened this issue Nov 27, 2013 · 4 comments

Comments

@akrymski
Copy link

Would be nice to go beyond plain C idioms and add support for classes (ES6 style). These can be easily represented as structs under the hood.

A real class system with inheritance and mixins would go a long way to making this far better alternative to C + emscripten. I'd have no issue with writing large web apps in LLJS that way.

@mbebenita
Copy link
Owner

We have support for structs with member functions, but I agree, we could do a lot better here. One path to consider here is building LLJS on top of Typescript.

@akrymski
Copy link
Author

Indeed, but what about the other way round - convert TypeScript to LLJS? And then LLJS -> C means you get TypeScript -> LLJS -> C -> native in theory :)

@mbebenita
Copy link
Owner

LLJS is not that sophisticated. It can't automatically lower JavaScript semantics into C, it just adds some C like features to JavaScript.

@akrymski
Copy link
Author

I'm really talking about the LLJS that compiles to asm.js - not the "superset of JS". If you only allow typed JS, then why not just remove "let" and translate "new" to malloc … and get C? what am I missing?)

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