{"id":29685515,"url":"https://github.com/fs-fio/fio","last_synced_at":"2025-12-16T13:05:18.295Z","repository":{"id":49685507,"uuid":"445239025","full_name":"fs-fio/fio","owner":"fs-fio","description":"🪻 A Type-Safe, Purely Functional Effect System for Asynchronous and Concurrent F#","archived":false,"fork":false,"pushed_at":"2025-07-18T16:41:15.000Z","size":793,"stargazers_count":49,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-07-18T20:56:10.377Z","etag":null,"topics":["concurrency","concurrent","concurrent-programming","effect-system","effect-systems","fiber","fibers","fsharp","functional-programing","green-threads","parallel-computing","parallel-programming","programming-library","runtime-system","threads"],"latest_commit_sha":null,"homepage":"https://iyyel.io/projects/fio/","language":"F#","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/fs-fio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2022-01-06T16:36:06.000Z","updated_at":"2025-07-16T18:49:41.000Z","dependencies_parsed_at":"2024-10-31T06:30:19.437Z","dependency_job_id":"88b489fd-32ad-462d-99bf-753fe9a3f87f","html_url":"https://github.com/fs-fio/fio","commit_stats":null,"previous_names":["fio-fsharp/fio","iyyel/fio","fs-fio/fio"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fs-fio/fio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fs-fio%2Ffio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fs-fio%2Ffio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fs-fio%2Ffio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fs-fio%2Ffio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fs-fio","download_url":"https://codeload.github.com/fs-fio/fio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fs-fio%2Ffio/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266614306,"owners_count":23956341,"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-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["concurrency","concurrent","concurrent-programming","effect-system","effect-systems","fiber","fibers","fsharp","functional-programing","green-threads","parallel-computing","parallel-programming","programming-library","runtime-system","threads"],"created_at":"2025-07-23T04:01:00.922Z","updated_at":"2025-12-16T13:05:13.240Z","avatar_url":"https://github.com/fs-fio.png","language":"F#","funding_links":[],"categories":["F#","Concurrent, Asynchronous, and Parallel Programming"],"sub_categories":[],"readme":"\u003ca id=\"readme-top\"\u003e\u003c/a\u003e\n\n[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]][license-url]\n[![NuGet][nuget-shield]][nuget-url]\n\n\n\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/fio-fsharp/fio\"\u003e\n    \u003cimg src=\"assets/images/fio_logo_wide.png\" width=\"auto\" height=\"300\" alt=\"FIO Logo\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003e🪻 A Type-Safe, Purely Functional Effect System for Asynchronous and Concurrent F#\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    \u003c!-- An awesome README template to jumpstart your projects! --\u003e\n    \u003c!--\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/fio-fsharp/fio\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    --\u003e\n    \u003ca href=\"https://iyyel.io/projects/fio/\"\u003eView Project Post\u003c/a\u003e\n    \u0026middot;\n    \u003ca href=\"https://github.com/fio-fsharp/fio/issues/new?labels=bug\u0026template=bug-report---.md\"\u003eReport Bug\u003c/a\u003e\n    \u0026middot;\n    \u003ca href=\"https://github.com/fio-fsharp/fio/issues/new?labels=enhancement\u0026template=feature-request---.md\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-fio\"\u003eAbout FIO\u003c/a\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n        \u003cul\u003e\n          \u003cli\u003e\u003ca href=\"#direct-usage\"\u003eDirect Usage\u003c/a\u003e\u003c/li\u003e\n          \u003cli\u003e\u003ca href=\"#using-fioapp-recommended\"\u003eUsing FIOApp (Recommended)\u003c/a\u003e\u003c/li\u003e\n          \u003cli\u003e\u003ca href=\"#alternative-dsl-only-style\"\u003eAlternative: DSL-Only Style\u003c/a\u003e\u003c/li\u003e\n        \u003c/ul\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#Benchmarks\"\u003eBenchmarks\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#benchmark-overview\"\u003eBenchmark Overview\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#running-benchmarks\"\u003eRunning Benchmarks\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#example\"\u003eExample\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#experimental-flags\"\u003eExperimental Flags\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#performance\"\u003ePerformance\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#execution-time\"\u003eExecution Time\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#scalability\"\u003eScalability\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#roadmap\"\u003eRoadmap\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#quick-start\"\u003eQuick Start\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#top-contributors\"\u003eTop Contributors\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#acknowledgments\"\u003eAcknowledgments\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\n\n## About FIO\n\n\u003c!-- [![Product Name Screen Shot][product-screenshot]](https://example.com) !--\u003e\n\n**FIO** is a type-safe, purely functional effect system for [**F#**](https://fsharp.org/), designed for building **highly concurrent** and **asynchronous** applications. It provides a lightweight [**DSL**](https://martinfowler.com/dsl.html) for writing composable programs using **functional effects**.\n\nInspired by [**ZIO**](https://zio.dev/) and [**Cats Effect**](https://typelevel.org/cats-effect/), **FIO** features:\n\n- An **IO monad** for managing side effects  \n- **Fibers** (green threads) for scalable concurrency  \n- A focus on **purity**, **type safety**, and **performance**\n\n**FIO** was developed as part of a master’s thesis in Computer Science at [**DTU**](https://www.dtu.dk/english). \n\n[**Read the thesis**](https://iyyel.io/assets/doc/masters_thesis_daniel_larsen.pdf) (some parts may be outdated).\n\n\u003e **Note:** FIO is under active development. Contributions, feedback, and questions are very welcome!  \n\u003e Feel free to report bugs, request features or [**reach out**](mailto:me@iyyel.io).\n\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n\nGetting started with **FIO** is simple:\n\n1. Install [**.NET**](https://dotnet.microsoft.com/en-us/)\n2. Use an editor like [**VS Code**](https://code.visualstudio.com/), [**Visual Studio**](https://visualstudio.microsoft.com/downloads/), or [**Rider**](https://www.jetbrains.com/rider/download/) (or even vim)\n3. Clone this repository\n4. Open it in your editor\n5. Explore the [**FSharp.FIO.Examples**](https://github.com/fs-fio/FIO/tree/main/examples/FSharp.FIO.Examples) project or create your own F# file\n\n### Usage\n\nYou can use **FIO** in two ways:  \n- Directly by creating and running effects manually (examples in [**FSharp.FIO.Examples**](https://github.com/fs-fio/FIO/tree/main/examples/FSharp.FIO.Examples))\n- Via `FIOApp`, which simplifies setup and runtime management (examples in [**FSharp.FIO.Examples.App**](https://github.com/fs-fio/FIO/tree/main/examples/FSharp.FIO.Examples.App))\n\n#### Direct Usage\n\nCreate a new F# file and open the DSL, IO and Concurrent runtime modules:\n\n```fsharp\nmodule DirectUsage\n\nopen FSharp.FIO.DSL\nopen FSharp.FIO.Lib.IO\nopen FSharp.FIO.Runtime.Concurrent\n\n[\u003cEntryPoint\u003e]\nlet main _ =\n    let askForName = fio {\n        do! FConsole.PrintLine \"Hello! What is your name?\"\n        let! name = FConsole.ReadLine ()\n        do! FConsole.PrintLine $\"Hello, %s{name}! Welcome to FIO! 🪻💜\"\n    }\n    \n    Runtime().Run askForName\n    |\u003e fun fiber -\u003e fiber.Task ()\n    |\u003e Async.AwaitTask\n    |\u003e Async.RunSynchronously\n    |\u003e printfn \"%A\"\n    0\n```\n\nRun it with:\n\n```\n$ dotnet run\n```\n\nAnd you'll see the following output:\n\n```\nHello! What is your name?\nDaniel\nHello, Daniel, welcome to FIO! 🪻💜\nOk ()\n```\n\n#### Using FIOApp (Recommended)\n\nWrap your effect in a `FIOApp` to simplify boilerplate. Open the App module:\n\n```fsharp\nmodule FIOAppUsage\n\nopen FSharp.FIO.DSL\nopen FSharp.FIO.Lib.IO\nopen FSharp.FIO.App\n\ntype WelcomeApp() =\n    inherit FIOApp\u003cunit, exn\u003e ()\n\n    override _.effect = fio {\n        do! FConsole.PrintLine \"Hello! What is your name?\"\n        let! name = FConsole.ReadLine ()\n        do! FConsole.PrintLine $\"Hello, %s{name}! Welcome to FIO! 🪻💜\"\n    }\n\nWelcomeApp().Run()\n```\n\nSame execution as before:\n\n```\n$ dotnet run\n```\n\nand same output as well:\n\n```\nHello! What is your name?\nDaniel\nHello, Daniel, welcome to FIO! 🪻💜\nOk ()\n```\n\n#### Alternative: DSL-Only Style\n\nPrefer DSL chaining? Use bind (\u003e\u003e=) directly:\n\n```fsharp\nmodule DSLOnly\n\nopen FSharp.FIO.DSL\nopen FSharp.FIO.Lib.IO\n\nlet askForName =\n    FConsole.PrintLine \"Hello! What is your name?\" \u003e\u003e= fun _ -\u003e\n    FConsole.ReadLine () \u003e\u003e= fun name -\u003e\n    FConsole.PrintLine $\"Hello, %s{name}, welcome to FIO! 🪻💜\"\n```\n\n\n\n## Benchmarks\n\nThis repository includes five benchmarks, each designed to evaluate a specific aspect of concurrent computation. All benchmarks are adapted from the [**Savina – An Actor Benchmark Suite**](http://soft.vub.ac.be/AGERE14/papers/ageresplash2014_submission_19.pdf).\n\n### Benchmark Overview\n\n- `Pingpong` – Message sending and retrieval between two actors  \n- `Threadring` – Message passing with frequent fiber context switching  \n- `Big` – Many-to-many message passing with high channel contention  \n- `Bang` – Many-to-one messaging, stressing a single receiver  \n- `Fork` – Measures fiber spawning overhead\n\n### Running Benchmarks\n\nThe benchmarks accept a variety of command-line options:\n\n```\nUSAGE: FSharp.FIO.Benchmarks [--help]\n                             [--direct-runtime]\n                             [--cooperative-runtime \u003cewc\u003e \u003cews\u003e \u003cbwc\u003e]\n                             [--concurrent-runtime \u003cewc\u003e \u003cews\u003e \u003cbwc\u003e]\n                             [--runs \u003cruns\u003e]\n                             [--actor-increment \u003cactorInc\u003e \u003ctimes\u003e]\n                             [--round-increment \u003croundInc\u003e \u003ctimes\u003e]\n                             [--pingpong \u003croundCount\u003e]\n                             [--threadring \u003cactorCount\u003e \u003croundCount\u003e]\n                             [--big \u003cactorCount\u003e \u003croundCount\u003e]\n                             [--bang \u003cactorCount\u003e \u003croundCount\u003e]\n                             [--fork \u003cactorCount\u003e]\n                             [--save \u003csaveToCsv\u003e]\n                             [--savepath \u003cabsolutePath\u003e]\n\nOPTIONS:\n\n    --direct-runtime      specify Direct runtime\n    --cooperative-runtime \u003cewc\u003e \u003cews\u003e \u003cbwc\u003e\n                          specify Cooperative runtime with ewc, ews and bwc\n    --concurrent-runtime \u003cewc\u003e \u003cews\u003e \u003cbwc\u003e\n                          specify Concurrent runtime with ewc, ews and bwc\n    --runs \u003cruns\u003e         specify number of runs for each benchmark\n    --actor-increment \u003cactorInc\u003e \u003ctimes\u003e\n                          specify the value of actor increment and the number of times\n    --round-increment \u003croundInc\u003e \u003ctimes\u003e\n                          specify the value of round increment and the number of times\n    --pingpong \u003croundCount\u003e\n                          specify number of rounds for Pingpong benchmark\n    --threadring \u003cactorCount\u003e \u003croundCount\u003e\n                          specify number of actors and rounds for Threadring benchmark\n    --big \u003cactorCount\u003e \u003croundCount\u003e\n                          specify number of actors and rounds for Big benchmark\n    --bang \u003cactorCount\u003e \u003croundCount\u003e\n                          specify number of actors and rounds for Bang benchmark\n    --fork \u003cactorCount\u003e   specify number of actors for Fork benchmark\n    --save \u003csaveToCsv\u003e    should save benchmark results to csv file\n    --savepath \u003cabsolutePath\u003e\n                          specify absolute path to save the benchmark results csv file\n    --help                display this list of options.\n```\n\n### Example\n\nTo run each benchmark 30 times using the concurrent runtime (39 evaluation workers, 200 evaluation steps, 1 blocking worker):\n\n```bash\n--concurrent-runtime 39 200 1 --runs 30 --pingpong 150000 --threadring 10000 10 --big 250 10 --bang 10000 10 --fork 20000\n```\n\n### Experimental Flags\n\n**FIO** also supports optional compile-time flags:\n\n- `DETECT_DEADLOCK` – Enables a simple thread that attempts to detect deadlocks during execution\n\n- `MONITOR` – Starts a monitoring thread that prints internal runtime structure state during execution\n\n\u003e **Note:** These features are experimental and may behave unpredictably.\n\n\n\n## Performance\n\nThe following plots illustrate the **execution time** (measured in milliseconds) and **scalability** of the available runtime systems across benchmarks.\n\nThe runtimes differ in how they manage fibers and blocked operations:\n\n- **Direct** – .NET tasks with waiting for blocked fibers\n- **Cooperative** – Fibers with linear-time handling of blocked fibers\n- **Concurrent** – Fibers with constant-time handling of blocked fibers\n\n### Execution Time\n\nThe boxplots show the measured execution time for each benchmark with the shown benchmark and runtime configurations.\n\n\u003cimg src=\"assets/images/boxplot.png\" alt=\"Boxplot\" /\u003e\n\n\n### Scalability\n\nThe lineplots show for each benchmark, how each runtime scales when the amount of fibers increases.\n\n\u003cimg src=\"assets/images/lineplot.png\" alt=\"Lineplot\" /\u003e\n\n\n\n\u003c!-- ROADMAP --\u003e\n## Roadmap\n\nSee the [**open issues**](https://github.com/fio-fsharp/fio/issues) for a full list of proposed features (and known issues).\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n\nContributions are welcome and appreciated!\n\nGot an idea or improvement? Feel free to:\n- Star the repository\n- Open an issue (tag it with `enhancement`)\n- Fork the project and submit a pull request\n\n### Quick Start\n\n1. Fork the repository\n2. Create a branch: `git checkout -b feature/AmazingFeature`\n3. Commit your changes: `git commit -m 'Add AmazingFeature'`\n4. Push the branch: `git push origin feature/AmazingFeature`\n5. Open a pull request\n\n### Top contributors\n\n\u003ca href=\"https://github.com/fio-fsharp/fio/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=fio-fsharp/fio\" alt=\"Contributors Image\" /\u003e\n\u003c/a\u003e\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the MIT License See [**LICENSE.md**](LICENSE.md) for more information.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\nDaniel \"iyyel\" Larsen ([**iyyel.io**](https://iyyel.io))\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- ACKNOWLEDGMENTS --\u003e\n## Acknowledgments\n\nAlceste Scalas ([**people.compute.dtu.dk**](https://people.compute.dtu.dk/alcsc/))\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n[contributors-shield]: https://img.shields.io/github/contributors/fio-fsharp/fio.svg?style=for-the-badge\n[contributors-url]: https://github.com/fio-fsharp/fio/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/fio-fsharp/fio.svg?style=for-the-badge\n[forks-url]: https://github.com/fio-fsharp/fio/network/members\n[stars-shield]: https://img.shields.io/github/stars/fio-fsharp/fio.svg?style=for-the-badge\n[stars-url]: https://github.com/fio-fsharp/fio/stargazers\n[issues-shield]: https://img.shields.io/github/issues/fio-fsharp/fio.svg?style=for-the-badge\n[issues-url]: https://github.com/fio-fsharp/fio/issues\n[license-shield]: https://img.shields.io/github/license/fio-fsharp/fio.svg?style=for-the-badge\n[license-url]: https://github.com/fio-fsharp/fio/blob/main/LICENSE.md\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge\u0026logo=linkedin\u0026colorB=555\n[linkedin-url]: https://linkedin.com/in/iyyel\n[product-screenshot]: images/screenshot.png\n[nuget-shield]: https://img.shields.io/nuget/v/FSharp.FIO.svg?style=for-the-badge\n[nuget-url]: https://www.nuget.org/packages/FSharp.FIO/0.0.30-alpha\n[FSharp]: https://img.shields.io/badge/F%23-378BBA?style=for-the-badge\u0026logo=.NET\u0026logoColor=white\n[FSharp-url]: https://fsharp.org/\n[.NET]: https://img.shields.io/badge/.NET-5C2D91?style=for-the-badge\u0026logo=.NET\u0026logoColor=white\n[.NET-url]: https://dotnet.microsoft.com/en-us/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffs-fio%2Ffio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffs-fio%2Ffio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffs-fio%2Ffio/lists"}