An open API service indexing awesome lists of open source software.

https://github.com/comcast/littlesheens

A Sheens implementation that has a small footprint
https://github.com/comcast/littlesheens

Last synced: about 1 year ago
JSON representation

A Sheens implementation that has a small footprint

Awesome Lists containing this project

README

          

# A minimalist C library for working with Sheens

## Summary

A minimalist [Sheens](https://github.com/Comcast/sheens)
implementation in ECMAScript that's executed by
[Duktape](http://duktape.org/) and wrapped in a C library. Yes, that
does sound a little odd.

The stripped 32-bit demo executable is 360KB. The core ECMAScript
code (un-minified) is less than 40KB (11KB minified). An experimental
[nodejs](https://nodejs.org/en/) module is available (via `make
nodejs`).

See that [Sheens repo](https://github.com/Comcast/sheens) for more
documentation about these machines.

## License

This repo is licensed under [Apache License 2.0](LICENSE).

## API

See `machines.h`.

## A demo

For now, running the demo requires two tools written in
[Go](https://golang.org/), so you need Go installed to build this
demo. (We'll remove this unncessary dependency soon.)

```Shell
go get github.com/bronze1man/yaml2json
go get github.com/tdewolff/minify/cmd/minify
make demo
./demo
```

## Another demo

This demo is a simple process that reads messages from `stdin` and
writes output to `stdout`.

```Shell
make specs/turnstile.js specs/double.js sheensio

# Define a "crew" of two machines.
cat< crew.json
{"id":"simpsons",
"machines":{
"doubler":{"spec":"specs/double.js","node":"listen","bs":{"count":0}},
"turnstile":{"spec":"specs/turnstile.js","node":"locked","bs":{}}}}
EOF

# Send messages to that crew.
cat<