Description of a Very Small
Functional Programming Language

Adjust your browser width for optimal viewing


Purpose

This language is intended as a programming project for CSCI 5220, Program Translation. The project is to write a compiler and interpreter for a very small programming language called SFL.

This page only describes the language, not how to implement it. See implementation of SFL for a discussion of the implementation.


Types

SFL is a typeless language. That means that all type checking, where needed, is done at run time.


Trees

When your program runs, each value is represented as a tree. Details of that are discussed in implementation of SFL.


Run-time error handling

Sometimes an expression cannot produce a value. For example, you cannot divide by 0, you cannot take the head of an empty list, and you cannot do an and unless both of the operands are boolean values. You might be asked to add a boolean value to a function.

All such errors will cause a program to stop immediately, and to show the tree that caused the error.


Language description

  1. Introduction
  2. Lexical structure
  3. Names
  4. Expressions
  5. Definitions
  6. Programs and actions