-
Notifications
You must be signed in to change notification settings - Fork 299
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
Io implementation in Rust #434
Comments
This is exciting. Have you thought about how concurrency would work for a Rust implementation? Would you make an Io VM with it's own stacks? |
I thought about using a library for this. There's a well known actix and other implementations of the actor model in the rust infra.
I'm really not sure about this for now. But I'll do research as there's no deadlines and I'm interested in this for educational purposes. |
One thing I learned from my Go implementation: it's impossible to implement an Io scheduler that is itself concurrent and that provides worry-free consistency. In order to achieve consistency with a goroutine per coroutine, without adding explicit synchronization mechanisms to Io, I've been busy with school and other projects, but when I eventually return to iolang, I plan to turn its scheduler into the same one-at-a-time model that Io uses, and make an addon for goroutine concurrency/parallelism. As an unrelated note, my implementation does currently run in Wasm. Although, last I tried, it deadlocked during tests on futures. |
Thank you very much! I'll look into this issue first. @stevedekorte @zephyrtronium |
The things that come to mind are:
|
If you mean "what would I do to have a better time writing Io," I'd implement coroutines early – maybe before even messages – instead of leaving them for almost last, and I'd care about the performance of message passing itself before implementing all the methods of Number and Sequence. Even with heavy optimization, my implementation is still about 8-10x slower than the original, and it took multiple rewrites to get it there from 20x. I also think I'd use singleton globals and not bother supporting multiple interpreter instances per program. This is probably more relevant for Go with its unusual calling convention, but eliminating an argument from every function should give a reasonable performance improvement, and it would make writing CFunctions slightly more convenient. There are few use cases for multiple interpreters, especially now that web REPLs can use Wasm instead of server-side processes. Alternatively, if you mean "what would I do if inventing Io," static typing. |
Thanks, guys! I need to return to Io and its sources after more than a year (or two?..) break. Then I'll research about everything you wrote. After that I'd write you personally if I had questions. Would you mind? |
I'd be happy to talk more about your project. |
I'm happy to answer questions as well. 🙂 |
I'm thinking of re-implementing Io in Rust. It's going to be a weekend side project, so the development is going to be slow. Some pros for motivation:
Are there any suggestions and wishes for this port?
@stevedekorte
The text was updated successfully, but these errors were encountered: