{"id":17710523,"url":"https://github.com/reilabs/hieratika","last_synced_at":"2025-04-15T01:03:40.297Z","repository":{"id":259119555,"uuid":"851791259","full_name":"reilabs/hieratika","owner":"reilabs","description":"Compiling LLVM bytecode to run on top of the CairoVM and execute provably on Starknet","archived":false,"fork":false,"pushed_at":"2025-04-14T21:48:55.000Z","size":6048,"stargazers_count":5,"open_issues_count":29,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-15T01:02:54.778Z","etag":null,"topics":["compiler","emulator","llvm","starknet"],"latest_commit_sha":null,"homepage":"http://starknet.io","language":"Cairo","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reilabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-03T17:53:51.000Z","updated_at":"2025-04-11T14:27:19.000Z","dependencies_parsed_at":"2024-10-24T06:46:01.984Z","dependency_job_id":"32543909-7b9a-45a9-ad63-26cf79adbc81","html_url":"https://github.com/reilabs/hieratika","commit_stats":{"total_commits":21,"total_committers":6,"mean_commits":3.5,"dds":"0.47619047619047616","last_synced_commit":"5a0f08b051ef53bceaf24f379d08b18c9f442f74"},"previous_names":["reilabs/llvm-to-cairo","reilabs/hieratika"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reilabs%2Fhieratika","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reilabs%2Fhieratika/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reilabs%2Fhieratika/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reilabs%2Fhieratika/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reilabs","download_url":"https://codeload.github.com/reilabs/hieratika/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248986313,"owners_count":21194025,"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","emulator","llvm","starknet"],"created_at":"2024-10-25T07:06:26.680Z","updated_at":"2025-04-15T01:03:40.280Z","avatar_url":"https://github.com/reilabs.png","language":"Cairo","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hieratika: Compiling LLVM to CairoVM\n\n\u003e **hieratiká /ˌhaɪ(ə)ˈɹætɪka/**, _adjective_\n\u003e\n\u003e Of or pertaining to the cursive writing system that developed alongside the hieroglyphic system as\n\u003e its handwritten counterpart for every-day use. It took the \"priestly\", domain-specific\n\u003e hieroglyphics and repurposed them for non-domain-specific expression.\n\nThis repository contains the efforts to enable compilation of LLVM bytecode to run on top of the\n[CairoVM](https://github.com/lambdaclass/cairo-vm) and hence [Starknet](https://www.starknet.io).\nThe goals of this project are threefold:\n\n1. **Provable Rust Execution:** To provide the ability to prove the execution of LLVM bytecode using\n   Starknet's proving infrastructure, thereby allowing verification of said execution.\n2. **Writing Contracts in LLVM Languages:** To provide the ability to write contracts for execution\n   on Starknet using any language that compiles to LLVM (while recognizing that this will require a\n   small per-language effort).\n3. **Using Foreign Libraries from Cairo:** There exist a wealth of useful cryptographic libraries in\n   languages such as Rust that compile to LLVM. Rather than requiring users to reimplement them in\n   [Cairo](https://www.cairo-lang.org), this effort would allow them to be exposed directly.\n\nThe initial efforts for this project are focusing on using [Rust](https://rust-lang.org) as the\nsource of the LLVM bytecode, and will see support libraries implemented for this language.\nNevertheless, this project aims to be agnostic to the actual source language of the bytecode besides\nthe language-specific libraries.\n\n## Architectural Overview\n\nAs there is a significant mismatch between the computational model expected by LLVM, and the Cairo\nmodel of execution, we take a multi-layered approach.\n\n- **Compilation:** Where there is a direct correspondence between LLVM and Cairo's semantics, we can\n  perform direct compilation, generating Cairo's `FlatLowered` IR from LLVM IR.\n- **Polyfills:** Where there is a mismatch, we have to implement the mismatched operation as an\n  _emulation_ or a _polyfill_. These will implement the expected semantics (often given by\n  [compiler-rt](https://compiler-rt.llvm.org)) as Cairo code that can then be called into by the\n  compilation process.\n\nAs Cairo is not an operating system, we restrict our source code to be `#[no_std]` or the equivalent\nfor other languages. This is necessary as we cannot provide useful primitives for things like the\nfilesystem, network, or even threading.\n\nIn the future, we intend to move many of our polyfilled operations into native operations as part of\nthe CASM instruction set, or as Cairo\n[builtins](https://book.cairo-lang.org/ch204-00-builtins.html#builtins) to improve performance.\nStarting with the emulation or polyfill layer, however, lets us determine which operations are going\nto be most effective to transfer first, and help us arrive to the final design of such operations\nbefore moving them to AIR.\n\n## Contributing\n\nIf you want to contribute code or documentation (non-code contributions are always welcome) to this\nproject, please take a look at our [contributing](./docs/CONTRIBUTING.md) documentation. It provides\nan overview of how to get up and running, as well as what the contribution process looks like for\nthis repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freilabs%2Fhieratika","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freilabs%2Fhieratika","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freilabs%2Fhieratika/lists"}