{"id":28473403,"url":"https://github.com/kirillzhosul/gofra","last_synced_at":"2025-07-02T02:31:09.217Z","repository":{"id":39659534,"uuid":"423793364","full_name":"kirillzhosul/gofra","owner":"kirillzhosul","description":"Concatenative (stack based) compiled (native) programming language","archived":false,"fork":false,"pushed_at":"2025-06-02T02:11:50.000Z","size":393,"stargazers_count":15,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-07T12:07:06.046Z","etag":null,"topics":["assembler","compiler","compilers","language","programming-language","stack-based-language"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kirillzhosul.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-11-02T10:10:20.000Z","updated_at":"2025-06-02T02:11:53.000Z","dependencies_parsed_at":"2025-02-09T09:25:56.804Z","dependency_job_id":"3765d504-d6b1-4f33-baad-09da4c490f1a","html_url":"https://github.com/kirillzhosul/gofra","commit_stats":null,"previous_names":["gofralang/gofra","kirillzhosul/gofra"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kirillzhosul/gofra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillzhosul%2Fgofra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillzhosul%2Fgofra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillzhosul%2Fgofra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillzhosul%2Fgofra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kirillzhosul","download_url":"https://codeload.github.com/kirillzhosul/gofra/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillzhosul%2Fgofra/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263063943,"owners_count":23408021,"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":["assembler","compiler","compilers","language","programming-language","stack-based-language"],"created_at":"2025-06-07T12:07:06.767Z","updated_at":"2025-07-02T02:31:09.206Z","avatar_url":"https://github.com/kirillzhosul.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gofra Programming Language\n\nGofra is an native stack based programming language.\n\nLanguage follows reverse polish notation (examples can be found below) \\\n**Language is in development stage and mostly made for fun and research so don't expect a lot and try to test or implement your own idea**\n\n## Table of content\n\n- [Hello world example](#hello-world-example)\n- [Compatibility](#compatibility)\n- [Features](#features)\n- [Installation](#installation)\n- [Examples](#examples)\n- [Language overview](#language-overview)\n- [Command Line Interface](#command-line-interface-cli)\n- [Milestones and planned features](#milestones-and-planned-features)\n\n---\n\n### Hello world example\n###### (For now, language is mostly bare-metal so in this example there is raw `sc_write` syscall and file descriptor usage)\n```\ninclude \"std.gof\"\nfunc void main\n    FD_STD_OUT \"Hello, World!\\n\" sc_write drop\nend\n```\n\n\n### Compatibility\nLanguage currently have codegenS only for:\n- AARCH64 MacOS (Darwin)\n- x86_64 Linux\n\n### Features\n- Native (codegen assembly)\n- Type safety (Validates stack usage and tries to infer types so you wont mess up)\n- Mostly self explanation errors (Tries to help you and correct your intentions)\n- Optimizer (DCE, CF, Helps optimize resulting assembly for codegen so your default usage will not be overwhelmed by language)\n- FFI with `global`/`extern` function modifers (there is CLI flags to emit an library/object file)\n- Simple CLI for working with language (simple toolkit)\n\n\n### Installation\n- Clone this repo\n- Install latest Python version\n- Navigate to root directory \n- Run `python -m gofra --help` (`python` depends on your installation of Python)\n\n### Examples\nExamples may be found inside `./examples` directory\n\n### Language overview\nAs language is stack based so your basic action is to *put something on a stack*, like `2 2` will push 2 and then another 2 on stack so stack underneath will look like [2, 2]\n\nIf you want to operate on that numbers you may do something like `3 2 +` which is same as `3 + 2` in other language or default math. Underneath this will mean: push 3 on stack -\u003e push 2 on stack -\u003e take 2 elements from stack -\u003e sum them -\u003e push result back. Stack after that will become [5]\n\nConditionals is also a bit controversial:\n```\n1 2 == if\n    ...\nend\n```\nwhich is same as other languages:\n```\nif (1 == 2){\n    ...\n}\n```\n(You can follow previous math example for checking stack manipulation)\n\nFor writing a bit more complex programs you may want to use macros and includes:\nMacros is an collection of tokens (like functions in other languages) but does not have an object-like system they just an way to not write same logic (for now)\nSo, this code:\n```\nmacro multiply_by_2\n    2 *\nend\n\n4 multiply_by_2\n```\nat compilation stage will be converted into simple `4 2 *` (tokens expanded)\nFor importing some file (same as macros system but for files) you can use `import \"file.gof\"`\n\n\n\n### Milestones and planned features\n\n- Standard library with not only syscall mapping\n- Stability improvements\n- Support for x86_64 Windows\n- More examples","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirillzhosul%2Fgofra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkirillzhosul%2Fgofra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirillzhosul%2Fgofra/lists"}