{"id":13781347,"url":"https://github.com/nohajc/.KEK-on-Rails","last_synced_at":"2025-05-11T14:34:59.233Z","repository":{"id":67728636,"uuid":"44069235","full_name":"nohajc/.KEK-on-Rails","owner":"nohajc","description":"A C-like language interpreter","archived":false,"fork":false,"pushed_at":"2019-11-10T23:20:25.000Z","size":646,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-17T16:42:38.834Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nohajc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-10-11T20:52:57.000Z","updated_at":"2019-11-10T23:20:28.000Z","dependencies_parsed_at":"2023-02-23T03:30:23.582Z","dependency_job_id":null,"html_url":"https://github.com/nohajc/.KEK-on-Rails","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nohajc%2F.KEK-on-Rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nohajc%2F.KEK-on-Rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nohajc%2F.KEK-on-Rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nohajc%2F.KEK-on-Rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nohajc","download_url":"https://codeload.github.com/nohajc/.KEK-on-Rails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253580371,"owners_count":21930932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T18:01:25.119Z","updated_at":"2025-05-11T14:34:58.940Z","avatar_url":"https://github.com/nohajc.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# .KEK-on-Rails\nA C-like language interpreter\n\u003cpre\u003e\n          _  __    ___    _  __  \n         | |/ /   | __|  | |/ /  \n    _    | ' \u003c    | _|   | ' \u003c   \n  _(_)_  |_|\\_\\   |___|  |_|\\_\\  \n_|\"\"\"\"\"|_|\"\"\"\"\"|_|\"\"\"\"\"|_|\"\"\"\"\"| \n\"`-0-0-'\"`-0-0-'\"`-0-0-'\"`-0-0-' \n\u003c/pre\u003e\n\n# FAQ\n\n- Q: i've clonned .kek but i can't find it plshelp\n- A: git clone https://github.com/nohajc/.KEK-on-Rails dotKEK-on-Rails\n\n# Features\n- Object oriented language with inheritance and dynamic dispatch\n- Dynamic type system\n- Exception handling\n- Growing arrays (like C++ vectors)\n- Tail call optimization (automatically detects RET after CALL and reuses stack frame)\n- Tagged integers and chars\n- Inline cache\n- Cheney's copying GC\n\n# Garbage collector flags\nIf 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:\n - **-gN** or **-g none** no gc at all. The virtual machine will use just malloc underneath. All memory is stored in a global LL and free'd at the end of the vm. state: **working without any known bugs**\n - **-gn** or **-g new** only new space. All objects are created in to-space. When there is no space for an obj we want to allocate, the Cheney's copying GC swaps to- and from- space, and copy live object back to the to- space. state: **working without any known bugs**\n - **-gg** or **-g gen** generational gc. It's almost the same as the previous mehthod, but if an obj survives in new space for two Cheney's copying, the object is moved into the old space. state: **there are some rare bugs**\n - **-gG** or **-g genmas** generational gc with mark-and-sweep algorithm in old space. state: **not yet implemented**\n - **-gM** or **-g genmasmac** generational gc with mark-and-sweep and mark-and-compact algorithm in old space. state: **not yet implemented**\n\n# TODO\n- generational gc with mark-and-sweep and mark-and-copy\n- one classfile per class\n- native class wrapping SDL\n- lambda functions\n- closures\n- continuations\n- JIT\n\n# Debugging\nLife 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.\n\n## Valgrind\nExample of running scheme from the root directory of the repository:\n\n          make -C ../compiler \u0026\u0026 ../compiler/kekc scheme.kek ../tests/kexes/scheme.kexe \u0026\u0026 make -C ../vm \u0026\u0026 valgrind --show-leak-kinds=all --leak-check=full --track-origins=yes ../vm/kek ../tests/kexes/scheme.kexe\n\n## GDB\nIf you're lazy to write GDB command over and over, here are some one-liners;\n\n          make -C ../vm \u0026\u0026 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\"\n\nsome breakpoints we've used:\n - -ex \"break vm.c:616 if tick == 10450\"\n - -ex \"watch *0x7ffff6da51d0\"\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnohajc%2F.KEK-on-Rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnohajc%2F.KEK-on-Rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnohajc%2F.KEK-on-Rails/lists"}