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.
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.
scalaVersion := "2.10.0"(seebuild.sbt)sbt(older versions may be required)sdf2tablemust be available onPATH- 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.
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
smith <module path> <module name> [term]
Smith expects:
- A module path, where it will look for the needed modules.
- A module name, e.g.
mainorfoo.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