-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A VM for crystal #168
Comments
Also we don't have to rewrite all, we can reuse the current lexer, parser and std-lib, just replacing the code-gen by a custom VM (I have no idea how to do it 😅 ) |
Hey, It would be definitely possible. The tricky parts would be C-interoperability and basically all the parts which use some form of assembly. Anyway, are slow compilation times really a problem with Crystal? Recompiling Charly takes about 1.3 seconds for me (unoptimized build), which is extremely fast in my opinion. I don't really see a need for an interpreted version of Crystal, but if there is a strong desire from the community for such a project to be developed, I'd love to help out wherever I can! Are there other people who want this, maybe even from the core-team? |
Oh, great! 🎉
Maybe we can add some warning for this, saying something like: if you want to use this feature you should use @KCreate I had the idea because I was asking for a true REPL for crystal, and I got a very interesting response from @RX14 :
Then he wrote some nice comments:
So, the problem is not because crystal slow compilation (sometimes is very slow, though), but because the type system.
Ref: https://gitter.im/crystal-lang/crystal?at=5ab00ef5f3f6d24c689220d7 |
Also, There is Myst a nice dynamic, interpreted, functional language made with crystal by @faultyserver Maybe he can share his opinions about a VM for crystal as well |
Hello! I'm basically in full agreement with what RX14 has said. I really don't know enough about the internals of the Crystal compiler to know what is and isn't possible (e.g., with templating, open types, etc.), but the idea of using the same front-end and just swapping the codegen for an interpreter sounds like the right direction. I have a lot of questions I'd have to work through to really get an idea of what's possible here, but I'd definitely be willing to help out/continue discussions/etc. |
Hi @KCreate I know this project isn't maintained anymore, but I want to ask you something,
Do you think would be possible to write a VM machine for crystal?
Ref: https://gitter.im/crystal-lang/crystal?at=5ab0150635dd17022e79c5fe
The idea is to create an interpreted, slow crystal-vm in aims for fast development, interpreted bytecde execution and live in-debugger. Keeping crystal compiler for production release executables (slow compilation, but fast execution and stand-alone binaries)
WDYT?
BTW, you
charly-vm
in C++ looks pretty nice 👍The text was updated successfully, but these errors were encountered: