-
Notifications
You must be signed in to change notification settings - Fork 38
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
improve memory consumption ; add Z# strict unary op, ternary ?:, and type aliases #77
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit adds Drop instances and related functionality that force garbage collection at life cycle end of various structs that contain Terms. I didn't implement Drop for Computation because its Terms are generally moved into a converter. This means that back-ends are responsible for garbage collecting (see new functionality in ILP, R1cs, and ABY).
also added err messages for asserts and ?: ternary support from ZoK upstream
Still missing monomorphization.
things work except that importing an alias and not its referent breaks typechecking
alex-ozdemir
approved these changes
Apr 26, 2022
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.
Looks good to me, pending the manifest reversion.
(and sorry: I didn't notice the other PR)
OK, updated Cargo.lock and Cargo.toml. Assuming the build goes OK, g2g from my end! |
elefthei
pushed a commit
to elefthei/circ
that referenced
this pull request
Oct 11, 2022
…type aliases (circify#77) * update TODO * add quiet mode to zxc * Drop and garbage collection This commit adds Drop instances and related functionality that force garbage collection at life cycle end of various structs that contain Terms. I didn't implement Drop for Computation because its Terms are generally moved into a converter. This means that back-ends are responsible for garbage collecting (see new functionality in ILP, R1cs, and ABY). * collect the cfold table, too * prevent double-panic as a result of garbage_collect() * z# parser: zx is a default extension too * update Cargo.lock * strictness un-op #() also added err messages for asserts and ?: ternary support from ZoK upstream * for assignments, strict rhs => strict lhs * zsharp: type definitions WIP Still missing monomorphization. * type defns: generic inference * struct monomorphization for type aliased structs * different approach: no monomorphization, just canonicalize aliases * canonicalize struct names * typedef tests things work except that importing an alias and not its referent breaks typechecking * add error message about needing to import referent structs * update hashconsing pointer in Cargo.toml * maybe_garbage_collect should also return early when panicking Co-authored-by: Alex Ozdemir <aozdemir@hmc.edu>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR breaks cycles between the term cache and the constant folding machinery. It also adds a couple Drop implementations that explicitly call the garbage collector (the C front-end might want one, too---not sure!)
For Z#, this adds
#
that strictly evaluates (i.e., constant folds) its argument. As a special case, an assignment's RHS is treated strictly if its LHS is#( ... )
condition ? consequent : alternative
flavor of ternary operator - exactly the same asif foo then bar else baz fi
type Foo = field[7]
or whatever.Typedefs have one limitation: if a typedef
Bar
refers to a structFoo
in module A, then to useBar
in module B one must also importFoo
.@alex-ozdemir: before we land this PR, we should land alex-ozdemir/hashconsing#2 and then I should update Cargo.lock to point to your repo again.