{"id":19872881,"url":"https://github.com/cyberfined/harakiri","last_synced_at":"2025-03-01T00:56:26.349Z","repository":{"id":191100623,"uuid":"339503777","full_name":"cyberfined/harakiri","owner":"cyberfined","description":"Compiler (without LLVM or GCC) for harakiri language","archived":false,"fork":false,"pushed_at":"2021-02-19T10:03:47.000Z","size":91,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-11T16:49:37.511Z","etag":null,"topics":["aarch64","compiler","harakiri","harakiri-language","haskell","imperative-programming-language","programming-language","register-allocation"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyberfined.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-02-16T19:14:02.000Z","updated_at":"2023-01-19T21:22:44.000Z","dependencies_parsed_at":"2023-08-28T06:04:12.975Z","dependency_job_id":null,"html_url":"https://github.com/cyberfined/harakiri","commit_stats":null,"previous_names":["cyberfined/harakiri"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberfined%2Fharakiri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberfined%2Fharakiri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberfined%2Fharakiri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberfined%2Fharakiri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyberfined","download_url":"https://codeload.github.com/cyberfined/harakiri/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241299529,"owners_count":19940485,"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":["aarch64","compiler","harakiri","harakiri-language","haskell","imperative-programming-language","programming-language","register-allocation"],"created_at":"2024-11-12T16:17:08.701Z","updated_at":"2025-03-01T00:56:26.331Z","avatar_url":"https://github.com/cyberfined.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Harakiri\r\n\r\nCompiler for a simple programming language named harakiri to an assembly. It's implemented without LLVM or GCC backend. \r\n\r\n## Supported architectures\r\n\r\n* Aarch64\r\n\r\n## Syntax\r\n\r\nAll supported constructions are used in the code below:\r\n\r\n```\r\ndef fib(n) {\r\n    if n \u003c= 2 {\r\n        return 1\r\n    }\r\n    return fib(n-1) + fib(n-2)\r\n}\r\n\r\ndef print_interval(from, to) {\r\n    while from \u003c to {\r\n        echo(from)\r\n        from = from + 1\r\n    }\r\n}\r\n\r\ndef main() {\r\n    echo(\"Enter mode: 0 - interval printer, 1 - fibonacci calculator\")\r\n    a = -1\r\n    while 1 {\r\n        a = input()\r\n        if a != 0 \u0026\u0026 a != 1 {\r\n            echo(\"Mode must be equal to 0 or 1\")\r\n        } else {\r\n            break\r\n        }\r\n    }\r\n    \r\n    if a == 0 {\r\n        echo(\"enter start value\")\r\n        a = input()\r\n        echo(\"enter end value\")\r\n        b = input()\r\n        print_interval(a, b)\r\n    } else {\r\n        echo(\"enter n to get n-th fibonacci number\")\r\n        a = input()\r\n        echo(a, \"-th fibonacci number is: \", fib(a))\r\n    }\r\n}\r\n```\r\n\r\n## Supported operations\r\n\r\n| operation | unary or binary | description              |\r\n|-----------|-----------------|--------------------------|\r\n| -         | unary           | negate                   |\r\n| +         | binary          | addition                 |\r\n| -         | binary          | subtraction              |\r\n| *         | binary          | multiplication           |\r\n| /         | binary          | division                 |\r\n| ==        | binary          | equal to                 |\r\n| !=        | binary          | not equal to             |\r\n| \u003c         | binary          | lower than               |\r\n| \u003c=        | binary          | lower than or equal to   |\r\n| \u003e         | binary          | greater than             |\r\n| \u003e=        | binary          | greater than or equal to |\r\n| \u0026\u0026        | binary          | boolean and              |\r\n| \\|\\|      | binary          | boolean or               |\r\n\r\n## Implemented parts\r\n\r\n- [x] Parser\r\n- [x] Type checker\r\n- [x] IR generation\r\n- [x] Assembly language code generation\r\n- [ ] IR optimizations\r\n\r\n## Usage\r\n\r\n```\r\nUsage: harakiri [-v|--version] [-t|--dump-ast] [-i|--dump-ir] [-a|--arch ARCH] \r\n                [-p|--platform OS] [-c PATH] [-o PATH] [-l PATH] \r\n                [--as-path PATH] [--ld-path PATH]\r\n\r\nAvailable options:\r\n  -v,--version             Display compiler version information\r\n  -t,--dump-ast            Dump AST representation\r\n  -i,--dump-ir             Dump intermediate representation\r\n  -a,--arch ARCH           Set target architecture (default: aarch64)\r\n  -p,--platform OS         Set target operating system (default: linux)\r\n  -c PATH                  Set source file\r\n  -o PATH                  Set output file\r\n  -l PATH                  Set standard library path\r\n  --as-path PATH           Set path to the assembler\r\n  --ld-path PATH           Set path to the linker\r\n  -h,--help                Show this help text\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberfined%2Fharakiri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyberfined%2Fharakiri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberfined%2Fharakiri/lists"}