Advanced Examples

These examples are intended to demonstrate the trickier corners and advanced use cases of the Kronos language.

Compile Time Computation

Kronos produces runtime code that is both deterministic and simple. Therefore, most of the abstraction you can use to generate complex patches takes place at compile time.

Tue Jun 9, 2020
Read more...

Extending Functions

One of the age-old rifts between programmers is the one between those who think that using the operator + for strings makes sense and those who are right. In this example, we will finally settle this debate with the only semantics that make sense, and on the way, we learn how to extend built-in functions in Kronos.

Tue Jun 9, 2020
Read more...

Writing Polymorphic Functions

Kronos functions can be polymorphic. At the lowest level, you have access to a compile time if. Yes, it is Turing complete. Making full use of that is probably not a good idea - most type systems are incomplete by design. Fortunately we have quite reasonable abstractions for you to fall back on.

Tue Jun 9, 2020
Read more...