The goal of this project is to release the developer from the burden to deal with constructs for parallelism such as threads, tasks and processes and their respective synchronization mechanism such as locks, messages, futures etc. We provide a programming model that is free of new abstractions but still allows the compiler and runtime system to exploit the inherent parallelism in your program.
So, what is your programming model then?
The heart of our programming model is the concept of a stateful function, that is a function that may use some additional state to compute a result, very similar to methods in object oriented languages.
– What?! That’s not new, I do that all the time when I write code!
You can now use it like a regular method in an algorithm.
Just as you would in any object oriented language you first initialize the state and then operate on it. Ohua makes sure that, even though we run your program implicitly parallel, that state access is efficiently synchronized and safe. The reason we call it “stateful function” and not method, is that you are not restricted to methods. You can freely choose the pairing of function and state. Of the function is a method, the state is its object, if its not, it simply receives it as an additional first argument.
In our example the state allows us to gather all the friends in
_alreadyGreeted. For a list of
– Ok, I got that but show me some parallelism already!
Well, that’s about it. You won’t see any parallelism in the code. That’s the
whole point of Ohua. You don’t have to worry about it, the compiler and runtime
system will do that for you! In the above code, Ohua finds the pipeline
printToStdOut and tells the runtime system
to compute the next greeting in parallel to printing the current one.
Show me Code!
- Parallelize your Rust code with the ohua-rust-runtime
- The standalone compiler for algorithms: ohuac (usually used in conjunction with an Ohua backend/runtime)
- Make your enterprise application both fast and secure with the ohua-jvm-integration with support for both Java and Clojure (also on clojars)
- Batch you I/O with little to no effort using the Yauhau project
- Hack on/with the ohua-core library to make your own Ohua or help us make it better
- The principles of Ohua as an embedded Haskell library for implicit parallelism: stc-lang. The name derives from the associated publication.
You can also visit the Ohua Development Organization. The Ohua core library, compiler and backends are developed under this umbrella.
If you are looking for an overview of the ideas and concepts that underpin Ohua then have a look at this presentation.
Here we list the papers we have published about Ohua and its applications.
- Combining monads and the Ohua programming paradigm in Haskell for embedded implicit parallel programming (link)
- Some internals of our compiler and transformations to optimize I/O in the context of micro-service deployments can be found here and were published also here.
- Stateful loops (
smap) and their translation into dataflow have been applied to bottlenecks in big data engines have been published here.
- The idea of stateful functions and algorithms that a compiler can translate into a dataflow-based runtime system can be found here.
For a more extensive and structured view see the bibliography.