risc0
risc0 copied to clipboard
Refactor the `entry` macro as an atrribute
Currently the entry
macro in risc0_zkvm::guest
has the syntax of entry!(main)
. It would be more stylish (😎) to have it be an attribute so it would be #[entry] fn main() {}
.
This issue only a style concern, with no functional impact. If we do want to do this, we would want to do it before 1.0, but if we don't it's fine.
(is there a way to not require entry!
? since it is naturally that the function called main
would be the main)
Under no_std
, there doesn't seem to be a way to avoid some sort of mechanism to mark what the entrypoint is.
This issue only a style concern, with no functional impact
Argument could be made that it's also functionally different because you can parse the function to give more targeted span errors for what about the function makes it incompatible, for a better DevX. Also, if it's ever wanted to include some logic you can only do in proc macros, like parsing any code within the function or signature, you don't need to make breaking changes.
I'm thinking we should long term try to move towards using std
for most things, assuming std
doesn't cost us much overhead.