Skip to content

v0.3.0-jinx2

Pre-release
Pre-release
Compare
Choose a tag to compare
@CohenArthur CohenArthur released this 07 Dec 15:28
· 708 commits to master since this release
50b1cdd

What's Changed

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!

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);

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.

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.

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.

Full Changelog: v0.3.0-jinx1...v0.3.0-jinx2