{"id":31424004,"url":"https://github.com/xieyuheng/inet-lisp","last_synced_at":"2025-09-30T03:11:34.951Z","repository":{"id":305453841,"uuid":"970793154","full_name":"xieyuheng/inet-lisp","owner":"xieyuheng","description":"An implementation of interaction nets.","archived":false,"fork":false,"pushed_at":"2025-09-10T09:37:44.000Z","size":3244,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-10T12:52:59.194Z","etag":null,"topics":["computation-model","graph-processing","inet","interaction-nets","interpreter","language-design","linear-logic","lisp","lisp-like","scalable-c"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xieyuheng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-22T14:44:17.000Z","updated_at":"2025-09-10T09:37:48.000Z","dependencies_parsed_at":"2025-09-10T11:09:10.459Z","dependency_job_id":"04f65b9b-4bf9-49a7-9c9c-2361a0d66e19","html_url":"https://github.com/xieyuheng/inet-lisp","commit_stats":null,"previous_names":["xieyuheng/inet-lisp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xieyuheng/inet-lisp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xieyuheng%2Finet-lisp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xieyuheng%2Finet-lisp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xieyuheng%2Finet-lisp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xieyuheng%2Finet-lisp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xieyuheng","download_url":"https://codeload.github.com/xieyuheng/inet-lisp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xieyuheng%2Finet-lisp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277623155,"owners_count":25849188,"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","status":"online","status_checked_at":"2025-09-30T02:00:09.208Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["computation-model","graph-processing","inet","interaction-nets","interpreter","language-design","linear-logic","lisp","lisp-like","scalable-c"],"created_at":"2025-09-30T03:11:30.941Z","updated_at":"2025-09-30T03:11:34.927Z","avatar_url":"https://github.com/xieyuheng.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# inet-lisp\n\nMoore's Law is broken.\n\n![Figure 6.11: MIPS/Clock-Frequency Trend for Intel CPUs](assets/images/mips-clock-frequency-trend-for-intel-cpus.png)\n\n(Figure 6.11: MIPS/Clock-Frequency Trend for Intel CPUs, from [\"Is Parallel Programming Hard, And, If So, What Can You Do About It?\"](https://www.kernel.org/pub/linux/kernel/people/paulmck/perfbook/perfbook.html), by Paul E. McKenney)\n\nThe exponential increase in single-threaded performance halted in about 2003.\nTherefore, increasing performance will increasingly require parallelism.\n\nHow do we program a machine with many cores?\n\nOne possible solution is the graph-based computation model\n-- [interaction nets](https://en.wikipedia.org/wiki/Interaction_nets) --\nwhere a program in this computation model can automatically\nmake use of any number cores in the machine.\n\nThis project is an implementation of interaction nets\nas a [lisp-like language](https://en.wikipedia.org/wiki/lisp_(programming_language)).\n\n## Syntax\n\n```\n(define-node \u003cname\u003e \u003cport-name\u003e ...)\n(define-rule \u003cpattern\u003e \u003cexp\u003e ...)\n(define-rule* (\u003cpattern\u003e ...) \u003cexp\u003e ...)\n(define \u003cname\u003e \u003cexp\u003e)\n(define (\u003cname\u003e \u003carg-name\u003e ...) \u003cexp\u003e ...)\n```\n\n## Examples\n\n### Natural Number\n\nDefine three nodes `(zero)`, `(add1)` and `(add)`:\n\n```\n(define-node zero value!)\n(define-node add1 prev value!)\n(define-node add target! addend result)\n```\n\n```\nvalue!   value!        result\n  |        |             |\n(zero)   (add1)        (add)\n           |           /   \\\n          prev    target!  addend\n```\n\nThe rule between `(add1)` and `(add)`:\n\n```\n(define-rule (add (add1 prev) addend result)\n  (add1 (add prev addend) result))\n```\n\n```\n     result            result           result\n       |                 |                |\n     (add)      =\u003e                =\u003e    (add1)\n     /   \\                 \\              |\n(add1)   addend           addend        (add)\n   |                 |                  /   \\\n prev              prev              prev   addend\n```\n\nThe rule between `(zero)` and `(add)`:\n\n```\n(define-rule (add (zero) addend result)\n  (connect addend result))\n```\n\n```\n     result         result        result\n       |              |             |\n     (add)     =\u003e             =\u003e    |\n     /   \\              \\            \\\n(zero)   addend        addend       addend\n```\n\nExample interaction:\n\n```\n       |                   |                   |              |\n     (add)               (add1)              (add1)         (add1)\n     /   \\                 |                   |              |\n(add1)    (add1)         (add)               (add1)         (add1)\n   |        |    =\u003e      /   \\       =\u003e        |        =\u003e    |\n(add1)    (add1)    (add1)    (add1)         (add)          (add1)\n   |        |          |        |            /   \\            |\n(zero)    (zero)    (zero)    (add1)    (zero)   (add1)     (add1)\n                                |                  |          |\n                              (zero)             (add1)     (zero)\n                                                   |\n                                                 (zero)\n```\n\nThe whole program with test:\n\n```\n(define-node zero value!)\n(define-node add1 prev value!)\n(define-node add target! addend result)\n\n(define-rule (add (zero) addend result)\n  (connect addend result))\n\n(define-rule (add (add1 prev) addend result)\n  (add1 (add prev addend) result))\n\n(define (two) (add1 (add1 (zero))))\n\n(add (two) (two))\n```\n\n### List\n\n```\n(define-node null value!)\n(define-node cons head tail value!)\n(define-node append target! rest result)\n\n(define-rule (append (null) rest result)\n  (connect rest result))\n\n(define-rule (append (cons head tail) rest result)\n  (cons head (append tail rest) result))\n\n(define-node sole value!)\n\n(append\n (cons (sole) (cons (sole) (cons (sole) (null))))\n (cons (sole) (cons (sole) (cons (sole) (null)))))\n```\n\n### More\n\nFor more examples, please see the [examples/](examples/) directory.\n\n## Docs\n\n- [Programming with Interaction Nets](docs/articles/programming-with-interaction-nets.md)\n- [反应网编程](docs/articles/反应网编程.md)\n\n## Community\n\n- [Discord / concatenative #inet](https://discord.gg/EcUfwRkbdx)\n\n## Install\n\nCompile:\n\n```\ngit clone https://github.com/xieyuheng/inet-lisp\ncd inet-lisp\nmake -j\nmake test\n```\n\nThe compiled binary `./bin/inet-lisp` is the command-line program.\n\n```sh\n$ ./bin/inet-lisp\ninet-lisp 0.1.0\n\ncommands:\n  run -- run files\n  info -- print system info\n  test-self -- run self test\n  test-packages -- run test for packages\n  version -- print version\n  help -- print help message\n```\n\nFor examples:\n\n```sh\n./bin/inet-lisp run examples/readme/nat.test.lisp\n```\n\n## Development\n\n```shell\nmake -j       # compile src/ files to lib/ and bin/\nmake run      # compile and run the command-line program\nmake test     # compile and run test\nmake clean    # clean up compiled files\n```\n\n## Implementations\n\n- [inet-cute](https://github.com/xieyuheng/inet-cute)\n- [inet-js](https://github.com/xieyuheng/inet-js)\n- [inet-forth](https://github.com/xieyuheng/inet-forth)\n- [inet-lisp-st](https://github.com/xieyuheng/inet-lisp-st)\n- [inet-lisp](https://github.com/xieyuheng/inet-lisp)\n\n## References\n\n**Papers**:\n\n- [1990-interaction-nets](./docs/references/1990-interaction-nets.pdf)\n- [1997-interaction-combinators](./docs/references/1997-interaction-combinators.pdf)\n\n**Books**:\n\n- [scalable c](https://github.com/booksbyus/scalable-c)\n\n## License\n\n[GPLv3](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxieyuheng%2Finet-lisp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxieyuheng%2Finet-lisp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxieyuheng%2Finet-lisp/lists"}