Skip to content

FP Mojo 1.0.2

Latest

Choose a tag to compare

@anatolvitold anatolvitold released this 02 Nov 09:05
· 4 commits to main since this release

FP Mojo 1.0.2 moves the library to Mojo 1.2.0, adds a structured async runtime, and supports macOS arm64 throughout, the multi-threaded runtime included.

  • Mojo 1.2.0. FP Mojo 1.0.2 requires Mojo 1.2.0; 1.0.0 and 1.0.1 remain the Mojo 1.1.0 releases.
  • Async runtime, after Cats Effect. IO with fibers, structured concurrency, racing, resources and Supervisor. Programs run on a work-stealing pool by default, with per-worker timers, descriptor waits and a blocking hand-off; the current-thread profile remains available. The public Runtime, Profile and IORuntimeConfig; IO.blocking and IO.interruptible; execution contexts (eval_on, start_on, background); concurrent traversal; and TestControl virtual time with seeded exploration and replay.
  • Pipelines and combinators. pipeline(value) infers the container family, and raising[E]() selects native errors once. Fluent map2, ap, map_n and product_n; effectful traversals, folds and predicates; parallel validation with error accumulation; shared error handling (recover, or_else, redeem, ensure and more) lifted through the monad transformers; NonEmptyList, Ior, and the environment, state and log capabilities.
  • Compact Node storage. Each value of a recursive data type is one allocation holding a 32-bit atomic count, its height and only its own constructor, which the handle names, so fp.match dispatches without reading memory. Dropping a tree allocates at most one work list. Building, traversing and releasing a 262,143-node tree takes 0.4-0.7x the time of hand-written ArcPointer cells.
  • macOS arm64. The whole library, including OS threads, the work-stealing pool and the blocking pool, runs on macOS. Pool and blocking threads get an 8 MiB stack there, as glibc usually gives on Linux.

Verified on Linux x86-64 and macOS arm64 (Apple M2 Max, macOS 26) with Mojo 1.2.0: every documentation example on both async profiles through source and package imports at O0 and O3; 1,109 suite programs and 2,888 compile-time rejections against the package; 6,048 native boundary checks. On macOS also the async runtime's qualification (1,184 checks on both profiles), a one-hour soak with flat memory, and the suite and rejections through source imports.

Install from the Modular community channel (available once modular/modular-community#443 is merged):

# pixi.toml
[workspace]
channels = ["https://conda.modular.com/max", "https://repo.prefix.dev/modular-community", "conda-forge"]
pixi add fp_mojo

Documentation: https://spellbound-mojo.github.io/fp_mojo/

Full changelog