-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Feature] Introduces V2 programs. #2634
base: feat/cycle-protections
Are you sure you want to change the base?
Conversation
#[test] | ||
fn test_bytes() -> Result<()> { | ||
let program = r" | ||
program$2 token.aleo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my humble POV, I'm not a fan of adding a new symbol $
to the syntax - even if we don't typically expose aleo instructions to end users. Also because it doesn't work the same way like it does in the other syntax everyone knows (shell scripts).
- For program version: what about a new keyword like
version
which we declare afterimport
and beforeprogram
? Related: I thinkmetadata.version
in the PR description should be changed tometadata.edition
. - For metadata we could simply drop the
$
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have strong opinions here. I'll leave it to the reviewers to arbitrate on syntax.
FWIW, I feel like the version
keyword doesn't create enough of a conceptual separation but I can be convinced if I stare at some programs long enough.
674c7e2
to
ef33b61
Compare
ef33b61
to
aa91004
Compare
aa91004
to
2250f82
Compare
This PR introduces the syntax for V2 programs.
At a high level, V2 programs:
program$2
keywordstruct
,record
,mapping
,function
,closure
, andimport
._init
keyword. Constructors must be specified after the above constructs.$metadata
to the program. Metadata must be specified after the constructor.Here is an example of a V2 program.
The implementation for V2 programs will be included in a following PR.
Testing
test_program_serde