Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support for ES6-style Classes #33

Open
akrymski opened this Issue · 4 comments

2 participants

@akrymski

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
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

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
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

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
Something went wrong with that request. Please try again.