
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
FIO is a type-safe, purely functional effect system for F#, designed for building highly concurrent and asynchronous applications. It provides a lightweight DSL for writing composable programs using functional effects.
Inspired by ZIO and Cats Effect, FIO features:
FIO was developed as part of a master’s thesis in Computer Science at DTU.
Read the thesis (some parts may be outdated).
Note: FIO is under active development. Contributions, feedback, and questions are very welcome!
Feel free to report bugs, request features or reach out.
Getting started with FIO is simple:
You can use FIO in two ways:
FIOApp
, which simplifies setup and runtime management (examples in FSharp.FIO.Examples.App)Create a new F# file and open the DSL, IO and Concurrent runtime modules:
module DirectUsage
open FSharp.FIO.DSL
open FSharp.FIO.Lib.IO
open FSharp.FIO.Runtime.Concurrent
[<EntryPoint>]
let main _ =
let askForName = fio {
do! FConsole.PrintLine "Hello! What is your name?"
let! name = FConsole.ReadLine ()
do! FConsole.PrintLine $"Hello, %s{name}! Welcome to FIO! 🪻💜"
}
Runtime().Run askForName
|> fun fiber -> fiber.Task ()
|> Async.AwaitTask
|> Async.RunSynchronously
|> printfn "%A"
0
Run it with:
$ dotnet run
And you'll see the following output:
Hello! What is your name?
Daniel
Hello, Daniel, welcome to FIO! 🪻💜
Ok ()
Wrap your effect in a FIOApp
to simplify boilerplate. Open the App module:
module FIOAppUsage
open FSharp.FIO.DSL
open FSharp.FIO.Lib.IO
open FSharp.FIO.App
type WelcomeApp() =
inherit FIOApp<unit, exn> ()
override _.effect = fio {
do! FConsole.PrintLine "Hello! What is your name?"
let! name = FConsole.ReadLine ()
do! FConsole.PrintLine $"Hello, %s{name}! Welcome to FIO! 🪻💜"
}
WelcomeApp().Run()
Same execution as before:
$ dotnet run
and same output as well:
Hello! What is your name?
Daniel
Hello, Daniel, welcome to FIO! 🪻💜
Ok ()
Prefer DSL chaining? Use bind (>>=) directly:
module DSLOnly
open FSharp.FIO.DSL
open FSharp.FIO.Lib.IO
let askForName =
FConsole.PrintLine "Hello! What is your name?" >>= fun _ ->
FConsole.ReadLine () >>= fun name ->
FConsole.PrintLine $"Hello, %s{name}, welcome to FIO! 🪻💜"
This 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.
Pingpong
– Message sending and retrieval between two actorsThreadring
– Message passing with frequent fiber context switchingBig
– Many-to-many message passing with high channel contentionBang
– Many-to-one messaging, stressing a single receiverFork
– Measures fiber spawning overheadThe benchmarks accept a variety of command-line options:
USAGE: FSharp.FIO.Benchmarks [--help]
[--direct-runtime]
[--cooperative-runtime <ewc> <ews> <bwc>]
[--concurrent-runtime <ewc> <ews> <bwc>]
[--runs <runs>]
[--actor-increment <actorInc> <times>]
[--round-increment <roundInc> <times>]
[--pingpong <roundCount>]
[--threadring <actorCount> <roundCount>]
[--big <actorCount> <roundCount>]
[--bang <actorCount> <roundCount>]
[--fork <actorCount>]
[--save <saveToCsv>]
[--savepath <absolutePath>]
OPTIONS:
--direct-runtime specify Direct runtime
--cooperative-runtime <ewc> <ews> <bwc>
specify Cooperative runtime with ewc, ews and bwc
--concurrent-runtime <ewc> <ews> <bwc>
specify Concurrent runtime with ewc, ews and bwc
--runs <runs> specify number of runs for each benchmark
--actor-increment <actorInc> <times>
specify the value of actor increment and the number of times
--round-increment <roundInc> <times>
specify the value of round increment and the number of times
--pingpong <roundCount>
specify number of rounds for Pingpong benchmark
--threadring <actorCount> <roundCount>
specify number of actors and rounds for Threadring benchmark
--big <actorCount> <roundCount>
specify number of actors and rounds for Big benchmark
--bang <actorCount> <roundCount>
specify number of actors and rounds for Bang benchmark
--fork <actorCount> specify number of actors for Fork benchmark
--save <saveToCsv> should save benchmark results to csv file
--savepath <absolutePath>
specify absolute path to save the benchmark results csv file
--help display this list of options.
To run each benchmark 30 times using the concurrent runtime (39 evaluation workers, 200 evaluation steps, 1 blocking worker):
--concurrent-runtime 39 200 1 --runs 30 --pingpong 150000 --threadring 10000 10 --big 250 10 --bang 10000 10 --fork 20000
FIO also supports optional compile-time flags:
DETECT_DEADLOCK
– Enables a simple thread that attempts to detect deadlocks during execution
MONITOR
– Starts a monitoring thread that prints internal runtime structure state during execution
Note: These features are experimental and may behave unpredictably.
The following plots illustrate the execution time (measured in milliseconds) and scalability of the available runtime systems across benchmarks.
The runtimes differ in how they manage fibers and blocked operations:
The boxplots show the measured execution time for each benchmark with the shown benchmark and runtime configurations.
The lineplots show for each benchmark, how each runtime scales when the amount of fibers increases.
See the open issues for a full list of proposed features (and known issues).
Contributions are welcome and appreciated!
Got an idea or improvement? Feel free to:
enhancement
)git checkout -b feature/AmazingFeature
git commit -m 'Add AmazingFeature'
git push origin feature/AmazingFeature
Distributed under the MIT License See LICENSE.md for more information.
Daniel "iyyel" Larsen (iyyel.io)
Alceste Scalas (people.compute.dtu.dk)
FAQs
Unknown package
We found that fsharp.fio demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.