Skip to content

Commit df0cead

Browse files
authored
Merge pull request #22 from BennyFranciscus/add-prologue
Add Prologue: Nim web framework (first Nim entry!)
2 parents 9495b72 + 1a3cfc8 commit df0cead

6 files changed

Lines changed: 411 additions & 0 deletions

File tree

frameworks/prologue/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM nimlang/nim:2.0.14-alpine AS build
2+
RUN apk add --no-cache sqlite-dev
3+
WORKDIR /app
4+
COPY src/ ./
5+
RUN nimble install -y prologue zippy db_connector
6+
RUN nim c -d:release -d:danger -d:usestd --opt:speed --threads:on --passL:-lsqlite3 -o:server server.nim
7+
8+
FROM alpine:3.19
9+
RUN apk add --no-cache libgcc sqlite-libs
10+
COPY --from=build /app/server /server
11+
EXPOSE 8080
12+
CMD ["/server"]

frameworks/prologue/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Prologue (Nim)
2+
3+
[Prologue](https://github.com/planety/prologue) is a powerful and flexible web framework written in Nim. Under the hood it uses [httpbeast](https://github.com/nicholasgasior/httpbeast) (via httpx) — a high-performance HTTP server that leverages epoll on Linux with multi-threaded request handling.
4+
5+
## Why Prologue?
6+
7+
- **Nim compiles to C** — native performance with a high-level, Python-like syntax
8+
- **httpbeast backend** — uses epoll and SO_REUSEPORT for multi-core scaling
9+
- **Zero-overhead routing** — trie-based router compiled at build time
10+
- **First Nim framework in HttpArena** — brings a new language to the benchmarks
11+
12+
## Build
13+
14+
```bash
15+
nim c -d:release -d:danger --opt:speed --threads:on -o:server server.nim
16+
```
17+
18+
## Endpoints
19+
20+
All standard HttpArena endpoints are implemented: `/pipeline`, `/baseline11`, `/baseline2`, `/json`, `/compression`, `/upload`, `/db`, `/static/{filename}`.

frameworks/prologue/build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
TAG="${1:-httparena-prologue}"
3+
docker build --network host -t "$TAG" -f "$(dirname "$0")/Dockerfile" "$(dirname "$0")"

frameworks/prologue/meta.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"display_name": "prologue",
3+
"language": "Nim",
4+
"type": "framework",
5+
"engine": "asynchttpserver",
6+
"description": "Prologue web framework for Nim — compiles to native C with powerful routing and middleware support.",
7+
"repo": "https://github.com/planety/prologue",
8+
"enabled": true,
9+
"tests": [
10+
"baseline",
11+
"pipelined",
12+
"limited-conn",
13+
"json",
14+
"upload",
15+
"compression",
16+
"mixed",
17+
"noisy"
18+
]
19+
}

0 commit comments

Comments
 (0)