Closed emilebosch closed 7 years ago
While this project is cool, I suspect its use of the term "AOT compilation" is a little inaccurate. It's more like https://github.com/zeit/pkg for Ruby
This project seems more comparable to Traveling Ruby
@paulcbetts Exactly. Currently it is just packaging, but when combined with work of @ko1 we could achieve real compiling in order to boost start-up speed and also protect intellectual properties.
I talked to @ko1 last year after his presentation about AOT compiling for Ruby at RailsConf, and it seems like we were missing a piece of the puzzle at that time, which is to preserve a virtual file system after compiling, in order to accommodate __FILE__
and require
calls. I achieved it now with the help of libsquash. So now in runtime every path that begins with /__enclose_io_memfs__/
got redirected to the memory, and so are your project files.
So what next step? You will some existing solution, like rubyomr or there exists prototype of AOT from @ko1 ?
@stereobooster Rubyomr is JIT instead of AOT. There is indeed existing prototype from work of @ko1 : https://github.com/ko1/yomikomu I have to take some time to integrate it.
But bootsnap simply precompile code to bytecode, e.g. we reduce parse time on load/reload, nothing else. Am I right? Does this mean that AOT will give only speed up on parse time and nothing else?
@stereobooster Also intellectual property protection, byte-code is harder to reverse-engineer than Ruby-code. In addition to,
@tmm1 Thanks for recommending bootsnap! Let me look into it.
FWIW I think the packaging thing on its own is worth while doing even if you never get to the point of having performance improvement.
I know there are other things out there that do that, but that's fine. This is important and IMO it's not a solved problem yet.
Ahead of time implies you compile it to LLVM/Instruction set? Would you care to elaborate?