News for hackers. Stuff that matters.
Re:Type-safely embed DSLs directly into Java by mckinney on Thursday September 17, 2020 @06:33PM (#24510786)
Hi, you can blame me for this. It's a Java compiler plugin[1], which is similar to an annotation processor, but can hook into the compiler at a much earlier stage, which allows it to contribute to all phases of the compiler, including the Parser phase. The Manifold plugin takes full advantage of this, hence its ability to analyze comments, contribute to bytecode generation, etc.

[1] https://docs.oracle.com/javase/8/docs/jdk/api/javac/tree/com...

Re:Type-safely embed DSLs directly into Java by teslalang on Saturday September 19, 2020 @05:52PM (#24530547)
Amazing! Reading the posted link this looks much bigger than embedding, which is crazy impressive btw. Do you anticipate building support for more resources? I notice you have GraphQL support... what about SQL?
Re:Type-safely embed DSLs directly into Java by eatonphil on Thursday September 17, 2020 @07:09PM (#24511065)
So you have a javascript frontend hooked into the java compiler? Or how does your javascript integration work?
Re:Type-safely embed DSLs directly into Java by mckinney on Thursday September 17, 2020 @07:29PM (#24511216)
At compile-time manifold-js[1] parses JS and generates Java types (stubs), which forward execution to rhino at runtime. Basically, JS seamlessly mapped onto Java's type system.

[1] https://github.com/manifold-systems/manifold/tree/master/man...