Live data from Hacker News

Lua to Javascript translator

github.com

1–10 of 30 posts

Re: Lua to Javascript translator

#3
Lua is a better language than Javascript in every possible way. I have half-a-mind to hack LuaJIT into Webkit, but I'm afraid that it may be futile at this point. The biggest shame in all of web development is the "type" attribute on the HTML "script" tag...

Re: Lua to Javascript translator

#4
post #3

Lua is a better language than Javascript in every possible way. I have half-a-mind to hack LuaJIT into Webkit, but I'm afraid that it may be futile at this point. The biggest shame in all of web development is the "type" attribute on the HTML "script" tag...

I disagree that Lua is better in every possible way. There are at least a couple of ways in which it is merely equal, yet where improvement would be possible.

Re: Lua to Javascript translator

#5
post #3

Lua is a better language than Javascript in every possible way. I have half-a-mind to hack LuaJIT into Webkit, but I'm afraid that it may be futile at this point. The biggest shame in all of web development is the "type" attribute on the HTML "script" tag...

I disagree that Lua is better in every possible way. There are at least a couple of ways in which it is merely equal, yet where improvement would be possible.

Point taken... "equal or better" in every possible way. :-)

Re: Lua to Javascript translator

#6
post #3

Lua is a better language than Javascript in every possible way. I have half-a-mind to hack LuaJIT into Webkit, but I'm afraid that it may be futile at this point. The biggest shame in all of web development is the "type" attribute on the HTML "script" tag...

Please hack LuaJIT into WebKit. I was thinking of doing something even more crazy: hack Mono into WebKit!

Re: Lua to Javascript translator

#8
This is a cool project, but sadly it's not a complete Lua. It's missing two of Lua's most powerful features:

A lot of the metatable functionality just won't work: http://www.lua.org/manual/5.1/manual.html#2.8

Second, it's missing co-routines. Which is a way to suspend the execution of a piece of code.

These features aren't possible in a compiler that simply translates from Lua to JS because JS doesn't have the ability to reproduce these concepts in its own constructs. You would have to output significantly different code to simulate these features.

Without these you're just writing JavaScript in another dialect.

Re: Lua to Javascript translator

#9
post #8

This is a cool project, but sadly it's not a complete Lua. It's missing two of Lua's most powerful features: A lot of the metatable functionality just won't work: http://www.lua.org/manual/5.1/manual.html#2.8 Second, it's missing co-routines. Which is a way to suspend the execution of a piece of code. These features aren't possible in a compiler that simply translates from Lua to JS because JS doesn't have the abilit…

Given this, what could be a legimate goal of this project?

There are more than a few language X -> Y translators (not compilers), and I suspect they all miss some aspects of the source or target language.

Post reply on HN