Skip to content

apexsloth/smith

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smith

Status: Archived / Historical Thesis Prototype

This repository contains the implementation for a master's thesis project.

It is kept as a historical reference and is not planned for active development. The core ideas may still be useful, but the implementation depends on an older Scala/SBT toolchain and external parsing tools.

Abstract

Functional programming languages come with several predefined binding structures, such as lambda abstractions, let expressions, monadic do notations and list comprehension. We specify and implement a programming language that allows defining new sequential and parallel binders. In addition, it is possible to add new syntax for such binders and other language elements.

These binding structures are implemented through functions, which have to fulfill certain type requirements. These implementations are then used to transform the application of binders and bindings to more primitive language expressions, such as abstraction and application.

Definitions of binders and bindings are type checked, so that only the type information (and not the implementation) is required to check their application. Errors in the definitions of such binding structures can be found before they are used. Furthermore, the consistency requirements for binding structures ensure type safety for applications with arguments of the appropriate type.

The semantic analysis is performed before the transformation to primitive expressions. As a result, error messages are relative to the original input.

Legacy Toolchain / Requirements

  • scalaVersion := "2.10.0" (see build.sbt)
  • sbt (older versions may be required)
  • sdf2table must be available on PATH
    • Historically this came from the SDF 2.6.3 Linux binary distribution (the original project URL appears to be unavailable now)

Notes:

  • This project may not build or run cleanly on modern JVM / SBT / OS setups without extra compatibility work.
  • The parser/tooling stack is from an older Spoofax/SDF era.

Getting Smith to Run (Legacy)

git clone https://github.com/linges/smith.git
cd smith/
sbt compile
sbt "run testFiles main"

If everything worked out, you should see something like:

Result: 5

Usage

smith <module path> <module name> [term]

Smith expects:

  • A module path, where it will look for the needed modules.
  • A module name, e.g. main or foo.bar.A.
  • An optional term which is evaluated in the context of the given module. If the term is omitted, "main" is used.

That means, in order to run it with sbt, call:

sbt "run <module path> <module name> [term]"

Or start an sbt session and run:

run testFiles main

About

Functional programming language with user defined binders and syntax

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors