{"id":17053301,"url":"https://github.com/noughtmare/interact_ackermann","last_synced_at":"2026-05-17T19:38:05.738Z","repository":{"id":96827004,"uuid":"209285525","full_name":"noughtmare/interact_ackermann","owner":"noughtmare","description":"Interaction nets vs GHC performance comparison","archived":false,"fork":false,"pushed_at":"2019-09-18T15:50:44.000Z","size":24,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T02:47:27.420Z","etag":null,"topics":["haskell","interaction-nets"],"latest_commit_sha":null,"homepage":null,"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/noughtmare.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":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-18T10:52:45.000Z","updated_at":"2023-03-25T04:09:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"f449303c-5077-493e-942d-9225dcfa4f63","html_url":"https://github.com/noughtmare/interact_ackermann","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/noughtmare/interact_ackermann","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noughtmare%2Finteract_ackermann","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noughtmare%2Finteract_ackermann/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noughtmare%2Finteract_ackermann/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noughtmare%2Finteract_ackermann/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noughtmare","download_url":"https://codeload.github.com/noughtmare/interact_ackermann/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noughtmare%2Finteract_ackermann/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33152128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"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":["haskell","interaction-nets"],"created_at":"2024-10-14T10:11:51.996Z","updated_at":"2026-05-17T19:38:05.720Z","avatar_url":"https://github.com/noughtmare.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# interact_ackermann\n\nInteraction nets vs GHC performance comparison\n\nIn this repository I have tried to implement interaction nets as described in [Yves Lafont (1990), Interaction Nets](https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.112.2822).\n\nI think the explicit duplication agent acts like a kind of automatic reference counting mechanism. Suprisingly, this seems to be faster than GHC's garbage collector.\n\nI haven't written a full compiler. Nevertheless, I expect that the C files could be generated automatically from a higher level discription of the interaction net.\n\nOne of the things that I experienced was that ordering of some of the functions inside the rules can be important. The current ordering is the best one I have found by trial and error. I do not know if it is possible to automatically determine the optimal order.\n\nBefore I made this a git repository I just duplicated the file to get primitive versioning. The current development file is `interact_ackermann.c`. The best version right now is `interact_ackermann_call_stack.c`. The others do not work correctly yet. It is called `call_stack` because it (ab)uses the call stack to store the interactions that are pending.\n\n## Running the benchmark\n\nThe C implementation of interaction nets requires [GJAlloc](https://github.com/arneg/GJAlloc) to be installed.\n\nThen just run `./bench.sh`. That will compile, run and time the programs.\n\n## Current results\n\n```\nCommand being timed: \"./interact_ackermann_call_stack\"\nUser time (seconds): 5.31\nSystem time (seconds): 0.00\nPercent of CPU this job got: 99%\nElapsed (wall clock) time (h:mm:ss or m:ss): 0:05.31\nAverage shared text size (kbytes): 0\nAverage unshared data size (kbytes): 0\nAverage stack size (kbytes): 0\nAverage total size (kbytes): 0\nMaximum resident set size (kbytes): 3800\nAverage resident set size (kbytes): 0\nMajor (requiring I/O) page faults: 0\nMinor (reclaiming a frame) page faults: 632\nVoluntary context switches: 1\nInvoluntary context switches: 7\nSwaps: 0\nFile system inputs: 0\nFile system outputs: 0\nSocket messages sent: 0\nSocket messages received: 0\nSignals delivered: 0\nPage size (bytes): 4096\nExit status: 0\n```\n\n```\nCommand being timed: \"./interact_ackermann-hs\"\nUser time (seconds): 8.07\nSystem time (seconds): 0.01\nPercent of CPU this job got: 99%\nElapsed (wall clock) time (h:mm:ss or m:ss): 0:08.09\nAverage shared text size (kbytes): 0\nAverage unshared data size (kbytes): 0\nAverage stack size (kbytes): 0\nAverage total size (kbytes): 0\nMaximum resident set size (kbytes): 7516\nAverage resident set size (kbytes): 0\nMajor (requiring I/O) page faults: 0\nMinor (reclaiming a frame) page faults: 1174\nVoluntary context switches: 1\nInvoluntary context switches: 111\nSwaps: 0\nFile system inputs: 0\nFile system outputs: 0\nSocket messages sent: 0\nSocket messages received: 0\nSignals delivered: 0\nPage size (bytes): 4096\nExit status: 0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoughtmare%2Finteract_ackermann","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoughtmare%2Finteract_ackermann","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoughtmare%2Finteract_ackermann/lists"}