{"id":37561570,"url":"https://github.com/marinasundstrom/raven","last_synced_at":"2026-01-16T09:06:42.345Z","repository":{"id":253081819,"uuid":"842385453","full_name":"marinasundstrom/raven","owner":"marinasundstrom","description":"A modern programming language for .NET - Compiler inspired by the .NET Roslyn compiler architecture.","archived":false,"fork":false,"pushed_at":"2026-01-11T19:47:32.000Z","size":6555,"stargazers_count":61,"open_issues_count":9,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-11T20:32:06.927Z","etag":null,"topics":["compiler","compiler-construction","csharp","dotnet","roslyn"],"latest_commit_sha":null,"homepage":"","language":"C#","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/marinasundstrom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2024-08-14T08:41:34.000Z","updated_at":"2026-01-11T19:47:36.000Z","dependencies_parsed_at":"2024-08-14T10:49:33.191Z","dependency_job_id":"953d085f-e44f-4c7c-843e-11a3181f2967","html_url":"https://github.com/marinasundstrom/raven","commit_stats":null,"previous_names":["marinasundstrom/raven-compiler","marinasundstrom/raven"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marinasundstrom/raven","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marinasundstrom%2Fraven","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marinasundstrom%2Fraven/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marinasundstrom%2Fraven/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marinasundstrom%2Fraven/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marinasundstrom","download_url":"https://codeload.github.com/marinasundstrom/raven/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marinasundstrom%2Fraven/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["compiler","compiler-construction","csharp","dotnet","roslyn"],"created_at":"2026-01-16T09:06:40.901Z","updated_at":"2026-01-16T09:06:42.309Z","avatar_url":"https://github.com/marinasundstrom.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raven Programming Language\n\n\u003c!---\n[![Build](https://github.com/marinasundstrom/raven/actions/workflows/dotnet.yml/badge.svg)](https://github.com/marinasundstrom/raven/actions/workflows/dotnet.yml)\n[![Tests](https://github.com/marinasundstrom/raven/actions/workflows/dotnet.yml/badge.svg?event=push)](https://github.com/marinasundstrom/raven/actions/workflows/dotnet.yml)--\u003e\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Docs](https://img.shields.io/badge/docs-available-brightgreen.svg)](docs/)\n\n**Raven** is a modern programming language and experimental compiler inspired by the [.NET Roslyn](https://github.com/dotnet/roslyn) architecture.\n\n✨ **Key traits**:\n- **Familiar yet fresh syntax** — looks like Swift, with ideas borrowed from Rust, F#, and C#  \n- **Targets the .NET runtime** — compiles directly to IL and integrates with the .NET ecosystem  \n- **Immutable, service-oriented design** — a compiler built as an API, following the \"Compiler-as-a-Service\" philosophy  \n\nRaven is primarily a **learning and exploration project**, aimed at:\n- Understanding modern compiler construction\n- Experimenting with language design\n- Providing a clean API for syntax manipulation and analysis\n\n\n## 🔰 Language Overview\n\nRaven is a general-purpose, expression-oriented language with an expression-first design that blends functional and imperative paradigms. Its type system supports union and literal types with flow-sensitive typing similar to TypeScript, and it uses `unit` instead of `void`. As a .NET language, Raven interops seamlessly with C#, even shipping a C# analyzer for type unions. The compiler follows the Roslyn \"compiler-as-a-service\" architecture.\n\n### Example\n\n```raven\nimport System.Console.*\nimport System.Collections.Generic.List\u003cint\u003e\nimport System.Linq.*\n\nalias LedgerEntry = (label: string, value: int)\n\nfunc shape(values: List\u003cint\u003e) -\u003e List\u003cLedgerEntry\u003e {\n    val result = List\u003cLedgerEntry\u003e()\n    for each value in values {\n        val label = if value \u003c 0 \"debit\" else \"credit\"\n        result.Add((label: label, value: value))\n    }\n    return result\n}\n\nfunc summarize(readings: List\u003cint\u003e) -\u003e string {\n    val shaped = shape(readings)\n    val total = shaped.Aggregate(0, (acc, entry) =\u003e acc + entry.value)\n\n    val verdict = if total \u003e 0\n        \"net positive\"\n    else if total \u003c 0\n        \"net negative\"\n    else\n        \"balanced\"\n\n    return $\"processed ${shaped.Count()} items -\u003e ${verdict} (${total})\"\n}\n\nvar ledger = List\u003cint\u003e()\nledger.Add(25)\nledger.Add(-10)\nledger.Add(5)\nledger.Add(0)\n\nWriteLine(summarize(ledger))\n```\n\n**Highlights**:\n\n* Expression-first control flow and file-scope functions\n* `val` vs `var` (immutable vs mutable) with tuple-shaped data\n* Lambdas and LINQ interop against .NET collection types\n* String interpolation with tuple element access\n* Direct interop with .NET libraries\n\nRead the full [Introduction](docs/introduction.md) for a more detailed overview.\n\n---\n\n## 🪶 Why the Name \"Raven\"?\n\nRavens are remarkable birds, known for their intelligence and adaptability.  \n\nIn Old Norse mythology, ravens held significant importance as messengers of Odin. His two ravens, **Huginn** (\"thought\") and **Muninn** (\"memory/mind\"), symbolized intellect and reflection—qualities that align with the goals of this language.  \n\nThe name reflects both the **mythological roots** and the **clever traits** of these birds.  \nAlternative names considered: Old Norse **\"Hrafn\"** or Danish **\"Ravn.\"**\n\n---\n\n## 🎯 Project Goals\n\n- **Create a Programming Language** — build a language from the ground up, covering design and implementation.  \n- **Focus on Parsing \u0026 Semantics** — implement parsing, binding, and analysis as the backbone of compilation.  \n- **Serve as a Reference** — provide a well-documented example for compiler enthusiasts.  \n- **Pragmatic Scope** — aim for a practical subset of Roslyn-like features, not full parity.  \n\n---\n\n## ✨ Syntax\n\nSee the pseudo-specification [here](/docs/lang/spec/language-specification.md).\n\nMore [samples](samples/).\n\n---\n \n## 🧩 API\n\n* Compiler API reference: [docs/compiler/api](docs/compiler/api)\n* Example usage: [Raven.Compiler project](src/Raven.Compiler/Program.cs)\n\n---\n\n## 🛠 Prerequisites\n\n* [.NET SDK 9.0](https://dotnet.microsoft.com/)\n* Optional: [DocFX](https://dotnet.github.io/docfx/) for docs\n\n---\n\n## 🚀 Quick Start\n\n```bash\n# Restore packages\ndotnet restore\n\n# Generate syntax nodes (run from the Syntax directory)\ncd src/Raven.CodeAnalysis/Syntax\ndotnet run --project ../../../tools/NodeGenerator   # add `-- -f` to force regeneration\ncd ../../..\n\n# Build the compiler, tests, and Raven.Core (the Option/Result standard library built with ravc)\ndotnet build Raven.sln\ndotnet test\n```\n\n### Run the compiler\n\nCommand:\n\n```bash\ndotnet run --project src/Raven.Compiler -- \u003cpath-to-file\u003e -o \u003coutput-file-path\u003e\n```\n\nOptions:\n\n- `--framework \u003ctfm\u003e` \u0026ndash; target framework\n- `--refs \u003cpath\u003e` \u0026ndash; additional metadata reference (repeatable)\n- `--raven-core \u003cpath\u003e` \u0026ndash; reference a specific `Raven.Core.dll`\n- `--emit-core-types-only` \u0026ndash; embed Raven core shims instead of using `Raven.Core.dll`\n- `-o \u003cpath\u003e` \u0026ndash; output assembly path\n- `-s` \u0026ndash; display the syntax tree (single file only)\n- `-d [plain|pretty[:no-diagnostics]]` \u0026ndash; dump syntax (`plain` for raw text, `pretty` for highlighted syntax; append `:no-diagnostics` to skip underlines, single file only)\n- `--highlight` \u0026ndash; display diagnostics with highlighted source snippets and severity-coloured underlines (covers\n  compiler, analyzer, and emit diagnostics)\n- `-r` \u0026ndash; print the raw source (single file only)\n- `-b` \u0026ndash; print the binder tree (single file only)\n- `-bt` \u0026ndash; print the binder and bound tree (single file only)\n- `--symbols [list|hierarchy]` \u0026ndash; inspect source symbols (`list` dumps properties, `hierarchy` prints the tree)\n- `-h`, `--help` \u0026ndash; show help\n\n`ravc` now ships with and references `Raven.Core.dll` by default. The library is copied next to `ravc` during build, and any compilation also copies it to the output directory of the produced assembly. Use `--raven-core` to point to a different build of Raven.Core, or `--emit-core-types-only` to embed the shimmed core types instead of referencing the DLL.\n\nCreating a `.debug/` directory in the current or parent folder causes the\ncompiler to emit per-file dumps (syntax tree, highlighted syntax, raw source,\nbound tree, and binder tree) into that directory. The debug options above will additionally\nwrite to the console when compiling a single file.\n\n\u003e ⚠️ **When the arguments are omitted**, there is a hardcoded input file, and a hardcoded output file path (`test.dll`).\n\n### Run the editor\n\n```bash\ndotnet run --project src/Raven.Editor -- \u003cpath-to-file\u003e\n```\n\nWhen a file path is supplied, the editor opens the file and displays its name in the window title.\n\n---\n\n## 📂 Repository Structure\n\n```\nsrc/\n  Raven.CodeAnalysis/         # Compiler core: syntax, binder, semantic model, code gen\n  Raven.Compiler/             # Command-line compiler\n  Raven.CodeAnalysis.Testing/ # Diagnostic test helpers\n  TypeUnionAnalyzer/          # Analyzer for C# type unions\n  TestDep/                    # Auxiliary test project\n\ntest/                         # Unit tests\nsamples/                      # Example Raven programs and CLI demos\ntools/\n  NodeGenerator/              # Generates syntax node code from Model.xml\n  Generator/                  # Shared Roslyn generator framework\ndocs/                         # Language spec \u0026 design docs\n```\n\n---\n\n## 🔧 Development Notes\n\n* The `RunNodeGenerator` target in `Raven.CodeAnalysis.csproj` runs automatically, but if generated files are missing, run the command manually.\n* Generated files reside in `Syntax/generated/` and `Syntax/InternalSyntax/generated/` — **do not edit by hand**.\n* Always run `dotnet build` and `dotnet test` before committing.\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome!\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for coding standards, git conventions, and workflow.\n\n---\n\n## 📚 Documentation\n\n* Full documentation: [docs/](docs/)\n* Unit tests for the language: [Raven.CodeAnalysis.Tests](test/Raven.CodeAnalysis.Tests)\n\n---\n\n💡 *Raven is a playground for exploring compilers and language design — your ideas and contributions can directly shape its evolution!*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarinasundstrom%2Fraven","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarinasundstrom%2Fraven","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarinasundstrom%2Fraven/lists"}