question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Principled Java code generation

See original GitHub issue

Overview

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.

Details

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 scala-java8-compat to adapt down to toCompletableFuture.

Progress

  • Encode existing Free algebras with knowledge of which language they are targeting
  • Remove all references to scala.meta from everything but the ScalaLanguage specification class and the generators
  • Add a language parameter to the argument parser/context
  • Add a java generators for akka-http clients and servers, using javaparser
  • Add a Jackson generator, wire it in to the java-akka stuff according to the docs

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
kelnoscommented, May 23, 2019

Just as an update here, we have full Java support in the core now, and generators for Dropwizard servers and AsyncHttpClient clients. At this point, adding Java akka-http servers and clients is just a matter of deciding on the generated output and writing generators.

1reaction
kelnoscommented, Dec 19, 2019

Heh, I guess this can be closed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 Principles of Code Generation from @KathleenDollard
Code should match or exceed human quality: While speed is an awesome goal, quality matters more. All code generation strategies should match or ......
Read more >
A Guide to Code Generation
With code generation you get always the code you expect. The generated code is designed according to the same principles, the naming rule...
Read more >
Design Principles for Code Generators
7 Design Principles of the OpenModelica Code Generator. 41. 7.1 Introduction . ... Java and C++ backends can be use for code generation....
Read more >
Programming Principles | Java Design Patterns
There are certain universal laws and principles in software development that guide architects, programmers, and anyone needing to design software.
Read more >
Solid Design Principles In Java Development
A solid design approach is a set of five principles in object-oriented programming that are designed to eliminate code rot and improve value ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found