{"id":16679568,"url":"https://github.com/mfelsche/pony-uring","last_synced_at":"2025-04-09T22:32:43.006Z","repository":{"id":40803431,"uuid":"462491658","full_name":"mfelsche/pony-uring","owner":"mfelsche","description":"io_uring support for Pony :ring: :horse:","archived":false,"fork":false,"pushed_at":"2023-04-21T07:26:20.000Z","size":5273,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T00:26:33.167Z","etag":null,"topics":["io-uring","ponylang"],"latest_commit_sha":null,"homepage":"https://mfelsche.github.io/pony-uring","language":"JavaScript","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/mfelsche.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":"2022-02-22T22:10:59.000Z","updated_at":"2023-04-25T08:24:21.000Z","dependencies_parsed_at":"2025-02-15T23:31:15.940Z","dependency_job_id":"8cde65f8-31c0-427d-8269-69b2fd813bbf","html_url":"https://github.com/mfelsche/pony-uring","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/mfelsche%2Fpony-uring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfelsche%2Fpony-uring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfelsche%2Fpony-uring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfelsche%2Fpony-uring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mfelsche","download_url":"https://codeload.github.com/mfelsche/pony-uring/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248123877,"owners_count":21051546,"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":["io-uring","ponylang"],"created_at":"2024-10-12T13:36:11.432Z","updated_at":"2025-04-09T22:32:42.997Z","avatar_url":"https://github.com/mfelsche.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# io_uring bindings for ponylang\n\n[**Slides**](https://mfelsche.github.io/pony-uring)\n\nThis library exposes [liburing](https://github.com/axboe/liburing) bindings to Pony programmers.\n\n## Build\n\nThis lib can only be built on linux for rather obvious reasons, as io_uring is only supported on linux. I know there is some windows work going on, but that is beyond my reach. Help here is most welcome.\n\nThis lib includes `liburing` and links it statically, if you integrate this lib via [corral](https://github.com/ponylang/corral) into you Pony application. See the [example](./example) for more information.\n\nIt needs to build both `liburing` and a small pony wrapper for exposing some hidden functions via FFI for pony. Thus building Pony apps with this library requires:\n\n  * `Make`\n  * a C compiler\n  * `ar` and `ranlib` (part of the `binutils` package on most systems)\n  * `wget`.\n\n## Why not integrating io_uring into the Pony runtime?\n\nThe runtime is designed around polling systems like epoll or kqueue that signal readiness for file descriptors to take certain actions. The usual way how you would do IO in pony is try to write/read, if it fails because it would block, register the fd via an asio event in the asio subsystem (Not to be confused with any C++ IO library, this is a custom pony IO abstraction). The runtime would send a special message to your actor (who created the asio event) via a behaviour called `_event_notify` and you would need to check if the event says the file descriptor is readable or writeable.\n\nThe model of io_uring is a little different in that you get true asynchronous IO operations. You don't need to try and if it won't work, it will block the thread and you gotta retry later. You just submit the operation to the kernel and at some point the kernel tells you that it completed.\n\nThe pony runtime in `libponyrt` would need to be redesigned for io_uring. At least I didn't find a good way to integrate it into the runtime.\n\n## Example\n\nHave a look into the [./example] directory.\n\nExample output showing probing capabilities and a single NOP operation being submitted and completed and received:\n\n```\nio_uring on Kernel 6.2.6-76060206-generic\nOPCODE                        SUPPORTED\n=======================================\nIORING_OP_NOP                 ✅\nIORING_OP_READV               ✅\nIORING_OP_WRITEV              ✅\nIORING_OP_FSYNC               ✅\nIORING_OP_READ_FIXED          ✅\nIORING_OP_WRITE_FIXED         ✅\nIORING_OP_POLL_ADD            ✅\nIORING_OP_POLL_REMOVE         ✅\nIORING_OP_SYNC_FILE_RANGE     ✅\nIORING_OP_SENDMSG             ✅\nIORING_OP_RECVMSG             ✅\nIORING_OP_TIMEOUT             ✅\nIORING_OP_TIMEOUT_REMOVE      ✅\nIORING_OP_ACCEPT              ✅\nIORING_OP_ASYNC_CANCEL        ✅\nIORING_OP_LINK_TIMEOUT        ✅\nIORING_OP_CONNECT             ✅\nIORING_OP_FALLOCATE           ✅\nIORING_OP_OPENAT              ✅\nIORING_OP_CLOSE               ✅\nIORING_OP_FILES_UPDATE        ✅\nIORING_OP_STATX               ✅\nIORING_OP_READ                ✅\nIORING_OP_WRITE               ✅\nIORING_OP_FADVISE             ✅\nIORING_OP_MADVISE             ✅\nIORING_OP_SEND                ✅\nIORING_OP_RECV                ✅\nIORING_OP_OPENAT2             ✅\nIORING_OP_EPOLLCTL            ✅\nIORING_OP_SPLICE              ✅\nIORING_OP_PROVIDE_BUFFERS     ✅\nIORING_OP_REMOVE_BUFFERS      ✅\nIORING_OP_TEE                 ✅\nIORING_OP_SHUTDOWN            ✅\nIORING_OP_RENAMEAT            ✅\nIORING_OP_UNLINKAT            ✅\nIORING_OP_MKDIRAT             ✅\nIORING_OP_SYMLINKAT           ✅\nIORING_OP_LINKAT              ✅\nIORING_OP_MSG_RING            ✅\nIORING_OP_FSETXATTR           ✅\nIORING_OP_SETXATTR            ✅\nIORING_OP_FGETXATTR           ✅\nIORING_OP_GETXATTR            ✅\nIORING_OP_SOCKET              ✅\nIORING_OP_URING_CMD           ✅\nIORING_OP_SEND_ZC             ✅\nIORING_OP_SENDMSG_ZC          ✅\nNop completed with 0\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfelsche%2Fpony-uring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmfelsche%2Fpony-uring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfelsche%2Fpony-uring/lists"}