Status
Corfli 0.1.1 is the first working version. It handles small programs well; a lot is still to come.
Works now
- Whole numbers of every size,
bool,charand strings - Variables, constants, replacing with
:=,.addressand.destroy() if,while,forandswitch- Functions with default values, named values and
mutparameters - Several files with
include,globandpriv print,input,input.secretandexit- Programs for Linux, and Windows programs built on Linux
Every change is tested against a set of programs on Linux. Windows support is new and still being tested.
Speed
The code generator is simple for now: every value goes through memory. Compared with C built by gcc -O2:
| program | Corfli | C |
|---|---|---|
| recursive fib(35) | 0.109 s | 0.022 s |
| a loop of 300 million steps | 1.32 s | 0.38 s |
Closing that gap is phase 3.
Next
- Phase 2:
doubleandfloat, structs, enums, lists and maps, values that may be missing (?T) or fail (!T), string methods, program arguments,corfli test, andcorfli lspfor errors and types in the editor. - Phase 3: an optimizer and register allocation, aiming for the speed of C.
- Phase 4: SIMD types,
unsafeblocks and inline assembly. - Phase 5: a formatter, debug info, calling C libraries and threads.