Giter Club home page Giter Club logo

zaml's Introduction

A type-inferred, statically typed functional programming language inspired by OCaml and Lambda calculus.

Documentation

Syntax

<ident> ::= words

<expr> ::= <const>
       | <expr> <bop> <expr>
       | "let" <ident> (<ident>*)? "=" <expr>
       | "let" <ident> "=" <expr> "in" <expr>
       | "if" <expr> "then" <expr> "else" <expr>
       | "fun" <ident>+ "->" <expr>
       | <const> (<const>)+
        
<bop> ::= "+" | "++" | "-" | "*" | "/" | "%" | "@" | "::" | "==" | "!=" | "<" | "<=" | ">" | ">="

<const> ::= <simple_expr>
        | <ident>
        | "[" <expr_list>? "]"
        | int ".." int
        | "(" <expr> ")"

<expr_list> ::= <expr> (";" <expr_list>)?

<simple_expr> ::= int
              | char
              | str
              | unit
              | true
              | false

Running

There are two options for running zaml:

-> Running the REPL:

dune exec zaml

-> Interpret from a .zml file:

dune exec zaml example.zml

Testing

dune runtest

TODO list

-> Next-up

  • Better Syntax Errors
    • Line Positions
    • Character Positions
      • REPL
      • Intepreter (they don't reset for some reason)

-> Core Language

  • Evaluation
  • Let variable expressions
  • Let function expressions
  • Let tuple with destructuring
  • Lambda expressions
  • If expressions
  • Partial Applications
  • Match expressions
  • Algebraic effects
  • Ranges (1..31 -> [1; 2; ... 30; 31])
  • Standard library
    • Universal print function
    • ! (or not, function for booleans)
    • Figure out what else to include
  • Binary operators
    • Universal ops
      • ==
      • !=
      • > , =>
      • <, =<
    • Int ops
      • -
      • -
      • -
      • /
      • %
    • String ops
      • ++ (string concat)
      • I don't know yet
    • 'a list
      • @ (append)
      • :: (cons)
  • Garbage Collection

-> Types

  • Typechecking (Generalized Hindley-Milner (inspired by Didier Remy))
  • Refinement types
  • Union types
  • Algebraic data types
  • Data types
    • Unit
    • Int
    • Bool
    • Char
    • Float
    • String
    • Var
    • Arrow (x -> y)
    • Product (tuples)
    • 'a list
    • 'a array

zaml's People

Contributors

zazedd avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.