My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

Subscript is an extension to the Scala programming language that is based on the Algebra of Communicating Processes (ACP). It adds "scripts" as a new refinement construct, that contain a kind of algebraic expressions.

Threading and event-handling are badly supported by mainstream programming languages: the flow of control is often unclear, and programmers lose overview. The result is frozen applications and stressed users.

Subscript aims to improve this situation. It supports parallelism and non-deterministic choice as much as sequential composition. Event-handling code is easily mixed with normal code. You can easily express

  • the "grammars" of Graphical User Interfaces
  • concurrency, e.g., in the benchmark program Sieve of Eratosthenes
  • language grammars, which are useful when parsing texts
  • discrete event simulations

Here are a Technical Report, a White Paper, and a PowerPoint presentation of a lecture at Amsterdam University for the course Thread Algebra.

For a quick look, consider a simple lookup application:

In Java this is still quite hard to program, due to the threading aspects. In SubScript you can program this easily and concisely:

  searchSequence    = searchCommand    showSearchingText 
                      searchInDatabase showSearchResults

  searchCommand     = searchButton
  showSearchingText = @gui: {outputTA.text = "Searching: "+searchTF.text}
  showSearchResults = @gui: {outputTA.text = "Found: 3 items"}
  searchInDatabase  = {* Thread.sleep 3000 *} // simulate a time consuming action

The Wiki provides a more detailed explanation and some other examples. It also highlights the theoretical background, and describes the language features and the implementation model. Among others:

Note that these Wiki pages are meant to become a explanation and reference for an initial implementation and language definition; the aim of these pages is not to give programmers and researchers a clear and well dosed introduction and specification; these will only arrive after an implementation is made available.

Subscript succeeds the language Scriptic, which is freely available on Google Code. Subscript applies some lessons learnt from Scriptic usage in 2010:

  • simplified syntax for old functionality
  • simplified semantics for process communication
  • simplified support for 'forcing' parameters
  • removed language features for discrete event simulations
  • allow for plug-in support for discrete event simulations, parallel execution etc
  • syntactic sugar for very concise specifications
  • support for communication over networks and pipes
  • support for more flavours of parallelism and suspension operators
  • unambiguous language definition

To get a partial feeling for Subscript programming, you could try out Scriptic. An installation guide and student assignments are available at the Scriptic Wiki.

I am looking for feedback and support. Feel free to contact me at andre.vandelft at gmail.

André van Delft

Powered by Google Project Hosting