{"id":31166250,"url":"https://github.com/bassosimone/minimk","last_synced_at":"2026-05-19T10:01:49.516Z","repository":{"id":312614923,"uuid":"1045593567","full_name":"bassosimone/minimk","owner":"bassosimone","description":"Network Measurement Library","archived":false,"fork":false,"pushed_at":"2025-08-31T21:16:13.000Z","size":630,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-31T23:33:40.804Z","etag":null,"topics":["c11","coroutines","cxx11","network-measurements","networking","socket-io"],"latest_commit_sha":null,"homepage":"https://bassosimone.github.io","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/bassosimone.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-27T12:26:03.000Z","updated_at":"2025-08-31T21:16:16.000Z","dependencies_parsed_at":"2025-08-31T23:33:45.447Z","dependency_job_id":"c3756bb7-31f1-43c2-b6bc-56698451e923","html_url":"https://github.com/bassosimone/minimk","commit_stats":null,"previous_names":["bassosimone/minimk"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bassosimone/minimk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bassosimone%2Fminimk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bassosimone%2Fminimk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bassosimone%2Fminimk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bassosimone%2Fminimk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bassosimone","download_url":"https://codeload.github.com/bassosimone/minimk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bassosimone%2Fminimk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275917646,"owners_count":25552447,"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-19T02:00:09.700Z","response_time":108,"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":["c11","coroutines","cxx11","network-measurements","networking","socket-io"],"created_at":"2025-09-19T09:56:17.845Z","updated_at":"2025-09-19T09:56:19.225Z","avatar_url":"https://github.com/bassosimone.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mini Measurement Kit\n\n[![Build](https://img.shields.io/badge/build-ninja-blue)](#build-instructions) [![C++](https://img.shields.io/badge/C%2B%2B-11-informational)](#features) [![License: GPL-3.0-or-later](https://img.shields.io/badge/license-GPL--3.0--or--later-brightgreen)](LICENSE)\n\n![\"Questa volte sul serio!\" (Dicono sempre così...)](docs/minimk.png)\n\nMini Measurement Kit (`minimk`) is a personal, hobby\nproject to reimplement [measurement-kit/measurement-kit](\nhttps://github.com/measurement-kit/measurement) and\n[measurement-kit/libndt](https://github.com/measurement-kit/libndt)\nas a small C++11 library exposing a C API.\n\n## Features\n\nThe project is in its early stage of development. The overall\nimplementation direction is the following:\n\n1. C++11 without using exceptions, RTTI, or the C++ stdlib\nto keep the binary size as small as possible and as free as\npossible from bloated dependencies with the overall goal\n(perhaps aspirational, but we will see) to weigh less than\n1 MiB when compiled without debug symbols with `-O2`.\n\n2. Cooperative single-threaded multitasking using coroutines\nand suspend/resume on timers as well as I/O events (only\nsupporting sockets because Windows complicates supporting\nother kinds of handles).\n\n3. Support for the following targets `linux/amd64`, `linux/arm64`,\n`windows/amd64`, `windows/arm64`, `darwin/arm64`. This should\ninclude the ability to compile for Android and iOS.\n\n4. Target-specific files side-by-side in the same directory (e.g.,\ncoroutine switching in assembly and specific wrappers around system\ncalls): `switch_linux_amd64.hpp`, `stack_windows.hpp`, etc.\n\n5. Adopting secure coding standards and support testability by\nsplitting units into three subcomponents: (1) a C API inside\na C header file, (2) a testable template instantiated *at compile\ntime* with either actual or mocked dependencies, (3) a C++ file\nthat implements the C header by instantiating the corresponding\ntemplate using the actual dependencies. This provides us with\nthe ability to write testable code but also allows us to generate\nthis code at compile time and avoid some bloat.\n\n6. Support DNS-over-UDP, TLSv1.3, HTTP/1.1, HTTP/2, DNS-over-TCP,\nDNS-over-TLS, QUIC, HTTP/3 and DNS-over-QUIC. Support for the\nrunning ndt7 network performance tests (hence we also need support\nfor JSON and WebSocket to implement this specific nettest).\n\n7. Comprehensive tracing of the library functionality with the\noption of emitting, in the future, JSON-formatted structured logs,\nfor easy post-processing, like [rbmk-project/rbmk](\nhttps://github.com/rbmk-project/rbmk) does.\n\n8. Prefer Entity-component-system (ECS) to complex object hierarchies.\n\nThe main drivers for this project are self-learning, curiosity to\nunderstand how small the final library will be, and the aspiration to write\nsimple and self-documenting code that could be useful to others.\n\n## Milestones (Long Term)\n\n- [x] Basic networking I/O on `linux/amd64`.\n- [ ] Ability to run ndt7 tests.\n- [ ] ...\n\n## Roadmap (Short Term)\n\n- [x] Implement `errno` mapping for `linux/amd64`.\n- [x] Implement accessing the monotonic clock for `linux/amd64`.\n- [x] Implement syscall wrappers for `linux/amd64`.\n- [x] Implement cooperative multitasking for `linux/amd64`.\n- [x] Implement cooperative socket I/O for `linux/amd64`.\n- [x] Structure the code for testability.\n- [x] Add examples that also serve as integration tests.\n- [ ] Implement `getpeername` and `getsockname`.\n- [ ] Implement DNS-over-UDP.\n- [ ] Write unit tests for the codebase.\n- [ ] ...\n\n## Architecture\n\n| Path                             | Description                   |\n| -------------------------------- | ----------------------------- |\n| [include/minimk](include/minimk) | Contains the public headers.  |\n| [libminimk](libminimk)           | Contains the project modules. |\n| [examples](examples)             | Contains examples.            |\n| [scripts](scripts)               | Contains helper scripts.      |\n| [build.ninja](build.ninja)       | The build script.             |\n\n\n### Major Modules\n\n| Module                       | Description                                                                                                                                        |\n| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [errno](libminimk/errno)     | Contains error management code, including mapping system errors to our error defines.                                                              |\n| [syscall](libminimk/syscall) | Contains wrappers for the system calls that we support.                                                                                            |\n| [runtime](libminimk/runtime) | Contains the cooperative runtime including switching coroutines cooperatively, suspending coroutines until a timer expires, and suspending on I/O. |\n| [socket](libminimk/socket)   | Contains cooperative sockets that suspend as coroutines on I/O and have timeouts.                                                                  |\n\n## Dependencies\n\nThis project relies on the following developer tools:\n\n- `clang` and `clang++` — LLVM-based C/C++ compilers\n- `ninja` — high-performance build system\n- `iwyu` (Include-What-You-Use) — tools for include analysis\n- `clang-format` — for code formatting\n- `clangd` *(optional)* — language server, useful for IDE integration\n\nTo install these dependencies, use (on Debian \"Trixie\"):\n\n```bash\nsudo apt install -y build-essential clang clang-format clangd iwyu ninja-build\n```\n\nDebian Trixie ships with Clang ≥ 17 (Clang 19 is the default). Any\nrecent Clang should work with this project.\n\n## Build Instructions\n\nThe project uses ninja for builds. Make sure dependencies are\ninstalled before proceeding.\n\nWe currently do not track inter-file dependencies very well, as\nsuch the recommended workflow is:\n\n```bash\nninja -t clean \u0026\u0026 ninja\n```\n\nThis command builds `libminimk.a` in the top-level directory\nas well as examples inside [examples](examples).\n\nThere are currently no automated tests.\n\nExamples serve as integration tests until a proper test suite is developed.\n\nWe recommend running these examples to confirm ~everything is still okay:\n\n```bash\n./examples/time/00_monotonic.exe\n./examples/runtime/00_coroutine_hello.exe\n./examples/runtime/01_coroutine_pingpong.exe\n./examples/runtime/02_coroutine_sleep.exe\n./examples/socket/01_echo_test.exe\n```\n\nAfter you modify files, please format them as follows:\n\n```bash\nclang-format -i file1 file2 ...\n```\n\nAlso, use `iwyu` to ensure the includes are okay:\n\n```bash\nfor file in file1 file2 ...; do\n    iwyu -Iinclude $file\ndone\n```\n\n## License\n\n```\nSPDX-License-Identifier: GPL-3.0-or-later\n```\n\nSee [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbassosimone%2Fminimk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbassosimone%2Fminimk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbassosimone%2Fminimk/lists"}