Skip to content

A programming language based on the untyped lambda calculus.

Notifications You must be signed in to change notification settings

aliclark/smooth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smooth is a pure, untyped, strictly evaluating Lambda Calculus language with
S-expression syntax and macros.

This project implements a compiler for Smooth.


This language and compiler is different from others in that:

* The compiler will reduce lambda expressions at compile time,
  effectively running as much of the program as possible before compiling the
  rest.

* The compiler will perform whole-program optimisation.

* The compiler implementation is very modular, allowing language
  features to be easily implemented, changed or tested independently. The
  intermediate code representation is always plain text.

* The module system is extremely modular. It combines ideas from
  Java's dependency injection for module dependencies, and Node.js/Javascript's
  notion of modules as first-class language objects.

* A key priority of the language design is that the output of the
  compiler should be tiny, even potentially without a dependency on libc.


Because lambda expressions are reduced at compile time:

* It is possible to perform run-time type checking which actually runs
  at compile time, thus allowing the language to be it's own Turing complete
  static dependent type system.

* There is no run-time cost to the module system in using first-class
  modules as inputs and outputs to other modules.

* Macros are first-class during compile time. If any macros are
  unevaluated before run-time this will be flagged as an error. This means that
  macros can be supplied as dependencies to a module in the same way as normal
  functions.


This project is still at an early stage, so the generated code is slow and the
error messages are nearly non-existent.

The program src/comments.smc is written in the Smooth programming language
(albeit in a very Scheme-like way).

To build this program, run ./build-comments.sh in the directory root of the
project.

Both the build script and code should give a starting point for writing code in
the language now, but as the language grows it will start to look much less
like Scheme code (and become more practicably useful to program in Smooth as
opposed to any other language).

About

A programming language based on the untyped lambda calculus.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published