Releases: LPCIC/elpi
2.0.6
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0
CHANGES:
Requires Menhir 20211230 and OCaml 4.08 or above.
-
Compiler:
-
Change the pipeline completely to make unit relocation unnecessary. Current
phases are (roughly):Ast.program—[RecoverStructure]—>Ast.Structured.programAst.Structured.program—[Scope,Quotation,Macro]—>Scoped.program(akaAPI.Compile.scoped_program)Scoped.program—[Flatten]—>Flat.programFlat.program—[Check]—>CheckedFlat.program(akaAPI.Compile.compilation_unit)CheckedFlat.program—[Spill,ToDbl]—>Assembled.program
Steps 4 and 5 operate on a base, that is an
Assembled.programbeing
extended.ToDblis in charge of allocating constants (numbers) for global
names and takes place when the unit is assembled on the base. These
constants don't need to be relocated as in the previous backend that
would allocate these constants much earlier. -
Change compilation units can declare new builtin predicates
-
Fix macros are hygienic
-
New type checker written in OCaml. The new type checker is faster,
reports error messages with a precise location and performs checking
incrementally when the API for separate compilation is used.
The new type checker is a bit less permissive since the old one would
merged together all types declaration before type checking the entire
program, while the new one type checks each unit using the types declared
inside the unit or declared in the base it extends, but not the types
declared in units that (will) follow it. -
Remove the need of
typeabbrv string (ctype "string")and similar -
New type check types and kinds (used to be ignored).
-
-
API:
- Change quotations generate
Ast.Term.tand notRawData.t. The data
typeAst.Term.tcontains locations (for locating type errors) and
has named (bound) variables and type annotations inAst.Type.t. - New
Compile.extend_signatureandCompile.signatureto extend a
program with the signature (the types, not the code) of a unit - New
Ast.Loc.tcarries a opaque payload defined by the host application - Remove
Query, onlyRawQueryis available (orCompile.query)
- Change quotations generate
-
Parser:
- Remove legacy parser
- New
% elpi:if version op A.B.Cand% elpi:endiflexing directives - New warning for
A => B, Cto be disabled by putting parentheses
aroundA => B.
-
Language:
- New infix
==>standing for application but with "the right precedence™",
i.e.A ==> B, CmeansA => (B, C). - New
predis allowed in anonymous predicates, eg:
pred map i:list A, i:(pred i:A, o:B), o:list Bdeclares that the first
argument ofmapis a predicate whose first argument is in input and
the second in output. Currently the mode checker is still in development,
annotations for higher order arguments are ignored. - New attribute
:functionalcan be passed to predicates (but not types).
For example,:functional pred map i:list A, i:(:functional pred i:A, o:B), o:list B
declaresmapto be a functional predicate iff its higher order argument is
functional. Currently the determinacy checker is still in development, these
annotations are ignored. - New
funckeyword standing for:functional pred. The declaration above
can be shortened tofunc map i:list A, i:(func i:A, o:B), o:list B. - New type annotations on variables quantified by
pias inpi x : term \ ... - New type casts on terms, as in
f (x : term) - New attribute
:untypedto skip the type checking of a rule.
- New infix
-
Stdlib:
- New
std.list.init N E Lbuilds a listL = [E, ..., E]with lengthN - New
std.list.make N F Lbuilds the listL = [F 0, F 1, ..., F (N-1)] - New
tripledata type with constructortripleand projectionstriple_1...
- New
-
Builtins:
- Remove
string_to_term,read,readterm,quote_syntax
- Remove
-
REPL:
- Remove
-no-tc,-legacy-parser,-legacy-parser-available - New
-document-infix-syntax
- Remove
1.20.0
CHANGES:
Requires Menhir 20211230 and OCaml 4.08 or above.
-
Language:
- attribute
:removeto remove a clause from the program
- attribute
-
Compiler:
- Build the index at assembly time, rather than optimization time.
This makes compilation slower, but startup faster. - Adding clauses before the type/mode declaration of a predicate
is now forbidden, since they are immediately inserted in the index
and the type/mode declaration can change the index type
- Build the index at assembly time, rather than optimization time.
1.19.6
1.19.5
CHANGES:
Requires Menhir 20211230 and OCaml 4.08 or above.
-
Compiler:
- Improve performance of separate compilation
-
CHR:
- Syntax extension for constraint declaration.
- This aims to avoid the
overlappingclique error - Example:
constraint c t x ?- p1 p2 { rule (Ctx ?- ...) <=> (Ctx => ...) } c,tandxare the symbols which should be loaded in the rule of the
constraint and should be considered as symbols composing the context (Ctx)
under whichp1andp2are used.