5 ms·
Now students will need to learn the pain of versioning on their first day of class. Bob: I get this weird error when I run this example from class. Sally: Wor
by bhawks 4y ago
Now students will need to learn the pain of versioning on their first day of class.
Bob: I get this weird error when I run this example from class.
Sally: Works for me! Hey can you try running this?
Bob: oh that works, lots of extra stuff in it. I guess I have to copy all of these things along for an app to work anywhere.
Sally: I guess so - it's weird the simple example works on my laptop and not yours.
Bob: must be a compiler bug, I hear about those alot in the compsci lab.
Personally I think that the compiler should generate a synthetic main entry point when it encounters code that matches the new "launch protocol". It provides a degree of portability and repeatability over relying on the runtime to select the entry point. There are probably downsides here too.
- kaba0 4y agoHow many classes do you have that have a function named “main”?
- bhawks 4y agoApproximately none. Which is why I would be fine with javac generating a synthetic public static void main(string[] args) that forwards to it when the pattern is encountered. In this setup the generated classes/jars work fine without extra flags to java and even work on older jvm installations if you pass the right flags to javac at build time. I really struggle to come up with a reason to implement this as a change to java vm over just javac.