trill-lang / trill

A type safe, compiled language inspired by (and written in) Swift
MIT License
275 stars 15 forks source link

[WIP] [JavaScript] JavaScript Standard Library Declarations #38

Closed harlanhaskins closed 7 years ago

harlanhaskins commented 7 years ago

This PR tracks implementations of foreign declarations of JavaScript standard library types.

harlanhaskins commented 7 years ago

There's no way to automatically import. We need types.

harlanhaskins commented 7 years ago

The JavaScript backend just can't be unified with the LLVM backend in its current state. I'd rather them be completely separate if they can't be completely unified.

harlanhaskins commented 7 years ago

That said, I'd love to use something like emscripten to generate asm.js and run that instead.

terhechte commented 7 years ago

I'm just a lurker on here, but the verbose Javascript Generation is actually something I really like about Trill. On the server, Swift can already be used fairly comfortably. I'd love to be able to replace client code with something as close to Swift as possible. One can always run the output through Google's Closure library in order to gain dead code elimination much like ClojureScript does it.

harlanhaskins commented 7 years ago

My issue with the verbose JavaScript output is that it really doesn't reflect the semantics of the language...

Though I'm cool considering it a separate dialect of Trill with separate semantics. I'd just shy away from recommending anyone use Trill for anything serious 😅