I have started exploring what it might mean for Groovy to support/co-exist with the JEP-445 "scripting" capabilities that are being offered as preview features in JDK21. I am documenting what that might entail here:
https://issues.apache.org/jira/browse/GROOVY-11118 It will likely be next week before it is really ready for discussion but if folks are particularly interested, please feel free to send me some comments. At this early stage, the TL;DR version of what I think it might look like is as follows: * JEP 445 supports source files with no explicit class declaration but they must contain a static or instance main method with no args or a String[] argument * we already support scripts which have no class declaration including ones with a static main method but we don't support instance main methods (they conflict with the automatically added main which is part of the scripting model) * we can support instance main methods and in such a case we can offer a JEP445-like experience * Groovy's runner protocol can be extended to support the revised JEP-445 launch protocol (essentially giving an option for launching JEP-455 compatible scripts from JDK11 onwards) Cheers, Paul. <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virus-free.www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>