neon123
|
  |
| Joined: 10 Apr 2009 |
| Total Posts: 923 |
|
|
| 04 May 2010 09:28 PM |
| Ok, not sure how to say this, but, can you make a script that translates a piece of Java, or C++, etc. code you type in, convert it to Lua, and operate it? I don't care how long the script would be, just can you do it. |
|
|
| Report Abuse |
|
|
fuggles
|
  |
| Joined: 01 Mar 2008 |
| Total Posts: 13937 |
|
| |
|
|
| 04 May 2010 11:10 PM |
NEVAH!!!!! I might be wrong but shouldn't this be in scripting helpers? |
|
|
| Report Abuse |
|
|
XlegoX
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 14955 |
|
|
| 04 May 2010 11:20 PM |
Very possible, in fact I and some of the other advanced scripters are probably capable of it.
Since you have access to compiling Lua byte code from within Lua, it's fully possible to take a language such as Java or C++ and compile it into Lua Byte code rather than machine instructions or the usual ByteCode language.
The most difficult part is to make a script to pack the Lua op-codes, since there's a lot of bit-wise operations required which are not easily done in Lua.
Parsing and generating code for the language (as long as you're willing to take just a subset of if, such as ignoring pointer arithmetic in C++, and if you don't care about optimization of the ByteCode), shouldn't be too complicated. |
|
|
| Report Abuse |
|
|
|
| 05 May 2010 01:41 AM |
Uhh, shouldn't be THAT complex, yet you wouldn't be able to use some classes that don't exist in Lua.
Yet, this will be totally useless. It is easier to write the code in Lua anyway. Another thing: Lua to Java/C++ would be nice... |
|
|
| Report Abuse |
|
|
|
| 05 May 2010 02:11 AM |
There is hardly any point. The things that are possible in Java AND Lua are simpler in Lua, and anything else is impossible.
"import java.util.*;" --> How will Lua handle that? "public class script extends JFrame implements KeyListener {" --> :P |
|
|
| Report Abuse |
|
|
drummerp
|
  |
| Joined: 10 Jan 2009 |
| Total Posts: 4892 |
|
|
| 05 May 2010 07:48 PM |
| You'd need to take away all the things out of java.awt (except for the events), java.beans, java.net, java.io, java.nio, javax.swing, java.script, java.security, java.applet, java.sql, a lot of the stuff in java.util, and most everything in javax and org. |
|
|
| Report Abuse |
|
|
XlegoX
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 14955 |
|
|
| 05 May 2010 09:16 PM |
| I'm pretty sure we're talking about the language syntax, not the libraries. |
|
|
| Report Abuse |
|
|
|
| 06 May 2010 01:40 AM |
OnT: Why bother with Java syntax, if nothing is gained from it?
OffT: When you put a flourescent lamp in a microwave, will it: • Work • Explode • The Ottoman Empire (1299-1922) |
|
|
| Report Abuse |
|
|
Bonecuss
|
  |
| Joined: 15 Feb 2008 |
| Total Posts: 6979 |
|
|
| 06 May 2010 11:44 AM |
| This is perfectly possible as xLEGOx said, I have seen many similarities with ActionScript 2.0 and RBX.Lua, I could probably make a basic converter (and an animation system) to guis, quite easily, I think it would be simpler just to get the basic idea of the script and change the syntax and words around a little. |
|
|
| Report Abuse |
|
|
ball360
|
  |
| Joined: 31 Mar 2009 |
| Total Posts: 1557 |
|
| |
|
ball360
|
  |
| Joined: 31 Mar 2009 |
| Total Posts: 1557 |
|
| |
|
|
| 13 Feb 2015 04:38 PM |
| YES, FINALLY, good news reguarding my plans to rip off mojangs minecraft-lol |
|
|
| Report Abuse |
|
|