# Crisp > Crisp is a systems programming language that transpiles compact `.crp` source to Rust. The `crisp` toolchain infers types, ownership, and errors; `rustc` remains the soundness boundary. Crisp is designed for systems work with a Rust-hosted bootstrap compiler (`cargo install crisp-lang`). Spec: v0.2.0-draft. Public release: v1.8.0. Repository: https://github.com/jose-compu/crisp v1.8.0: `else if` (#117); optional record commas (#111); parse/lex `file:line:col` (#109); unary `-` on float (#113); checking-position `int`→`float` / `as float` (#112); Copy records (#118); harness CIR args (#114); implicit `vec` and `xs[i]` (#119 / #120); prelude `exp`/`sin`/`cos`/`tanh`/`sqrt` (#115); `extern rust` scalars (#116). v1.7.3: `crisp.toml` path deps (`foo = { path = "…" }`, #105, `examples/path_dep`); `crisp run` cwd is the crate root, not `target/rust` (`CRISP_CRATE_ROOT`, #106). v1.7.2 compiler fixes: binop grouping (`(lo + hi) / 2`, #99), nested type `use` (`crate::…::Verdict`, #100), string `match` arms (#101), `crisp test` unique names / bool-str `assert_eq!` (#102). ## Docs - [Home](https://crisp-lang.org/): Language overview and positioning - [Install](https://crisp-lang.org/install.html): Install `crisp-lang` / `crisp-lsp` from crates.io or from source - [Tutorial](https://crisp-lang.org/tutorial.html): Guided introduction to Crisp syntax and toolchain - [Learning path](https://crisp-lang.org/learning.html): Ordered path through docs and examples - [Language](https://crisp-lang.org/language.html): Language surface — bindings, types, generics, errors, modules - [Docs hub](https://crisp-lang.org/docs.html): Spec, limitations, and documentation index - [CLI](https://crisp-lang.org/cli.html): `crisp` and `reveal` command reference - [Use cases](https://crisp-lang.org/use-cases.html): Where Crisp fits (CLI tools, services, interop with Rust) - [Limitations](https://crisp-lang.org/limitations.html): Honest known gaps vs the draft spec ## Install (agents) ```bash cargo install crisp-lang --locked crisp --version crisp run . ``` Requires Rust 1.85+ (`rustup`). Optional LSP: `cargo install crisp-lsp --locked`. ## Hello world ``` shape Named = { name: str } type Guest = { name: str = "world" } id(x: T) = x greet(who: Named) = "hello {who.name}" pub main() = { world := Guest {} print(id(greet(world))) } ``` `crisp run examples/hello` prints `"hello world"`. Shape `Named` is structural; unbound `T` is a type parameter; `Guest {}` uses the field default. ## Generics (prefer implicit binders) Unbound names in type position are parameters. Write `<>` to pin a definition or to apply arguments: ``` type Pair = { left: A, right: B } id(x: T) = x first(p: Pair) = p.left shape Boxy = { value: T } unwrap_int(b: Boxy) = b.value trait Wrapper = { unwrap(self) -> T } impl Wrapper for IntBox = { unwrap(self) = self.value } ``` Keep `T`. The body infers the constraint (`+` → `T: Add`; `x.show()` → `T: Show`). Unsatisfied instantiations are typeck **E0084**. ``` shape HasPosition = { x: T, y: T } distance(a: HasPosition, b: HasPosition) = { dx := a.x - b.x dy := a.y - b.y dx * dx + dy * dy } label(x: T) = x.show() ``` Pins (same meaning): `id(x: T)`, `type Pair`. Examples: `examples/generics_implicit` (preferred), `examples/generics`, `examples/generics_pub`, `examples/shapes_generic`, `examples/shapes_user`, `examples/show_trait`. Written `where` / generic trait bounds / `dyn Trait` remain limited. ## Function values There is one callable kind. `double(n) = n * 2`, `inc := |n| n + 1`, and passing `double` to `apply(f, x) = f(x)` are the same values. ``` apply(f, x) = f(x) run(f) = f(21) label(g, p) = g(p) type Person = { name: str } pub main() = { print(apply(double, 21)) print(apply(_ * 2, 21)) print(run { |x| x * 2 }) print(label(.name, Person { name: "Ada" })) print(apply(.magnitude(), v)) } ``` Sugar when a function is expected: holes (`apply(_ * 2, n)`), trailing last-arg (`run { |x| x * 2 }`), field sections (`label(.name, person)`), method sections (`apply(.magnitude(), v)`; extra args bake in: `.scale(2.0)` → `|v| v.scale(2.0)`). Example: `examples/closures`. Too many/few holes is E0085; `_` where a function is not expected is E0086. Operator sections (`+ 1`) and `dyn Fn` are not shipped. ## Source & package - GitHub: https://github.com/jose-compu/crisp - crates.io package: https://crates.io/crates/crisp-lang (bins: `crisp`, `reveal`) - Spec (repo): https://github.com/jose-compu/crisp/blob/main/docs/spec/CrispLang-SPECS-0.2.0.md - Changelog: https://github.com/jose-compu/crisp/blob/main/CHANGELOG.md ## Optional - [Full site map](https://crisp-lang.org/sitemap.xml) - [robots.txt](https://crisp-lang.org/robots.txt)