croczilla.com 
 home   stratified   oni   bits&pieces   blog   personal   
  home > oni

Oni - an Embedded Structured Concurrency Language

Oni is a framework for managing the control flow of concurrent applications. There are two central ideas to Oni:

  • To make concurrent actions composable by implementing control structures with which asynchronous actions can be choreographed in the same way that traditional sequential languages implement control structures for choreographing synchronous actions.
  • To leverage the facilities of a "host language" rather than implement a complete programming language from scratch.

Oni can be implemented as a set of functions ("Oni operators") in a suitable host language, such as JavaScript or C++ (any reasonable language will do). Our current implementation, dubbed Oni/JS, is in JavaScript, targeted at in-browser use (should work in any modern browser - FF, Chrome, Safari, IE, ...). Oni/JS also forms the basis of the runtime for Stratified JavaScript.

Oni requires no preprocessing or precompilation; an Oni program is a just an expression in the host language.

Oni leverages the type system, control structures and asynchronous facilities (message loop, etc) of the host language. Constructs (functions, etc) from the host language can be "lifted" into an Oni program. Conversely, Oni features can be introduced retroactively into a conventional program without requiring the whole program to be converted to a different style in any way.

Documentation & Examples

Main documentation

Mailing list

  • We have a very low-volume mailing list for Oni discussions and announcements here. Please consider subscribing to be kept up to date with ongoing Oni developements.

Presentations


Download it

Core Oni/JS

The browser-based version of the core Oni language consists of a single Javascript file which can be downloaded here:

Oni is included into a webpage like this:

<script type="text/javascript" src="oni.js"></script>

Oni should work with any modern browser. We've tested FF3, IE7, IE8, Chrome, Safari 3.2.

Oni/JS Ajax library

oni-ajax.js, the Oni/JS extension library for client-side Ajax programming can be downloaded here:


Future plans

Oni is usable in its current form, but it is still at the prototype stage. Syntax and semantics will probably be refined and changed over time.

Some particular areas under investigation include:

  • Consolidating oni_fexps and oni_exps, so that Exec & Apply become obsolete. DONE
  • Adding a 'Complete' operator which protects its children from being aborted. DONE
  • Adding a cleanup mechanism a la unwind-protect ('Bracket' operator). DONE
  • Add facilities for call-by-need semantics.
  • Adding first-class continuation support a la call/cc. This is not a good idea after all; we want Oni to be 'structured' in time as well, i.e. the dynamic extent of a call should always be a connected time period. This would not be the case if we had call/cc.
  • Making the language more axiomatic.