Kuribo64
Views: 22,894,873 Home | Forums | Uploader | Wiki | Object databases | IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search
10-06-24 12:52 PM
Guest:

0 users reading Not hating on Java, but this is awesome! | 1 bot

Main - Archived forums - SMG hacking tools development - Not hating on Java, but this is awesome! Hide post layouts | New reply


SuperNova2150
Posted on 01-04-13 12:39 AM Link | #2772
https://github.com/natural/java2python

I love the fact that it can convert almost all Java code into Python. I wonder if Whitehole could be eventually converted to Python this way. (not requesting anything NOW, but essentially "putting it on the table".)

Arisotura
Posted on 01-04-13 12:41 AM Link | #2773
No.

Python is likely slower than Java. Also, you can't just take Whitehole's code an convert it to Python with that and expect it to work. You'd have to rewrite all the GUI code because there's no Python equivalent to Java's Swing.

____________________
NSMBHD - Kafuka - Jul
melonDS the most fruity DS emulator there is

zafkflzdasd

MK7tester
Posted on 01-04-13 01:06 AM Link | #2776
Not a programmer myself, but i've heard few rumors Python beats Java. Not sure if true.

Arisotura
Posted on 01-04-13 01:08 AM (rev. 2 of 01-04-13 01:09 AM) Link | #2777
If you go by rumors, it is also said that Java is faster than C.

Which would mean Python is faster than C. Which is wrong. Reggie! has an external C(++) library for handling certain tasks, it's there for a reason.

Anyway, if you guys don't know, Whitehole already went through a recoding phase, from C# to Java. It's painful and I don't feel like doing it again.

And as I said in my previous post, you can't just take Java code and automagically turn it into Python code. The languages have different APIs, requiring several code changes to get the final code working.


In short, no.

____________________
NSMBHD - Kafuka - Jul
melonDS the most fruity DS emulator there is

zafkflzdasd

xfix
Posted on 01-04-13 06:51 PM (rev. 3 of 01-04-13 06:53 PM) Link | #2807
First of all, mechanical translations are bad. Second, there is just no reason to port it to Python. None. It works rather well and fast already (ok, I haven't tested). Now as for java2python utility you provided. I have put something more complex than "Hello, world!" and well...
[source=java]public class HelloWorld {
public static void main(String[] args) {
System.out.printf("Hello, %s!\n", "world");
}
}[/source]
Simple enough? Yes. This is my translation (without that utility).
[source=python]print "Hello, %s!\n" % "world",[/source]
Readable, I know. But this tool doesn't do that.
[source=python]#!/usr/bin/env python
""" generated source for module HelloWorld """
class HelloWorld(object):
""" generated source for class HelloWorld """
@classmethod
def main(cls, args):
""" generated source for method main """
System.out.printf("Hello, %s!\n", "world")


if __name__ == '__main__':
import sys
HelloWorld.main(sys.argv)[/source]
What about... no? It doesn't even translate things correctly (System definitely isn't identifier in Python). The only translator I actually have seen working well is sed to Perl (included with Perl as s2p), but it generates lots of code for edge cases. Oh, and C# <=> VB.NET, but those are similar languages (they just have different syntax).


Main - Archived forums - SMG hacking tools development - Not hating on Java, but this is awesome! Hide post layouts | New reply

Page rendered in 0.023 seconds. (2048KB of memory used)
MySQL - queries: 27, rows: 203/203, time: 0.009 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.