Is static metaprogramming possible in Java?

前端 未结 11 1178
無奈伤痛
無奈伤痛 2020-12-14 00:56

I am a fan of static metaprogramming in C++. I know Java now has generics. Does this mean that static metaprogramming (i.e., compile-time program execution) is possible in

11条回答
  •  难免孤独
    2020-12-14 01:11

    The Manifold project offers type-safe static metaprogramming for Java. You can use it to build types dynamically at compile-time as Javac resolves type names. The JSON Schema demo demonstrates static metaprogramming in terms of dynamic, compile-time type projection (no code generation build steps).

    Additionally you can use Manifold to add new features. Check out Structural Typing, Method Extensions, and Type-safe Reflection. .

提交回复
热议问题