v0.3.0-jinx2
Pre-releaseWhat's Changed
- Allow multi type parsing by @CohenArthur in #349
- Parse list of generic types in function declaration by @CohenArthur in #341
- Type instantiation and Function calls generics by @CohenArthur in #343
- Parse generic type declarations by @CohenArthur in #380
These PRs add the parsing of generic types in function calls, type
instantiations, function declarations and type declarations. The syntax is the
following:
type SomeType[T](member: T);
type OtherType[T, U, V](member: T, member2: U, member3: V);
func takes_generic[T](arg: T) -> T { ... }
instance = SomeType[T](member: some_argument);
takes_generic[T](some_argument);
Thanks to @Skallwar, we now have LTO release builds which are much smaller than
previously. Thanks to you and @tanguysegarra 's efforts, this means we have a
1.9MB large docker image for jinko!
- Parse and instantiate empty types by @CohenArthur in #348
This enables the concept of empty-types or value-types: Types that can be instantiated,
but do not contain any fields. They provide a lot of type safety and can be optimized
and removed completely very easily. The syntax is the following:
type Empty; // declaration
e = Empty; // instantiation
They allow the Maybe
type to be implemented in the following fashion:
type Nothing;
type Maybe[T](inner: T | Nothing);
They also allow the representation of enums once we have multi-types:
type Horse;
type Cat;
type Dog;
type Animal(Horse | Cat | Dog);
-
Add
NoReturn
type by @CohenArthur in #382 -
binop: Allow binary operation as boolean by @CohenArthur in #394
-
Allow function calls as booleans by @CohenArthur in #383
Thanks to @Skallwar, it is now much cleaner to execute expressions and cast
them as booleans for if-else conditions. Since we now have a typechecker, we
can completely avoid checking the type of variables also at execution. This should speed
up the interpreter and improve safety overall.
- docker: use alpine instead of debian by @tanguysegarra in #397
- ci: add docker stage by @tanguysegarra in #398
- ci: add specific dockerhub releases by @tanguysegarra in #411
- ci: remove docker release when push to master by @tanguysegarra in #413
We now have a fantastic Dockerfile and docker image on hub.docker.com thanks to
@tanguysegarra. It is build automatically on each push to master and available as
jinko/jinko:latest
.
- Add --test flag to the interpreter by @CohenArthur in #399
We can now run tests declared in a file with the test
keyword! Once we have a few more
abstractions, we will be able to write testsuites entirely in jinko. What is currently
missing is an assertion
library, as well as a few abstractions.
- Resolve fixed parser issues by @CohenArthur in #393
- Add Args.count() by @CohenArthur in #381
- Fix arg_get builtin by @Skallwar in #391
- Fix empty string parsing by @Skallwar in #405
- Release v0.3.0-jinx2 by @CohenArthur in #412
- Switch to Rust edition 2021 by @Skallwar in #385
- Rename Token::type_tok by @Skallwar in #386
Full Changelog: v0.3.0-jinx1...v0.3.0-jinx2