-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to run? #5
Comments
Wow, it was almost seven years since lasts time I worked on this project. Not sure if I remember how. Most of the time I was running the tests. But I found this file which looks like an entry point [1]. As you can see, it has some hardcoded values.
It's intended to be a standalone tool, but it's far from ready. IIRC translation of the syntax is complete, for the target seven years ago, which was Java 7. What's remaining is most of the work: translating the semantics. Which you can see I've just started with [3]. [3] https://github.com/d-widget-toolkit/jport/commits/master |
Excellent. May I ask how you chose Scala? (I don't know it, but am interested in learning). |
Well, ideally a tool for D should be written in D. But I needed a Java compiler that was usable as a library. If you look at all the big Java IDEs that have great language support (Eclipse, Netbeans, IntelliJ) they are all implemented in Java. They also have Java compilers implemented in Java. I didn't want to use JNI to access a compiler from D, seems too complicated. Using Java after using D for almost 10 years feel a bit limiting. Therefore I chose Scala, because it works on the JVM and can easily integrate with existing Java code. In hindsight it might have been better to use Java anyway. If JPort is ever finished then I could have used JPort to port the Java compiler and then JPort itself to D. Then we would both have a Java compiler and a tool that can convert Java code to D code implemented in D 😃. |
Awesome. I agree. I have worked with JNI and SWIG and they're not much fun. It seems you based JPort on Eclipse's compiler. That's clever. I never thought to look at the Java code for that. Do you have an opinion on Scala vs Groovy? |
I don't know much about Groovy. IIRC it's more of a scripting language than Java or Scala. But if I would translate JPort to another language it would probably be Java. Because that would allow to run JPort on itself. Another alternative would be Kotlin. Seems to be more popular than Scala these days. |
There's still some life in Java I would say. Have you been able to use Scala for anything else? |
Yes, definitely. It's Scala that I think is less popular.
No, this is my first any only project in Scala. |
Would love an example or two to explain how you run your tool on java code to produce d. I gather you're not sure this is ready for a standalone tool on its own?
I have several java projects that I'd like to port to d.
The text was updated successfully, but these errors were encountered: