zeolite-lang v0.10.0.0 Release Notes
Release Date: 2020-12-05 // over 4 years ago-
Language
[breaking] Major changes to
.0rt
syntax:- [breaking] Removes the expression argument from
success
andcrash
testcase
types. Use one or moreunittest
(see next point) instead. - [new] Adds
unittest
keyword to allow the user to define multiple tests within a singlesuccess
testcase
.
testcase "simple tests" { success } unittest checkInvariant1 { // this is a regular procedure with no return } unittest checkInvariant2 { // this is a regular procedure with no return }
This allows multiple tests to use the same setup, while still being able to track multiple test failures.
error
andcrash
testcase
types are still available.- [breaking] Allows
testcase
to statically setArgv
(seelib/util
) using theargs
keyword. By default, only the program name is set. Previously,Argv
used whatever was passed to the test binary.
testcase "with static Argv" { success args "arg1" "arg2" } unittest test { // something that requires Argv.global() }
Note that this isn't a library change; this also affects C++ extensions that use
Argv
frombase/logging.hpp
.- [new] Adds
compiles
mode fortestcase
. This is likesuccess
except nothing is executed. (success
requires at least oneunittest
, whereascompiles
will not execute anything even ifunittest
are present.)
- [breaking] Removes the expression argument from
Libraries
- [new] Adds the
lib/testing
library with basic helpers for unit tests.
Compiler CLI
[new] Updates parsing of
.zeolite-module
to allow any ordering of the fields. Previously, the fields needed to be in a very specific order.[fix] Adds compile-time protection against self-referential expression macros defined in
expression_map:
in.zeolite-module
. Previously, the result was infinite recursion that could exhaust system resources.[breaking] Adds an error when
root
/path
in.zeolite-module
differs from the location of the respective.zeolite-module
. This is to catch both typos (e.g., copy-and-paste errors) and ambiguities.
Previous changes from v0.9.0.0
-
Compiler CLI
[breaking] Major changes to C++ extensions:
- [breaking] Corrects hole in
$ModuleOnly$
visibility in C++ extensions. Previously, C++ extensions could directly access categories defined in$ModuleOnly$
sources in dependencies. - [breaking] Randomizes cache paths and
namespace
s for generated C++ code so that C++ extensions cannot use static#include
paths to circumvent the visibility rules of a dependency. - [breaking] Makes
TypeInstance
s shared in generated C++ and in C++ extensions, to allow for better memory management of@type
s in the future. - [breaking] Adds guards to C++ headers for
$TestsOnly$
categories, to prevent them from being used in non-$TestsOnly$
C++ extensions.
- [breaking] Corrects hole in
[fix] Fixes regression where calling
zeolite
with-p
would overwrite an existing.zeolite-module
.
Language
[breaking] Syntax changes:
- [breaking] Changes the syntax for calling
@category
functions from$$
to:
, e.g.,Foo:create()
instead ofFoo$$create()
. A new error message (to be removed later) will remind the user to stop using$$
. - [breaking] Changes the syntax for calling
@type
functions from$
to.
, e.g.,Foo.create()
instead ofFoo$create()
. A new error message (to be removed later) will remind the user to stop using$
.
- [breaking] Changes the syntax for calling
[breaking] Changes to param usage:
- [breaking] Updates param inference to be more accurate. The new algorithm will infer a param type iff the best choice is unambiguous given the expected and actual function arguments.
- [breaking] Disallows bounding a single param both above and below, e.g.,
having both
#x requires Foo
and#x allows Bar
. This is primarily to prevent cycles and contradictions in the type system.
Previously, the best case for such restrictions was that there are extremely few choices for
#x
, and the worst case was that it impliesBar
converts toFoo
when it isn't true, thus making#x
unusable. Having either of those requirements likely indicates a design flaw.[breaking] Prohibits having a
$TestsOnly$
definition for a non-$TestsOnly$
category. Previously, aconcrete
category declared in a non-$TestsOnly$
.0rp
could bedefine
d in a$TestsOnly$
.0rx
, which creates a loophole that allows binaries to utilize$TestsOnly$
code.[fix] Fixes a latent type-checking bug that could occur when attempting to assign a value with an intersection type to a variable with a union type, if one or both types has another nested type, e.g.,
[A&B]
→[[A&B]|C]
or[[A|B]&C]
→[A|B]
. This change shouldn't cause new type-checking failures.
Libraries
- [fix] Implements
subSequence
forArgv
inlib/util
. This is required byReadPosition
but was forgotten. Calling it prior to this would cause a failure.