{"id":13609516,"url":"https://github.com/coalton-lang/coalton","last_synced_at":"2026-05-13T07:15:32.956Z","repository":{"id":37028696,"uuid":"401459573","full_name":"coalton-lang/coalton","owner":"coalton-lang","description":"Coalton is an efficient, statically typed functional programming language that supercharges Common Lisp.","archived":false,"fork":false,"pushed_at":"2026-04-25T22:24:06.000Z","size":15633,"stargazers_count":1581,"open_issues_count":142,"forks_count":96,"subscribers_count":32,"default_branch":"main","last_synced_at":"2026-04-25T22:26:13.679Z","etag":null,"topics":["common-lisp","functional-programming","type-safety"],"latest_commit_sha":null,"homepage":"https://coalton-lang.github.io/","language":"Common Lisp","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/coalton-lang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","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":"2021-08-30T19:17:09.000Z","updated_at":"2026-04-25T22:24:09.000Z","dependencies_parsed_at":"2024-05-21T16:45:23.533Z","dependency_job_id":"392dd329-d899-4db9-982a-52462f487635","html_url":"https://github.com/coalton-lang/coalton","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/coalton-lang/coalton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coalton-lang%2Fcoalton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coalton-lang%2Fcoalton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coalton-lang%2Fcoalton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coalton-lang%2Fcoalton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coalton-lang","download_url":"https://codeload.github.com/coalton-lang/coalton/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coalton-lang%2Fcoalton/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32407252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"online","status_checked_at":"2026-04-29T02:00:06.602Z","response_time":110,"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":["common-lisp","functional-programming","type-safety"],"created_at":"2024-08-01T19:01:35.536Z","updated_at":"2026-05-13T07:15:32.946Z","avatar_url":"https://github.com/coalton-lang.png","language":"Common Lisp","funding_links":[],"categories":["Common Lisp","Languages"],"sub_categories":["Common Lisp"],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://coalton-lang.github.io/\"\u003e\n    \u003cimg alt=\"Coalton\" src=\"docs/assets/coalton-logotype-gray.svg\" style=\"zoom:45%;\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\" class=\"badges\"\u003e\n  \u003ca href=\"https://github.com/coalton-lang/coalton/actions/workflows/main.yml\"\u003e\n    \u003cimg alt=\"Github Workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/coalton-lang/coalton/main.yml?branch=main\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://discord.gg/cPb6Bc4xAH\"\u003e\n    \u003cimg alt=\"Discord\" src=\"https://img.shields.io/discord/888196168067199046?logo=discord\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nCoalton is an efficient, statically typed functional programming language that supercharges Common Lisp.\n\nCoalton integrates directly into Common Lisp:\n\n```lisp\n(defpackage #:differentiation\n  (:use #:coalton #:coalton-prelude)\n  (:local-nicknames (#:sym #:coalton/symbol))\n  (:export #:Expr #:EConst #:EVar #:E+ #:E*)\n  (:export #:diff #:t #:d/dt))\n\n(in-package #:differentiation)\n\n(named-readtables:in-readtable coalton:coalton)\n\n(coalton-toplevel\n  ;; Define a new parametric algebraic data type for simple\n  ;; mathematical expressions.\n  (define-type (Expr :t)\n    \"A symbolic expression of basic arithmetic.\"\n    (EConst :t)\n    (EVar   sym:Symbol)\n    (E+     (Expr :t) (Expr :t))\n    (E*     (Expr :t) (Expr :t)))\n\n  ;; The classic `diff` function, in Coalton.\n  (declare diff (Num :t =\u003e sym:Symbol * Expr :t -\u003e Expr :t))\n  (define (diff x f)\n    \"Compute the derivative of `f` with respect to `x`.\"\n    (match f\n      ((EConst _)                       ; c' = 0\n       (EConst 0))\n      ((EVar s)                         ; x' = 1\n       (if (== s x) (EConst 1) (EConst 0)))\n      ((E+ a b)                         ; (a+b)' = a' + b'\n       (E+ (diff x a) (diff x b)))\n      ((E* a b)                         ; (ab)' = a'b + ab'\n       (E+ (E* (diff x a) b)\n           (E* a          (diff x b))))))\n\n  ;; We can use `t` just fine since Coalton doesn't import `cl:t`.\n  (define t (sym:make-symbol \"t\"))\n\n  (declare d/dt (Num :t =\u003e Expr :t -\u003e Expr :t))\n  (define (d/dt f)\n    \"The time derivative operator.\"\n    (diff t f)))\n```\n\nIt also works directly in the REPL:\n\n```lisp\nCL-USER\u003e (in-package #:differentiation)\nDIFFERENTIATION\u003e (coalton-toplevel\n                   (define (square x) (E* x x)))\n;; SQUARE :: ∀ A. ((EXPR A) → (EXPR A))\n\nDIFFERENTIATION\u003e (coalton (d/dt (E+ (square (EVar t)) (EConst 1))))\n#.(E+ #.(E+ #.(E* #.(ECONST 1) #.(EVAR |t|))\n            #.(E* #.(EVAR |t|) #.(ECONST 1)))\n      #.(ECONST 0))\n```\n\nType errors are discovered at compile-time, and errors are printed beautifully without sacrificing Common Lisp's interactive debugging facilities.\n\n```\nDIFFERENTIATION\u003e (coalton (d/dt (E+ (EConst 1/2) (EConst 0.5))))\nerror: Type mismatch\n  --\u003e repl:1:32\n   |\n 1 |  (coalton (d/dt (E+ (EConst 1/2) (EConst 0.5))))\n   |                                  ^^^^^^^^^^^^ Expected type '(EXPR FRACTION)' but got '(EXPR F32)'\n```\n\nCoalton is currently used in production to build defense and [quantum computing software](https://coalton-lang.github.io/20220906-quantum-compiler/).\n\n## Getting Started\n\n\u003e [!WARNING]\n\u003e Coalton has **not** reached \"1.0\" yet. This means that, from time to time, you may have a substandard user experience. While we try to be ANSI-conforming, Coalton is currently only tested on recent versions of SBCL, Allegro CL, and Clozure CL.\n\u003e\n\u003e The version of Coalton that may be in Quicklisp may not be up-to-date.\n\n**Prepare**: Install [SBCL](http://www.sbcl.org/platform-table.html) (on macOS with Homebrew: `brew install sbcl`). Install Quicklisp by following instructions [here](https://www.quicklisp.org/beta/#installation). (The step command involving `gpg` is not needed.) After installing Quicklisp, you should have a `quicklisp` folder which will make installing Coalton easier.\n\n**Install**: Clone this repository into a place your Lisp can see (e.g., `~/quicklisp/local-projects/`).\n\n**Use**: Either run `(ql:quickload :coalton)`, or add `#:coalton` to your ASD's `:depends-on` list.\n\n**Test**: Compile the tests with `(ql:quickload :coalton/tests)`, then run the tests with `(asdf:test-system :coalton)`. \n\n\u003e [!NOTE] \n\u003e Running the Coalton test suite on SBCL requires [GNU MPFR](https://www.mpfr.org/mpfr-current/mpfr.html#Installing-MPFR) in order to run `Big-Float` tests. If you would like to run tests without installing `gnu-mpfr`, you can use Coalton's portable `Big-Float` implementation by running `(pushnew :coalton-portable-bigfloat *features*)` before loading Coalton.\n\n**Learn**: Start with [*Whirlwind Tour of Coalton*](docs/manual/site/topics/whirlwind-tour.md), the [language manual](https://coalton-lang.github.io/manual/), and the [standard library reference](https://coalton-lang.github.io/reference/), and then take a peek at the [examples directory](examples/). It may also be helpful to check out the [introductory blog post](https://coalton-lang.github.io/20211010-introducing-coalton/).\n\n**Open Source Community**: [Awesome Coalton](https://github.com/Jason94/awesome-coalton) has a list of community-built libraries, applications, and examples, that you can use in your own projects or as examples to learn from.\n\n## What's Here?\n\nThis repository contains the source code to the [Coalton compiler](src/), and the [standard library](library/).\n\nIt also contains a few example programs, such as:\n\n- Some [simple pedagogical programs](examples/small-coalton-programs/),\n- An [implementation](examples/thih/) of Jones's *Typing Haskell in Haskell*, and\n- An [implementation](examples/quil-coalton/) of a simple [Quil](https://en.wikipedia.org/wiki/Quil_(instruction_set_architecture)) parser using parser combinators.\n\nLastly and importantly, we maintain a collection of documentation about Coalton in the [docs](docs/) directory.\n\n## Get Involved\n\nWant to ask a question about Coalton, propose a feature, or share a cool program you wrote? Try posting in the [GitHub Discussions](https://github.com/coalton-lang/coalton/discussions) page!\n\nWe welcome contributions of all forms, especially as we stabilize toward a 1.0 release. We would be grateful to receive:\n\n- bug reports (filed as issues),\n- bug fixes and typo corrections (filed as pull requests),\n- small [example programs](examples/small-coalton-programs/), and\n- user experience troubles.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoalton-lang%2Fcoalton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoalton-lang%2Fcoalton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoalton-lang%2Fcoalton/lists"}