4 ms·
It is already happening. Not specifically with python or ruby (although possibly, I don't follow them), but several languages have "compile to javascript" opti
by asdasf 13y ago
It is already happening. Not specifically with python or ruby (although possibly, I don't follow them), but several languages have "compile to javascript" options now. Just like we treat CSS as purely for the machine generated from the SASS which is for people, we treat javascript as purely for the machine generated from the haskell which is for people.
- meowface 13y agoTrue, such options are available. To my understanding there is a performance hit involved, though, unless something like asm.js is used. I also believe there are some current projects that compile Python and Ruby into JS, but I'm not sure how mature they are.
- asdasf 13y agoThe performance is the same as if you wrote the javascript by hand. The only potential performance issue is when the compiler generates really poor javascript for some particular bit of code, where a person would have written less poor javascript if doing it by hand.
- jcutrell 13y agoOpal and Decaf are two projects that run ruby in the browser. Opal compiles to JS. Decaf is a "modification of Webkit". Decaf: http://trydecaf.org/ http://trydecaf.org/ Opal: http://opalrb.org/ http://opalrb.org/ A quick google search gave me Pyjs. http://pyjs.org/ http://pyjs.org/