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

View Javascript Output #5

Open
davej opened this issue May 9, 2015 · 1 comment
Open

View Javascript Output #5

davej opened this issue May 9, 2015 · 1 comment

Comments

@davej
Copy link

davej commented May 9, 2015

Very minor but it would be nice if there was someway to view the resulting ES6 on the site. I expected the "Try It!" button would let me see what EG code looked like when converted to ES6.

I realise that I can download the lib and compile my own code to see the output myself but it would be nice to have it on the site (ala CoffeeScript).

@breuleux
Copy link
Owner

breuleux commented May 9, 2015

I guess I could add it somewhere, but the main issue at the moment is that the compiled code can be a bit messy: the compiler introduces temporary variables quite liberally, variable names always get mangled (x -> x$0) for technical reasons. It's not too bad, but it's not super clean, and ideally I'd like to solve these technicalities before making a show of it.

You can technically view the ES5 in the repl if you were to run for example:

fib(match) =
   0 -> 0
   1 -> 1
   n -> fib(n - 1) + fib(n - 2)
fib.to-string()

Caveats being that this is not the ES6 version, and references to $eg$global are a namespacing trick for the repl that you won't find in the code you compile yourself.

Anyway, I'll keep this in mind.

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