{"id":45181185,"url":"https://github.com/Comcast/littlesheens","last_synced_at":"2026-03-05T08:01:18.668Z","repository":{"id":48678057,"uuid":"116726167","full_name":"Comcast/littlesheens","owner":"Comcast","description":"A Sheens implementation that has a small footprint","archived":false,"fork":false,"pushed_at":"2021-07-14T15:33:17.000Z","size":134,"stargazers_count":16,"open_issues_count":6,"forks_count":9,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-07-21T01:39:03.627Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Comcast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-08T20:45:36.000Z","updated_at":"2025-03-25T10:52:37.000Z","dependencies_parsed_at":"2022-08-29T05:21:59.259Z","dependency_job_id":null,"html_url":"https://github.com/Comcast/littlesheens","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Comcast/littlesheens","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Flittlesheens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Flittlesheens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Flittlesheens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Flittlesheens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Comcast","download_url":"https://codeload.github.com/Comcast/littlesheens/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Flittlesheens/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30115662,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T03:40:26.266Z","status":"ssl_error","status_checked_at":"2026-03-05T03:39:15.902Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-20T10:00:30.838Z","updated_at":"2026-03-05T08:01:18.643Z","avatar_url":"https://github.com/Comcast.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# A minimalist C library for working with Sheens\n\n## Summary\n\nA minimalist [Sheens](https://github.com/Comcast/sheens)\nimplementation in ECMAScript that's executed by\n[Duktape](http://duktape.org/) and wrapped in a C library.  Yes, that\ndoes sound a little odd.\n\nThe stripped 32-bit demo executable is 360KB.  The core ECMAScript\ncode (un-minified) is less than 40KB (11KB minified).  An experimental\n[nodejs](https://nodejs.org/en/) module is available (via `make\nnodejs`).\n\nSee that [Sheens repo](https://github.com/Comcast/sheens) for more\ndocumentation about these machines.\n\n## License\n\nThis repo is licensed under [Apache License 2.0](LICENSE).\n\n## API\n\nSee `machines.h`.\n\n## A demo\n\nFor now, running the demo requires two tools written in\n[Go](https://golang.org/), so you need Go installed to build this\ndemo.  (We'll remove this unncessary dependency soon.)\n\n```Shell\ngo get github.com/bronze1man/yaml2json\ngo get github.com/tdewolff/minify/cmd/minify\nmake demo\n./demo\n```\n\n## Another demo\n\nThis demo is a simple process that reads messages from `stdin` and\nwrites output to `stdout`.\n\n```Shell\nmake specs/turnstile.js specs/double.js sheensio\n\n# Define a \"crew\" of two machines.\ncat\u003c\u003cEOF \u003e crew.json\n{\"id\":\"simpsons\",\n \"machines\":{\n   \"doubler\":{\"spec\":\"specs/double.js\",\"node\":\"listen\",\"bs\":{\"count\":0}},\n   \"turnstile\":{\"spec\":\"specs/turnstile.js\",\"node\":\"locked\",\"bs\":{}}}}\nEOF\n\n# Send messages to that crew.\ncat\u003c\u003cEOF | ./sheensio -d\n{\"double\":1}\n{\"double\":10}\n{\"double\":100}\n{\"input\":\"push\"}\n{\"input\":\"coin\"}\n{\"input\":\"coin\"}\n{\"input\":\"push\"}\nEOF\n```\n\nThe above is in `demo.sh`.\n\n\n## Yet another demo\n\nThis demo shows how to do some primitive Sheens work from Javascript\n(`demo.js`).\n\n```Shel\nmake demo\n./demo driver.js demo.js\n```\n\n## Utilities\n\nThe `driver` executable will execute (`mach_eval`) code in files given\non the command line.  The environment includes what's in the directory\n`js` and in the file `driver.js`, so you can experiment directly with\nthose functions.  For example, if the file `check.js` contains\n\n```Javascript\nJSON.stringify(match(null, {\"likes\":\"?x\"}, {\"likes\":\"tacos\"}, {}));\n```\n\nThen\n\n```Shell\n./driver check.js\n```\n\nshould write\n\n```Javascript\n[{\"?x\":\"tacos\"}]\n```\n\nPer the documentation for `mach_eval`, the code that's executed should\nreturn a string.\n\n\n## Discussion\n\n### Routing\n\n`driver.js` implements optional routing that can present a message\nonly to machines specified in that message.  If a message has a `\"to\"`\nproperty, the value should be a string or an array of strings.  The\nmessage is then only presented to the machine or machines with those\nids.\n\nFor example, `{\"to\":\"doubler\",\"double\":1}` will only be sent to a\nmachine with id `doubler` (if it exists).  The message\n`{\"to\":[\"this\",\"that\"],...}` will only be presented to the machines\nwith ids `this` and `that` (if they exist).  Note that the entire\nmessage (including the `\"to\"` property) is still present to the target\nmachines.\n\n### Nodejs\n\nLittle Sheens has some crude support for [Node.js](https://nodejs.org/en/).\n\n```Shell\nmake nodejs\n```\n\nThat command might make the Node module `node-littlesheens`.  [This\nexample](sheens.ipynb) [Jupyter](http://jupyter.org/) notebook\ndemonstrates a little of the available functionality.\n\n### \"Lua programs can also be little\"\n\nA [start](misc/match.lua) at a [Lua](https://www.lua.org/)-based\nLittle Sheens?  (Should end up in another repo if worthy.)\n\n## docker\n\nUse the following to set up docker container for dev environment.\n\n```\ndocker build -t gears/littlesheens:latest .\ndocker run -i -t -v $HOME/go:/go gears/littlesheens:latest /bin/bash\n```\n\n## Code of Conduct\n\nWe take our [code of conduct](CODE_OF_CONDUCT.md) seriously. Please\nabide by it.\n\n\n## Contributing\n\nPlease read our [contributing guide](CONTRIBUTING.md) for details on\nhow to contribute to our project.\n\n\n## References\n\n1. [Sheens](https://github.com/Comcast/sheens)\n1. [Duktape](http://duktape.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FComcast%2Flittlesheens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FComcast%2Flittlesheens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FComcast%2Flittlesheens/lists"}