Skip to content

Commit cce7769

Browse files
Add Gleam + Mist: first Gleam and BEAM VM entry
Adds Mist HTTP server for Gleam running on the BEAM (Erlang VM). This is the first Gleam framework and first BEAM VM entry in HttpArena. - Language: Gleam (compiles to Erlang bytecode) - Runtime: BEAM (Erlang VM / OTP) - HTTP: Mist (OTP process per connection) - JSON: gleam_json - SQLite: sqlight (NIF bindings) - Compression: Erlang's built-in zlib The BEAM's preemptive scheduling and per-process GC represents a fundamentally different concurrency model than async/await or OS threads.
1 parent 511d334 commit cce7769

5 files changed

Lines changed: 649 additions & 0 deletions

File tree

frameworks/gleam-mist/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM ghcr.io/gleam-lang/gleam:v1.8.0-erlang-alpine AS build
2+
RUN apk add --no-cache gcc musl-dev sqlite-dev
3+
WORKDIR /app
4+
COPY gleam.toml .
5+
RUN gleam deps download
6+
COPY src ./src
7+
RUN gleam export erlang-shipment
8+
9+
FROM erlang:27-alpine
10+
RUN apk add --no-cache sqlite-libs
11+
WORKDIR /app
12+
COPY --from=build /app/build/erlang-shipment /app
13+
EXPOSE 8080
14+
CMD ["/app/entrypoint.sh", "run"]

frameworks/gleam-mist/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Gleam + Mist — BEAM VM HTTP Server
2+
3+
[Mist](https://github.com/rawhat/mist) is a glistening HTTP server for the [Gleam](https://gleam.run/) programming language, running on the BEAM (Erlang VM).
4+
5+
## Why it's interesting
6+
7+
- **First Gleam framework** in HttpArena
8+
- **First BEAM VM entry** — adds a completely new runtime to the mix
9+
- Gleam compiles to Erlang bytecode and runs on the battle-tested BEAM VM
10+
- Mist uses OTP processes for concurrency — one lightweight process per connection
11+
- The BEAM's preemptive scheduling and per-process GC is a fundamentally different concurrency model than async/await or OS threads
12+
- Type-safe, functional language with exhaustive pattern matching
13+
14+
## Stack
15+
16+
- **Language:** Gleam
17+
- **Runtime:** BEAM (Erlang VM / OTP)
18+
- **HTTP server:** Mist
19+
- **JSON:** gleam_json
20+
- **SQLite:** sqlight (NIF bindings)
21+
- **Compression:** Erlang's built-in zlib

frameworks/gleam-mist/gleam.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name = "httparena_gleam_mist"
2+
version = "1.0.0"
3+
target = "erlang"
4+
5+
[dependencies]
6+
gleam_stdlib = ">= 0.70.0 and < 1.0.0"
7+
gleam_http = ">= 4.3.0 and < 5.0.0"
8+
gleam_json = ">= 3.1.0 and < 4.0.0"
9+
gleam_erlang = ">= 1.0.0 and < 2.0.0"
10+
mist = ">= 6.0.0 and < 7.0.0"
11+
sqlight = ">= 1.0.3 and < 2.0.0"
12+
simplifile = ">= 2.0.0 and < 3.0.0"
13+
envoy = ">= 1.0.0 and < 2.0.0"
14+
logging = ">= 1.2.0 and < 2.0.0"

frameworks/gleam-mist/meta.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"display_name": "gleam-mist",
3+
"language": "Gleam",
4+
"type": "framework",
5+
"engine": "BEAM (Erlang VM)",
6+
"description": "Mist HTTP server for Gleam on the BEAM VM — first Gleam and first BEAM entry in HttpArena.",
7+
"repo": "https://github.com/rawhat/mist",
8+
"enabled": true,
9+
"tests": [
10+
"baseline",
11+
"noisy",
12+
"pipelined",
13+
"limited-conn",
14+
"json",
15+
"upload",
16+
"compression",
17+
"mixed"
18+
]
19+
}

0 commit comments

Comments
 (0)