Escalator

Escalator Logo A Tool for Literate Programming, Executable Documentation, and Interactive Exploration in Scala

Download; Source

What is Escalator?

While Escalator is not all things to all people, it does attempt to be several things to at least a few people. In particular:

Escalator was designed for use in educational settings: for in-class demonstrations and experimentation, for student use as an alternative to console interaction, for the display of interactive tutorials, and for the documentation of student projects and homework. However, we would be delighted if it proved useful in non-educational settings as well; one of our design goals was to allow Escalator to work well with existing source tools, and a near-term project is to integrate Escalator with sbt, the simple build tool.

Examples

Here is an example of including some source code; the command is // source 'demo/BST.scala' object Tree / def search:

demo/BST.scala
  def search[T <% Ordered[T]](x: T, tree: Tree[T]): Boolean = tree match {
    case Tip => false
    case Node(left, value, right) if x < value => search(x, left)
    case Node(left, value, right) if x > value => search(x, right)
    case _ => true
  }

This is what the result of running an example looks like:

Show source
> println("Hello World!")
Hello World!

> 2+2
res1: Int = 4

> import demo._
import demo._

> import Tree._
import Tree._

> search(4, insert(2, insert(6, insert(4, Tip))))
res2: Boolean = true

And here is a sample of test output:

Show source
Specification "Spec1"
  + 2+2 is 4
  x 2+2 is 5
    '4' is not equal to '5' (<console>:16)
Total for specification "Spec1":
Finished in 0 second, 297 ms
2 examples, 2 expectations, 1 failure, 0 error

(Be sure to look at the source in each case).

Here is what Escalator does with a (very small) source tree: demo

Here is the start of a set of tutorials on using Scala: tut


The Escalator team is led by Dr. Brian Howard (bhoward@depauw.edu) at DePauw University as a part of the Scales Project. This research was supported by NSF REU grant number CCF-0851812.


Of course, this site was generated by Escalator; look at the Escalator source for this page.

Here is Escalator 1.0, a different approach to writing literate Scala programs which is no longer maintained.