All Projects → coalton-lang → coalton

coalton-lang / coalton

Licence: MIT license
Coalton is an efficient, statically typed functional programming language that supercharges Common Lisp.

Programming Languages

common lisp
692 projects
Makefile
30231 projects

Projects that are alternatives of or similar to coalton

Percentage
A percentage type for Swift
Stars: ✭ 225 (-48.75%)
Mutual labels:  type-safety
vault
A typed, persistent store for values of arbitrary types
Stars: ✭ 55 (-87.47%)
Mutual labels:  type-safety
typical
Data interchange with algebraic data types.
Stars: ✭ 114 (-74.03%)
Mutual labels:  type-safety
Dry Schema
Coercion and validation for data structures
Stars: ✭ 249 (-43.28%)
Mutual labels:  type-safety
kanji
A strongly typed GraphQL API framework
Stars: ✭ 12 (-97.27%)
Mutual labels:  type-safety
PolyCast
Safely cast values to int, float, or string in PHP
Stars: ✭ 52 (-88.15%)
Mutual labels:  type-safety
Typestrict
ESLint config focused on maximizing type safety 💪
Stars: ✭ 182 (-58.54%)
Mutual labels:  type-safety
HashedExpression
Type-safe modelling DSL, symbolic transformation, and code generation for solving optimization problems.
Stars: ✭ 40 (-90.89%)
Mutual labels:  type-safety
regbits
C++ templates for type-safe bit manipulation
Stars: ✭ 53 (-87.93%)
Mutual labels:  type-safety
yants
Yet Another Nix Type System | Source has moved to https://git.tazj.in/tree/nix/yants
Stars: ✭ 35 (-92.03%)
Mutual labels:  type-safety
Truth
A Domain Representation Language
Stars: ✭ 23 (-94.76%)
Mutual labels:  type-safety
Unchained
A fully type safe, compile time only units library.
Stars: ✭ 70 (-84.05%)
Mutual labels:  type-safety
typed flags
Type-safe and human-readable set of bool flags
Stars: ✭ 23 (-94.76%)
Mutual labels:  type-safety
Dimensioned
Compile-time dimensional analysis for various unit systems using Rust's type system.
Stars: ✭ 235 (-46.47%)
Mutual labels:  type-safety
genTypeScript
Auto generation of type-safe bindings between Reason and Typescript.
Stars: ✭ 75 (-82.92%)
Mutual labels:  type-safety
Ts Toolbelt
ts-toolbelt is the largest, and most tested type library available right now, featuring +200 utilities. Our type collection packages some of the most advanced mapped types, conditional types, and recursive types on the market.
Stars: ✭ 3,099 (+605.92%)
Mutual labels:  type-safety
tsafe
🔩 The missing TypeScript utils
Stars: ✭ 285 (-35.08%)
Mutual labels:  type-safety
eslint-plugin-total-functions
An ESLint plugin to enforce the use of total functions (and prevent the use of partial functions) in TypeScript.
Stars: ✭ 72 (-83.6%)
Mutual labels:  type-safety
type-lite
type - Strong types for C++98, C++11 and later in a single-file header-only library
Stars: ✭ 25 (-94.31%)
Mutual labels:  type-safety
playwarts
WartRemover warts for Play Framework.
Stars: ✭ 23 (-94.76%)
Mutual labels:  type-safety

Github Workflow Status Discord

Coalton is an efficient, statically typed functional programming language that supercharges Common Lisp.

Coalton can be written in files:

(in-package #:coalton-user)

(coalton-toplevel
  (define-type Symbol
    (Symbol String))

  (define (symbol-name sym)
    (match sym
      ((Symbol s) s)))

  (define-instance (Eq Symbol)
    (define (== a b)
      (== (symbol-name a) (symbol-name b))))

  (define-type Expr
    "A symbolic expression of basic arithmetic."
    (EConst Integer)
    (EVar   Symbol)
    (E+     Expr Expr)
    (E*     Expr Expr))

  (declare diff (Symbol -> Expr -> Expr))
  (define (diff x f)
    "Compute the derivative of F with respect to X."
    (match f
      ((EConst _)   ; c' = 0
       (EConst 0))
      ((EVar s)     ; x' = 1
       (if (== s x) (EConst 1) (EConst 0)))
      ((E+ a b)     ; (a+b)' = a' + b'
       (E+ (diff x a) (diff x b)))
      ((E* a b)     ; (ab)' = a'b + ab'
       (E+ (E* (diff x a) b)
           (E* a          (diff x b))))))

 (declare dt (Expr -> Expr))
 (define dt
   "The time derivative operator."
   (diff (Symbol "t"))))

And at the REPL:

CL-USER> (in-package #:coalton-user)
COALTON-USER> (coalton (dt (E+ (EVar (Symbol "t"))
                               (EConst 1))))
#.(E+ #.(ECONST 1) #.(ECONST 0))

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 may only work on SBCL 2.1.x.

Getting Started

Prepare: Install SBCL (on macOS with Homebrew: brew install sbcl). Install Quicklisp by following instructions here. (The step command involving gpg is not needed.) After installing Quicklisp, you should have a quicklisp folder which will make installing Coalton easier.

Install: Clone this repository into a place your Lisp can see (e.g., ~/quicklisp/local-projects/). Coalton is not yet on Quicklisp.

Use: Either run (ql:quickload :coalton), or add #:coalton to your ASD's :depends-on list. Quicklisp will automatically download all of Coalton's dependencies.

Test: Compile the tests with (ql:quickload :coalton/tests), then run the tests with (asdf:test-system :coalton).

Learn: We recommend starting with the Intro to Coalton document, and then taking a peek in the examples directory. It may also be helpful to check out the introductory blog post.

What's Here?

This repository contains the source code to the Coalton compiler, and the standard library.

It also contains a few example programs, such as:

Lastly and importantly, we maintain a collection of documentation about Coalton in the docs directory, including a standard library reference guide.

Get Involved

Want to ask a question about Coalton, propose a feature, or share a cool program you wrote? Try posting in the GitHub Discussions page!

We welcome contributions of all forms, especially as we stabilize toward a 1.0 release. We would be grateful to receive:

  • bug reports (filed as issues),
  • bug fixes and typo corrections (filed as pull requests),
  • small example programs, and
  • user experience troubles.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].