Closed PhilippSalvisberg closed 4 years ago
Btw have you considered Kotlin?
Yes I have. Especially since there are a lot of similarities with Xtend. I would have liked to use a JVM language with multiline text blocks in string literals. However, I decided for Java because of popularity (even if Kotlin seems to be now the 2nd most popular JVM language according this post) and because we are using it as the JVM language of choice in the other utPLSQL projects.
And I have already started to migrate classes to Java. Painful. Commits to local branch. Not pushed yet.
In the Xtext release notes of version 2.20.0 you find the following about "Xtend"
IMO Xtend is really superior in the area of string templating. It's used to build SQL statements in this project. However, this is not a code generation project. Therefore we can live with inferior Java features in this area. Java 13/14/15 text blocks would address some issues, but not all. Anyway, In this project we have to stick to the Java version used by SQL Developer. The current version of SQL Developer 19.4.0 supports JDK8 or JDK11. The user chooses the exact version. Hence we have to stick with JDK8 for the moment.
Moving from Xtend to Java will have the the following positive impact:
But there is also a negative impact:
Xtend generated Java5 code. However, this code is not meant to be maintained manually. It looks ugly and since it was originally based on Java5, it does not use Java8 features where possible (e.g. for lambda expression). Hence the migration from Xtend to Java is a semi-automated process, where the generated code might be used as a starting point only, but must not be used 1:1.
A migration is possible class by class. However, I suggest to do it for the whole project including tests.