Git Product home page Git Product logo

hlc's Introduction

HLC

Henry's Lambda Calculus.

I envison HLC to inhabit some of the stylistic choices in programming languge design, which also being completely true to the assignment (hw06).

Grammar

The grammar for HLC is the following:


  <program> ::=
  | Module <name> { *<statement> }
  | Executable <name> { *<statement> } Main { <expression> }
  | Main { <expression> }

  <statement> ::=
  | Definition <name> := { <expression> }

  <expression> ::=
  | <primitive>
  | <variable>
  | <name> => <expression>                  # lambda
  | <expression> <expression>               # application
  | <name> := <expression> ; <expression>   # binding
  | ( <expression> )                        # association

  <primitive> ::=
  | unit                                    # unit
  | true | false                            # booleans
  | <natural>                               # naturals 0,1,2,...
  | +<natural> | -<natural>                 # integers

  <variable> ::= <name>

  <name> ::= <string>

Note the following conventions:

  • *pattern is a possibly-empty list of pattern

Running

To run HLC on a program, do

  make run source=<source.hlc>

If the program has a Main, the Main body will be normalized then output.

For example, to run the program in examples/sample1.hlc, do

  make run source=examples/sample.hlc

To toggle verbosity, do

  make run source=<source.hlc> verbosity=<level>

where the verbosity levels are

level description
0 output,
1 warnings
2 notes
3 logs

Organization

Building

The behind-the-scenes process for building and running HLC is the following:

  1. ml-build gathers the sml source files, as specified by hlc.cm
  2. ml-build builds a heap image main.amd64-darwin
  3. sml @SMLload main.amd64-darwin <source.hlc> runs the main function specified in main.sml, passing <source.hlc> as an argument

hlc's People

Contributors

rybla avatar

Watchers

James Cloos 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.