ParaSail Programming Language
ParaSail is a new parallel programming language designed to support the development of inherently safe and secure, highly parallel applications that can be mapped to multicore, manycore, heterogeneous, or distributed architectures. Javallel and Parython are versions of the ParaSail technology adapted for Java and Python. (Thanks to Abouzar Abassi for elegant new ParaSail logo.)
ParaSail LLVM-based Compiler
We are making a new, major release of the ParaSail llvm-based compiler (release 8.4 – parasail_release_8_4.zip). ParaSail was originally based only on an interpreter for the ParaSail “virtual machine” (PSVM). We also now have a translator from PSVM instructions to LLVM instructions, and from there to object code. The translator was initially written in ParaSail itself, by Justin Hendrick (Cornell 2016) during a summer 2014 internship in Boston, and then re-engineered in 2016, based on an updated PSVM that provides a closer connection to LLVM’s register-based architecture.
ParaSail Introduction
ParaSail stands for Parallel Specification and Implementation Language. As implied by its full name, ParaSail is for both specifying and implementing parallel applications. As such, it includes high-level specification features, including parameterized modules with full separation of interface from implementation, pre- and postconditions for individual operations within a module, invariants that apply across all operations within a module, and constraints that apply to individual instances of a module.
ParaSail provides support for both implicit and explicit parallelism. Every ParaSail expression is defined to have parallel evaluation semantics. That is, given a ParaSail expression like F(X) + G(Y), the language rules ensure that it is safe to evaluate F(X) and G(Y) in parallel. The compiler makes the decision based on complexity or other criteria whether a given computation should be created as a potentially parallel activity. An underlying scheduler then maps these potentially parallel activities to particular processing resources, by default using a work-stealing approach, which provides load balancing across processors while also providing good locality of reference and minimal cache contention.
The primary approach to ensuring the safe parallelism is by simplification of the language, with the elimination of features that interfere with safe parallelization. In particular, ParaSail:
-
eliminates global variables – operations may only access variables passed as parameters;
-
eliminates parameter aliasing – two parameters passed to the same operation must not refer to the same object if either parameter is updateable within the operation;
-
eliminates pointers – optional and expandable objects and generalized indexing provides an approach that allows safe parallelization;
-
eliminates run-time exception handling – strong compile-time checking of preconditions and support for parallel event-handling provides a safer alternative;
-
eliminates a global garbage-collected heap – automatic storage management is provided using region-based storage management which provides immediate, automatic reclamation of storage with none of the global contention and disruption associated with a global garbage-collected heap;
-
eliminates explicit threads, lock/unlock, or signal/wait – parallel activities are identified automatically by the compiler, and language rules prevent data races between readers and writers of the same object, while explicitly concurrent objects can be used for safe synchronization when concurrent access from multiple readers and writers is required, without any need for explicit lock/unlock or signal/wait.
Writings on ParaSail
Here are some introductory articles, videos, and other documentation on ParaSail:
-
Programming Journal Issue 3.3, February 2019, ParaSail: A Pointer-Free Pervasively-Parallel Language for Irregular Computations (click the PDF link above the abstract for the full paper, or go directly to: arXiv.org)
-
Talk at Microsoft Research, October 2012, ParaSail: A Pointer-Free Path to Object-Oriented Parallel Programming Slides for presentation are here.
-
Presentation given at TU Dresden July 2013: ParaSail: Less is More with Multicore
-
ParaSail programming language blog – covers ParaSail language design process starting September 2009
-
Tutorial at SPLASH 2013 on multicore programming using divide-and-conquer and work stealing
-
CotsJournalOnline.com:Parallel Programming Languages Enable Safer Systems
ParaSail, Javallel, and Parython Documentation and Download
Here is the latest download and reference manual:
-
Latest source and binary (Linux, Mac, and Windows) release of ParaSail llvm-based Compiler, plus the ParaSail Interpreter, Interactive Debugger, and Virtual Machine, revision 8.4 (includes sources and binaries for Javallel and Parython as well): parasail_release_8_4.zip
-
Older version: ParaSail Interpreter and Virtual Machine release, revision 8.0 (includes binaries for Javallel and Parython as well): parasail_release_8_0.zip
-
ParaSail Reference manual: parasail_ref_manual.pdf
Comments or Questions
Please direct your comments or questions to the Google Group for ParaSail:
Examples
import PSL::Short_Names::*, * func Greetings() is Println("Hello, World!") end func Greetings func Fib(N : Int) {N >= 0} -> Int is // '{N >= 0}' is a precondition to this function // Checked preconditions are part of the language if N <= 1 then return N else // Left and right side of '+' are computed in parallel return Fib(N - 1) + Fib(N - 2) end if end func Fib func Increment_All(var Nums : Vector<Int>) is // This function takes a 'var' parameter. // The modifications made here will be seen by caller for each Elem of Nums concurrent loop // The 'concurrent' keyword tells the compiler that // iterations of the loop can happen in any order. // It will choose the optimal number of picothreads to use Elem += 1 end loop end func Increment_All func Sum_Of_Squares(N : Int) -> Int is // Built-in and inherently parallel map-reduce // Initial value is enclosed with angle brackets return (for I in 1 .. N => <0> + I ** 2) end func Sum_Of_Squares
See the blog or download ParaSail (above) for more examples.
Subject to change. ParaSail is a work in progress.