Implement automatic hxb caching for run scripts
This provides a nice improvement in responsiveness when running eval scripts, by making use of the hxb feature of haxe 5.
TODO:
- [ ] Flag to force a rebuild the cache
- [ ] Automatic handling of corrupt/outdated hxb cache
Ah, nice! I stopped thinking about hxb scripts when it was brought up that this would come with distribution issues because hxb is tied to a compiler version, but supporting this kind of local pre-compilation is a neat idea.
I stopped thinking about hxb scripts when it was brought up that this would come with distribution issues because hxb is tied to a compiler version
Yeah, being tied to a specific compiler version is a bit of an issue, especially when compared to neko which is pretty stable and is independent of haxe version. Having the option to run with a run.hl file might still be a good idea, especially for libraries that are intended to support older haxe versions.
If a library is already using an eval script, there is no reason not to apply this optimisation, although, we will have to come up with a proper mechanism to detect when the cache is mismatched with the current haxe version and requires recompilation. I was wondering if you had any ideas for this? How much of this should be handled in the compiler vs in haxelib?