Main.java generation — System.out.println, while, and typed declarations.
Implemented
gset run foo.java defaults to the Java target; --target java forces it. Generated code follows the "one public class Main" model:
public class Main { public static void main(String[] args) { var name = "World"; var count = 3; System.out.println("Hello, " + name); while (count > 0) { System.out.println(count); count = count - 1; } }}
Types: var (Java 10+) requires initialized local declarations. Declarations with var name = … are fine; uninitialized/typed-empty declarations are not valid Java.
Arithmetic: var n = 5 gives Java int for integer literals — n * n is valid int arithmetic. Use typed annotations (var n int = 5) when you need explicit types.
Main.java collides per CWD. Running several Java targets in the same directory may overwrite Main.java. Use separate directories or --keep to inspect output.
Methods on the class shell are not generated yet. Keep behavior in functions for the Java target.