GithubHelp home page GithubHelp logo

jswalens / chocolalib Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 82 KB

Chocola as an extension of Clojure

Home Page: https://chocola.jnwllm.be

License: Eclipse Public License 1.0

Clojure 48.19% Java 51.81%
stm software-transactional-memory futures actors research concurrency parallelism clojure

chocolalib's Introduction

Chocola

Chocola – composable concurrency

Chocola is a Clojure library for concurrent and parallel programming. It provides futures, transactions, and actors. It is unique in ensuring that these three models work correctly even when they are combined.

You can find more information and code examples at https://chocola.jnwllm.be/.

Getting started

Because this library monkey-patches Clojure, it is a bit complicated to get working: we need to make sure it is loaded before Clojure, i.e. the Chocola jar must appear earlier in the classpath than Clojure. Assuming you use Leiningen, you can follow these steps:

  1. In a temporary folder, checkout this repository and create the 'uberjar':
$ git clone https://github.com/jswalens/chocolalib.git
$ lein uberjar

This creates the file target/chocola-2.0.1-standalone.jar, which contains Clojure 1.10.1, Chocola, and its dependencies (core.match).

  1. Copy this file into the resources folder of your project. (The folder can have another name too.)

  2. Update your project's project.clj to add the following lines:

  :resource-paths ["resources/chocola-2.0.1-standalone.jar"]
  :injections [(require 'chocola.core)]

The first line will make sure that Chocola and its dependencies are loaded. The second line injects a call to include Chocola in your code, which will patch Clojure and modify its internals to use Chocola's semantics.

Some code examples of Chocola can be found at https://chocola.jnwllm.be/.

Publications

We published about (the ideas behind) Chocola in the following academic papers:

You can find a lot more information in my PhD thesis.

If you use this software in an academic context, please cite the following paper:

@article{10.1145/3427201,
    author = {Swalens, Janwillem and {De Koster}, Joeri and {De Meuter}, Wolfgang},
    title = {{Chocola: Composable Concurrency Language}},
    journal = {ACM Transactions on Programming Languages and Systems},
    year = {2021},
    month = jan,
    volume = {42},
    number = {4},
    articleno = {17},
    numpages = {56},
    publisher = {Association for Computing Machinery},
    address = {New York, NY, USA},
    issn = {0164-0925},
    doi = {10.1145/3427201},
    url = {https://doi.org/10.1145/3427201},
}

To do

  • Documentation:
    • Check whether getting started always works as expected
    • Add documentation on how to use Chocola and explain its semantics
  • Implementation:
    • Garbage collection of unreachable actors (currently, unreachable actors will stay idle forever)
    • Interaction with exceptions/errors (seems to mostly work correctly, but exhaustive testing is needed)
    • commute (doesn't work as expected in transactional futures)
    • Performance improvements (see TODOs throughout code)

License

Copyright © 2018–2019 Janwillem Swalens, Software Languages Lab, Vrije Universiteit Brussel. Distributed under the Eclipse Public License, included in the file LICENSE.

chocolalib's People

Contributors

jswalens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.