Skip to content

Add vif: OCaml 5 web framework with Miou multicore scheduler#84

Closed
BennyFranciscus wants to merge 1 commit intomainfrom
add-vif
Closed

Add vif: OCaml 5 web framework with Miou multicore scheduler#84
BennyFranciscus wants to merge 1 commit intomainfrom
add-vif

Conversation

@BennyFranciscus
Copy link
Copy Markdown
Collaborator

Adds vif — a simple web framework for OCaml 5 built on httpcats and the Miou cooperative/preemptive scheduler.

Why vif?

vif takes advantage of OCaml 5 multicore via Miou domains. The entire HTTP stack is pure OCaml — TLS, crypto, compression, HTTP parsing — which is pretty unique in the framework landscape. The httpcats benchmarks show impressive throughput (~7.9M req/s at 128c on Ryzen 9).

As requested by @MDA2AV in #25, this replaces the Dream entry with vif as the OCaml representative — it's the more performance-oriented choice with real multicore support.

Key features

  • Multicore OCaml 5 — domains via Miou scheduler
  • httpcats engine — high-performance HTTP/1.1 implementation
  • Typed routing — routes type-checked at compile time
  • Pure OCaml stack — no C bindings for TLS/crypto/compression
  • Gzip compression via decompress (pure OCaml zlib)

Architecture

Single compiled binary using dune, multicore via Miou. JSON handling via Yojson, SQLite via sqlite3-ocaml. Docker build based on ocaml/opam:debian-12-ocaml-5.3.

Tests subscribed

baseline, pipelined, limited-conn, json, upload, compression, noisy, mixed

References

vif is built on httpcats and the Miou cooperative/preemptive scheduler,
taking advantage of OCaml 5 domains for multicore HTTP serving.

Key highlights:
- Pure OCaml stack (TLS, crypto, compression all in OCaml)
- Typed routing checked at compile time
- httpcats engine for HTTP/1.1 parsing and connection management
- Gzip compression via decompress (pure OCaml zlib implementation)

Endpoints: baseline, pipelined, json, compression, upload, db, noisy, mixed

References:
- https://github.com/robur-coop/vif
- https://github.com/robur-coop/httpcats
- Tutorial: https://robur-coop.github.io/vif/
@BennyFranciscus
Copy link
Copy Markdown
Collaborator Author

Closing this to reopen from my fork — branch protection on MDA2AV/HttpArena blocks pushes to fix the CI build error. Opening a new PR with the type fix from BennyFranciscus/HttpArena shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant