Code Monkey home page Code Monkey logo

kind's Introduction

banner

 

crates.io discord.invite build.badge

Kind is a pure functional programming language and proof assistant.

Getting startedExamplesInstallation

 

Getting started

It is a complete rewrite of Kind1, based on HVM, a lazy, non-garbage-collected and massively parallel virtual machine. In our benchmarks, its type-checker outperforms every alternative proof assistant by a far margin, and its programs can offer exponential speedups over Haskell's GHC. Kind2 unleashes the inherent parallelism of the Lambda Calculus to become the ultimate programming language of the next century.

Welcome to the inevitable parallel, functional future of computers!

Examples

Pure functions are defined via equations, as in Haskell:

// Applies a function to every element of a list
Map <a> <b> (list: List a) (f: a -> b) : List b
Map a b Nil              f             = Nil
Map a b (Cons head tail) f             = Cons (f head) (Map tail f)

Theorems can be proved inductively, as in Agda and Idris:

// Black Friday Theorem. Proof that, for every Nat n: n * 2 / 2 == n.
BlackFridayTheorem (n: Nat)     : Equal Nat (Nat.half (Nat.double n)) n
BlackFridayTheorem Nat.zero     = Equal.refl
BlackFridayTheorem (Nat.succ n) = Equal.apply (x => Nat.succ x) (BlackFridayTheorem n)

For more examples, check the Kindex.

Installation

First, install Rust first, then enter:

cargo +nightly install kind2

Then, use any of the commands below:

Command Usage Note
Check kind2 check file.kind2 Checks all definitions.
Eval kind2 eval file.kind2 Runs using the type-checker's evaluator.
Run kind2 run file.kind2 Runs using HVM's evaluator, on Rust-mode.
To-HVM kind2 to-hvm file.kind2 Generates a .hvm file. Can then be compiled to a rust crate using HVM.
To-KDL kind2 to-kdl file.kind2 Generates a .kdl file. Can then be deployed to Kindelia.

The rust crate can be generated via HVM:

kind2 to-hvm file.kind2 > file.hvm
hvm compile file.hvm

kind's People

Contributors

algebraic-sofia avatar victortaelin avatar developedby avatar kings177 avatar aripiprazole avatar samueldurantes avatar derenash avatar denisgorbachev avatar franchufranchu avatar gimbling-away avatar nreilingh avatar mjh316 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.