{"id":19053920,"url":"https://github.com/mikelma/oktac","last_synced_at":"2025-04-24T03:08:55.619Z","repository":{"id":184001861,"uuid":"371405915","full_name":"mikelma/oktac","owner":"mikelma","description":"okta programming language compiler. THIS IS A MIRROR OF THE ORIGINAL REPO HOSTED IN SOURCEHUT.","archived":false,"fork":false,"pushed_at":"2022-05-01T19:22:31.000Z","size":448,"stargazers_count":27,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T03:08:49.969Z","etag":null,"topics":["compiler","language","llvm","programming-language","rust"],"latest_commit_sha":null,"homepage":"https://git.sr.ht/~mikelma/oktac","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikelma.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-05-27T14:39:25.000Z","updated_at":"2024-11-22T15:34:24.000Z","dependencies_parsed_at":"2023-07-26T18:46:06.643Z","dependency_job_id":null,"html_url":"https://github.com/mikelma/oktac","commit_stats":null,"previous_names":["mikelma/oktac"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikelma%2Foktac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikelma%2Foktac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikelma%2Foktac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikelma%2Foktac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikelma","download_url":"https://codeload.github.com/mikelma/oktac/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250552076,"owners_count":21449165,"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":["compiler","language","llvm","programming-language","rust"],"created_at":"2024-11-08T23:35:52.487Z","updated_at":"2025-04-24T03:08:55.600Z","avatar_url":"https://github.com/mikelma.png","language":"Rust","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"\u003ch1\u003eoktac  \u003cimg src='https://git.sr.ht/~mikelma/oktac/blob/main/assets/okta-ottis.png' width='70'\u003e\u003c/h1\u003e\n\nThe compiler of the *okta* programming language. For more information\nplease visit the official [website](https://okta-lang.org), and to quickly get \nokta running refer to the [getting started](https://okta-lang.org/docs/getting-started/) \nsection.\n\nCurrently, *okta* only supports the following platform and architecture combinations:\n\n* Linux:\n    - x86_64 (tested on versions 5.\\*)\n    - riscv64 (tested on [debian](https://wiki.debian.org/RISC-V))\n* FreeBSD x86_64 (tested on 13.0-RELEASE)\n\n**DISCLAIMER:** This project, as well as the okta language itself, it's in a very \nearly development state, expect bugs and frequent breaking changes.\n\n## How to build\n\nThere are two ways to compile *oktac* from source: using docker, or using \ncargo (the traditional way), chose the most combinient method for you.\n\n* Cargo:\n    - Smaller binary (dynamically links agains non rust dependencies: LLVM, glibc, ...).\n    - More dependencies have to be installed in the host machine.\n    - More complex.\n\n* Docker:\n    - Fully automated build (simple).\n    - Static binary (at the cost of greater size of the binary).\n    - Very few dependencies. \n\nThe instructions for both methods assume the repository is cloned and that \nthe working directory is set to the cloned repository:\n\n```bash\ngit clone https://git.sr.ht/~mikelma/oktac\ncd oktac\n```\n\n### Using docker\n\nFirst of all, check if the following dependencies are present in your host machine:\n\n* git\n* docker\n* clang\n\nNext, execute the following command to build the docker container with the build environment:\n\n```bash\ndocker build -t oktac-build .\n```\n\nThe last step is to run the docker container as the following:\n\n```bash\ndocker run --rm -it -v \"$(pwd)\":/home/rust/src oktac-build:latest\n```\n\nAfter some minutes, the building process should finish, providing an `oktac` static binary \nin the current directory.\n\n### Using cargo\n\nThe first step is to install the following dependencies (if not already present):\n\n* git\n* LLVM 12\n* clang 12\n* [Rust](https://www.rust-lang.org/tools/install) (latest stable)\n* libffi-devel\n* libxml2-devel\n* libstdc++-devel\n\nThe next step is to build the compiler using rust's `cargo`. Note that \nthe `--release` flag isn't mandatory, however it is strongly recommended, \nas if this flag isn't provided the debug version of oktac will be built instead.\n\n```bash\ncargo build --release\n```\n\nThe output binary shoud be located in the `target/release/oktac` path.\n\n## How to use\n\nThis section covers the most common use cases of oktac, for more information \nrun `oktac --help`.\n\n### Compiling okta programs \n\n* Compiling a single okta file to a binary. \n    ```bash\n    oktac test.ok -o test\n    ```\n\n* Compiling multiple okta files:\n    ```bash\n    oktac main.ok bar.ok foo.ok\n    ```\n    \n    Note that if the `-o` (output) flag isn't provided the output binary is saved to `a.out`.\n\n* Including okta libraries:\n    ```bash\n    oktac -L path/to/lib some.ok code.ok\n    ```\n\n    `some.ok` and `code.ok` can import modules inside `path/to/lib` \n    as if they were in their same location (path).\n\n### Useful debugging options\n\n* Emit the LLVM-IR generated from the source:\n    ```bash\n    oktac test.ok --emit=llvm-ir\n    ```\n\n* Emit the AST of the source code:\n    ```bash\n    oktac main.ok --emit=ast\n    ```\n\n* Emit the **full** AST of the source code (very verbose):\n    ```bash\n    oktac main.ok --emit=ast-dbg\n    ```\n\n## Language reference\n\nThe language's reference is also provided with the compiler's source code.\nThe reference can be found in `docs/reference.md` inside this repo, or online\n[here](https://git.sr.ht/~mikelma/oktac/tree/main/item/docs/reference.md).\nYou can also convert the reference to a pretty PDF using\n[`pandoc`](https://pandoc.org/) and [wkhtmltopdf](https://wkhtmltopdf.org/):\n\n```bash\npandoc --pdf-engine=wkhtmltopdf --css docs/style.css docs/reference.md -o reference.pdf\n```\n\n## Contributing\n\nIf you want to contribute or found a bug, please take a look at the \n[contributing](https://okta-lang.org/contribute) section of the okta website.\n\n## License\n\nOktac is distributed under the terms of the GLPv3 license. \nSee [LICENSE](https://git.sr.ht/~mikelma/oktac/tree/main/item/LICENSE) for more details.\n\n## Special thanks\n\n* [@stiviwonder](https://github.com/stiviwonder) for the alpha testing\n* [@iiraaiitz](https://github.com/iiraaiitz) for helping with the grammar \n* [@hginigo](https://github.com/hginigo) for diving deep into the dark world of macros \n* [@ladecadence](https://github.com/ladecadence) for testing oktac in riscv64-linux\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikelma%2Foktac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikelma%2Foktac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikelma%2Foktac/lists"}