Skip to content
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

Expand reduceBool and add reduceSlice #197

Closed
wants to merge 4 commits into from

Conversation

Gusarich
Copy link
Member

resolves tact-lang/tact-docs#195

I didn't cover that with new tests yet, going to do it soon

@Gusarich Gusarich force-pushed the boolean-reduces-upgrade branch from 8c39829 to 2cd58d0 Compare March 27, 2024 09:46
CHANGELOG.md Outdated Show resolved Hide resolved
src/types/resolveConstantValue.ts Show resolved Hide resolved
src/types/resolveConstantValue.ts Show resolved Hide resolved
src/types/resolveConstantValue.ts Outdated Show resolved Hide resolved
Gusarich and others added 2 commits March 27, 2024 19:46
Co-authored-by: byakuren-hijiri <159621697+byakuren-hijiri@users.noreply.github.com>
@Gusarich Gusarich marked this pull request as draft March 27, 2024 17:10
@Gusarich
Copy link
Member Author

Current implementation doesn't actually work and throws errors on compiling new test cases.
I'll investigate the problem and try to fix it.

@anton-trunov
Copy link
Member

The issue here is that constant evaluation is performed on a non-typechecked AST. So when you call getExpType to dispatch on the type of == / != operators, there is no actual type information. The proper fix here would be to refactor the compiler to perform constant evaluation after typechecking (and to actually do this refactoring we need a new type describing typed ASTs).

@anton-trunov anton-trunov added this to the v1.4.0 milestone Apr 21, 2024
@Gusarich Gusarich modified the milestones: v1.4.0, v1.5.0 Jun 11, 2024
@anton-trunov
Copy link
Member

Looks like this PR should be closed now? Because the architecture of the constant evaluator has changed a lot in #432. Of course, we can still improve a lot of things in the constant evaluator, adding support for slices would be especially nice.

@Gusarich
Copy link
Member Author

yes, right

@Gusarich Gusarich closed this Jun 19, 2024
@Gusarich Gusarich deleted the boolean-reduces-upgrade branch June 19, 2024 08:21
@verytactical verytactical added the scope: partial-eval The constant and partial evaluation optimization mechanisms (src/optimizer/constEval.ts) label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: partial-eval The constant and partial evaluation optimization mechanisms (src/optimizer/constEval.ts)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change all map<k, v> occurences to map<K, V> to conform to grammar.ohm
4 participants