GithubHelp home page GithubHelp logo

jtkristensen / pun-lang Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 4.32 MB

The Fun programming language, extended with built-in utilities for property based testing.

License: Other

Haskell 100.00%

pun-lang's Introduction

The pun Programming Language : A Fun Programming Language with Properties.

tests hlint

Pun is a small functional programming langauge (similar to the Fun langauge from Pierce's "Types and Progamming Languages", and the REC language from Glynn Winskel's "The Formal Semantics of Programming Langauges").

The main feature is a property declaration, which has the syntactic form:

propery <name> <parameters> . <term> .

that lets the programmer specify properties to be checked by QuickCheck, only that rather than having to write a generator by hand, the pun interpreter will generate terms to substitute in for the parameters.

Example, here is a property.

property plus-is-commutative m n . m + n = n + m .

Which will check that the term m + n = n + m normalizes to true for a suitable handful of choices of m and n that make the term well-typed.

Installation

Assuming that you have the haskell build-tool stack installed. You should be able to install pun by running

> stack install

from within the repository.

Artifact

To reproduce the result the paper currently submitted to IFL, run

pun --check examples/ifl1.pun
pun --check examples/ifl2.pun

Getting started.

To typecheck a a program, run:

> pun --types <program-name>.pun

and start typing in terms to evaluate.

To run the properties specified in a program, pass the flag --check like so:

> pun --check <program-name>.pun

the folder ./examples contains a number of example programs to get you started.

pun-lang's People

Contributors

jtkristensen avatar triera avatar sophiebosio avatar

Stargazers

Oliver Jahren avatar  avatar cybai (Haku) avatar Niels G. W. Serup avatar  avatar Michael Kirkedal Thomsen avatar

Watchers

Michael Kirkedal Thomsen avatar  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.