Code Monkey home page Code Monkey logo

asyncpi's Introduction

asyncpi Build Status Go Reference

An implementation of asynchronous π-calculus in Go.

The basic syntax accept is given below, for details (including syntactic sugar), see docs.

P,Q ::= 0           nil process
      | P|Q         parallel composition of P and Q
      | (new a)P    generation of a with scope P
      | !P          replication of P, i.e. infinite parallel composition  P|P|P...
      | u<v>        output of v on channel u
      | u(x).P      input of distinct variables x on u, with continuation P

Install

go get -u go.nickng.io/asyncpi

Play

cmd/asyncpi is a simple REPL front end for the package, with very basic support for parsing, free name calculation, process reduction and code fragment generation.

Build and install

go install go.nickng.io/asyncpi/cmd/asyncpi

Run

$ asyncpi
async-π> parse
.......> a<b,c,d> | a(x,y,z).x().0 | b<> | c(z).0 | (new c)c<d>
((((a<b,c,d> | a(x,y,z).x().0) | b<>) | c(z).0) | (new c)c<d>)
async-π> reduce
Reducing: ((((a<b,c,d> | a(x,y,z).x().0) | b<>) | c(z).0) | (new c)c<d>)
(((b().0 | b<>) | c(z).0) | (new c)c<d>)
async-π> reduce
Reducing: (((b().0 | b<>) | c(z).0) | (new c)c<d>)
(c(z).0 | (new c)c<d>)
async-π> reduce
Reducing: (c(z).0 | (new c)c<d>)
(c(z).0 | (new c)c<d>)
async-π> codegen
/* start generated code */

go func() { z := <-c /* end */ }()
c := make(chan interface{})
c <- d

/* end generated code */
async-π> exit

License

asyncpi is licensed under the Apache License

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.