nova-net: General-purpose reliable UDP with C99 hot path and Haskell protocol logic

[ bsd3, game, library, network ] [ Propose Tags ] [ Report a vulnerability ]

A general-purpose reliable UDP networking library. C99 hot path (serialization, send/recv, ack processing, crypto) for maximum performance on any platform. Haskell protocol brain (connection state machines, congestion control, replication) for correct-by-construction logic. Successor to gbnet-hs.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log CHANGELOG.md
Dependencies base (>=4.19 && <5), bytestring (>=0.11 && <0.13), containers (>=0.6 && <0.8), deepseq (>=1.4 && <1.6), mtl (>=2.2 && <2.4), network (>=3.1 && <3.3), stm (>=2.5 && <2.6), transformers (>=0.5 && <0.7) [details]
Tested with ghc ==9.8.4
License BSD-3-Clause
Author Devon Tomlin
Maintainer devon.tomlin@novavero.ai
Uploaded by aoinoikaz at 2026-03-09T21:27:12Z
Category Network, Game
Home page https://github.com/Novavero-AI/nova-net
Bug tracker https://github.com/Novavero-AI/nova-net/issues
Source repo head: git clone https://github.com/Novavero-AI/nova-net -b main
Distributions
Downloads 1 total (1 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2026-03-09 [all 1 reports]

Readme for nova-net-0.1.0.0

[back to package description]

nova-net

General-Purpose Reliable UDP

C99 hot path. Haskell protocol brain. Any platform with a C compiler.

CI Hackage Haskell C99 License


What is nova-net?

A general-purpose reliable UDP networking library. C99 handles the hot path (serialization, send/recv, ack processing, crypto). Haskell handles the protocol logic (connection state machines, congestion control, replication).

  • C99 hot path — packet serialization, socket I/O, ACK bitfield processing, CRC32C, ChaCha20-Poly1305. No heap allocation on the hot path.
  • Haskell protocol brain — connection state machines, handshake orchestration, congestion control, replication. Pure, testable, correct-by-construction.
  • Unsafe FFI boundary — Haskell calls C with zero marshalling overhead. Just a function pointer jump.
  • Any platform — C99 core compiles everywhere. Link from Haskell, Swift, Kotlin, Python, Zig, anything.
  • Effect abstractionMonadNetwork typeclass enables pure deterministic testing with no real sockets.

Architecture

┌─────────────────────────────────────────┐
│           User Application              │
├─────────────────────────────────────────┤
│  Haskell Protocol Brain                 │
│  Connection, Peer, Handshake,           │
│  Congestion, Replication                │
├─────────────────────────────────────────┤
│  Unsafe FFI Boundary                    │
│  foreign import ccall unsafe            │
├─────────────────────────────────────────┤
│  C99 Hot Path                           │
│  nn_packet, nn_serialize, nn_socket,    │
│  nn_reliability, nn_crypto, nn_channel  │
└─────────────────────────────────────────┘

Features

  • 68-bit packet headers (4-bit type + 16-bit seq + 16-bit ack + 32-bit ack bitfield)
  • 5 delivery modes (Unreliable, UnreliableSequenced, ReliableUnordered, ReliableOrdered, ReliableSequenced)
  • Dual-layer congestion control (binary mode + TCP New Reno window)
  • ChaCha20-Poly1305 AEAD encryption with anti-replay
  • Jacobson/Karels RTT estimation with adaptive retransmit
  • Large message fragmentation and reassembly
  • Connection migration
  • Delta compression, interest filtering, priority accumulation, snapshot interpolation

Build & Test

Requires GHCup with GHC >= 9.8.

cabal build                              # Build library
cabal test                               # Run all tests
cabal build --ghc-options="-Werror"      # Warnings as errors
cabal bench                              # Run benchmarks

Contributing

cabal test && cabal build --ghc-options="-Werror"

BSD-3-Clause · Novavero AI