Corfli
Corfli is a small compiled language for Linux and Windows. It's easy to read and builds native x86-64 programs that need nothing else to run.
fn grade(int score) -> string {
switch score {
case 90 to 100: return "A"
case 80 to 89: return "B"
case 70 to 79: return "C"
default: return "keep going"
}
}
print("noa: {grade(93)}")
print("dan: {grade(78)}")
print("tal: {grade(51)}")
noa: A
dan: C
tal: keep going
Small programs
Corfli writes the executable itself, with no C library inside, so programs stay small.
| hello world | Corfli | C |
|---|---|---|
| Linux | 299 bytes | 15,960 bytes |
| Windows | 1,024 bytes | 39,936 bytes |
C was built with gcc -O2 on Linux and MinGW gcc -O2 -s for Windows.
What it has
- One tool.
corfli newmakes a project,corfli runruns it, andcorfli build -wmakes a Windows.exeon Linux. - Text that can't overflow. Strings know their own length, and
inputreads a line of any length and asks again when the answer is wrong. - Errors that point at the spot. Mistakes are shown with the line and a marker under them. Dividing by zero or a number that doesn't fit stops the program with the file and line.
- destroy.
password.destroy()wipes the value from memory and removes the name.
Try it
$ curl -LO https://corfli.nitaimaarek.com/download/corfli-0.1.1-1-x86_64.pkg.tar.zst
$ sudo pacman -U corfli-0.1.1-1-x86_64.pkg.tar.zst
$ corfli new hello
$ cd hello
$ corfli run
For other Linux systems, see Download. Then read Getting started.
Corfli is new, and version 0.1.1 covers the basics. Status lists what works and what comes next.