expression type check #1
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#1
Loading…
Reference in New Issue
No description provided.
Delete Branch "pca006132/nac3:expression-type"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implemented expression type check and limited type inference for type variables.
The error messages are just for debugging, would be modified later to include location and more precise error messages.
The implementation is equivalent to the python implementation in https://git.m-labs.hk/pca006132/nac3-spec/src/branch/master/toy-impl
Tweaks have been made to account for the differences between the AST of python and rustpython parser, lifetime and performance limitation, and fixed some bugs in inference.
Primitives cannot be made into static const, as Rc cannot be shared across threads safely, and Arc would probably add too much overhead which is not really needed.
One optimization might be to include the primitives in the context object as fields, to reduce overhead and memory usage of initializing many different
Rc
s containing the same object. Would be implemented later.Expression and type inference are tested extensively.
98d34e74ef
to50ffded020
Looks great!
As discussed
parse_
functions inexpression.rs
should be renamed, and maybe break commits/PR into smaller chunks if possible.lyken referenced this pull request2024-08-28 13:24:15 +08:00
Pull request closed