https://twitter.com/deepities/status/1021711693586554881

Please compile jshell ahead of time to get the startup from ~5sec to somewhere around ~10ms.
Challenge accepted.
But is this even realistic to achieve?

Simple AOT compiled HelloWorld I executed on the same oldish laptop I executed jshell on. Obviously this is a minimal example and jshell is probably quite complex. I wonder what jshell is doing, because ~5sec. seems awfully long. Maybe will do some digging later.
I take that back, this is possible! :heart:
My assumption is that jshell is running quite some initialization code and also loads javac. The main technical challenge for us will be to load and interpret the dynamically generated bytecodes. This is a functionality that we miss at this point in time in native image mode, but it is under active development.
I came here trying to find out how I can bake JShell into a Native Image. As of 2020-10-28 the docs on Dynamic Proxy in Native Image state:
Native Image does not provide machinery for generating and interpreting bytecodes at run time. Therefore all dynamic proxy classes need to be generated at native image build time.
The way I understand things, this is a requirement for JShell, since it needs to generate and interpret bytecode at run time. So, no significant progress here, right?
Most helpful comment
Challenge accepted.