-
Notifications
You must be signed in to change notification settings - Fork 2
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
test the reference implementation #120
Merged
Merged
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 makes `desugar` at least work not fail for currently unhandled syntax.
The exception type is needed for catching failures escaping `interpret`.
The module is now compiled as part of the `spectest` program.
The interpreter doesn't detect infinite recursion and simply crashes due to a stack overflow, making it a necessity to fix the issue already.
The step is integrated into the existing job, as it's too small to warrant its own job.
The current plan going forward is as follows:
Work on new language features can continue in parallel. All tests not included in the |
The `mut` qualifier is an implementation detail not relevant to outside use.
saem
approved these changes
Mar 8, 2025
The cache may be modified by `interpret`, which can result in the storage location of the iterated-over `seq` changing, thus causing the reference passed to `mitems` becoming stale.
#121 introduced a parameter aliasing violation leading to the previous CI failure. I've fixed it and updated the PR message accordingly. |
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.
Summary
Also run the
expr
tests using the source language referenceimplementation
languages/source.nim
, to make sure that thereference/specification implements/describes the desired semantics.
Details
As a temporary solution, a standalone test orchestrator is used that
scans the
expr
directory for test files. For each test file, thespec is extracted and (the relevant bits of it) parsed, with the test
content then parsed into a representation understood by the meta-
language interpreter.
The processing pipeline is: desugar -> type-check -> evaluate. Stages
are enabled/disabled based on the test specification. Failing tests
don't result in an orchestrator error, so that they can be fixed
incrementally; the list of known issues is hard-coded and needs to be
updated manually once more tests start to succeed.
There are many issues with the reference implementation as is, and
therefore not all tests can be run successfully at the moment.
A few small changes/additions are made to
source
, so that at leastsome tests work:
cstep
relation is added tosource
, which is the transitiveclosure of
step
. It's used for fully reducing (i.e., evaluating)an expression
<:=
relation is fixeddesugar
so that the functiondoesn't fail for unhandled input
Finally, a dangling reference caused by a parameter aliasing violation
with the
mitems
's iterator usage ininterpretRelation
is fixed.