{"id":38032996,"url":"https://github.com/aabs/fifthlang","last_synced_at":"2026-01-16T19:47:00.420Z","repository":{"id":309853979,"uuid":"867943666","full_name":"aabs/fifthlang","owner":"aabs","description":"Fifth is a multi-paradigm language for the .NET platform treating Knowledge Graphs as first-class citizens, embedding RDF and SPARQL syntax directly into the code. It combines functional programming idioms—such as list comprehensions, lambdas, and pattern matching—with .NET interoperability and a Roslyn-based compilation pipeline.","archived":false,"fork":false,"pushed_at":"2026-01-16T00:06:36.000Z","size":99824,"stargazers_count":11,"open_issues_count":12,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-16T03:05:59.682Z","etag":null,"topics":["compiler","dotnet","functional-programming","programming-language"],"latest_commit_sha":null,"homepage":"https://fifth-lang.org/","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/aabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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-10-05T04:19:36.000Z","updated_at":"2026-01-16T00:06:40.000Z","dependencies_parsed_at":"2025-08-14T07:13:57.132Z","dependency_job_id":"f09bb747-4298-42e9-b584-80188012bb38","html_url":"https://github.com/aabs/fifthlang","commit_stats":null,"previous_names":["aabs/fifthlang"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/aabs/fifthlang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aabs%2Ffifthlang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aabs%2Ffifthlang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aabs%2Ffifthlang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aabs%2Ffifthlang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aabs","download_url":"https://codeload.github.com/aabs/fifthlang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aabs%2Ffifthlang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28481944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","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","dotnet","functional-programming","programming-language"],"created_at":"2026-01-16T19:47:00.328Z","updated_at":"2026-01-16T19:47:00.412Z","avatar_url":"https://github.com/aabs.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fifth Language\n\n[![CI](https://github.com/aabs/fifthlang/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/aabs/fifthlang/actions/workflows/ci.yml)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![.NET](https://img.shields.io/badge/.NET-8.0-512BD4)](https://dotnet.microsoft.com/)\n\nA .NET systems programming language with native support for knowledge graphs and semantic web technologies.  \nFifth is still under active development, and is not yet ready for mission-critical use.  \nI invite you to get involved and play with it, and tell me what you do and don't love.\n\n---\n\n## Language Features\n\nFifth uniquely combines imperative programming with first-class RDF and SPARQL support.  Mostly, it's a lot like C#, but it takes the syntax for Function overloading, Destructuring, and nested Guard Clauses from languages like Erlang.  For a tour of the language, take a look at the [Learn X=5th in Y Minutes Guide](https://raw.githubusercontent.com/aabs/fifthlang/refs/heads/master/docs/learn5thInYMinutes.md).  \n\nMore docs [here](https://fifth-lang.org) including [installation](https://fifth-lang.org/Getting-Started/installation/) instructions.\n\n### Basic Language Features\n- Classes with methods and properties\n- Function overloading with parameter constraints (guards)\n- Parameter Destructuring with guard clauses\n- All of the usual control-constructs\n- Exception handling: try/catch/finally blocks\n- Multiple module support with namespaces\n- Namespace imports with aliasing support\n- Type system: Primitives, classes, lists, Arrays\n- List comprehensions with projection and filtering: `[expr from var in source where constraint]`\n  - **Breaking change**: Legacy `in`/`#` syntax replaced with `from`/`where` syntax\n  - **SPARQL comprehensions**: Use property access on iteration variable (e.g., `[x.age from x in query \u003c- store]`)\n  - SPARQL variables accessed as properties: `x.propertyName` instead of `?variable`\n  - See [migration guide](specs/015-sparql-comprehensions/migration.md) for full details\n\n### Knowledge Graph Primitives\n- Native RDF types: `graph`, `triple`, `store`, `query` are built-in language primitives\n- Built-in KG runtime: `Fifth.System.KG` provides graph creation, triple management, and store operations\n- Triple literals: `\u003csubject, predicate, object\u003e` syntax for inline RDF construction\n- TriG blocks: Multi-line graph literals with full TriG syntax support\n- SPARQL literals: Embed SPARQL queries directly in source code with `?\u003cSELECT...\u003e`\n- Operator syntax provides clean and intuitive ways to work with triples, graphs, triple-stores and queries.\n- Transparent persistence: Save graphs to remote stores with simple assignment: `myStore += graph;`\n\n### What Works\n- Full .NET IL compilation pipeline (via Roslyn back-end)\n- Multi-platform support (Linux, macOS, Windows)\n- MSBuild integration with `.5thproj` project files (very basic at this stage)\n- Parameter destructuring in functions\n- Classes with methods and properties\n- Control flow statements (if/else, while)\n- Exception handling with try/catch/finally\n- Function overloading with parameter guards\n- List comprehensions with new `from`/`where` syntax: `[projection from var in source where constraints]`\n- Knowledge graph operations (TriG literals, SPARQL literals, graph operations)\n- Comprehensive test suite (TUnit + FluentAssertions)\n\n### Planned Improvements\nSee our [architectural roadmap](docs/NEXT-STEPS.md) for detailed plans. Key priorities:\n\n- Published MSBuild SDK and compiler support via Nuget\n- Direct Consumption of Query Results in List Comprehensions\n- Architectural Improvements to support modern compiler tool chains: auto-complete, LSP, go to definition \u0026c\n- Parser error recovery: Better handling of syntax errors for IDE support\n- Incremental compilation: Faster rebuild times for large projects\n\nFull analysis available in [architectural review](docs/architectural-review-2025.md).\n\n## Quick Start\n\n### Prerequisites\n- .NET SDK 8.0+ ([download](https://dotnet.microsoft.com/download))\n\n### Installation\n\nDownload the latest release from the [releases page](https://github.com/aabs/fifthlang/releases) or build from source:\n\n```bash\ngit clone https://github.com/aabs/fifthlang.git\ncd fifthlang\ndotnet build fifthlang.sln\n```\n\n### Your First Fifth Program\n\nCreate a file `hello.5th`:\n\n```fifth\nmain(): int {\n    x: int = 42;\n    return x;\n}\n```\n\nBuild and run with a `.5thproj` file (see below for project setup).\n\n### Working with Knowledge Graphs\n\nCreate a file `kg-example.5th`:\n\n```fifth\n// Connect to a SPARQL store\nalias x as \u003chttp://example.com/blah#\u003e;\nalias rdf as \u003chttp://www.w3.org/1999/02/22-rdf-syntax-ns#\u003e;\nmyStore : store = sparql_store(\u003chttp://localhost:8080/graphdb\u003e);\n\nmain(): int {\n\n    // Create a graph and add triples\n    g: graph = @\u003c \u003e;\n    g += \u003cx:Alice, x:age, 42\u003e;\n    g += \u003cx:Alice, rdf:type, x:Person\u003e;\n    \n    // Save to the store\n    myStore += g;\n    \n    // SPARQL Literals embedded in 5th code...\n    age: int = 42;\n    rq: query = ?\u003c\n        PREFIX x: \u003chttp://example.com/blah#\u003e\n        SELECT ?person\n        WHERE {\n            ?person x:age age .\n        }\n    \u003e;\n    \n    fortyTwoYearOlds: result = rq \u003c- myStore ; // query application on a store\n    \n    // go do something with the results\n\n    return 0;\n}\n```\n\n---\n\n## Creating Fifth Projects\n\nFifth integrates with .NET's build system using `.5thproj` files:\n\n```xml\n\u003c!-- MyApp.5thproj --\u003e\n\u003cProject Sdk=\"Fifth.Sdk\"\u003e\n  \u003cPropertyGroup\u003e\n    \u003cOutputType\u003eExe\u003c/OutputType\u003e\n    \u003cTargetFramework\u003enet8.0\u003c/TargetFramework\u003e\n  \u003c/PropertyGroup\u003e\n\u003c/Project\u003e\n```\n\nBuild like any .NET project:\n\n```bash\ndotnet build MyApp.5thproj\ndotnet run --project MyApp.5thproj\n```\n\nSee [Fifth.Sdk documentation](src/Fifth.Sdk/README.md) for more details.\n\n---\n\n## Roadmap\n- Introduction of Dataset and separation of datasets and stores.\n- Graph/Dataset Destructuring Into Object Instances\n- SPARQL integration into List Comprehensions. ([ideas](https://github.com/aabs/fifthlang/wiki/List-Comprehension-Syntax))\n- MSBUILD SDK Support for full Visual Studio integration with Project Templates published via Nuget.\n- Inference Support\n\n### Recently Completed\n- Multi-platform release pipeline (spec 014)\n- Constructors (spec 013)\n- Generics (spec 012)\n- Query Application (spec 011)\n- TriG literal expressions (spec 009) - Multi-line graph blocks with TriG syntax\n- SPARQL literal expressions (spec 010) - Embedded SPARQL queries\n- System KG types (spec 008) - Runtime graph operations via Fifth.System.KG\n- Roslyn backend (spec 006) - IL emission and compilation pipeline\n- Exception handling (spec 005) - Try/catch/finally control flow\n- Guard clauses (spec 002) - Parameter constraints for function overloading\n- Namespace imports (spec 004) - Import directives with aliasing\n1. Q1 2026: Error recovery + diagnostic improvements\n2. Q2 2026: Language Server Protocol (LSP) + incremental compilation\n3. Q3 2026: Symbol table enhancements + testing architecture\n\nSee [roadmap details](docs/NEXT-STEPS.md) and [issue templates](docs/arch-review-issues/).\n\n---\n\n## Documentation\n\n### Getting Started\n- [Learn Fifth in Y Minutes](docs/learn5thInYMinutes.md) - Quick language tour\n- [Knowledge Graphs Guide](docs/knowledge-graphs.md) - RDF/SPARQL features\n- [Example Programs](docs/examples/) - Real Fifth code\n\n### Language Reference\n- [Architectural Review](docs/architectural-review-2025.md) - Compiler design deep dive\n- [Language Specifications](specs/) - Detailed feature specs\n- [Completed Features](specs/) - See `completed-*` directories\n\n### Community\n- [GitHub Discussions](https://github.com/aabs/fifthlang/discussions) - Ask questions, share ideas\n- [Issues](https://github.com/aabs/fifthlang/issues) - Bug reports and feature requests\n- [Contributing](AGENTS.md) - Development guidelines\n\n---\n\n## Contributing\n\nWe welcome contributions from the community. Areas where help is particularly valuable:\n\n- Language design feedback and suggestions\n- Documentation improvements and examples\n- Bug reports with minimal reproductions\n- Feature proposals with use cases\n\nTo get started:\n1. Check open issues tagged [`good-first-issue`](https://github.com/aabs/fifthlang/labels/good-first-issue)\n2. Read [development instructions](AGENTS.md) if you want to work on the compiler\n3. Start a discussion for questions or proposals\n\n---\n\n## License\n\nFifth is distributed under the MIT License. See [LICENSE](src/LICENSE) for details.\n\n---\n\n## Project Structure\n\n```\nsrc/\n├── parser/              ANTLR-based parser (FifthLexer.g4, FifthParser.g4)\n├── ast-model/           Core AST definitions (AstMetamodel.cs)\n├── ast-generated/       Auto-generated builders \u0026 visitors\n├── compiler/            Transformation pipeline (18 phases)\n├── code_generator/      IL emission (Roslyn-based)\n├── fifthlang.system/    Runtime library (KG operations)\n└── Fifth.Sdk/           MSBuild integration\n\ntest/\n├── ast-tests/           AST builder \u0026 visitor tests\n├── syntax-parser-tests/ Grammar \u0026 parsing tests\n├── runtime-integration-tests/ End-to-end execution tests\n└── kg-smoke-tests/      Knowledge graph feature tests\n```\n\nBuilt with: C# 14, .NET 8.0, ANTLR 4.8, dotNetRDF, Roslyn, TUnit\n\nStatus: Active development | Experimental | Pre-release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faabs%2Ffifthlang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faabs%2Ffifthlang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faabs%2Ffifthlang/lists"}