{"id":18014842,"url":"https://github.com/zevv/nimcoro","last_synced_at":"2025-09-10T03:33:48.348Z","repository":{"id":150599218,"uuid":"267314042","full_name":"zevv/nimcoro","owner":"zevv","description":"Nim coroutine based async \"from scratch\"","archived":false,"fork":false,"pushed_at":"2021-08-09T05:04:32.000Z","size":29,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T13:49:38.486Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zevv.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":"2020-05-27T12:30:42.000Z","updated_at":"2022-11-11T09:29:12.000Z","dependencies_parsed_at":"2023-06-11T17:15:31.579Z","dependency_job_id":null,"html_url":"https://github.com/zevv/nimcoro","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/zevv%2Fnimcoro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fnimcoro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fnimcoro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fnimcoro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zevv","download_url":"https://codeload.github.com/zevv/nimcoro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198466,"owners_count":20900081,"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":[],"created_at":"2024-10-30T04:11:22.958Z","updated_at":"2025-04-04T15:14:25.561Z","avatar_url":"https://github.com/zevv.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nThis is a little proof-of-concept prject to see if I can get Lua-style\ncoroutines semantics in Nim, and use this to build an alternative async\nimplementation. It's built on very low level primitives only: the `posix` lib\nfor sockets and `poll()`, and a small wrapper around the posix `ucontext`\nfunctions.\n\nThere's a few moving parts in this project:\n\n- coro.nim: This implements simple coroutines based on ucontext. This are\n  basically Lua-style coroutines, but because of Nims static typing it is hard\n  to implement the Lua way of passing data through `yield()` and `resume()`.\n  For now I've chosen not to pass data at all, as there are enough other ways\n  to do that outside of the core coroutine\n\n- evq.nim: This is a very basic and naive event loop implementation: register\n  file descriptors with read or write events and a proc, and your proc will\n  be called back when the file descriptor is ready.\n \n- io.nim: Here the above two modules come together to create very friendly\n  async I/O. Look at the `waitForFd()` proc to see what is happening.\n\n- main.nim: This example creates a listening TCP socket which can handle\n  multiple clients, which are all run inside coroutines.\n\nNote that the curent coro implementation confuses Nim's GC, run with `--gc:arc`!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzevv%2Fnimcoro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzevv%2Fnimcoro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzevv%2Fnimcoro/lists"}