Join GitHub today
Principled Java code generation #36
Jotting down some thoughts for the future. The core underlying concept of guardrail seems doable in Java; one challenge would be maintaining the flexibility of the various typeclasses without global registries. Explicit value passing and typechecking responses.
The biggest advantage I see for providing this would be to permit an easier migration path from existing Java services into Scala, by first following best practices isolating the business logic from the web framework and using generated models+encoders/decoders for all communication, then migrating the business logic piecemeal into Scala by using
Some code to throw darts at:
Yeap, this would be pretty great to grow adoption and to get people to be able to move/switch if they wish to do so...
I think it'd be amazing to have both languages covered, and all these tools expose Routes, since then one can literally combine "anything they want" into such routes...
For reference, this is the style that akka-grpc generates for Java: https://github.com/akka/akka-grpc/blob/master/plugin-tester-java/src/main/java/io/grpc/examples/helloworld/GreeterServiceImpl.java
referenced this issue
Apr 4, 2018
I've been eyeing https://github.com/javaparser/javaparser for some time.
A small list of the benefits of having a full AST for target languages are:
A small overview of work to be done:
The last two points are moving towards a particular goal -- It should conceivably be possible to use the javadsl from Scala and possibly the scaladsl from Java, although I'd be less focused on that.
The motivation behind this is that even though most of the underlying types are compatible, treating them as separate http frameworks should keep us from building too tight of coupling between the framework and the language.
Even if this isn't achieved with the first iteration, as more frameworks are added (scalatra, server support for http4s) and other languages (eta being a primary target from a safety perspective, languages like java, groovy, and jruby being offered as gateways to writing safer code) this should be a guiding principle.