Turn chaos into magic!
Chaos is a strongly typed, dynamic yet compilable, test-oriented procedural programming language that achieves zero cyclomatic complexity.
FOREVER
keywordif..else
, no switch..case
) Decision making only possible on function returns:
num def add(num x, num y)
num z = x + y
end {
z == 8 : f1(),
z > 10 : f2(),
default : f3()
}
while
or when
keywords. Loops are mostly predetermined. Infinite loops can only be achievable through the INFINITE
keyword.break
and continue
statements but breaking a multiline loop inside a function is forbidden.Install the requirements:
make requirements
Compile the Chaos source:
make
Install the chaos
binary system-wide:
make install
$ chaos
Chaos Language 0.2.0 (Jan 20 2021 02:39:23)
GCC version: 9.3.0 on linux
Turn chaos into magic!
kaos> print "hello world"
hello world
kaos> exit
Bye bye!
hello.kaos:
print "hello world"
$ chaos hello.kaos
hello world
$ chaos -c hello.kaos -o hello
Starting compiling...
Compiling Chaos code into build/hello.c
Compiling the C code into machine code...
Cleaning up the temporary files...
Finished compiling.
Binary is ready on: build/hello
$ build/hello
hello world
Run chaos --help
to see more options.
You can uninstall the chaos
binary and its C headers with:
make uninstall