GithubHelp home page GithubHelp logo

plumpmath / zhang Goto Github PK

View Code? Open in Web Editor NEW

This project forked from clozhang/zhang

0.0 1.0 0.0 2.84 MB

An implementation of the Erlang process model in Clojure core.async

License: Other

Makefile 23.57% Clojure 76.43%

zhang's Introduction

張 zhang

Build Status Dependencies Status Clojars Project

An implementation of the Erlang process model in Clojure core.async

Table of Contents

Introduction

The zhang project aims to create a very minimal library in Clojure, built on core.async, that, as closely as possible, implements the Erlang process model. It does not aim to provide any opionions about (and thus even less, any implementations for) either message structure or infrastructure necessary for supporting remote processes.

As such, zhang should be a general-purpose, low-level library for the JVM ideally suited for anyone who is interested in building systems with functions that offer capabilities of communication.

Desired features include:

  • quickly creating and destroying processes
  • safe "crashing" of a process
  • quickly sending messages between processes
  • support large numbers of processes
  • shared nothing
  • message passing
  • function mailboxes
  • ordered save queues
  • timeouts
  • pattern matching (core.match) and selective receive
  • process registration hooks (in order to support arbitrary publishing mechanisms)

How processes register with a publication mechanism and how they communicate with each other (either locally or remotely) is beyond the scope of the zhang library. As an example, the Clojang library (which intends to use zhang) will provide implementation details for these -- it just needs an underlying process model amenable to its implementation goals.

Documentation

Documentation for zhang is regularly generated and made available here:

Usage

TBD

Background

TBD

Origins

The zhang project came about, like so many software projects, through the time-honored process of yak-shaving. The particular yak that spawned zhang was associated with the Clojang project, which in turn was a yak-shaving response to Erlang's [JInterface](http://erlan g.org/doc/apps/jinterface/jinterface_users_guide.html) (in particular the desire to have a low-level Clojure-idiomatic wrapper for JInterface).

One of the issues that arose when working on Clojang was the number of threads created when connecting nodes and the lack of light-weight (non-OS) processes for creating Clojure servers that communicate with Erlang processes. This limits the number of nodes that can be created and doesn't really allow programmers to fully explore the power of Erlang's processing model on the JVM. (In all fairness, this was never the intent of JInterface; instead, it is a Java translation of Erlang Ports, allowing basic interoperability between Java and Erlang programs.)

To work around this, we wanted to create servers in Clojure using the core.async library, which brings light-weight, non-OS processes to Clojure programmers. The core.async library was inspired by Tony Hoare's work on communicating sequential processes (CSP) originally described in a 1978 paper. That paper (and significant subsequent work) influenced the design of concurrency in the C# language as well as the concurrency model used in the Go programming language. Both of these heavily influenced the design and implementation of core.async in Clojure.

And this is the purpose of zhang: to build a close approximation of the Erlang process model using the channels, messages, go blocks, etc., of Clojure's core.async library -- thus allowing us to create highly scalable, concurrent applications in Clojure.

Erlang, JInterface, & Clojang

TBD

Akka/Okku & Quasar/Pulsar

TBD

A Note on the Name

The zhang project takes it's name from Zhang Heng, who approximated π early in the first millennium (Han Dynasty). This is an obscure pun, since the Erlang process model could be, in some ways, interpreted as an approximation of the π-calculus. In addition to being a mathematician, Zhang Heng was also a poet, astronomer, and engineer -- a wonderful patron for a software project!

License

Copyright © 2016-2017 Duncan McGreggor

Distributed under the Apache License, Version 2.0.

zhang's People

Contributors

oubiwann avatar

Watchers

James Cloos 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.