Home

Awesome

.KEK-on-Rails

A C-like language interpreter

<pre> _ __ ___ _ __ | |/ / | __| | |/ / _ | ' < | _| | ' < _(_)_ |_|\_\ |___| |_|\_\ _|"""""|_|"""""|_|"""""|_|"""""| "`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' </pre>

FAQ

Features

Garbage collector flags

If you're testing something and it doesn't work, it's a good idea to turn off gc completely. Because there may be a bug in gc. There is a list of available options:

TODO

Debugging

Life is hard, but it's even harder when you program in C. Programming in reality is really different than what we can see in movies. We used Valgrind and GDB.

Valgrind

Example of running scheme from the root directory of the repository:

      make -C ../compiler && ../compiler/kekc scheme.kek ../tests/kexes/scheme.kexe && make -C ../vm && valgrind --show-leak-kinds=all --leak-check=full --track-origins=yes ../vm/kek ../tests/kexes/scheme.kexe

GDB

If you're lazy to write GDB command over and over, here are some one-liners;

      make -C ../vm && gdb -ex "set confirm off" -ex "file ../vm/kek" [INSERT BREAKPOINT HERE] -ex "set args ../tests/kexes/scheme.kexe sat.scm sat_in.txt" -ex "r"

some breakpoints we've used: