-
Notifications
You must be signed in to change notification settings - Fork 51
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
Port to elpi 2.0 #708
Draft
gares
wants to merge
13
commits into
master
Choose a base branch
from
elpi-new-compiler
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Port to elpi 2.0 #708
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
gares
force-pushed
the
elpi-new-compiler
branch
3 times, most recently
from
November 15, 2024 09:20
c8ed413
to
d83271f
Compare
gares
force-pushed
the
elpi-new-compiler
branch
from
November 21, 2024 15:10
57aba65
to
08fc5e3
Compare
gares
force-pushed
the
elpi-new-compiler
branch
from
November 22, 2024 12:22
08fc5e3
to
dccde88
Compare
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.
The main visible change in Elpi 2.0 is that the compiler performs type checking incrementally (as units gets added to the base program) and reports error messages with a precise location. The new type checker is written in OCaml and is much faster, but a bit less permissive. Before this PR all type declarations were merged together before type checking the entire program. With Elpi 2.0 compilation units need to type check using the types declared inside them (or in the base they extend).
Elpi Typecheck
becomes useless.A subtle difference is that rules belonging to a Db are type checked against the Db only, not the programs that uses them or the program that generates them.
This means Db rules "work" in the context of any Db user. But rules cannot call any of the code of these programs (the type checker complains about undefined symbols). Unless the types of the predicates they call are also declared in the Db (not necessarily their code: ensuring that the code is finally available is left to the programmer for now).
Elpi Accumulate dbname File name.
can mitigate this issue by putting inname
the code (or at least the type declarations) needed by the rules in the Db.This PR also adds
Elpi File name code.
to declare a (virtual) file that can be easily accumulated to Dbs or Programs.This PR also adds a scope attribute to
Elpi Accumulate
, in particular#[superglobal] Elpi Accumulate dbname File stuff
ensure the Db always contains stuff (a bit like it did always contain its header).This PR adds a new command
Elpi Accumulate Db Header
to accumulate the header (type declaration typically) of a Db but not its code. The idiom is to accumulate the Db header early and the Db contents late. This can speed up the (re)compilation of large programs when the db is extended.TODO:
Elpi Accumulate File Signature foo.