View Single Post
09-23-16, 02:35 PM   #7
EyalSK
A Deviate Faerie Dragon
 
EyalSK's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 13
Originally Posted by SDPhantom View Post
Readable isn't the same as efficient. You can have readable code that nukes system resources. The fundamental problem is now you're running through two compilers/interpreters now. You're not running Java bytecode in a VM built in C. You're running a JS compiler/interpreter on top of Lua's equivalent of Java VM. Of course this is depending on how well the JS-to-Lua compiler is written and the code that is ingested, but there will always be overhead you will have to contend with.
Your reply isn't clear but if you imply that he runs two VMs to execute the Lua code then that would be incorrect because he doesn't, he probably uses a transpiler that runs on top of NodeJS that produces a valid Lua code and finally that code is what he would use in his addons.

Now, to the OP I really don't know why would you do that to yourself, I mean I understand some transpilers like TypeScript, LESS, CoffeeScript, Babel and C# to JS, I completely understand why people would use these tools but JavaScript to Lua doesn't make sense to me at all outside to maybe research for few reasons that isn't really related to readability or efficiency, a JavaScript AST can be easily converted into Lua AST and you can actually produce a very efficient and readable Lua code but it also depends on the generator of the transpiler and optimizer if any.

The issue I see with it is Lua is pretty simple language and there is many concepts in JavaScript that you can bring with you to Lua due to the nature of both languages being dynamic languages.

I mean, the troubles that you need to go through to make things work doesn't worth it in my opinion and now you want to bring in React.js to WoW, a technology that aims to solve a specific problem with the DOM, a problem that doesn't really exist in WoW so why would you want to use it? however, to answer your question what you can do though is build yet another tool that trasnpiles React components into WoW's APIs... I don't think someone was that bored to create it yet.

In short, I'll be honest with you and tell you, you should really, really, REALLY, did I said really? yes I did.. really abandon this idea and use technologies where they are better used in a context in which they solve a problem or were designed for it unless you want to find yourself solving problems for fun! that don't exist! like writing a tool that maps React components into WoW's APIs just because... I'm not saying it's bad but you really need to ask yourself the following question "Do I really want to build a UI for WoW or a technology that brings the web stack into WoW?"

Anyway, good luck.

Last edited by EyalSK : 09-23-16 at 02:38 PM.
  Reply With Quote