Description
We currently have a target called riscv32im-risc0-zkvm-elf
, which targets the RISC Zero Zero Knowledge VM. This target is maintained by @SchmErik, @jbruestle, @flaub #134721 has revealed some issues in this target.
The biggest issue is that the target sets target_os = "zkvm"
. A "Zero Knowledge VM" is a generic concept and not an operating system. The correct target_os
would be risc0
.
But there is another question, whether this target should exist in the first place. The alternative to this target would be using the existing riscv32im-unknown-none-elf
target with a RISC0-provided crate for the system calls.
The thing that is currently gained from having this target is that it can have std
, where the very few syscalls that exist are used to implement some standard library interfaces.
Concretely, the following functionality is provided:
- program arguments
- environment variables (read-only)
- stdio
- the system global allocator
- and of course HashMap
- (no_threads) std::sync
other features like std::fs
, std::io
, std::process
, std::thread
, std::time
, std::net
are not supported.
@SchmErik, who is a maintainer of the target, highlights how the std
support is useful in #134721 (comment):
Having std support is important to us because it allows developers to use crates outside of no_std. This has enabled many others to use our target much more easily with existing crates
Additionally, they mentioned how having the target allows them to add cfgs to forked ecosystem crates to make them use more of RISC Zero's APIs (though this could also be implemented without a target and a normal custom cfg).
It is always unsatisfactory to have targets with such incomplete standard libraries (at least it's not as bad as wasm32-unknown-unknown
in this case). On the other hand, (just like the wasm target) the APIs that are implemented are likely useful.
This issue is about figuring out what to do with this target, whether to keep it (renamed) or remove it alltogether.