{"id":21866876,"url":"https://github.com/rootmos/silly-actor","last_synced_at":"2025-06-12T12:34:31.243Z","repository":{"id":82434238,"uuid":"119512275","full_name":"rootmos/silly-actor","owner":"rootmos","description":"Small actor model implementation that compiles to C using nanopass-framework","archived":false,"fork":false,"pushed_at":"2024-11-02T06:05:24.000Z","size":149,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T16:12:52.909Z","etag":null,"topics":["actor-model","compiler","nanopass-framework","scheme"],"latest_commit_sha":null,"homepage":"","language":"Scheme","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rootmos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-30T09:19:40.000Z","updated_at":"2024-11-02T06:05:28.000Z","dependencies_parsed_at":"2023-06-15T16:15:20.865Z","dependency_job_id":null,"html_url":"https://github.com/rootmos/silly-actor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootmos%2Fsilly-actor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootmos%2Fsilly-actor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootmos%2Fsilly-actor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootmos%2Fsilly-actor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootmos","download_url":"https://codeload.github.com/rootmos/silly-actor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244870831,"owners_count":20523937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["actor-model","compiler","nanopass-framework","scheme"],"created_at":"2024-11-28T05:07:47.026Z","updated_at":"2025-03-21T21:24:55.412Z","avatar_url":"https://github.com/rootmos.png","language":"Scheme","funding_links":[],"categories":[],"sub_categories":[],"readme":"silly-actor\n===========\n[![Build image and run tests](https://github.com/rootmos/silly-actor/actions/workflows/build.yaml/badge.svg)](https://github.com/rootmos/silly-actor/actions/workflows/build.yaml)\n\nA small proof of concept [actor system](https://en.wikipedia.org/wiki/Actor_model), with a [nanopass](https://github.com/nanopass/nanopass-framework-scheme) compiler targeting C with a runtime utilizing a [Boehm-Demers-Weiser](https://www.hboehm.info/gc/) garbage collector.\n\nExamples\n--------\n\n### Example: 01\n```scheme\n(system\n  ((init Main ()))\n  (define (Main) (Init (output (state)))))\n```\n#### Output\n```scheme\n(())\n```\n\n### Example: 02\n```scheme\n(system\n  ((init Main ()))\n  (define (Main) (_ (seq (output 1) (output 2)))))\n```\n#### Output\n```scheme\n((number . 1) (number . 2))\n```\n\n### Example: 03\n```scheme\n(system\n  ((init Main 7))\n  (define (Main) (_ (output (state)))))\n```\n#### Output\n```scheme\n((number . 7))\n```\n\n### Example: 04\n```scheme\n(system\n  ((init Main ()))\n  (define (Main) (8 (output success)) (_ (send (self) 8))))\n```\n#### Output\n```scheme\n((atom . success))\n```\n\n### Example: 05\n```scheme\n(system\n  ((init Main ()))\n  (define (Main)\n    (_ (seq (send (self) 8)\n            (become (actor (8 (output success))) (state))))))\n```\n#### Output\n```scheme\n((atom . success))\n```\n\n### Example: 06\n```scheme\n(system\n  ((init Main ()))\n  (define (Aux) (7 (output (state))) (_ ()))\n  (define (Main)\n    (_ (let ([Id (spawn Aux success)]) (send Id 7)))))\n```\n#### Output\n```scheme\n((atom . success))\n```\n\n### Example: 07\n```scheme\n(system\n  ((init Main ()))\n  (define (Aux) (7 (output (state))) (_ ()))\n  (define (Main) (_ (send (spawn Aux success) 7))))\n```\n#### Output\n```scheme\n((atom . success))\n```\n\n### Example: 08\n```scheme\n(system\n  ((init Main ()))\n  (define (Main)\n    (_ (let ([X 7]) (match 7 ['X (output success)])))))\n```\n#### Output\n```scheme\n((atom . success))\n```\n\n### Example: 09\n```scheme\n(system\n  ((init Main ()))\n  (define (Main) (_ (match '(1 2) [(X _) (output X)]))))\n```\n#### Output\n```scheme\n((number . 1))\n```\n\n### Example: 10\n```scheme\n(system\n  ((init Main ()))\n  (define (Aux) (7 (reply 8)) (_ ()))\n  (define (Main)\n    (_ (seq (send (spawn Aux ()) 7)\n            (output (recv (8 success)))))))\n```\n#### Output\n```scheme\n((atom . success))\n```\n\n### Example: 11\n```scheme\n(system\n  ((init Main ()))\n  (define (Aux)\n    (7 (seq (reply 8) (reply 13)))\n    (9 (reply 10))\n    (_ ()))\n  (define (Main)\n    (_ (let ([Id (spawn Aux ())])\n         (seq (output (call Id 7 (8 a)))\n              (output (call Id 9 (10 b))))))))\n```\n#### Output\n```scheme\n((atom . a) (atom . b))\n```\n\n### Example: 12\n```scheme\n(system\n  ((init Main ()))\n  (define (Aux) (Init (send (parent) foo)))\n  (define (Main) (Init (spawn Aux ())) (foo (output bar))))\n```\n#### Output\n```scheme\n((atom . bar))\n```\n\n### Example: 13\n```scheme\n(system\n  ((init Main ()))\n  (define (Aux) (na (output failure)))\n  (define (Main)\n    (Init (stay (spawn Aux ())))\n    ((Died Match_error Msg)\n      (let ([true (= (state) (from))]) (output Msg)))))\n```\n#### Output\n```scheme\n((sys . Init))\n```\n\n### Example: 14\n```scheme\n(system\n  ((init Main ()))\n  (define (Counter)\n    (poke (stay (+ (state) 1)))\n    (tell (output (state)))\n    (_ ()))\n  (define (Main)\n    (Init\n      (let ([Id (spawn Counter 0)])\n        (match (send Id poke)\n          [1 (output whoops)]\n          [2 (output whoops)]\n          [(A B) (output whoops)]\n          [() (send Id tell)])))))\n```\n#### Output\n```scheme\n((number . 1))\n```\n\n### Example: 15\n```scheme\n(system\n  ((init Main ()))\n  (define (Main)\n    (Init (send (self) 0))\n    (X (match (= X 100000)\n         [false (send (self) (+ X 1))]\n         [true (output success)]))))\n```\n#### Output\n```scheme\n((atom . success))\n```\n\n### Example: arith\n```scheme\n(system\n  ((init Main ()))\n  (define (Main) (_ (seq (output (+ 1 2)) (output (+ 0 7))))))\n```\n#### Output\n```scheme\n((number . 3) (number . 7))\n```\n\n### Example: eq\n```scheme\n(system\n  ((init Main ()))\n  (define (Main)\n    (_ (seq (output (= 1 1)) (output (= 1 2)) (output (= 1 foo))\n            (output (= foo foo)) (output (= foo bar)) (output (= () ()))\n            (output (= 1 ()))))))\n```\n#### Output\n```scheme\n((atom . true) (atom . false) (atom . false) (atom . true)\n  (atom . false) (atom . true) (atom . false))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootmos%2Fsilly-actor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootmos%2Fsilly-actor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootmos%2Fsilly-actor/lists"}