Skip to content

Core 0.1.3

Pre-release
Pre-release

Choose a tag to compare

@zweiler1 zweiler1 released this 18 Jul 22:25
· 1399 commits to main since this release
b34407b

Changelog

  • Added a test-suite written in Flint to test all the examples of the Flint Wiki as a regression-testing system
  • Completely refactored the whole Parser (which took nearly 2 weeks of time) to make adding new features much smoother in the future
  • Added switch statements and expressions to Flint
use Core.print

enum MyEnum:
    VAL1, VAL2, VAL3, VAL4;

def main():
    MyEnum me = MyEnum.VAL2;
    switch me:
        VAL1: print("is val1\n");
        VAL2: print("is val2\n");
        else: print("is val3 or val4\n");

    i32 res = switch me:
        VAL1 -> 1;
        VAL2 -> 2;
        else -> 0;
  • Added ability to write a single statement right next to the colon of a switch body, where the whole switch's body is only this single statement. This does not yet work for other scoped statements, but it is planned for them.
  • Added default-branching of the switch statement and expression through the else branch
  • Added support to be able to switch on more primitive types (str does not work yet)
  • Addes support for the Optional type:
use Core.print

def main():
    i32? maybe = 69;
    if maybe != none:
        print($"maybe = {maybe!}\n");
    maybe = none;
    i32 res = maybe ?? 0;
  • Added ability to switch on optional variables
  • Added the ! postfix unwrap-operator to force-unwrap an optional, which hard crashes when the optional has no value
  • Added the ?? null coalescence operator to provide default-values for optionals
  • Added the ability to compare optional values with the none literal and with one another
  • Improved the build.sh and profile.sh scripts with more flags
  • Improved the general build time using the build.sh script, as it now skips building LLVM entirely if it's out directory already exists, reducing build time from 40+ seconds to be mostly in the 10+ second range
  • Fixed for loops being always infinite loops, a mistake from the last release
  • Fixed a lot of other issues and bugs

Full Changelog: v0.1.2-core...v0.1.3-core