{"id":32724603,"url":"https://github.com/lucasfelixsilveira/morgana","last_synced_at":"2026-03-10T05:02:25.549Z","repository":{"id":322133660,"uuid":"1086095023","full_name":"lucasFelixSilveira/morgana","owner":"lucasFelixSilveira","description":"🐑 Comptime low than LLVM or MLIR - Morgana use community extensors for more compilation performance. Knowing exactly what it need to do since you run the build command","archived":false,"fork":false,"pushed_at":"2026-03-02T05:58:03.000Z","size":38355,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-02T10:06:30.722Z","etag":null,"topics":["better-than-llvm","carla","carla-lang","ir","ir-language","language","llvm","mlir","mlir-lang","mlir-llvm","mlir-llvm-morgana","morgana","morgana-ir","morgana-ir-lang","simple-syntax"],"latest_commit_sha":null,"homepage":"","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/lucasFelixSilveira.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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-30T00:04:58.000Z","updated_at":"2026-03-02T05:58:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lucasFelixSilveira/morgana","commit_stats":null,"previous_names":["lucasfelixsilveira/morgana"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lucasFelixSilveira/morgana","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasFelixSilveira%2Fmorgana","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasFelixSilveira%2Fmorgana/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasFelixSilveira%2Fmorgana/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasFelixSilveira%2Fmorgana/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucasFelixSilveira","download_url":"https://codeload.github.com/lucasFelixSilveira/morgana/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasFelixSilveira%2Fmorgana/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30325598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T01:36:58.598Z","status":"online","status_checked_at":"2026-03-10T02:00:06.579Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["better-than-llvm","carla","carla-lang","ir","ir-language","language","llvm","mlir","mlir-lang","mlir-llvm","mlir-llvm-morgana","morgana","morgana-ir","morgana-ir-lang","simple-syntax"],"created_at":"2025-11-03T01:00:45.958Z","updated_at":"2026-03-10T05:02:25.539Z","avatar_url":"https://github.com/lucasFelixSilveira.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"right\" src=\"./assets/icon_nobg.png\" alt=\"Morgana Logo\" width=\"120px\" height=\"120px\"\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n# 🐑 Morgana IR language \n\nMorgana is a lightweight, high-performance Intermediate Representation designed to cut through the heavy, bloated pipeline of LLVM.\nIt powers the Carla compiler, but is fully usable as a standalone IR for any custom language or code generation tool.\n\n### 🚀 Why Morgana Exists\n\nLLVM is slow.\n\nYes, it's insanely powerful and feature-heavy — but that complexity comes with a price: massive pipelines, heavy abstractions, and sluggish code generation.\n\nMorgana strips away the unnecessary layers and gives you a direct, nearly-metal IR, with a tiny translation pipeline that turns instructions into machine code with minimal overhead.\n\nIf you want real speed without drowning in LLVM’s complexity,\n\n**Morgana isn’t an upgrade — it’s the alternative.**\n\n##\n\n## ✨ What Is Morgana?\n\nMorgana is a clean and compact IR language originally built to replace LLVM in the Carla compiler project.\n\nBut nothing stops you from using it in your own compiler or VM.\nIt was designed to be simple enough to generate, powerful enough to optimize, and low-level enough to map cleanly to native assembly.\n\n## Morgana Extensors\n\nWhat is extensors?\n\nExtensors are extensions to Morgana codegen, which allow you to add your custom instructions, types, and optimizations to the language.\n\n- `I need implement my own extensors?`: No, you can use the official extensors, third-party extensors or even write your own.\n- `How can i write my own extensors?`: You can write your own extensors using [Runa (ルナ)](https://github.com/lucasFelixSilveira/runa) and the pattern who is teach on the [Morgana Extensors](https://github.com/Carla-corp/extensors) repository.\n- `I can write without overriding any of the existing extensors?`: Yes, you can write your own extensors without overriding any of the existing ones. Compiling with the flag `-o`\n\n```sh-session\n# x86_64 extensor for example\n$ morgana build -o x86_64-optimized\n```\n\n## What official extensors are already implemented?\n\u003ctable\u003e\n    \u003ctr\u003e\n    \u003ctd\u003eMCU (AVR)\u003c/td\u003e\n    \u003ctd\u003eMCU (xtensa)\u003c/td\u003e\n    \u003ctd\u003eCPU (x86_64)\u003c/td\u003e\n    \u003ctd\u003eCPU (i386)\u003c/td\u003e\n    \u003ctd\u003eCPU (ARM)\u003c/td\u003e\n    \u003ctd\u003eGPU (NVIDIA)\u003c/td\u003e\n    \u003ctd\u003eGPU (AMD)\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n    \u003ctd\u003e🟡\u003c/td\u003e\n    \u003ctd\u003e❌\u003c/td\u003e\n    \u003ctd\u003e🟡\u003c/td\u003e\n    \u003ctd\u003e❌\u003c/td\u003e\n    \u003ctd\u003e❌\u003c/td\u003e\n    \u003ctd\u003e❌\u003c/td\u003e\n    \u003ctd\u003e❌\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n# Examples\n\n### Morgana LED Flip Flop - MCUs\n[Click to watch - Morgana FLIP FLOP in AVR platform](https://youtu.be/N7LiUWXcLLY)\n### Morgana reading GPIO and taking decisions - MCUs\n[Click to watch -  Morgana now has Branches! Arduino (MCU) use example](https://youtu.be/N7LiUWXcLLY)\n\n## 🔥 LLVM vs Morgana\n  \n- **LLVM IR**\n```llvm\ndefine i32 @main(i8 %0, ptr %1) {\nentry:\n  %3 = alloca i8, align 1\n  %4 = alloca ptr, align 8\n  store i8 %0, ptr %3, align 1\n  store ptr %1, ptr %4, align 8\n  ret i32 0\n}\n```\n\n- The same code in **Morgana IR**\n```morgana\ni32 main i8 [16:i8]* {\n  (a0, a1) @_\n  ret 0\n}\n```\n\nNotice the difference:\n**Same semantics, 5× less noise.**\n\n# 📚 Library Usage Example\n\n```cpp\n#include \"morgana/builder.hpp\"\n#include \"morgana/context.hpp\"\n#include \"morgana.hpp\"\n#include \u003ciostream\u003e\n#include \u003cvector\u003e\n\nint main() {\n    Builder builder(false);\n\n    morgana::desconstruct::values data = {};\n\n    Context context;\n    morgana::desconstruct d(morgana::mics::that, data);\n    context \u003c\u003c d.string();\n\n    morgana::type i8 = morgana::type::integer(8);\n    morgana::type i32 = morgana::type::integer(32);\n    morgana::type pvecstr = morgana::type::integer(8).ptr().vec(16);\n\n    morgana::function f(\"main\", i32.shared(), morgana::function::args{}, context.string());\n\n    builder \u003c\u003c f.string();\n    std::cout \u003c\u003c builder.string(); // Print the generated IR\n    return 0;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasfelixsilveira%2Fmorgana","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucasfelixsilveira%2Fmorgana","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasfelixsilveira%2Fmorgana/lists"}