Ok, this topic is pretty much way over my head, but I’m hoping to get a conversation started at least so it can be brought up with the people that know more about this.
My company uses Crystal in production heavily, and one thing we bring up on a weekly basis is having a native REPL. We have done some research on how this would work, and if it’s even possible. It looks like Julia is using LLVM, and they have a native REPL. One thing these LLVM languages have in common is an interpreted mode.
After doing some more research on other compiled languages that have interpreters, I’ve seen references to MCJIT come up. It looks like there was some talk in 2015 about using it with Crystal, but that was eventually closed out. I guess it is/was used in some parts of the language? Would MCJIT give us the ability to have an interpreted mode?
During the last Crystal live Q&A stream @RX14 had briefly mentioned that an interpreter was a possible goal for the future, but obviously there are a lot more pressing issues to worry about first.
What if the community started working on this? It could be a shard on the side to natively interpret Crystal and give us the ability to have a native REPL. What would this look like? Where would you even start? Are there already classes in Crystal that could handle most the heavy lifting, or would this need to be written in C (c++ ?) directly?