{"id":50406737,"url":"https://github.com/kardashevlang/kardashev","last_synced_at":"2026-06-09T01:00:57.954Z","repository":{"id":360445900,"uuid":"1250172189","full_name":"kardashevlang/kardashev","owner":"kardashevlang","description":"A Rust-flavored systems language with lightweight effect labels in the type system — LLVM backend (JIT + AOT), ownership + borrow checking, generics, traits, and #[derive].","archived":false,"fork":false,"pushed_at":"2026-06-04T07:16:37.000Z","size":3754,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-04T08:23:01.664Z","etag":null,"topics":["borrow-checker","compiler","effect-system","jit","language","llvm","programming-language","rust","systems-programming","type-system"],"latest_commit_sha":null,"homepage":"https://kardashevlang.github.io/kardashev/","language":"C++","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/kardashevlang.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"ROADMAP-1.0-AND-BEYOND.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-26T11:24:29.000Z","updated_at":"2026-06-04T07:16:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"1b2b475e-e22f-4e3d-a1d1-3c3ff57cd9a3","html_url":"https://github.com/kardashevlang/kardashev","commit_stats":null,"previous_names":["nktkt/kardashev","kardashevlang/kardashev"],"tags_count":89,"template":false,"template_full_name":null,"purl":"pkg:github/kardashevlang/kardashev","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kardashevlang%2Fkardashev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kardashevlang%2Fkardashev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kardashevlang%2Fkardashev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kardashevlang%2Fkardashev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kardashevlang","download_url":"https://codeload.github.com/kardashevlang/kardashev/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kardashevlang%2Fkardashev/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34086664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"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":["borrow-checker","compiler","effect-system","jit","language","llvm","programming-language","rust","systems-programming","type-system"],"created_at":"2026-05-31T02:00:32.572Z","updated_at":"2026-06-09T01:00:57.888Z","avatar_url":"https://github.com/kardashevlang.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kardashev\n\nA systems programming language with lightweight effect-label typing, built on LLVM.\n\n**[📖 Documentation](https://kardashevlang.github.io/kardashev/)** · [Language Reference](https://kardashevlang.github.io/kardashev/language-reference.html) · [Effects](https://kardashevlang.github.io/kardashev/effects.html) · [Stdlib](https://kardashevlang.github.io/kardashev/stdlib.html) · [Architecture](https://kardashevlang.github.io/kardashev/architecture.html) — Licensed [MIT](LICENSE-MIT) OR [Apache-2.0](LICENSE-APACHE)\n\n## What it is\n\nkardashev is a Rust-flavored systems language whose signature feature is **lightweight effect labels in the type system**: every function declares which side-effects it can produce (`io`, `alloc`, `panic`, `async`, ...) as part of its signature, and the compiler tracks them across call chains. Unlike Koka, there are no handlers or continuations — effects are pure type-system information, with zero runtime cost.\n\n```rust\nfn add(a: i64, b: i64) -\u003e i64 { a + b }                       // pure\n\nfn read_cfg(path: \u0026str) -\u003e Result\u003cConfig\u003e ! { io, alloc } {   // effects in signature\n    let s = std::fs::read_to_string(path)?;\n    parse(s)\n}\n\nfn map\u003cT, U, e\u003e(xs: Vec\u003cT\u003e, f: fn(T) -\u003e U ! {e}) -\u003e Vec\u003cU\u003e ! { e, alloc } {\n    let mut out = Vec::with_capacity(xs.len());\n    for x in xs { out.push(f(x)); }\n    out\n}\n```\n\nThe `! { ... }` syntax after the return type is the effect row. `e` is a row variable making the function effect-polymorphic — `map` is pure when `f` is pure, and propagates whatever effects `f` introduces.\n\n## Design\n\n- **Memory model**: ownership + borrowing (Rust-style affine, non-lexical lifetimes)\n- **Type system**: HM-based with generics, ADTs, traits + `impl`, monomorphization\n- **Errors**: `Result\u003cT, E\u003e` + `?` operator\n- **Concurrency**: `async` / `await` lightweight tasks + OS threads with a checked `Send` / `share` rule\n- **Memory management**: deterministic `Drop` / RAII (constant-memory loops)\n- **Effect labels**: row-polymorphic effect sets, no handlers, compile-time only\n- **Backend**: LLVM (AOT to a native binary + ORC JIT for the REPL)\n- **Build**: Bazel + `rules_kardashev`, or a `Makefile.local` LLVM/clang shim\n- **Source extension**: `.kd`\n\n### Built-in effect labels\n\n| Label    | Meaning                                                       |\n|----------|---------------------------------------------------------------|\n| `pure`   | No effects (empty row; the default if `! { ... }` is omitted) |\n| `alloc`  | Heap allocation                                               |\n| `io`     | File / network / stdio / general syscalls                     |\n| `panic`  | Unrecoverable failure                                         |\n| `async`  | Yields to the scheduler                                       |\n| `unwind` | Stack unwinding for cancellation (distinct from `panic`)      |\n| `share`  | Crosses a thread boundary (gates the `Send` rule)             |\n\nEffect sets are unioned across the call graph and checked at definition sites; no runtime cost.\n\n## A taste\n\n```rust\n// Generics + traits + borrowing + effects\ntrait Show { fn show(self) -\u003e i64; }\nstruct Point { x: i64, y: i64 }\nimpl Show for Point { fn show(self) -\u003e i64 { self.x + self.y } }\n\nfn read(p: \u0026Point) -\u003e i64 { p.x + p.y }     // borrow; NLL lets you move after its last use\n\nfn raw_read() -\u003e i64 ! { io } { 42 }\nfn main() -\u003e i64 ! { io } { raw_read() }     // a pure-declared caller would be rejected\n```\n\n```rust\n// async / await\nasync fn add(a: i64, b: i64) -\u003e i64 { a + b }\nasync fn double(n: i64) -\u003e i64 { add(n, n).await }\nfn main() -\u003e i64 ! { async, io } { print(double(21).await); 0 }   // 42\n```\n\n`Option` / `Result` ship via a built-in prelude; `Vec\u003cT\u003e`, growable `String`, and `HashMap\u003cK, V\u003e` are built-in containers. Multi-file programs use `mod foo;` (resolves `foo.kd` siblings); a `kard.toml` manifest with local-path dependencies drives `kard build` / `kard run`. More in the [examples](examples/) and the [docs site](https://kardashevlang.github.io/kardashev/).\n\n## Using it\n\n```\nkardc \u003cfile.kd\u003e              # JIT-run main() and print its result\nkardc -o \u003cout\u003e \u003cfile.kd\u003e     # AOT-compile to a native executable\nkardc --test \u003cfile.kd\u003e       # run every `test_*() -\u003e i64` fn (0 = pass)\nkardc -O0|-O1|-O2|-O3 ...     # optimization level (default -O2)\nkardc                        # interactive REPL (JIT each expression)\nkard-lsp                     # Language Server (diagnostics, hover, completion, rename, …)\nkard build | kard run        # build/run a kard.toml project\n```\n\nBuild with Bazel (`bazel build //... \u0026\u0026 bazel test //...`) on ubuntu or macOS, or — when Bazel isn't available — the `Makefile.local` LLVM/clang shim. Programs compile through lexer → parser → HM typechecker → NLL borrow-checker → effect inference → LLVM IR → ORC JIT (or an AOT native object linked with `clang`). `kardc -o` uses a content-addressed incremental AOT compile cache (under `${XDG_CACHE_HOME:-~/.cache}/kardashev`, keyed on the resolved source + flags); pass `--no-cache` to bypass it.\n\n## Status\n\nNineteen roadmaps (**v1–v19**, Phases 0–114) have shipped and are merged to `main`, each green on a cleared clean build — 6 unit suites plus the full smoke / fuzz aggregate, **JIT and AOT**, on ubuntu + macOS CI. Current release: **[v0.19.0](https://github.com/kardashevlang/kardashev/releases/latest)**.\n\nThe north-star arc is **self-hosting**: v15–v17 build a complete compiler *in* kardashev — lexer → parser → type checker → code generator + VM, with `examples/selfhost/compile.kd` type-checking a whole function and then compiling + running its body. Dogfooding it found and fixed three real host-compiler bugs. v18–v19 added a differential fuzzer (random programs, `JIT == AOT == reference`) across the arithmetic, control-flow, memory-safety, and integer codegen paths.\n\n\u003e The per-phase history and every release's details live in **[CHANGELOG.md](CHANGELOG.md)**.\n\n## Roadmap\n\n| Version | Theme |\n|---------|-------|\n| v1  | MVP: the full pipeline (lexer → HM types → LLVM JIT/AOT), ownership + NLL borrow check, ADTs, traits/generics, `Result`/`?`, **effect labels**, `async`/`await`, modules, LSP |\n| v2  | Iteration, closures + effect-carrying fn types, `dyn Trait` dispatch, a growable stdlib, `kardfmt` |\n| v3  | `Drop` / RAII (constant memory), panic + unwinding, OS threads + `Mutex`, opt-levels + `--test` |\n| v4  | Generic trait params + associated types + `where`, arrays/tuples, `const` evaluation, `extern \"C\"` FFI |\n| v5  | Stdlib depth (strings, generic `HashMap`), file I/O + CLI args, self-written capstones (`calc`, `rpn`) |\n| v6  | \"make the heap recursive\" — `Box` / recursive enums; a JSON parser written in kardashev |\n| v7  | \"real numbers, real abstraction\" — `f64`, `#[derive]` Clone/Eq; JSON 2.0 |\n| v8  | \"generics, finished\" — `Ord`/`Hash`/`Default` derives, generic trait objects; JSON 3.0 |\n| v9  | \"data in motion\" — `Vec` combinators, string tools; a word-frequency capstone |\n| v10 | \"sized and sound at compile time\" — const-generics, dimension-checked matrices, effect-subset soundness |\n| v11 | \"real machine integers\" — the numeric tower (sized int/float, `as`, bitwise, defined wrapping) |\n| v12 | \"real stdlib\" — parsing, `Vec`/`HashMap`/`String` methods, math helpers |\n| v13 | \"concurrency\" — the `share` effect, typed MPSC channels, the structural `Send` rule |\n| v14 | \"hardening\" — cross-platform CI (macOS green), a JIT-vs-AOT differential sweep |\n| v15 | \"self-hosting\" — a compiler front-end written in kardashev |\n| v16 | \"self-hosting, continued\" — the body grammar (parser + interpreter) |\n| v17 | \"a compiler in kardashev\" — a self-hosted type checker + code generator; capstone `compile.kd` |\n| v18 | \"hardening II\" — review-followup fixes + a differential fuzzer |\n| v19 | \"hardening III\" — memory-safety + integer fuzzers, cleaner diagnostics |\n\n## Why \"kardashev\"?\n\nThe [Kardashev scale](https://en.wikipedia.org/wiki/Kardashev_scale) ranks civilizations by how much energy they can harness. A systems language, in its own small way, is about controlling resources at scale — a fitting name for one that aims to be precise about effects, ownership, and computation.\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\n   \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkardashevlang%2Fkardashev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkardashevlang%2Fkardashev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkardashevlang%2Fkardashev/lists"}