JEP proposed to target JDK 11: 330: Launch Single-File Source-Code Programs (original) (raw)
Peter B. Kessler Peter.B.Kessler at Oracle.COM
Thu May 17 22:00:20 UTC 2018
- Previous message: JEP proposed to target JDK 11: 330: Launch Single-File Source-Code Programs
- Next message: JEP proposed to target JDK 11: 330: Launch Single-File Source-Code Programs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Why are single-file source-code programs limited to being in files? Why not allow them to be in shell "here documents", or be read from pipelines, etc.? E.g.,
$ java - << '-EOF-'
public class HelloWorld {
public static void main(String[] arg) {
System.out.println("Hello world!");
}
}
-EOF-
or
$ myJavaGenerator | java -
or even
$ java 'public class HelloWorld { public static void main(String[] arg) { System.out.println("Hello world!"); } }'
JEP-330 mentions source files "compiled into memory", eliminating the class file. Why not eliminate the source file, too?
It might be only a small matter of programming to write a "java-like" wrapper that would read a Java program from a non-file source, put it in a file, compile it, and execute it (except for the awkward correspondence between the class name the and source file name, sigh). But this JEP is all about not having wrappers.
... peter
On 05/17/18 01:12 PM, mark.reinhold at oracle.com wrote:
The following JEP is proposed to target JDK 11:
330: Launch Single-File Source-Code Programs http://openjdk.java.net/jeps/330 Feedback on this proposal is more than welcome, as are reasoned objections. If no such objections are raised by 23:00 UTC on Thursday, 24 May, or if they're raised and then satisfactorily answered, then per the JEP 2.0 process proposal [1] I'll target this JEP to JDK 11. - Mark
- Previous message: JEP proposed to target JDK 11: 330: Launch Single-File Source-Code Programs
- Next message: JEP proposed to target JDK 11: 330: Launch Single-File Source-Code Programs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]