This is a bit of a reminder about the purpose of the Rust runtime (currently on the branch misc-rust-rt).
The main reason to implement the PonieScript runtime in Rust is to drop the dependency on libc, particularly for the web. This simplifies things a bit given that the idea is for PonieScript to be eventually implemented in a game engine written in Rust.
The main things we might rely on libc for are:
- Formatting output
- memcpy
- Allocation
- Others..?
Of these, we have the following:
- Allocation: This is handled by the GC, which is already written in Rust.
- Formatting: This is the main reason to write the runtime in Rust right now. As of this writing, all of our formatted output goes through printf() and friends, which is a bit suboptimal.
- memcpy: This is probably the hardest one to drop. memcpy() is unfortunately, a very useful builtin as it is the best way to do type-punning. I'm not sure we actually have any calls to memcpy() right now, but the C compiler tends to want to have a memcpy() available in some way. I guess we will deal with this one as it comes.
In the short term, implementing the formatting in Rust would let us probably (?) start compiling C in a 'nostdlib' way, which would be quite nice.
This is a bit of a reminder about the purpose of the Rust runtime (currently on the branch misc-rust-rt).
The main reason to implement the PonieScript runtime in Rust is to drop the dependency on libc, particularly for the web. This simplifies things a bit given that the idea is for PonieScript to be eventually implemented in a game engine written in Rust.
The main things we might rely on libc for are:
Of these, we have the following:
In the short term, implementing the formatting in Rust would let us probably (?) start compiling C in a 'nostdlib' way, which would be quite nice.