News for hackers. Stuff that matters.
Re:Manifold: Java Type-Safe Metaprogramming, Structural Typi... by brabel on Saturday May 04, 2019 @04:03AM (#19825100)
Ok just checked this deeper. The [docs](http://manifold.systems/docs.html) actually show this is a javac plugin (I didn't know about the `-Xplugin` flag, but you ALSO need to pass that to javac for Manifold to work)... you also need the `tools.jar` file (which includes the JavaCompiler) on the runtime classpath... so suddenly, there's no magic... it's a bit misleading to say this does not require a build step, it clearly does, but as it integrates with javac itself, it "feels" seamless...
Re:Manifold: Java Type-Safe Metaprogramming, Structural Typi... by mckinney on Saturday May 04, 2019 @04:24AM (#19825187)
Note tools.jar is needed only for Java 8, and only for compile-time, unless you use Manifold's dynamic loading feature. The JREs for Java 9+ bundle what used to be called tools.jar.
Re:Manifold: Java Type-Safe Metaprogramming, Structural Typi... by the8472 on Saturday May 04, 2019 @09:53AM (#19826437)
How much of an update hazard is this? Does it break with every major java upgrade?
Re:Manifold: Java Type-Safe Metaprogramming, Structural Typi... by mckinney on Saturday May 04, 2019 @04:20AM (#19825173)
There's a significant difference between a code gen build step and what Manifold is doing with javac. Resource files are virtual source files, this represents a leap in terms of dev productivity.
Re:Manifold: Java Type-Safe Metaprogramming, Structural Typi... by brabel on Saturday May 04, 2019 @04:32AM (#19825215)
Yes, I agree... just wished they made it clearer how they achieve that!
Re:Manifold: Java Type-Safe Metaprogramming, Structural Typi... by jillesvangurp on Saturday May 04, 2019 @05:18AM (#19825356)
The documentation is a bit handwavy on how it works indeed. Just drop a jar file in the code doesn't quite tell the whole story. However, I'm impressed with how amazingly awesome this stuff is. A lot of the stuff it does is already in Kotlin but being able to use json and property files without boiler plate code is nice. I'd like to be able to do that in Kotlin as well.