Lobsters

Source: https://lobste.rs/

Subscribe to this expanded feed

https://fullrss.dev/?url=https%3A%2F%2Flobste.rs%2Frss Open Raw
Formats:
Open in RSS reader:
Adjust extraction, AI TL;DR & filter options
Content
10 expanded (0 cached) 0 already full 0 fallback +17,764 words added 2457 ms
Jump to article (25 items)
  1. 1. Roc version 0.1.0, eight years in the making 31 min
  2. 2. Advent of Code 2026 1 min
  3. 3. Why I can't sell you a €1 email inbox 13 min
  4. 4. Post-quantum cryptography is breaking government censors 15 min
  5. 5. A Better UTF-8 Automaton 2 min
  6. 6. “This message has been on the screen for almost two hours now.” 3 min
  7. 7. My website is now its own social media account 4 min
  8. 8. You can use Touch ID for sudo 2 min
  9. 9. Would you reconsider your Tufte CSS sidenotes? 9 min
  10. 10. What are you doing this week? 1 min
  11. 11. The Math Behind Counter-Strike Surfing 1 min
  12. 12. Uncovering Hidden TCP Throttling in the Linux Kernel 1 min
  13. 13. Carnegie Mellon's School of Computer Science is putting full classroom lectures from its faculty on YouTube for free 1 min
  14. 14. An O(N) implicit representation for the Koch Snowflake 1 min
  15. 15. Let me Give You Worms · 1 min
  16. 16. Gram 3.6.1 released 1 min
  17. 17. A decades-old bug in Knuth's long division 1 min
  18. 18. I ported my Vulkan game engine to macOS in one day 1 min
  19. 19. OLAP style reporting on DuckDB files 1 min
  20. 20. An Introduction to Probabilistic Programming (2021) 1 min
  21. 21. What formal verification is in reality 1 min
  22. 22. Refurb weekend: Silicon Graphics Fuel ... times two 1 min
  23. 23. I wrote a (free) book on Quantum Computing for Software Engineers 1 min
  24. 24. How Immutable is Your Immutable Root of Trust? 1 min
  25. 25. usb2shell: Root on Linux from a USB Plug-In 1 min
Per-item expansion report (25 items)
#ArticleStatusWords
1 Roc version 0.1.0, eight years in the making Expanded · 9 → 6968 words 9 → 6968
2 Advent of Code 2026 Expanded · 4 → 48 words 4 → 48
3 Why I can't sell you a €1 email inbox Expanded · 10 → 2933 words 10 → 2933
4 Post-quantum cryptography is breaking government censors Expanded · 6 → 3283 words 6 → 3283
5 A Better UTF-8 Automaton Expanded · 5 → 382 words 5 → 382
6 “This message has been on the screen for almost two hours now.” Expanded · 9 → 676 words 9 → 676
7 My website is now its own social media account Expanded · 9 → 857 words 9 → 857
8 You can use Touch ID for sudo Expanded · 8 → 532 words 8 → 532
9 Would you reconsider your Tufte CSS sidenotes? Expanded · 7 → 2045 words 7 → 2045
10 What are you doing this week? Expanded · 21 → 128 words 21 → 128
11 The Math Behind Counter-Strike Surfing Past limit 6 → 6
12 Uncovering Hidden TCP Throttling in the Linux Kernel Past limit 6 → 6
13 Carnegie Mellon's School of Computer Science is putting full classroom lectures from its faculty on YouTube for free Past limit 6 → 6
14 An O(N) implicit representation for the Koch Snowflake Past limit 7 → 7
15 Let me Give You Worms · Past limit 28 → 28
16 Gram 3.6.1 released Past limit 6 → 6
17 A decades-old bug in Knuth's long division Past limit 8 → 8
18 I ported my Vulkan game engine to macOS in one day Past limit 9 → 9
19 OLAP style reporting on DuckDB files Past limit 7 → 7
20 An Introduction to Probabilistic Programming (2021) Past limit 3 → 3
21 What formal verification is in reality Past limit 6 → 6
22 Refurb weekend: Silicon Graphics Fuel ... times two Past limit 6 → 6
23 I wrote a (free) book on Quantum Computing for Software Engineers Past limit 243 → 243
24 How Immutable is Your Immutable Root of Trust? Past limit 7 → 7
25 usb2shell: Root on Linux from a USB Plug-In Past limit 8 → 8

Roc version 0.1.0, eight years in the making

November 30, 2026

After eight years of development, the Roc programming language has its first numbered release: version 0.1.0!

There are too many contributors to thank for all their incredible work on the road to this milestone, but I at least want to mention (in alphabetical order) Agus Zubiaga, Anthony Bullard, Anton-4, Aurélien Geron, Ayaz Hafiz, Brendan Hansknecht, Brian Carroll, Folkert de Vries, Hannes, Jack Scully, Jared Ramirez, Jasper Woudenberg, Jelle Teeuwissen, Josh Warner, JRI98, Luke Boswell, MagicMan, Niclas Åhdén, Sam Mohr, Stephan, and Steve Howell.

Thank you all so much!

What is Roc?

Roc is a programming language with the tagline fast, friendly, functional.

It's designed to build faster than Go and output programs that run nearly as fast as Rust, with user-friendly tooling and a friendly community, plus security and reliability guarantees you can't find in any mainstream language today. Roc hasn't achieved all of its goals yet (version 0.1 is not 1.0!) but as you'll see, 0.1.0 has a lot.

Roc 0.1.0 compiles to standalone binaries (with hot reloading out-the-box) or to WebAssembly, it combines Hindley-Milner type inference with purity inference and static dispatch, and uses a novel system of platforms and applications to let you build on lower-level languages without a FFI compromising guarantees.

I started designing the language in 2018 with a goal of making an Elm-inspired experience for "the long tail of use cases." Back then, Elm was focused only on user interfaces, although now with Acadia its scope has expanded—check it out if you haven't already! Roc has evolved its own character over time, so although the languages still have much in common, there are some obvious differences too.

I made the first compiler commit in 2019, and talked about the project publicly in 2020. More contributors got involved then, leading to promising early results that I spoke about at Strange Loop 2021. We incorporated research from the Koka and Morphic languages, but hit a major architectural problem along the way, which I talked about in detail with Ayaz Hafiz in 2024. This led to a 2025 scratch-rewrite of the compiler, which we completed earlier in 2026.

Many details in the language's design changed over those years, yet the types in the standard library still look about how they did in my 2018 sketches. (One of the reasons for holding off on making a numbered release was to set a clear expectation not to expect stability. Things are much more stable these days!)

There's more detail about language specifics below, as well as a showcase of projects community members have built. But first, some numbers!

Fast Programs

One of Roc's goals is to approach the performance of speed-focused languages like Rust and C++, without quite matching it (since Roc does automatic memory management and is stricter about memory safety than Rust, and both of those design choices have runtime performance costs). So how close can Roc get?

Here are some performance benchmarks across four community projects. Each includes a comparison to Rust or C, and all were built with the highest levels of optimization in their respective compilers.

roc-deflate

In How close can pure FP get to C?, I compared Niclas Åhdén's roc-deflate with C's libdeflate across 144 compression benchmarks. You can read more about these measurements in that article, but the quick summary is that roc-deflate had a median slowdown (compared to libdeflate) of 2.6% on an M1 MacBook Pro and 8.9% on a Ryzen 3900X. Here's the main chart from that article:

#### Compression on Silesia corpus

M1 MacBook Pro Ryzen 3900X Ubuntu

MB/s

L1

L2

L3

L4

L5

L6

L7

L8

L9

L10

L11

L12

  • libdeflate
  • roc-deflate

Compression Level

MB/s

L1

L2

L3

L4

L5

L6

L7

L8

L9

L10

L11

L12

  • libdeflate
  • roc-deflate

Compression Level

roc-redis

Jared Ramirez included benchmarks in the README of his roc-redis package. I plotted them here with Rust's redis-rs as the dashed red baseline, and the other libraries' numbers converted to percentages of redis-rs. (Higher is better.)

#### Redis client throughput

  • roc-redis
  • go-redis
  • redis-py
  • redis-rs

Throughput vs. redis-rs

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

ping_sequential

set_get_sequential

incr_sequential

ping_pipeline

mset_mget_sequential

hash_roundtrip_sequential

set_get_pipeline

roc-redis on ping_sequential

91.8% of redis-rs throughput

go-redis on ping_sequential

76.0% of redis-rs throughput

redis-py on ping_sequential

29.7% of redis-rs throughput

roc-redis on set_get_sequential

93.5% of redis-rs throughput

go-redis on set_get_sequential

79.2% of redis-rs throughput

redis-py on set_get_sequential

29.8% of redis-rs throughput

roc-redis on incr_sequential

92.6% of redis-rs throughput

go-redis on incr_sequential

78.7% of redis-rs throughput

redis-py on incr_sequential

32.1% of redis-rs throughput

roc-redis on ping_pipeline

96.3% of redis-rs throughput

go-redis on ping_pipeline

91.8% of redis-rs throughput

redis-py on ping_pipeline

10.0% of redis-rs throughput

roc-redis on mset_mget_sequential

92.7% of redis-rs throughput

go-redis on mset_mget_sequential

81.4% of redis-rs throughput

redis-py on mset_mget_sequential

29.8% of redis-rs throughput

roc-redis on hash_roundtrip_sequential

94.4% of redis-rs throughput

go-redis on hash_roundtrip_sequential

80.5% of redis-rs throughput

redis-py on hash_roundtrip_sequential

29.7% of redis-rs throughput

roc-redis on set_get_pipeline

91.2% of redis-rs throughput

go-redis on set_get_pipeline

95.8% of redis-rs throughput

redis-py on set_get_pipeline

11.3% of redis-rs throughput

roc-regex

Karl's roc-regex technically benchmarks faster than the popular regex Rust crate, but it's not an apples-to-apples comparison. Karl used a matching algorithm based on RE#, which differs from how regex is implemented in ways that favor the RE# algorithm on these particular inputs. Still, both packages get identical answers across all inputs in this benchmark. (Lower is better.)

#### Regular expression matching

  • roc-regex
  • regex crate

Matching time vs. regex crate

0%

20%

40%

60%

80%

100%

120%

Holmes

Moriarty

8-name alternation

[A-Za-z]+

[0-9]{2,4}

\bthe\b

\w+\s+\w+

(\w+)@(\w+)

\p{L}+

.*Holmes

roc-regex matching Holmes

26.54 μs (96% of regex)

(minimum across five runs)

roc-regex matching Moriarty

9.69 μs (98% of regex)

(minimum across five runs)

roc-regex matching 8-name alternation

411.99 μs (97% of regex)

(minimum across five runs)

roc-regex matching [A-Za-z]+

1,041.30 μs (47% of regex)

(minimum across five runs)

roc-regex matching [0-9]{2,4}

58.83 μs (55% of regex)

(minimum across five runs)

roc-regex matching \bthe\b

175.63 μs (93% of regex)

(minimum across five runs)

roc-regex matching \w+\s+\w+

1,093.57 μs (71% of regex)

(minimum across five runs)

roc-regex matching (\w+)@(\w+)

62.63 μs (91% of regex)

(minimum across five runs)

roc-regex matching \p{L}+

1,260.14 μs (61% of regex)

(minimum across five runs)

roc-regex matching .*Holmes

238.12 μs (37% of regex)

(minimum across five runs)

roux webserver

Zak Kohler built roux on top of his Zig webserver, fourneau. He benchmarked it against Rust's popular axum crate as well as a vanilla Go webserver. This chart uses his November 28 benchmarks, and his Drag Race Page updates nightly with fresh measurements using the latest roux and fourneau. (Higher is better.)

#### HTTP server throughput

  • roux
  • fourneau-zig
  • go
  • axum

Throughput vs. axum

0%

25%

50%

75%

100%

125%

150%

175%

Echo 4 KiBConnection churnSSE (Datastar)PlaintextPlaintext (h2c)Templates

axum · Echo 4 KiB

77,950 req/s (100%)

(best of three runs)

fourneau-zig · Echo 4 KiB

74,510 req/s (96% of axum)

(best of three runs)

go · Echo 4 KiB

45,396 req/s (58% of axum)

(best of three runs)

roux · Echo 4 KiB

77,576 req/s (100% of axum)

(best of three runs)

axum · Connection churn

14,730 req/s (100%)

(best of three runs)

fourneau-zig · Connection churn

14,550 req/s (99% of axum)

(best of three runs)

go · Connection churn

7,458 req/s (51% of axum)

(best of three runs)

roux · Connection churn

14,621 req/s (99% of axum)

(best of three runs)

axum · SSE (Datastar)

99,010 req/s (100%)

(best of three runs)

fourneau-zig · SSE (Datastar)

136,931 req/s (138% of axum)

(best of three runs)

go · SSE (Datastar)

19,736 req/s (20% of axum)

(best of three runs)

roux · SSE (Datastar)

139,933 req/s (141% of axum)

(best of three runs)

axum · Plaintext

236,522 req/s (100%)

(best of three runs)

fourneau-zig · Plaintext

354,305 req/s (150% of axum)

(best of three runs)

go · Plaintext

69,886 req/s (30% of axum)

(best of three runs)

roux · Plaintext

361,682 req/s (153% of axum)

(best of three runs)

axum · Plaintext (h2c)

244,087 req/s (100%)

(best of three runs)

fourneau-zig · Plaintext (h2c)

383,439 req/s (157% of axum)

(best of three runs)

go · Plaintext (h2c)

74,426 req/s (30% of axum)

(best of three runs)

roux · Plaintext (h2c)

391,028 req/s (160% of axum)

(best of three runs)

axum · Templates

38,710 req/s (100%)

(best of three runs)

fourneau-zig · Templates

63,443 req/s (164% of axum)

(best of three runs)

go · Templates

1,875 req/s (5% of axum)

(best of three runs)

roux · Templates

49,569 req/s (128% of axum)

(best of three runs)

Fast Feedback Loops

Roc is designed not only to run fast, but also to provide fast feedback loops.

Instead of sharing laboratory benchmarks on build times, I decided to ask the community what projects of theirs I could share in this post. Some posted their own build times, and others I measured on my own machine. (A few of the projects were commercial and proprietary, so I don't have access to the code.)

Terminology note: a "cold" build has no on-disk cache yet, a "warm" build has been built once before (and so benefits from the cache), "root changed" means a rebuild after only the root module changed (meaning every other module can be loaded from cache; this is almost the best-case scenario for caching), and "import changed" means a rebuild after a heavily-imported module changed, which would invalidate a bunch of cached modules and bring the overall build time closer to the cold build time.

roc check does type-checking and compile-time evaluation and reports errors, roc build --opt=dev does everything roc check does, and then also outputs a binary (a development build without optimizations, because of --opt=dev), and roc test runs tests as well.

Here are the results:

### roc check on real-world code bases

  • Cold
  • Warm
  • Root changed
  • Import changed

roc check wall time

0

200 ms

400 ms

600 ms

800 ms

1 s

0

10k

20k

30k

40k

50k

60k

70k

Lines of code including dependencies

lukewilliamboswell/roc-graph-layout · cold

874 ms · 66,168 lines

(median across five runs)

roxum/ddd · cold

560 ms · 11,896 lines

(median across three runs)

roxum/middleware · cold

530 ms · 10,501 lines

(median across three runs)

grayrest/roc-regex · cold

509 ms · 17,408 lines

(median across five runs)

lukewilliamboswell/roc-font · cold

489 ms · 29,118 lines

(median across five runs)

roxum/hello · cold

470 ms · 10,159 lines

(median across three runs)

lukewilliamboswell/weaver · cold

399 ms · 15,470 lines

(median across five runs)

lukewilliamboswell/roc-ray · cold

398 ms · 18,856 lines

(median across five runs)

showell/roc-apps · cold

344 ms · 4,371 lines

(median across five runs)

showell/roc-markdown · cold

329 ms · 6,241 lines

(median across five runs)

lukewilliamboswell/plume · cold

319 ms · 12,951 lines

(median across five runs)

lukewilliamboswell/roc-automation · cold

294 ms · 9,239 lines

(median across five runs)

lukewilliamboswell/roc-time · cold

249 ms · 13,822 lines

(median across five runs)

grayrest/roc-regex · import changed

218 ms · 17,408 lines

(median across five runs)

grayrest/roc-regex · root changed

201 ms · 17,408 lines

(median across five runs)

lukewilliamboswell/roc-font · import changed

185 ms · 29,118 lines

(median across five runs)

lukewilliamboswell/roc-time · import changed

88.1 ms · 13,822 lines

(median across five runs)

showell/roc-markdown · import changed

83.7 ms · 6,241 lines

(median across five runs)

showell/roc-apps · import changed

81.6 ms · 4,371 lines

(median across five runs)

lukewilliamboswell/roc-graph-layout · import changed

79.3 ms · 66,168 lines

(median across five runs)

lukewilliamboswell/roc-graph-layout · root changed

62.3 ms · 66,168 lines

(median across five runs)

lukewilliamboswell/plume · import changed

61 ms · 12,951 lines

(median across five runs)

lukewilliamboswell/weaver · import changed

59.7 ms · 15,470 lines

(median across five runs)

showell/roc-apps · root changed

52.5 ms · 4,371 lines

(median across five runs)

lukewilliamboswell/roc-font · root changed

48.5 ms · 29,118 lines

(median across five runs)

rocco/widgets · cold

46 ms · 3,740 lines

(median across three runs)

rocco/pong · cold

41 ms · 3,583 lines

(median across three runs)

lukewilliamboswell/weaver · root changed

30.6 ms · 15,470 lines

(median across five runs)

rocco/primitives · cold

30 ms · 2,134 lines

(median across three runs)

lukewilliamboswell/roc-ray · root changed

28.6 ms · 18,856 lines

(median across five runs)

lukewilliamboswell/roc-automation · root changed

26.9 ms · 9,239 lines

(median across five runs)

lukewilliamboswell/roc-time · root changed

23.8 ms · 13,822 lines

(median across five runs)

lukewilliamboswell/roc-graph-layout · warm

20.8 ms · 66,168 lines

(median across five runs)

lukewilliamboswell/plume · root changed

18.9 ms · 12,951 lines

(median across five runs)

lukewilliamboswell/roc-font · warm

12.2 ms · 29,118 lines

(median across five runs)

ageron/roclet · cold

10.8 ms · 29 lines

(median across five runs)

lukewilliamboswell/plume · warm

10.2 ms · 12,951 lines

(median across five runs)

lukewilliamboswell/weaver · warm

9.9 ms · 15,470 lines

(median across five runs)

lukewilliamboswell/roc-ray · warm

9.9 ms · 18,856 lines

(median across five runs)

ageron/roclet · root changed

9.7 ms · 29 lines

(median across five runs)

lukewilliamboswell/roc-time · warm

9.7 ms · 13,822 lines

(median across five runs)

grayrest/roc-regex · warm

9.5 ms · 17,408 lines

(median across five runs)

showell/roc-markdown · root changed

8.6 ms · 6,241 lines

(median across five runs)

lukewilliamboswell/roc-automation · warm

8.3 ms · 9,239 lines

(median across five runs)

lukewilliamboswell/roc-platform-template-zig · cold

7.6 ms · 106 lines

(median across five runs)

showell/roc-markdown · warm

6.5 ms · 6,241 lines

(median across five runs)

showell/roc-apps · warm

6.3 ms · 4,371 lines

(median across five runs)

lukewilliamboswell/roc-platform-template-zig · root changed

5.7 ms · 106 lines

(median across five runs)

ageron/roclet · warm

4.4 ms · 29 lines

(median across five runs)

lukewilliamboswell/roc-platform-template-zig · warm

4.4 ms · 106 lines

(median across five runs)

### roc build --opt=dev on real-world code bases

  • Cold
  • Warm
  • Root changed
  • Import changed

roc build --opt=dev wall time

0

200 ms

400 ms

600 ms

800 ms

1 s

0

10k

20k

30k

40k

50k

60k

70k

Lines of code including dependencies

lukewilliamboswell/roc-graph-layout · cold

985 ms · 66,168 lines

(median across five runs)

roxum/ddd · cold

640 ms · 11,896 lines

(median across three runs)

roxum/middleware · cold

590 ms · 10,501 lines

(median across three runs)

lukewilliamboswell/roc-font · cold

559 ms · 29,118 lines

(median across five runs)

roxum/hello · cold

530 ms · 10,159 lines

(median across three runs)

grayrest/roc-regex · cold

527 ms · 17,408 lines

(median across five runs)

lukewilliamboswell/weaver · cold

441 ms · 15,470 lines

(median across five runs)

lukewilliamboswell/roc-automation · cold

334 ms · 9,239 lines

(median across five runs)

lukewilliamboswell/plume · cold

332 ms · 12,951 lines

(median across five runs)

lukewilliamboswell/roc-time · cold

271 ms · 13,822 lines

(median across five runs)

grayrest/roc-regex · import changed

226 ms · 17,408 lines

(median across five runs)

grayrest/roc-regex · root changed

207 ms · 17,408 lines

(median across five runs)

lukewilliamboswell/roc-font · import changed

204 ms · 29,118 lines

(median across five runs)

lukewilliamboswell/roc-graph-layout · import changed

115 ms · 66,168 lines

(median across five runs)

lukewilliamboswell/roc-graph-layout · root changed

98.6 ms · 66,168 lines

(median across five runs)

lukewilliamboswell/roc-time · import changed

94.8 ms · 13,822 lines

(median across five runs)

lukewilliamboswell/roc-automation · root changed

86.2 ms · 9,239 lines

(median across five runs)

rocco/widgets · cold

86 ms · 3,740 lines

(median across three runs)

lukewilliamboswell/weaver · import changed

84.6 ms · 15,470 lines

(median across five runs)

lukewilliamboswell/roc-font · root changed

81.4 ms · 29,118 lines

(median across five runs)

lukewilliamboswell/roc-graph-layout · warm

80.1 ms · 66,168 lines

(median across five runs)

rocco/pong · cold

73 ms · 3,583 lines

(median across three runs)

lukewilliamboswell/weaver · root changed

63.4 ms · 15,470 lines

(median across five runs)

lukewilliamboswell/plume · import changed

58.1 ms · 12,951 lines

(median across five runs)

rocco/primitives · cold

56 ms · 2,134 lines

(median across three runs)

lukewilliamboswell/roc-font · warm

55.7 ms · 29,118 lines

(median across five runs)

lukewilliamboswell/plume · root changed

38.3 ms · 12,951 lines

(median across five runs)

lukewilliamboswell/roc-time · root changed

26.9 ms · 13,822 lines

(median across five runs)

lukewilliamboswell/weaver · warm

21.5 ms · 15,470 lines

(median across five runs)

lukewilliamboswell/roc-time · warm

18 ms · 13,822 lines

(median across five runs)

grayrest/roc-regex · warm

17.8 ms · 17,408 lines

(median across five runs)

lukewilliamboswell/plume · warm

16.9 ms · 12,951 lines

(median across five runs)

lukewilliamboswell/roc-automation · warm

16.3 ms · 9,239 lines

(median across five runs)

ageron/roclet · cold

14.2 ms · 29 lines

(median across five runs)

ageron/roclet · root changed

13.4 ms · 29 lines

(median across five runs)

ageron/roclet · warm

8.5 ms · 29 lines

(median across five runs)

### roc test on real-world code bases

  • Cold
  • Warm
  • Root changed
  • Import changed

roc test wall time

0

500 ms

1 s

1.5 s

2 s

2.5 s

0

10k

20k

30k

40k

50k

60k

Lines of code including dependencies

lukewilliamboswell/roc-blueprint · cold

2.242 s · 14,460 lines

(median across five runs)

lukewilliamboswell/roc-graph-layout · cold

1.8 s · 57,088 lines

(median across five runs)

lukewilliamboswell/roc-blueprint · import changed

1.744 s · 14,460 lines

(median across five runs)

grayrest/roc-markdown · cold

1.621 s · 8,649 lines

(median across five runs)

lukewilliamboswell/roc-font · cold

1.621 s · 19,995 lines

(median across five runs)

grayrest/roc-markdown · import changed

1.608 s · 8,649 lines

(median across five runs)

grayrest/roc-markdown · root changed

1.567 s · 8,649 lines

(median across five runs)

lukewilliamboswell/roc-graph-layout · import changed

700 ms · 57,088 lines

(median across five runs)

roxum/ddd · cold

700 ms · 11,896 lines

(median across three runs)

roxum/middleware · cold

650 ms · 10,501 lines

(median across three runs)

roxum/hello · cold

620 ms · 10,159 lines

(median across three runs)

lukewilliamboswell/roc-time · cold

580 ms · 19,374 lines

(median across five runs)

lukewilliamboswell/weaver · cold

457 ms · 7,190 lines

(median across five runs)

lukewilliamboswell/roc-ray · cold

432 ms · 18,856 lines

(median across five runs)

showell/roc-markdown · cold

366 ms · 6,241 lines

(median across five runs)

grayrest/roc-regex · cold

261 ms · 9,076 lines

(median across five runs)

lukewilliamboswell/roc-font · import changed

198 ms · 19,995 lines

(median across five runs)

grayrest/roc-regex · import changed

147 ms · 9,076 lines

(median across five runs)

lukewilliamboswell/plume · cold

132 ms · 3,838 lines

(median across five runs)

showell/roc-apps · cold

115 ms · 2,869 lines

(median across five runs)

lukewilliamboswell/roc-time · import changed

110 ms · 19,374 lines

(median across five runs)

showell/roc-markdown · import changed

83.7 ms · 6,241 lines

(median across five runs)

lukewilliamboswell/weaver · import changed

65.6 ms · 7,190 lines

(median across five runs)

rocco/widgets · cold

65 ms · 3,740 lines

(median across three runs)

lukewilliamboswell/plume · import changed

56 ms · 3,838 lines

(median across five runs)

rocco/pong · cold

56 ms · 3,583 lines

(median across three runs)

showell/roc-apps · import changed

51.7 ms · 2,869 lines

(median across five runs)

rocco/primitives · cold

42 ms · 2,134 lines

(median across three runs)

lukewilliamboswell/roc-ray · root changed

41.2 ms · 18,856 lines

(median across five runs)

lyceum-quest/study · cold

27.6 ms · 348 lines

(median across five runs)

showell/roc-apps · root changed

26 ms · 2,869 lines

(median across five runs)

lukewilliamboswell/roc-graph-layout · root changed

22.6 ms · 57,088 lines

(median across five runs)

lukewilliamboswell/roc-graph-layout · warm

19.3 ms · 57,088 lines

(median across five runs)

lukewilliamboswell/roc-platform-template-zig · cold

14.9 ms · 139 lines

(median across five runs)

ageron/roclet-display · import changed

14.4 ms · 101 lines

(median across five runs)

ageron/roclet-display · cold

14.3 ms · 101 lines

(median across five runs)

lukewilliamboswell/roc-time · root changed

13.7 ms · 19,374 lines

(median across five runs)

lukewilliamboswell/roc-time · warm

13 ms · 19,374 lines

(median across five runs)

lukewilliamboswell/roc-font · root changed

12.9 ms · 19,995 lines

(median across five runs)

lukewilliamboswell/roc-platform-template-zig · root changed

12.2 ms · 139 lines

(median across five runs)

lukewilliamboswell/roc-font · warm

11.1 ms · 19,995 lines

(median across five runs)

lukewilliamboswell/roc-ray · warm

10.9 ms · 18,856 lines

(median across five runs)

ageron/roclet · root changed

10 ms · 29 lines

(median across five runs)

ageron/roclet · cold

9.3 ms · 29 lines

(median across five runs)

lukewilliamboswell/roc-blueprint · root changed

9.1 ms · 14,460 lines

(median across five runs)

showell/roc-markdown · root changed

8 ms · 6,241 lines

(median across five runs)

lukewilliamboswell/roc-blueprint · warm

7.8 ms · 14,460 lines

(median across five runs)

showell/roc-markdown · warm

7 ms · 6,241 lines

(median across five runs)

lukewilliamboswell/weaver · root changed

7 ms · 7,190 lines

(median across five runs)

grayrest/roc-regex · root changed

6.9 ms · 9,076 lines

(median across five runs)

lukewilliamboswell/plume · root changed

6.8 ms · 3,838 lines

(median across five runs)

showell/roc-apps · warm

6.5 ms · 2,869 lines

(median across five runs)

lukewilliamboswell/weaver · warm

6.2 ms · 7,190 lines

(median across five runs)

grayrest/roc-regex · warm

6.2 ms · 9,076 lines

(median across five runs)

grayrest/roc-markdown · warm

6 ms · 8,649 lines

(median across five runs)

lukewilliamboswell/plume · warm

5.7 ms · 3,838 lines

(median across five runs)

ageron/roclet-display · root changed

4.8 ms · 101 lines

(median across five runs)

lyceum-quest/study · root changed

4.8 ms · 348 lines

(median across five runs)

lukewilliamboswell/roc-platform-template-zig · warm

4.4 ms · 139 lines

(median across five runs)

ageron/roclet-display · warm

4.1 ms · 101 lines

(median across five runs)

ageron/roclet · warm

3.9 ms · 29 lines

(median across five runs)

lyceum-quest/study · warm

3.9 ms · 348 lines

(median across five runs)

I left one outlier out of these charts because it made the y-axes hard to read: Rocco's village example. Its cold-run median build times on an M5 MacBook Pro were 1s for roc check, 3.5s for roc build --opt=dev, and 7.5s for roc test. The example wasn't significantly bigger than the other code bases, but it contained a huge literal which revealed a pathological edge case in the compiler. A fix for that edge case should be in the next release after 0.1.0.

Roc is designed to have user-friendly syntax, APIs, and compiler error messages.

Syntax Example

Here's what Roc code looks like, adapted from a sparkline rendering example in Kite, a Roc GUI platform whose author runs it on an e-ink tablet. (You can read more about Kite in its community showcase entry below.)

spark_cell = |ctx| {
	prices = ctx.row.timeline
	
	up = match (prices.first(), prices.last()) {
		(Ok(first), Ok(last)) => first < last
		(_, _) => True
	}
	
	color = if up { Colors.good } else { Colors.bad }
	
	Sparkline.bars(prices, 100.0, 28.0, color)
		|> View.style(St.width(Grow).height(Fixed(28)))
}

Error Messages

Here's the error message you get if you change True to 1 in this example:

✗ type mismatchmain.roc:11:13

This number is being used where a non-number type is needed.

(_, _) => 1
          ^

Other code expects this to have the type:

    Bool

Roc is directly descended from Elm, whose compiler is legendary for its friendly error messages, and Roc's goal is to follow in its footsteps.

Purity Inference

A concise example of Roc's user-friendliness is this snippet:

if File.exists!(path)

Just by looking at this code, I can tell you that File.exists! is not a pure function; it performs side effects. That's because Roc's type system gives different types to pure functions and effectful functions, and the compiler enforces the naming convention that effectful functions' names must end in !.

I can also tell that this conditional is inside an effectful function. That's because effectful functions may only be called from other effectful functions (pure functions can be called anywhere), which the compiler infers and enforces. This simple system reliably tells you which parts of your code base are pure (usually most, in real-world Roc code bases), and exactly where the effects are, while keeping function calls as straightforward as they are in mainstream languages.

Compile-Time Evaluation

Pure functions are also evaluated at compile time when possible (that is, when they depend on no runtime inputs), and this happens before exhaustiveness checking. That means this roc-regex snippet will execute Regex.compile when you are compiling your Roc program:

Ok(my_regex) = Regex.compile(".*Holmes.*&.*Watson.*")

If your regex string contains a syntax error, Regex.compile will return an Err during compile-time evaluation, making the Ok pattern-match fail before your program even runs. Even roc check will report an error for this! These functions are safe to evaluate at compile time because the compiler knows they're pure.

Friendly People

The Roc community is also full of friendly people who hang out in Roc Zulip. Come say hi in the #introductions channel!

When I asked for community projects to share in the 0.1.0 announcement post, I got way too many responses to put here, so I left some out and limited these to one project per author. Below each featured project, you can find links to other projects that community member has made.

Roc is designed to be useful in a variety of use cases, and these projects demonstrate a wide range of them: a full-stack Web framework, native macOS and Windows app frameworks based on reactive signals, a 3D game engine, a reactive notebook, a neural-network library, a native GUI platform running apps on an e-ink tablet, a chat client, a Game Boy Advance emulator, commercial screenwriting software, an immediate-mode UI library, a Web framework for hypermedia apps, a bindings generator for Godot and related game engines, a CLI for reproducible development environments and machines, a Redis client, an HTTP API and backend server platform, and a serialization format.

An open-source framework for building full-stack web applications in Roc, with an Elm-style architecture and a WebAssembly frontend. Niclas has been using Joy in paid production work for 2 years.

Niclas Åhdén talking about the Joy Web Framework

Niclas has also published numerous other open-source Roc packages, most of which he uses in production.

Platforms for building native macOS and Windows applications in Roc, using pure functions for rendering and reactive signals for state updates without side effects.

Build native macOS apps using Roc — Luke Boswell

Luke uses Roc for internal tooling at work, and has open-sourced many different packages and platforms.

An experimental 3D game engine for native desktop or WebAssembly games, with game logic written in Roc and engine internals written in Odin. It has a stylish interactive tour that you can try in your browser.

Download the Rocco demo video.

Reactive Roc notebooks that run in a browser (including offline!) with support for exporting notebooks and running the server locally.

Download the Roclet introduction.

Aurélien's introduction to Roclet. Shared on Zulip.

Aurélien has also written lots of Roc's official documentation and tutorial, and also created the Roc Exercism Track. He's also published a variety of other Roc packages.

A small neural network package for exploring machine learning, inspired by micrograd and tinygrad. You can try it in your browser via Roclet.

A native GUI platform using The Elm Architecture, Tailwind-inspired styles, animation, and rich text. Karl runs it on an e-ink tablet:

Karl has open-sourced other Roc packages as well.

A privately-deployed chat application featuring topics, direct messages, and Markdown for styling. roc-chat uses Roc for its application logic and a custom platform under the hood written in Zig.

Steve has also built games, learning materials, and packages in Roc.

A work-in-progress Game Boy Advance emulator written in Roc. It uses Luke Boswell's roc-ray for graphics, and has not implemented sound yet.

Commercial screenwriting software that uses Roc for screenplay layout, pagination, and other application logic, with a custom Rust platform under the hood for managing I/O and collaborative document state.

An immediate-mode GUI library for Roc native applications and games, with a Clay-inspired layout system, a Model-View-Update architecture, and roc-ray rendering. You can see its interactive tutorial in action here:

Download the Terrocotta demo.

A web platform with typed HTML templates, SQLite queries that are verified at compile time, server-sent events, and live reload. Its tutorial is a Roux app, and there are nightly benchmarks vs. Go, axum, and others.

Generates Roc bindings for Godot, Redot, and other game engines using GDExtension, so you can write game logic in Roc for any of these engines.

Scott has also built other platforms and developer tools in Roc.

As the README explains: "Kai wraps Nix in a friendly frontend"—with an optional guix plugin as well.

Brandon has also built Ancient Greek learning tools in Roc.

A binary-safe Redis client that can be used from different Roc platforms. Jared isn't aware of anyone using it in the wild yet.

#### Redis client throughput (higher is better)

  • roc-redis
  • go-redis
  • redis-py
  • redis-rs

Throughput vs. redis-rs

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

ping_sequential

set_get_sequential

incr_sequential

ping_pipeline

mset_mget_sequential

hash_roundtrip_sequential

set_get_pipeline

roc-redis on ping_sequential

91.8% of redis-rs throughput

go-redis on ping_sequential

76.0% of redis-rs throughput

redis-py on ping_sequential

29.7% of redis-rs throughput

roc-redis on set_get_sequential

93.5% of redis-rs throughput

go-redis on set_get_sequential

79.2% of redis-rs throughput

redis-py on set_get_sequential

29.8% of redis-rs throughput

roc-redis on incr_sequential

92.6% of redis-rs throughput

go-redis on incr_sequential

78.7% of redis-rs throughput

redis-py on incr_sequential

32.1% of redis-rs throughput

roc-redis on ping_pipeline

96.3% of redis-rs throughput

go-redis on ping_pipeline

91.8% of redis-rs throughput

redis-py on ping_pipeline

10.0% of redis-rs throughput

roc-redis on mset_mget_sequential

92.7% of redis-rs throughput

go-redis on mset_mget_sequential

81.4% of redis-rs throughput

redis-py on mset_mget_sequential

29.8% of redis-rs throughput

roc-redis on hash_roundtrip_sequential

94.4% of redis-rs throughput

go-redis on hash_roundtrip_sequential

80.5% of redis-rs throughput

redis-py on hash_roundtrip_sequential

29.7% of redis-rs throughput

roc-redis on set_get_pipeline

91.2% of redis-rs throughput

go-redis on set_get_pipeline

95.8% of redis-rs throughput

redis-py on set_get_pipeline

11.3% of redis-rs throughput

A webserver platform with typed handlers, tags, and staged middleware. Here's how Roxum benchmarks against Rust's axum crate:

#### HTTP throughput with Roxum

  • roxum
  • axum

Throughput vs. axum

0%

20%

40%

60%

80%

100%

120%

Plaintext

Pre-encoded JSON

Routing (100 routes)

Keep-alive-heavy

1,000 connections

Roxum on plaintext

216,198 req/s (82% of axum)

(median across four runs)

Roxum on pre-encoded json

218,086 req/s (83% of axum)

(median across four runs)

Roxum on routing (100 routes)

187,479 req/s (73% of axum)

(median across four runs)

Roxum on keep-alive-heavy

172,320 req/s (96% of axum)

(median across four runs)

Roxum on 1,000 connections

200,752 req/s (76% of axum)

(median across four runs)

Pronounced "raven," short for Roc Value Notation. As the README says:

Raven is to Roc as JSON is to JavaScript. Any Roc value that does not contain functions is valid Raven.

{
	language: "Roc",
	tags: [Fast, Friendly, Functional],
	color: 0x7c38f5, # Hex numbers and comments, too!
}

Jasper also created Gregorian, "a small and safe date/time package."

Other Packages

You can find many more Roc projects at roc-awesome, or right here in this list:

More packages from community members

Niclas Åhdén

  • joy-html provides HTML building blocks for Joy applications.
  • roc-pg is a PostgreSQL client with compile-time checking of SQL queries.
  • roc-deflate implements DEFLATE compression in pure Roc.
  • roc-xlsx generates Excel spreadsheets.
  • roc-zip creates and extracts ZIP archives.
  • roc-playwright lets Roc programs automate browsers using Playwright.
  • roc-spec runs tests in parallel with isolated test environments.
  • roc-vcr records and replays HTTP interactions for tests.
  • roc-openapi validates HTTP request bodies against OpenAPI specifications.
  • roc-sendgrid sends email through SendGrid.
  • roc-url parses and constructs URLs.
  • roc-database-url parses database connection URLs.
  • roc-base64 encodes and decodes Base64.
  • roc-crc32 calculates CRC32 checksums.
  • roc-hmac implements HMAC authentication codes in pure Roc.
  • roc-md5 implements MD5 hashing in pure Roc.
  • roc-scram implements SCRAM authentication in pure Roc.
  • roc-prng provides pseudorandom number generation.
  • roc-xml generates XML.
  • roc-human-readable-file-size formats file sizes for people to read.
  • roc-maybe provides a type for optional values.
  • roc-non-zero provides a number type that excludes zero.

Luke Boswell

  • roc-ray is a platform for games and graphics built on raylib, with support for tasks, networking, files, and databases.
  • roc-gui is an experimental platform for native GUI applications using GPUI.
  • roc-signals is a signals-based framework for web user interfaces.
  • plume provides a typed Roc API for interactive Plotly.js charts.
  • roc-docx reads and writes Word documents compatible with Word, LibreOffice, and Google Docs.
  • roc-font reads OpenType and TrueType fonts and shapes text into positioned glyphs.
  • roc-graph-layout provides graph layout algorithms and parses and renders Mermaid diagrams.
  • roc-parser combines parser combinators with ready-made parsers for formats including JSON, YAML, XML, Markdown, AsciiDoc, HTTP, and Roc source.
  • roc-pdf generates PDF 2.0 and PDF/A-4 documents in Roc.
  • roc-time handles dates, times, and durations.
  • weaver parses command-line arguments with an API inspired by Rust's clap.
  • basic-ssg generates static sites from Markdown and AsciiDoc.
  • roc-fuzz provides fuzzing and property-based testing using libFuzzer, along with tools for observing performance.
  • Zig platform template is a starting point for hosting Roc applications in Zig.
  • Rust platform template is a starting point for hosting Roc applications in Rust.
  • Go platform template is a starting point for hosting Roc applications in Go.
  • embed-roc-in-dotnet demonstrates embedding Roc in a .NET application.
  • roc-blueprint describes development environments, builds, tasks, and workflows in Roc, with Nix integration.
  • roc-automation supplies shared automation and a manual for maintaining Roc packages and platforms.
  • roc-awesome collects maintained Roc packages, platforms, tools, and applications from across the community.

Karl

  • Trantor assembles Roc platforms from reusable Rust components.
  • roc-regex is a regular expression engine written in Roc.
  • roc-markdown is Karl's CommonMark and GitHub Flavored Markdown parser, a separate project from Steve's library of the same name.

Steve Howell

  • Safari Walk is a 3D journey through a savanna at sunset, built with Roc and Rocco and running in browsers with WebGPU support.
  • A little Roc book teaches Roc by walking through the code behind the original 2D Safari Ride.
  • roc-markdown is Steve's Markdown library, used in his book-building tools and chat application.
  • BASIC interpreter is a browser playground for running BASIC programs with an interpreter written in Roc.
  • Fast Track is a browser implementation of the marble-racing board game, with card-driven moves and computer opponents.
  • Welcome to Roc is an animated welcome made for the Roc release.

blu

  • Lyceum Study is a spaced-repetition tool for learning Ancient Greek, being ported to Roc.
  • Apo uses language models to generate glosses and prose translations as part of the Lyceum Ancient Greek toolkit.

Aurélien Geron

  • roclet-display adds rich notebook output such as tables, images, charts, and interactive controls.
  • Exercism's Roc track provides coding exercises, tests, and example solutions for learning and practicing Roc.

Jasper Woudenberg

  • Gregorian provides tools for working with dates and times.

Scott Campbell

  • goose-roc experiments with hosting Roc applications in Goose, including a console example and a work-in-progress mini-Doom port.
  • roc-build runs build tasks in parallel according to their dependency graph, using a Zig host.
  • roc-platform-patcher injects middleware into already-distributed platforms, enabling instrumentation, effect interception, and testing even when a platform's source is unavailable.

More about the language

Beyond the basics discussed earlier, here are some more details about Roc as a language. This won't be as comprehensive as the language reference or as helpful an introduction to the language as the tutorial or Exercism learning track, but it will give you an overview of what you can find in it.

Common Features

These are some features Roc has that can be found in several other languages.

  • Cross-compiling to static binaries out-the-box just like Go, including to Linux with no libc dependency (e.g. for Alpine Linux).
  • Sum types with pattern matching and exhaustiveness checks.
  • Simple, sound type system.
    • No null or any (or equivalent of either).
    • Type annotations are optional. Roc's type inference is principal and decidable, meaning it always correctly infers the most flexible correct type.
  • All expressions that can be evaluated at compile time are evaluated then.
    • This is true even if heap allocations are involved.
  • Testing, building, package management, and formatting, are all out-the-box.
  • Tests are automatically cached to avoid re-running tests whose outcomes couldn't possibly have changed given that the relevant source code didn't.

Uncommon Features

These are features that are much less common.

Getting Started

If Roc sounds interesting to you, the official tutorial is an easy place to start, and the language reference can answer questions you encounter in more detail.

In addition to writing much of the official documentation, Aurélien Geron created Exercism's Roc track and has built out 139 different exercises in conjunction with other maintainers.

Finally, Roc Zulip has always been a welcoming place for beginners, and there are plenty of friendly people there who are happy to help you get into the language. Come say hi in the #introductions channel!

Shout-Outs

Before wrapping up, I want to give some final shout-outs to all the people and projects who got Roc to this milestone, including:

  • The amazing Roc community! This post would have practically no content without the people who created the wonderful projects above.
  • All the contributors, past and present, who helped bring the language to this milestone. Thank you, thank you, thank you!
  • The Elm Programming Language, which directly inspired Roc (fun fact: the logo is origami as an homage to Elm's tangram logo).
  • The Koka and Morphic research languages, without which Roc would not be competitive with fast imperative languages on performance.
  • The Rust Programming Language, which is the language Roc's original compiler was written in. It served us well for years, and I'm still happy to use it daily at work.
  • The Zig Programming Language, which is the language Roc's compiler is now written in. It has continued to be great for us since the rewrite, and I'm still a happy recurring donor to the nonprofit Zig Software Foundation.
  • Zed, the editor I used for the entirety of the current code base, at least until I switched to...
  • Delta, which has become my main tool for building software. It's what I use daily to collaborate with my coworkers, as well as some Roc contributors.
  • And finally, all the people and companies who have donated to the nonprofit Roc Programming Language Foundation. Your donations, whether through every.org, Liberapay, GitHub Sponsors, or Benevity, have let us pay contributors to improve the language, and we'd love to do more of that! Corporate sponsors are also welcome; DM me on Zulip if you'd like to chat about corporate sponsorship.

What's Next?

The next release after 0.1.0 will most likely be 0.1.1, with bugfixes and performance improvements based on issues people have already reported on 0.1.0. (It will not take eight years to ship. Most likely sometime in December 2026.) In the meantime, there are automatically-published nightly releases if you want to try the latest compiler built from the previous day's main.

After that, here are some things we're exploring for 2027 and beyond:

  • Concurrency primitives in the standard library
  • Improved test output, as well as support for simulating effects (and testing real effects) and property-based testing out-the-box
  • A built-in debugger (in addition to the DWARF debug info we already emit for third-party debuggers to use)
  • Features inspired by theorem provers for additional ways to verify Roc programs
  • Improving build times for cold builds and optimized builds. (Minimizing development rebuild times was the priority for 0.1.0, since that's the most common feedback loop.)

It's taken a long time to get this foundation in place, but 0.1.0 is just the beginning for Roc!

Compare original feed summary (9 words)
<p><a href="https://lobste.rs/s/bbo39t/roc_version_0_1_0_eight_years_making">Comments</a></p>

Advent of Code 2026

Our sponsors help make Advent of Code possible:

Alber Blanc - We're a proprietary trading firm and market maker, active on exchanges worldwide. From Cyprus to the Netherlands, Switzerland and Singapore, our desks span four countries. Markets move in an instant, and so do we.

Compare original feed summary (4 words)
<p><a href="https://lobste.rs/s/ckfcg1/advent_code_2026">Comments</a></p>

Why I can't sell you a €1 email inbox

For the past few days, I've been building something I was really excited about: email inboxes for Magic Pages customers. Nothing fancy. Just an address at your own domain, an inbox you can open on your phone, with servers running in Europe, for €1 a month.

The idea came from something that has bugged me for a while. Ghost can send your newsletter from your own domain, but it can't receive email. For me, that's just how email works. Sending and receiving are two different things. But if you're a publisher and simply want to write, it's confusing. Your readers see hello@yourdomain.com on every newsletter. So why can't they respond there?

When customers ask us about it, we usually recommend Proton or mailbox.org. But whenever I look at where those same customers actually end up running their email, it's mostly Google and Microsoft, with a bit of Zoho. For a company that has been about privacy-focused, European hosting since I started it in 2023, that always felt like a gap. Publishing your thoughts shouldn't require an IT degree. Or a Google account.

So in mid-November, we asked our customers. I put a small survey on the billing page of the Magic Pages customer portal, and 23 customers said they'd pay for an inbox, somewhere between €1 and €3 a month. The majority wanted to pay €1. Not a huge number. But I had never advertised the idea, so to me that read like "please build this".

So, I did. Right now it's sitting on a server at Hetzner in Falkenstein. It's working well. I can send emails. I can receive them. I have a way of provisioning inboxes for customers.

But I can't sell it. The reason is a European law. And while I support the idea of it, the implementation is far from the reality of the European tech landscape.

Why small publishers need European email

But let's quickly take a look at why this matters so much to me. Because frankly, nobody gets rich from €1 inboxes. The customers that responded positively to the survey would have barely covered the infrastructure cost on our end.

But for me, Magic Pages is bigger than making everything profitable. We have a healthy subscription business that covers our salaries, infrastructure, and the time it takes to think about little things like these.

And where small publishers' email ends up matters to me. Both personally, and ideologically from the perspective of Magic Pages as a business. Some of our publishers write about local politics, privacy or press freedom. They write about sensitive topics, receive confidential information from their readers, or simply want to have conversations with their readers that are truly private.

Yet the majority of their inboxes sit with US companies, which are all subject to their dystopian "national security" laws.

There's a case from last year that pretty clearly shows why that's a problem. In May, AP reported that Microsoft cancelled the email address of the International Criminal Court's chief prosecutor after the US sanctioned him. He then moved to Proton Mail. Microsoft's president later said they hadn't cut off the court itself, as if cancelling the email of the court's chief prosecutor wasn't bad enough.

A month later, Microsoft France's director of public and legal affairs told a French Senate inquiry, under oath, that he could not guarantee French customer data would not be handed to US authorities.

So my plan was simple: an email inbox. No tracking. No AI reading your mail. No US dependency. And a price low enough that it's never the reason to stay with Google.

Under the hood, I set up an open-source mail server (Stalwart), with its own sending IP, webmail, IMAP and POP3, spam filtering and backups. Hetzner already hosts everything else Magic Pages runs, so there wasn't even a new subprocessor to add.

Yesterday I added a test domain and sent some stuff around. I also ran a test on mail-tester.com and it scored 10 out of 10. So...ready to launch for beta users, I thought.

Then I stumbled across some EU legislation, after doing some due diligence. Sigh...

The EU treats your inbox like a phone network

NIS2 is the EU's cybersecurity directive. And it's a good thing. It lays out the process and framework to uphold cybersecurity in critical sectors across the Union. Most companies only fall under it once they have 50 employees or €10 million in turnover. And if there's one thing I can guarantee you it's that Magic Pages is nowhere near that.

But Article 2(2) has a short list of exceptions that apply "regardless of their size". One of them is "providers of publicly available electronic communications services". Wait, what??

I did some digging and found the European Electronic Communications Code, which defines that term. And yes, it includes email.

It wasn't always that way though. In 2019, the Court of Justice of the EU ruled that Gmail was not an electronic communications service. The Code then changed the definition, and since December 2020 an email inbox has been in the same legal category as a physical phone network.

Austria, where Magic Pages is based, put the same rule into § 24 of its NISG 2026: providers of public communications services are so-called "important entities", "unabhängig von ihrer Größe" (regardless of their size). And according to the FAQ of the Austrian Bundesamt für Cybersicherheit, the whole company falls under the law.

Effectively that means that the first €1 inbox I sell would make all of Magic Pages subject to the NIS2 legislation, including the hosting for Ghost.

That alone isn't bad though. Making hosting providers aware of their obligations in terms of cybersecurity is a good thing, in my eyes. It's just that...nobody actually looked at the reality of the businesses that this would affect. Putting a managed hosting company at the same level as a phone network. Ooff...I don't know...

The security documentation I'd happily do for Europe

But hey, honestly, I would have done it. I was prepared to submit the paperwork. After all, most of the documents were already written down in one form or another. We just had to bring it into the right format.

In my reading of the Austrian law (I've asked my chamber of commerce to double-check), being an "important entity" under current legislation would mean:

  1. Registering with the Bundesamt für Cybersicherheit within three months of launch (an online form, easy).
  2. Writing a risk analysis and a security policy, signed off by management (that's me, and we already have that – so also easy).
  3. Reporting significant incidents with an early warning within 24 hours, a report within 72 hours and a final report within a month, and telling affected customers (we haven't had a "significant" cybersecurity incident, but all incidents on Magic Pages are handled transparently already).
  4. Keeping a list of every system and supplier, testing backups and using multi-factor authentication everywhere (we do all of that).
  5. Taking a cybersecurity course for managers, sending in a self-declaration within 12 months and reviewing everything once a year (this one would be new, but I am pretty sure my chamber of commerce would offer something).

Overall, I'd probably have spent about a day or so on the documentation. Nothing seems overly complicated and we have tested backup restoration, enforce MFA everywhere, and know who our suppliers are. The small parts we're missing are things that make sense to do, regardless of the legislation. I'd have happily sent the documents to Vienna and moved on to giving customers access to our mailboxes.

If you know me, I consider myself a European patriot. I believe in the EU as a project and advocate for closer integration. I've also defended the GDPR in online and offline debates for years, and I've even argued that a bit of bureaucracy can be a good thing, because it makes you write down what you'd otherwise just assume. Looking at the world right now, I want a Europe that takes the security of its infrastructure seriously. So, I wholeheartedly support what NIS2 is trying to do.

Hey single market, where are you?

Until I got to Article 26...

Under NIS2, a business normally deals with the authority of the country it's established in. Easy peasy. Cloud providers, data centers and hosting companies like Magic Pages get exactly that.

However, telecom providers don't. Article 26(1)(a) says they "shall be considered to fall under the jurisdiction of the Member State in which they provide their services".

What the...

The European Commission's FAQ confirms it, and Belgium's cybersecurity authority spells it out for foreign companies: you register in Belgium if you "provide electronic communication services or networks in Belgium".

Right now, Magic Pages doesn't do either. We provide managed hosting to customers in Belgium. But we don't provide electronic communication services or networks. So today, this rule doesn't touch us.

The Belgian FAQ even gives an example: a provider offering electronic communication services in Belgium, Luxembourg and Germany "has to respect the NIS2 transposition laws of Belgium, Luxemburg and Germany", and "the strictest rules will have to be respected". Honestly, I'd be fine with following the strictest rules. But that still means registering, updating details and reporting incidents in every single one of those countries.

Now take that from three countries to 25. That's how many EU countries Magic Pages has customers in right now. And if you remember, an email inbox would count as an "electronic communication service".

So offering a €1 email inbox would mean I would have to register 25 times, through 25 national portals, under 25 national versions of the same directive.

Not only that. Security incidents get reported to every country where customers are affected, and every new IP range we use has to be updated 25 times.

That's truly insane.

The big players won't even notice. Magenta in Austria and Telekom in Germany belong to the same group. That group has subsidiaries in several EU member states and well, each of them registers once. Google and Microsoft have legal departments for exactly this kind of thing.

The people this actually hits are small providers offering email across borders inside the single market – the decentralised, European alternatives everyone in Brussels says they want right now.

But instead, what we get is a few big corporations that can afford this process. And while Telekom, IONOS, and OVH are better than Microsoft and Google, I'd personally rather see small players on the market where a single incident cannot take down half a country.

How do the others do it?

I was curious how the providers we usually recommend handle this, so I went looking. mailbox.org is run by a company in Berlin, and its own terms of service treat it as a telecom provider under German law. In January, they published a blog post explaining that "important and particularly important institutions are obliged to register" with Germany's BSI. It's written for their customers though, and ends with a pitch for their backup communication product. Whether mailbox.org itself is registered isn't mentioned.

Proton is Swiss and only names a representative in Luxembourg for GDPR purposes. Its trust center mentions NIS2 only as a framework that wants companies to use "providers with state-of-the-art security". So Proton talks about NIS2 as its customers' problem, not its own.

And you can't really check it either. Email providers don't even show up in Germany's telecom register, because they're exempt from that notification – which is a different law than NIS2. An Austrian consultancy points out the same trap here: "Wer nicht im Register der Regulierungsbehörde steht, kann daher trotzdem vom NISG 2026 erfasst sein". That translates to "Not being in the regulator's register doesn't mean you're outside the NIS2 law".

And none of the NIS2 authorities I looked at publish who has registered. Maybe they've quietly done it 25 times. Maybe nobody has asked them yet. I honestly don't know, and if anyone from mailbox.org or Proton reads this, I'd love to hear how you handle it.

So could I simply resell their inboxes under the Magic Pages name instead? Unfortunately not. As far as I understand Austrian telecom law, whoever sells the service to the customer in their own name counts as the provider. And that would still be me.

And why not just sell it to Austrian customers? Only a small portion of Magic Pages customers are based in Austria. And even if I wanted to, it would make the single market absurd. An Austrian company that has to register with a second national authority to sell a €1 inbox to a publisher in Bavaria, an hour's drive from where we are located? That's not what the single market was built for.

So, who caused this mess?

My first guess was that the telecom lobby had pushed for this. It kinda fits the picture everybody tries to paint of the EU. A couple of lobbyists influencing laws.

But reality might even be worse. I went through the legislative history and looked for press coverage. Apart from law firms noting, very matter-of-factly, that telecom providers may need multiple registrations across Europe, I found nothing. And as far as the public record goes, nobody actively decided it on purpose. It just...happened.

In December 2020, the Commission's first draft of NIS2 put every company under every country where it provides services. Only cloud providers, data centres, DNS providers and content delivery networks got to answer to their home country. The Commission even explained why: "to ensure that such entities do not face a multitude of different legal requirements, as they provide services across borders to a particularly high extent".

Well...that sentence describes an email provider perfectly. Email crosses borders with almost every message, and an inbox is about as cloud-based as a service gets. Still, email providers sat in the very same annex as cloud and data centres, and they weren't on that list.

A year later, the member states in the Council flipped the default, because they had "expressed concerns with the consequences of having a differentiated jurisdiction for entities in the ICT sector". Energy, banks, hospitals and transport all moved to the country of establishment. Telecom providers were left where they were, and in the final negotiations in 2022 that leftover was written into Article 26(1)(a) as an explicit exception.

I couldn't find a single document or statement explaining why. My guess is that national telecom regulators had regulated their operators country by country for decades and nobody wanted to take that away from them, but nobody wrote that reasoning down anywhere.

What I did find is someone who saw the problem coming. In March 2021, the industry association DIGITALEUROPE asked for electronic communications services to be supervised by the country of their main establishment. They pointed to "the expanded scope of interpersonal communications services under the EECC, many of which are inherently cloud-based and cross-border in nature". Yup. That also describes email.

To be fair, DIGITALEUROPE's members include Google, Microsoft and Meta, so they weren't exactly speaking for companies like Magic Pages. Still, the only lobbying I could find on this rule argued for the fix that makes sense. Nobody seems to have argued for the 25 registrations. As I wrote above: they just happened 🤷

And nobody is fixing it now, either. In January 2026, the Commission proposed targeted amendments to NIS2 to "simplify" the directive. Micro and small DNS providers would be taken out of scope. Good for them, honestly! Small email providers would not be taken out though. The rewritten Article 26 repeats the telecom exception once more. A separate proposal would create a single EU entry point for incident reports, which would help with reporting. That is a great and necessary change. But registering would still happen 25 times.

"Nobody's going to enforce this against a tiny Austrian company"

Maybe. Probably, even. But Austria's law allows fines of up to €7 million or 1.4% of turnover for important entities, and since Magic Pages is a sole proprietorship, any fine is my private liability. Even if Magic Pages was a limited liability corporation (GmbH), I'd argue that knowing about the law and ignoring it would make me personally liable as managing director.

So, I'm not going to build a service on the hope that I'm too small to be noticed in 24 other countries.

So what happens now? Honestly, I don't know yet. The server keeps running, but nobody gets an inbox for now. I've asked my chamber of commerce whether my reading of the law is correct, and I'll update this post once they get back to me.

There's an old joke that America innovates, China copies and Europe regulates. These days it often comes with a punchline about the most famous thing Europe has shipped in years being a bottle cap you can't take off. I've argued against that joke more times than I can count.

And yet, this time I don't have a good answer. I built a sovereign European inbox in a few days but cannot sell it without 25 national registrations.

As long as Europe keeps doing this to its own alternatives, I am afraid the bottle cap – as smart as it is – is what the rest of the world will remember us for.

Compare original feed summary (10 words)
<p><a href="https://lobste.rs/s/foohpo/why_i_can_t_sell_you_1_email_inbox">Comments</a></p>

Post-quantum cryptography is breaking government censors

Ever since Discord got banned here in 2024, I've had my selfhosted Amnezia VPN turned on 24/7. It works great, but every once in a while, I'll have to turn off my VPN to do something with my real IP, and I'll forget to turn it back on. And somehow, if I wait long enough, Discord will MAGICALLY come back to life on its own!

For almost two years I attributed this to race conditions in middleboxes because I could replicate a similar behavior by going to a website like roblox.com (yes roblox too), and holding down refresh until it too magically loaded before breaking again on the next refresh. I didn't look into it much past that. I figured the censor was just getting overwhelmed and letting some requests it can't process through. Turns out the real explanation is far more interesting than anything I could've imagined. If you live in Turkey and your ISP isn't Superonline, you probably think I'm crazy because you've never experienced this before. But I promise I'll make it make sense.

How countries ban websites

Internet freedom around the world looks something like this:

Free Partly free Not free

  1. 94
  2. 91
  3. 85
  4. 78
  5. 74
  6. 73
  7. 65
  8. 51
  9. 48
  10. 37
  11. 31 Turkey
  12. 28
  13. 25
  14. 22
  15. 17
  16. 13
  17. 9
  18. n/a

Freedom on the Net 2025 scores out of 100 by Freedom House.

Literally every country on Earth has some level of network interference, and it correlates heavily with real-life freedoms. Countries on the left of the graph tend to focus more on security and copyright enforcement, while more authoritarian-leaning countries take drastic measures to interfere with any kind of traffic they don't like.

The cheapest and most common method is DNS poisoning, where your ISP returns you fake results to plaintext DNS queries. This works surprisingly well because every ISP has to run a DNS server, and very few people even know what that is or bother to change whatever DHCP hands out.

1/5

For a while, Turkey was in a weird spot where it was banning popular services left and right like Youtube and even Wikipedia, but did so with primitive methods that were so easy to bypass, even non-technical people like my mom knew how to change their DNS settings to unblock every website.

8.8.8.8 spray-painted on a wall

Graffiti showing Google's public DNS workaround after the
Twitter ban in 2014 captioned "let your bird sing."

Unsurprisingly, this quickly escalated into an arms race, where Turk Telekom was caught hijacking 8.8.8.8 traffic and returning poisoned responses to Google's DNS queries as if they were being made to the ISP resolvers.

1/5

By 2018 latest, government controlled ISPs reportedly obtained PacketLogic DPI devices to step up their censorship game and crack down on DNS workarounds, which became ever more important as TLS reached near complete adoption. Superonline today is almost certainly running the same gear. Every RST it injects carries the 32120 TCP window Citizen Lab fingerprinted on PacketLogic boxes. † † The 2018 report also found a hardcoded IP ID of 13330 on injected packets. They've all been random in my tests, so there's likely been a firmware update to change that.

Deep Packet Inspection

The next level in censorship is looking at and vetting specific packets passing through your infrastructure, which is way more computationally expensive and difficult to pull off. The machines doing this have to be fast enough to not slow down customer traffic, they have to be correct without letting requests slip through, and they have to be resilient without ossifying any specific protocol. It's a very difficult task to get a perfect score on.

For some context, your device connects to websites by wrapping its requests in multiple different layers. For HTTP/2 (the most common HTTP protocol at the moment), it layers TLS on TCP on IP. Middleboxes that do deep packet inspection have to understand every protocol under the one they care about (in this case it's all of them) and be able to unwrap messages they were never meant to read. That's where the "deep" part of DPI comes from.

››

packet 1 · 637 B · payload 617 BMTU · 1500 B

Click a payload to expand its contents.

The TLS protocol has a field on the ClientHello record your client sends when initiating its connection called Server Name Indication (SNI), that tells the server which domain it's trying to connect to. Sadly this gets sent in plaintext † † ECH (Encrypted Client Hello) allows encrypting this entire process ahead of time, but it's only a meaningful improvement for infrastructure that fronts many websites like Cloudflare and Cloudfront where 1 ip != 1 domain. China and Iran already block this. as the machine you're connecting to might be hosting multiple websites and will need to know which site's certificate to respond with. Censors take advantage of this to drop or reset connections to blocked domains without having to care about DNS or encrypted traffic.

Let's take a closer look at that ClientHello record:

SNI499 bytes

  • headers
  • fixed fields
  • extensions
  • server_name
  • key_share
  • GREASE

It has a few fixed fields and a cleverly designed extension system that allows the protocol to evolve without requiring brand new proposals. Each extension has a 2 byte identifier, a 2 byte length, and arbitrary data following it. Most middleboxes only care about the SNI field and will use that length prefix to skip everything they don't recognize.

Observant readers will have noticed there's a maximum size to what the IP packet can fit. For many reasons, there is a cap to how much data you can put on a single Ethernet or Wi-Fi frame. Many layers on top of the physical / link layer have their own solution to split their payloads to not exceed that mostly universal 1500 byte cap. Even though TLS and ClientHello in specific have evolved many times over the years, it's never really come close to exceeding that cap until recently. Let's see how big that same packet gets when the client supports a post-quantum algorithm like X25519MLKEM768.

SNIML-KEM key share1,721 bytes

  • headers
  • fixed fields
  • extensions
  • server_name
  • key_share
  • GREASE

That's a more than 3x increase in size just to offer the server the possibility of a different algorithm! By the way, notice how the post-quantum key exchange bundles in two X25519 public keys, both for the hybrid exchange, and the old school key exchange. It would almost annoy me if that redundancy made any difference in size at all.

Classic key_share (X25519)47 B

Post-quantum key_share (X25519MLKEM768)1,267 B · 27× larger

I'm going to be honest, I don't have a good understanding of why this key is so big. I know that an X25519 public key represents a point on an elliptic curve, and that lattice cryptography isn't as compact with a neat input like that. But a 35x+ increase in key size is far beyond anything I would've expected.

Either way, this packet no longer fits our MTU, and has to be split in some way. For the purposes of ClientHello, this is done the exact same way any generic large payload is split, by sending the rest in a different TCP segment.

››

packet 1 · 1500 B · payload 1480 BMTU · 1500 B

packet 2 · 402 B · payload 382 B

Click a payload to expand its contents.

There's no TLS header on the second packet, because it's simply the continuation of the previous payload. You may already see where this is going. Because middleboxes are not used to seeing this message get segmented, the way they detect/handle reassembly is poorly tested if not outright broken. That's a problem people have known about for a while, but in our case, the middlebox breaking is a good thing because they tend to fail open and let traffic through when they do 😄.

How middleboxes break

After doing some probing, I came up with a hypothesis that I thought was plausible. The censor was probably letting through packets that split perfectly between two extensions without checking whether there's more on the way if it hadn't already seen the SNI, with logic that could look something like this:

if (is_client_hello(&packet)) {
  tls_ch* hello = parse_hello(&packet);
  if (is_blocked(hello))
    return block();
  else if (is_packet_valid(hello))
    return ok();
  else
    return wait_for_more();
}

Where the packet split would happen right at the end of one extension and the start of the next one.

key_sharesupported_versions⋯660d454c522b002b0007064a

⋯type0x002blength7 B

Because the censor hadn't seen an offending SNI record yet, and there was no incomplete extension indicating it had to wait for more bytes, it might blindly be letting the request through after seeing packet 1. And to my surprise this worked! But there was a problem. In my tests (pressing cmd + r until Discord comes back online) I was seeing ~5-6% success rate, not the near-100% success rate I would expect from the same client contacting the same server, since there's almost nothing variably sized in a ClientHello.

I later remembered that Chromium - which Discord uses (for now) - had pushed out a TLS extension randomization update a couple years ago to fight TLS fingerprinting by shuffling the list of extensions it sends. That would explain why I was getting a low success rate, but if that were the case, I should've been seeing a much lower success rate. The chances of the SNI field being in the second packet while the cut happens exactly between 2 extensions should be astronomically low; well below 1%.

I looked at the packet capture of a passing request, and this is where the two packets happened to be segmented:

key_sharepsk_key_exchange_modes⋯660d454c522b002d00020101

⋯type0x002dlength2 B

Not at the end of key_share like I thought it would be, but 3 bytes after it. Somehow, forcing a +2 split on the same packets also worked consistently, though not +4, +5 or onwards.

key_sharepsk_key_exchange_modes⋯660d454c522b002d00020101

⋯

⋯660d454c522b002d00020101

⋯

⋯660d454c522b002d00020101

⋯type0x002dlength2 B

These +2 and +3 byte offsets also seem to work for almost every other extension. I think what's going on here is that this specific part of the length processing codebase was never updated to account for multiple TCP packets, and fails open for what it thinks are malformed packets that end abruptly. Even though the part of the codebase for skipping the rest of the body waits for the next packet as expected.

if (pointer + 2 > end) {
  // broken packet, don't read past the end
  return ok();
}
uint16_t ext_len = read_u16(pointer);

This begs the question, what happens if we split at +1, where the parser doesn't know what it's parsing yet, and saved the first byte of the extension while it waits for the second byte?

key_sharepsk_key_exchange_modes⋯660d454c522b002d00020101

⋯type0x002dlength2 B

The request goes through! But not because it thinks the packet is broken. After reading the second byte 0x2d, the DPI forgets what it was doing!! And it goes through the extension parsing code from the top, reading 0x0002 (extension length) as an unknown extension type, and 0x0101 (extension body) as a 257 byte long extension it has to skip.

Even crazier yet, the buggy parser manages to re-synchronize for certain extensions that contain an inner length field like signature_algorithms.

key_sharesignature_algorithms⋯660d454c522b000d00120010

⋯type0x000dlength18 Blist_len16 B

It reads 0x0012 (extension length) as an unknown extension type, then 0x0010 (list_len) as the extension length. By pure chance, that extension's inner length happens to equal how much more of that extension has to be read, and lands on the start of whatever the next extension is. They probably use these kinds of extensions in their test suite.

To figure this out, I crafted a request to wattpad.com (yes even wattpad 😭) with a fake extension 0x0099 split across the middle, and a valid SNI extension immediately afterwards. This is now a completely broken ClientHello, but because the parser forgot what it was doing after receiving the second byte of the extension, it goes back to parsing the SNI successfully, and blocks the request after seeing what it thinks is a new SNI extension.

Broken!server_name⋯009900000010000e00000b776174747061642e636f6d

⋯type0x0099type0x0000length16 Blist_len14 Bname_type0x00name_len11 Bhost_namewattpad.com

Simply replacing the blocked host lets the (broken) request through, though we get a TLS alert back from the recipient since it can't decipher the nonsense we just sent it.

Broken!server_name⋯009900000010000e00000b6578616d706c652e636f6d

⋯type0x0099type0x0000length16 Blist_len14 Bname_type0x00name_len11 Bhost_nameexample.com

These offset tricks don't work for every extension though. When the censor sees SNI, supported_groups, GREASE, ECH and even the ESNI draft proposal, it does wait for the next bytes correctly, meaning there's something "special" about those extensions that just happen to parse the length correctly.

if (is_special(packet)) {
  process_packet_v2(packet);
} else {
  process_packet_v1(packet);
}

As a sidenote, it's a little bit ironic this happens with GREASE as well, since the whole point of it is to get ignored, yet it's specifically being detected here, and detected poorly. GREASE values are supposed to be repeating bytes ending with a, like 0x1a1a or 0xfafa, but it seems they've implemented their check lazily like:

if ((t & 0x0f0f) == 0x0a0a) {
  // ❌
}
// as opposed to
if ((t & 0x0f0f) == 0x0a0a && (t >> 8) == (t & 0xff)) {
  // ✅
}

because an invalid GREASE extension like 0x1a2a also triggers their GREASE special-path despite not being real GREASE.

I can't believe it's not real GREASE

Now all of this would be understandable for SNI, since that's the main thing they're looking for, and it really is "special." But why would a censorship middlebox have a different code branch for supported_groups?

It's not just about censorship

To check if those extensions are being treated differently, I took a capture of a failing 1 TCP segment request, and updated the body of supported_groups by setting the list_len field that immediately follows the extension length to an invalid length.

supported_groups⋯000a000c000a2a2a11ec001d00170018⋯

⋯000a000cffff2a2a11ec001d00170018⋯type0x000alength12 Blist_len65535 BgroupGREASEgroupX25519MLKEM768groupx25519groupsecp256r1groupsecp384r1

The request went through the censor and got a TLS alert response! Which means the censor does read the body of that extension, and through some more experimentation, I found out that it fails open for any case where the extension length isn't validated to be exactly list_len + 2, unlike every other extension where the body is completely skipped.

The same body-validation behavior exists for ALPN as well. We also see a repetition of the earlier extension length parser bug there, but now with the list_length fields, as well as splitting cleanly after one protocol. They must be calling the same length parsing function here. These are such mind-blowing revelations to me, I'm like Levent Alpöge if he dropped out of uni and was unemployed.

application_layer_protocol_negotiation⋯0010000e000c02683208687474702f312e31

⋯

⋯0010000e000c02683208687474702f312e31

⋯type0x0010length14 Blist_len12 Blen2 Bprotocolh2len8 Bprotocolhttp/1.1

At first I thought all this special-casing and body extraction was a sign of proprietary TLS fingerprinting to detect TLS based VPNs like OpenVPN or VLESS because it's specifically looking for GREASE. Not something off-the-shelf like JA3/JA4, because the boxes don't seem to care about important extensions like ec_point_formats, but a proprietary AppLogic (formerly Sandvine) algorithm. But thinking over it some more, I'm almost certain they do this to collect data on usage trends for some dashboard somewhere, and it makes sense when you think about why each one would be special:

SNI

If there was ever going to be a special case, it would make sense for it to be this one.

ALPN

This contains important information about protocol usage. Based on my research, Superonline started censoring QUIC traffic sometime this year, so they are probably keeping an eye on HTTP/2 and HTTP/3 client support with this.

Supported Groups

As funny as it might seem, I think they're looking at post-quantum crypto adoption here. It's possible AppLogic might end up fixing some of these bugs as PQC adoption continues to get closer to 100%, but I honestly doubt it.

ECH

This is the main danger to their censorship efforts that they probably want to be on the lookout for. It probably doesn't help that Chrome sends fake ECH extensions even when the server can't support it.

Legacy ESNI

This is what makes me sure this whole thing is not about fingerprinting. These guys have been monitoring workarounds for a long time, and still treat the earlier draft codepoints that saw real-world deployment (0xffce from ESNI and 0xfe0a from early ECH) differently from everything else.

It's also possible Superonline doesn't care about or see any of this information at all, and it's just that the generic extraction function that runs for every customer touches those fields before being discarded. We simply have no way to know, it's not like we're recompiling the GTA VI binary here.

Winning the lottery

Putting it all together, my connection to Cloudflare for Discord has a maximum TCP segment size of 1,388 bytes because CF asks for a max size of 1400 bytes - 12 bytes of TCP options. The ClientHello header plus the leading GREASE extension BoringSSL always prepends take up 118 bytes, and key_share alone is 1,267 bytes, coming in at 1,385 bytes total. Since even an empty extension is 4 bytes, if any other extension gets shuffled in front of key_share, the 1,388-byte cut lands inside key_share's body and the censor blocks it.

The only way through is if BoringSSL shuffles key_share into the very first slot, leaving exactly 3 bytes before the TCP segment splits and landing the cut at +3 into whatever extension comes next. That triggers the length bug for 11 of the remaining 14 extensions (everything except SNI, supported_groups, and ECH):

1 15

key_share first

11 14

buggy extension next

11 210

exact odds

5.24% bypass rate

That 5.24% chance matches the behavior I was seeing exactly! I use Discord as my example here, because connecting to the gateway is the one thing that stops you from chatting after you get disconnected.

Annoyingly though, updates.discord.gg uses a different TLS stack that doesn't include PQC algorithms at all, so if you fully restart Discord and get stuck on the update gate, you can never win that 5% lottery on my ISP. @advaith pls fix with Discord Phoenix, literally unusable.

Other ISPs

Earlier, I mentioned that other ISPs don't have this problem. I tested the same thing on Vodafone's network and yes, they don't seem to have these specific problems, but they still have problems of their own.

Edge case Superonline Vodafone
IP fragmentation ✅ Reassembles perfectly ✅ Reassembles perfectly
TCP segmentation ❌ Held together with duct tape and prayers ✅ Reassembles perfectly
Small packet handling ✅ No confusion ❌ Lets any TCP segment <10 bytes through
TLS record splitting ❌ Split records ignored completely ❌ Split records ignored completely
QUIC censorship ✅ Inspects Initial packets ❌ Ignores QUIC

Both ISPs have no idea a ClientHello packet can be split into multiple records in a single TCP segment. But if you do use a different ISP like Vodafone, you've likely never run into this bug, because not all of them have problems reassembling larger TCP packets the way Superonline does.

Every time the web evolves to become more secure or private, it pokes holes in brittle middleboxes and makes authoritarians play another round of whac-a-mole using hard-earned taxpayer money. What's the point of even having internet access if we end up turning into China and Iran to block everything?

Once I have a little bit more time, I want to use my findings - along with this research paper Fingerprinting Deep Packet Inspection Devices by Their Ambiguities - to build a tool that can turn these behaviors into a fingerprint we can use to match software deployed in different countries across every possible dimension.

Compare original feed summary (6 words)
<p><a href="https://lobste.rs/s/jjotej/post_quantum_cryptography_is_breaking">Comments</a></p>

A Better UTF-8 Automaton

2026-11-29

Without wasting your time, here it is:

UTF-8 DFA

Any edge not shown goes to an error state. If you can start in ACC, follow the edges for each byte in your input and end up back in ACC, your string is valid UTF-8.

Some C code implementing the above DFA is as follows. It highlights some of the neat features that our new automaton supports, namely quick branchless transitions as a shift-DFA, trivial parallel evaluation, and instant error recovery.

#include <stddef.h>
#include <stdint.h>

enum { DFA_ACCEPT = 2, DFA_SYNC = 16 };

static const uint32_t DFA[256] = {
    [0x00 ... 0x7f] = 0xcae2bb8a, [0x80 ... 0x8f] = 0xaef05f22,
    [0x90 ... 0x9f] = 0xbff05f22, [0xa0 ... 0xbf] = 0xbf905f22,
    [0xc0 ... 0xc1] = 0xc6318cbb, [0xc2 ... 0xdf] = 0xcb8dc637,
    [0xe0]          = 0xc6565dd9, [0xe1 ... 0xec] = 0xc8c7771d,
    [0xed]          = 0xc63318cc, [0xee ... 0xef] = 0xc8c7771d,
    [0xf0]          = 0xcbbaeeeb, [0xf1 ... 0xf3] = 0xc8c97725,
    [0xf4]          = 0xc6546551, [0xf5 ... 0xff] = 0xc6318cbb,
};

uint32_t step(uint32_t s, uint8_t b) { return DFA[b] >> (s & 31); }
int is_error(uint32_t s) { return !((0x4459a285 >> (s & 31)) & 1); }
int partial(uint32_t s) { return (0x92283845 >> ((s + 12) & 31)) & 3; }

size_t utf8_valid_up_to(const uint8_t *buf, size_t len) {
    uint32_t s = DFA_ACCEPT, t;
    size_t i = 0;
    for (; i + 32 <= len; i += 32) {
        uint32_t s1 = s, s2 = DFA_SYNC;
        for (int j = 0; j < 18; j++) {
            s1 = step(s1, buf[i + j]);
            s2 = step(s2, buf[i + j + 14]);
        }
        if (is_error(s1) | is_error(s2)) break;
        s = s2;
    }
    for (; i < len && !is_error(t = step(s, buf[i])); i++) s = t;
    return i - partial(s);
}

Note that a proper UTF-8 validation routine should at the very least have hot paths for ASCII, this is just an example. And while the above definitely doesn’t beat simdutf, it runs only ~2.5x slower on my Apple M5 laptop when validating Chinese, which isn’t bad for ~30 lines of scalar code. Compared to Björn Höhrmann’s minimal C UTF-8 validator, the above runs 9 times faster in the same benchmark.

State machine

Our state machine isn’t minimal, but that’s on purpose. It has three nice properties:

  1. Like Per Vognsen’s shift-DFA, this state machine can be encoded so each transition is a byte lookup into an array of magic constants followed by a bit shift. Their original implementation packed the constants as uint64_ts, this one fits them in uint32_ts through the use of a SAT solver and overlapping the constants, reducing the lookup table from 2 → 1 KiB.

  2. Because we do not merge states which have consumed a different number of bytes of a partial codepoint, error recovery is trivial. In case of an error we can directly read off from the state machine how many bytes we consumed, go back that much, and insert a replacement character if desired.

  3. An extra SYNC state is added to the state machine, which absorbs continuation bytes. This makes it super easy to do parallel validation, allowing the shift-DFA to run almost twice as fast as previous shift-DFA UTF-8 validators due to instruction-level parallelism.

    The trick is to overlap the end of one chunk of bytes with the start of the next chunk by 4 bytes (since no valid codepoint can be > 4 bytes). The first parallel run will validate the overlap, and the second can synchronize on it. If there was an error in these four bytes the second DFA’s state will be nonsense, but the first will catch the error safely.

Shift-DFA

I would highly recommend reading Per Vognsen’s original shift-DFA exposition, but in short, if you have a finite automaton with a limited number of states and symbols, you can store a transition table.

It seems natural to store per state what transition to take for each symbol: $$(\mathrm{State} \times \mathrm{Symbol}) \to \mathrm{State},$$ but if you have a very small number of states it is actually more efficient to store for each symbol how each state transitions: $$\mathrm{Symbol} \to (\mathrm{State} \to \mathrm{State}).$$ This is for two reasons:

  1. The memory lookups can all be done in parallel, off the critical dependency chain, as each lookup only depends on its symbol, not the previous state.

  2. All the information needed for a $\mathrm{State} \to \mathrm{State}$ function can be stored in one register (naive encoding is $n \cdot \lceil \log_2 n \rceil$ bits for $n$ states).

    If you choose your state indices cleverly, doing a state transition can even be a single operation after the lookup, e.g. for at most 32 states:

    state = table[symbol] >> (state % 32)
    

    On most hardware shift counts automatically wrap around, making the mod free, as long as it’s 32 or 64.

I’m not clever enough, so a SAT solver was used to pack the shift-DFA transition table into uint32_t magic constants. It is somewhat surprising this fit at all, since we have thirteen states, meaning we need 4 bits to encode a transition target, and ${13 \times 4 = 52}$ bits to store it naively. Worse still, since we want to target uint32_t magic constants, our natural modulo is 32, meaning five bits define a state. Luckily we can overlap the bits of neighboring states, if the start of one matches the end of another.

To make it fit I still had to be a bit creative: there isn’t a single error state. Instead, we have 32 possible states, of which 12 are valid and 20 are invalid. The only requirement on the invalid states is that they remain invalid on every transition. Luckily checking if a state is valid can still be done with just one shift into a bit vector.

What follows is the Z3 code to find our magic DFA constants, it runs in ~15 minutes on my machine.

from z3 import *

STATES = 'ACC SYNC 1/2 1/3 2/3 1/4 2/4 3/4 E0 ED F0 F4'.split()
CONT = {'SYNC': 'SYNC', '1/2': 'ACC', '1/3': '2/3', '2/3': 'ACC',
        '1/4': '2/4', '2/4': '3/4', '3/4': 'ACC'}
CLASSES = {
    '00-7f': {'ACC': 'ACC', 'SYNC': 'ACC'},
    '80-8f': {**CONT, 'ED': '2/3', 'F4': '2/4'},
    '90-9f': {**CONT, 'ED': '2/3', 'F0': '2/4'},
    'a0-bf': {**CONT, 'E0': '2/3', 'F0': '2/4'},
    'c0-c1 f5-ff': {},
    'c2-df': {'ACC': '1/2', 'SYNC': '1/2'},
    'e0': {'ACC': 'E0', 'SYNC': 'E0'},
    'e1-ec ee-ef': {'ACC': '1/3', 'SYNC': '1/3'},
    'ed': {'ACC': 'ED', 'SYNC': 'ED'},
    'f0': {'ACC': 'F0', 'SYNC': 'F0'},
    'f1-f3': {'ACC': '1/4', 'SYNC': '1/4'},
    'f4': {'ACC': 'F4', 'SYNC': 'F4'},
}

# The offset of valid state s, and the word of class c.
off = {s: BitVec(s, 32) for s in STATES}
word = {c: BitVec(c, 32) for c in CLASSES}
valid = lambda x: Or([x == o for o in off.values()])

# Each state has a unique offset below 32.
solver = Solver()
solver.add(*[ULT(o, 32) for o in off.values()])
solver.add(Distinct(*off.values()))

for c, trans in CLASSES.items():
    step = lambda o: LShR(word[c], o) & 31

    # State s should go to its target state or error.
    for s in STATES:
        if s in trans:
            solver.add(step(off[s]) == off[trans[s]])
        else:
            solver.add(Not(valid(step(off[s]))))

    # Error states only transition to error states.
    for e in range(32):
        e = BitVecVal(e, 32)
        solver.add(Or(valid(e), Not(valid(step(e)))))

solver.check()
model = solver.model()
for s in STATES:
    print(s, model[off[s]])
for c in CLASSES:
    print(c, f'{model[word[c]].as_long():08x}')

Acknowledgements

I’d like to thank Thom Chiovoloni for their discussions and their earlier work on packing the lookup tables using Z3, and Max Hollmann for bringing shift-DFA UTF-8 validation to my attention at RustWeek 2026 and exchanging further thoughts.

Compare original feed summary (5 words)
<p><a href="https://lobste.rs/s/mcodii/better_utf_8_automaton">Comments</a></p>

“This message has been on the screen for almost two hours now.”

IBM’s mainframe computers in the 1970s sported particularly distinctive red power buttons:

These were rooted in computers still occasionally being close to industrial machinery – high vacuum, high voltages, memory tanks filled to the brim with mercury, punch cards flying through the system with astonishing speeds – but at some point, as we domesticated the machines and put them on our office and home desks, those power toggles became more of a branding element than anything else:

A physical power switch has a problem, however – it cuts off the power immediately and indiscriminately, without giving the system time to cleanly shut everything down, write everything to disk, park its drive heads, and so on.

So, computers slowly migrated to “power-by-wire,” if you will. Just like pressing the keys on the keyboard was no longer physically moving the typebars and only sending signals to the CPU, the power button was now also sending just a simple signal, allowing the computer to get ready for the night. It was only after all the necessary clean up that the computer would talk to the power supply and shut itself down to a minimal power state, where the only energy it would be spending was checking for the power button to be pressed again for next morning’s wake up.

![](https://unsung.aresluna.org/this-message-has-been-on-the-screen-for-almost-two-hours-now/_media/this-message-has-been-on-the-screen-for-almost-two-hours-now/7.1088w.avif)

Shutting down was now just as much software as it was previously hardware, and we know software has problems. So there had to be a failsafe, and the failsafe was designed this way: if you held the power button for 4 seconds, the machine would just shut down at that point. This was still software, but software directly on your motherboard, which was a lot more resilient: it could not fail and ignore your power button the same way Windows could when it was preoccupied dealing with some blue screen or another problem.

I believe that delay grew over time to be about 10 seconds. But more recently, a new state appeared:

![](https://unsung.aresluna.org/this-message-has-been-on-the-screen-for-almost-two-hours-now/_media/this-message-has-been-on-the-screen-for-almost-two-hours-now/8.1088w.avif)

In case you cannot read it, it says “Please release the power button. We just need a few more seconds to shut down.”

This is how I understand it: Windows now gets a signal whenever the user holds the power button. It knows that after 10 or however many seconds, the power will be cut off, no negotiation. So if it knows it won’t finish its jobs by ten seconds, it pleads with the user to stop pressing the button.

I have seen different explanations for it – some people say it’s only on some machines, or only for developers, to save enough debugging information and perform a clean shutdown.

I’m not sure, because I have also seen a new failure mode:

My Microsoft Laptop is displaying an error that says, “Please release the power button. We need a few more seconds to shut down. 0% complete.” I was attempting a hard reboot because the keyboard wasn’t functioning. That typically resolves the issue, but I couldn’t get it to shut down. I must have held the power button down and then received that message. This message has been on the screen for almost two hours now. How can I resolve this?

The answer is: do not listen to your computer, and keep holding.

I am not sure if I have a point here. I just thought it was a fascinating example of a growing complexity of what once was a simple thing.

I also found the machine saying “please release the power button” to be a wild user interface string. You can find all sorts of photos online of this state – they cannot be screenshots at this point – and they have this positively haunting, almost horror-like quality:

![](https://unsung.aresluna.org/this-message-has-been-on-the-screen-for-almost-two-hours-now/_media/this-message-has-been-on-the-screen-for-almost-two-hours-now/9.1088w.avif)

![](https://unsung.aresluna.org/this-message-has-been-on-the-screen-for-almost-two-hours-now/_media/this-message-has-been-on-the-screen-for-almost-two-hours-now/10.1088w.avif)

![](https://unsung.aresluna.org/this-message-has-been-on-the-screen-for-almost-two-hours-now/_media/this-message-has-been-on-the-screen-for-almost-two-hours-now/11.1088w.avif)

Maybe a potential lesson in here: If at some point you have to add a “please release the power button” function, perhaps it is time to step back and re-think the whole idea.

Personally? I prefer my machines to go the other way.

![](https://unsung.aresluna.org/this-message-has-been-on-the-screen-for-almost-two-hours-now/_media/this-message-has-been-on-the-screen-for-almost-two-hours-now/13.1088w.avif)
Compare original feed summary (9 words)
<p><a href="https://lobste.rs/s/thxyni/this_message_has_been_on_screen_for_almost">Comments</a></p>

My website is now its own social media account

Five years ago I wrote about making this website come to life by connecting it to social media. The idea was, and still is, that my writing lives here, and the conversation about it should show up here too. For most of those five years, the connections ran through other people’s services: webmention.io collected the comments, Bridgy and later Bridgy Fed carried my posts out to Twitter, the fediverse and Bluesky, and carried the replies and likes back.

Last week I cut those out. This site is now its own fediverse account, its own Bluesky account, and it receives its own webmentions. Nothing sits between you and it except the protocols.

Why#

I wanted the experience to be self-contained. When somebody replied to a post, the reply went to Bridgy Fed, which turned it into a webmention, which went to webmention.io, which my build picked up on its next run. Every one of those hops was a place where things could go quiet without anybody noticing.

And I wanted to push the boundary of what I can do with self-hosted web publishing and social media on one small server. The site had already grown webmention push notifications and a little mobile posting pipeline. The obvious next question was: how much of the social part can live here too? It turns out, pretty much all of it.

Let me be clear about Bridgy Fed, though: it is a gift to the open web. It did exactly what it promised for a year and a half, and its migration tools are the reason this move was possible at all. If you want your website on the fediverse this afternoon, Bridgy Fed is still the answer.

The new setup#

There is one static website, plus three small services.

The new setup: a regular build turns the Git repository into the static site and hands posts, profile and follow list to the activitypub service. That service talks to the fediverse and, through its own Bluesky PDS, to Bluesky, and passes replies, likes, reposts and quotes to the webmentions service, which also receives webmentions from other websites. The build reads all interactions back from the webmentions service.

A webmention receiver. A small Rust service now accepts webmentions for stephanhagemann.com, verifies that the source really links to the target, stores the source, and keeps a copy of the author’s photo so comments don’t depend on somebody else’s avatar server. The same service was already sending the push notifications for new comments, so it is now the one place where every interaction lands.

A fediverse account. A Fedify service makes this site a fediverse actor. The handle is now the short one: @stephan@stephanhagemann.com. My favorite part is that a post’s URL is the post. Ask for /posts/<slug> with a browser and you get the page. Ask for it with an ActivityPub Accept header and you get the object that Mastodon sees. There is no second copy somewhere under a bridge’s domain. Replies, likes, boosts and quotes arrive in the service’s inbox and go straight into the webmention store, next to the webmentions proper.

A Bluesky account on its own PDS. The Personal Data Server is Bluesky’s own, unchanged, running as one more container. The account kept its identity (the DID), so the handle, the posts and the followers all came along. An adapter publishes new posts to the PDS and polls its notifications for replies, likes, reposts and mentions, which end up in the same store as everything else.

Then there is the thing that didn’t change: the site itself. Posts are still Markdown files in a git repository, and the site is still static, rebuilt regularly. The services read the build’s output and deliver it; they don’t own anything. A reply from Mastodon shows up on the post page at the next build, like it did before. Slowcial, as I called it when I tested the posting pipeline last year, is still the right speed for me and this website.

What moved and what got lost#

The fediverse migration is an ActivityPub Move: the old account tells its followers’ servers “I am now over there,” and the servers follow the new account on your behalf. Some of them did. If you followed this site before and the follow didn’t make it, please search for @stephan@stephanhagemann.com and follow again. I’d love to see you back!

What the Move does not carry is the other direction. The accounts I followed through Bridgy Fed stayed behind, and the Bridgy Fed account is gone now. I rebuilt the list by hand, and in the process gave it a home that cannot get lost again: the people this site follows are a YAML file in the repository. The service follows exactly that list, on whichever network a handle belongs to, and collects what those accounts post into a timeline on a private page. Following somebody now means a git commit. I get more joy out of that than I probably should.

What this is not#

This is not a Mastodon client. I do not act as the account from a phone app. The private timeline is rudimentary, and there is no reply button (yet). When I want to answer somebody, I write a reply post here, and the services deliver it to the thread it answers, on the fediverse or on Bluesky. The site is the account, and everything the account does is something the site published.

#this site #fediverse #bluesky #webmentions

Compare original feed summary (9 words)
<p><a href="https://lobste.rs/s/qktfqs/my_website_is_now_its_own_social_media">Comments</a></p>

You can use Touch ID for sudo

I got tired of typing my password every time I ran my agents ran sudo, so I switched it to Touch ID. Now a small prompt shows up. You can set this up in about a minute.

The Touch ID prompt for sudo, showing who asked and the command

Turning it on

sudo asks PAM (the pluggable authentication modules macOS inherited from Unix) whether you are who you say you are. Apple ships a PAM module called pam_tid.so that asks the fingerprint sensor instead. Since macOS Sonoma there's a config file for local changes that survives system updates, and Apple even provides a template for it with the right line commented out:

sudo cp /etc/pam.d/sudo_local.template /etc/pam.d/sudo_local
sudo nano /etc/pam.d/sudo_local

Remove the # in front of this line and save:

auth       sufficient     pam_tid.so

sufficient means a matching fingerprint is enough by itself. If you cancel the prompt, sudo falls back to asking for your password like before, so you can't lock yourself out with this. Open a new terminal and run sudo -v to try it.

My version

The stock module has one catch. macOS stops offering Touch ID in these prompts while anything is capturing the screen, and my DisplayLink dock captures the screen all the time. Screen sharing and screen recording trigger it too.

So I my agent wrote a small PAM module that asks for the fingerprint through Apple's LocalAuthentication API directly, which keeps working while the screen is captured. Since it draws its own prompt, it can also say who is asking and show the full command.

The source code, install steps and notes on how I tracked down the screen capture problem are in the macos-touchid-sudo skill in my skills repository.

I wrote the module about two months ago and have used it every day since without any issues. I put it in the skills repository so I could set it up on my other two MacBooks, and it works just as well on those.

My desk with three MacBooks, all of them using Touch ID for sudo

Addendum

ryan-duve pointed out that you can combine this with a sudoers rule that lets your agents run specific commands without any prompt. Run sudo visudo and add a line like this at the bottom:

# Replace last term with your target command.
agent_user  ALL = (ALL) NOPASSWD: /usr/bin/gdb

Commands you approved in advance then run silently, and Touch ID only shows up for everything else, which cuts down on prompt fatigue. Be careful which commands you allow this way. A tool like gdb can start a shell or attach to any process, so allowing it without a password is effectively the same as giving out root.

a1b3c3d7 mentioned that they have been doing this for a few months, and that you need a fingerprint reader that isn't slow, because it's miserable with some readers. I didn't know that fingerprint readers for sudo were a thing outside of macOS, and it's good to know that not all of them are fast enough to make this pleasant.

BaziBuilds pointed out that inside tmux, the Touch ID prompt won't show up unless you also install pam-reattach. They also stressed using /etc/pam.d/sudo_local instead of editing /etc/pam.d/sudo directly, since macOS updates wipe changes to the main file, which is the approach described above.


Discuss on r/ClaudeCode

Discuss on r/MacOS

Discuss on Lobsters

Subscribe to get new posts.

Compare original feed summary (8 words)
<p><a href="https://lobste.rs/s/xsci5l/you_can_use_touch_id_for_sudo">Comments</a></p>

Would you reconsider your Tufte CSS sidenotes?

TL;DR: Using “clever CSS tricks” for Tufte CSS, or sidenotes, is probably a bad idea, as inlining sidenotes as the official Tufte CSS does can cause trouble for browser reader modes or mobile devices.

This is an expansion of my rant in a comment on Lobsters about Tufte CSS. I think it might be helpful to have something you can link to, with screenshots/demonstrations of how things might fail. So here we go.

However, before we start, please note that this page is not designed for viewing on narrow screens like phones. So if you are reading on a mobile device, I would recommend scrolling through the post for a feeling of sidenotes, and then turning on Reading Mode (if your browser has one).1

1

I tested the page on Firefox and (Ungoogled) Chromium. If your browser supports Reading Mode but you can’t open this page with it, please let me know!

6

These two are footnote examples, by the way.

1. Tufte CSS Sidenotes/Margin Notes¶

Sidenotes are nice, and Tufte CSS beautifully demonstrates a way to incorporate sidenotes into the Web to be compatible with both wider views and narrower screens, with a little bit of CSS magic. 2

2

Like this! This is a sidenote.

Tufte CSS builds its sidenotes and margin notes upon inlined HTML elements plus a rather well-known CSS checkbox trick:

  1. You write your sidenote inline, like this:

    As it is one of the few styles that default to using serif fonts ( they use the ET Book font, a font designed by Dmitry Krasny, Bonnie Scranton, and Edward Tufte ), I love Tufte CSS nevertheless.

  2. Then, you wrap your note up with a span element with a label as the sidenote reference:

    As it is one of the few styles that default to using serif fonts <label>...</label><span class="sidenote"> ( they use the ET Book font, a font designed by Dmitry Krasny, Bonnie Scranton, and Edward Tufte )</span> , I love Tufte CSS nevertheless.

  3. With tufte.css, the note should now be extracted from its context by browsers’ layout engines, and displayed on the side, just like any sidenote does:

    As it is one of the few styles that default to using serif fonts ( they use the ET Book font, a font designed by Dmitry Krasny, Bonnie Scranton, and Edward Tufte ), I love Tufte CSS nevertheless.

    Sidenotes are automatically numbered using CSS counters in Tufte CSS. (This page doesn’t do that, though.)

  4. Since sidenotes take a significant portion of horizontal space, they don’t really fit on mobile screens or narrow browser windows:

    You probably don’t want your text to get clamped to the left half of the already narrow screen:

    As it is one of the few styles that default to using serif fonts ( sidenote ), I love Tufte CSS nevertheless.

    Or, if you are reading on a rather narrow screen right now, you probably don’t want your text to look like this page. :p

    Tufte CSS makes use of the checkbox CSS hack to make sidenotes collapsible on narrower screens:

    As it is one of the few styles that default to using serif fonts ( they use the ET Book font, a font designed by Dmitry Krasny, Bonnie Scranton, and Edward Tufte ), I love Tufte CSS nevertheless.

    (For the sake of demonstration, I didn’t style the checkbox. You may try toggling the checkbox to see how it controls the display of the “sidenote”.)

This sounds really good: mobile-friendly, JavaScript-less sidenotes! Also, arguably, sidenotes are actually better suited on the web than footnotes, as web pages are quite different from book pages, and the footnotes, if placed in the “footer” of a web page, can be a pain to navigate to.3 I’ve seen quite a few blog sites heavily using Tufte-CSS-like sidenotes and they all work pretty well… until they don’t.

3

Unless they provide links and backlinks to jump back and forth between footnotes and their references.

2. Inline Sidenotes Break Semantics¶

The main problem is that HTML does not really expect a less important, collapsible, floating, potentially display: block element to reside in a paragraph. And text selection, reader modes, screen readers, etc. all build on the same premise.

2.1. Non-intuitive text selection¶

Text selection can be non-intuitive with inline sidenotes:

As it is one of the few styles that default to using serif fonts They use the ET Book font, a font designed by Dmitry Krasny, Bonnie Scranton, and Edward Tufte. , I love Tufte CSS nevertheless.

The above showcases what text you will actually select if you drag your mouse from “serif fonts” to “Tufte CSS”. I’m not sure what most people would expect when they try to select (and maybe copy) from “serif fonts” to “Tufte CSS”, but I certainly don’t want the sidenote to be included, as the selected/copied text will be:

serif fonts They use the ET Book font, a font designed by Dmitry Krasny, Bonnie Scranton, and Edward Tufte. , I love Tufte CSS

It can certainly get more chaotic if you put more sentences or block elements into your sidenotes; or it may be less so, depending on whether you spend the time to tailor the sidenote clauses to their context.

2.2. Puzzling text flow¶

Reader modes4 (and M-x eww, if I may, or any other text-mode browsers) and screen readers follow more or less the same DOM-based logic. They ignore those fancy CSS stylings and lay out text as it appears in the DOM, just like our previous text selection example. This means what looks like a pretty sidenote might turn out to be disastrous:

In print, Tufte has used the proprietary Monotype BemboSee Tufte’s comment in the Tufte book fonts thread. font.

The above text copies and pastes (and also displays in Firefox Reader View) like this:5

In print, Tufte has used the proprietary Monotype BemboSee Tufte’s comment in the Tufte book fonts thread. font.

5

Yup, currently there is no space between “Bembo” and “See”.

And EWW displays it like:

In print, Tufte has used the proprietary Monotype Bembo[ ] See Tufte’s comment in the Tufte book fonts thread. font.

And TalkBack reads it (when opened in Firefox for Android) as follows:

In print, Tufte has used the proprietary Monotype Bembo _ one _ one _ space _ See Tufte’s comment in the _ Tufte book fonts _ link _ thread. _ font.

I’m not sure about TalkBack and other screen readers: to me, a sighted, English-as-a-second-language reader, inline sidenotes actually sound more “contextual” than sidenotes extracted into separate paragraphs. But as an Emacs user, I definitely wish these sidenotes worked better in text-mode browsers.

3. Buttons Are … Tempting¶

Call me addicted or whatever. ⊕ Sorry for the troll. Please read on. 🥲 But I find buttons … really tempting. Part of it might come from a bit of a fear of missing out, as this comment on Lobsters argues (emphasis mine):

Footnotes are always a mandatory disruption to the flow of reading, because readers can’t tell up front whether a footnote is worth the effort or not. Like when reading on paper, a footnote should always be in view and never require interaction, so it can be read with just a glance. …

So, when I think clicking on a button might reveal more content, I click on it.

…

…

…

Now, please tell me, did you notice that “⊕” checkbox label? If so, did you click on it at first sight? Well, at least for me, I would: I can’t tell whether a footnote is worth the effort or not, so I just un-collapse it to see what it is. Sometimes, I unfortunately catch a glimpse of the very suspicious-looking symbol even before I start reading the paragraph, and have to hold back my thirst for click-click-clicks.

Also, the “⊕” symbol might be quite confusing. I mean, I wouldn’t expect an XOR or direct sum symbol there, but I also wouldn’t think of it as a hint for collapsed content: for me, it’s typically used for collapsible lists, generally located over the left margin and definitely never inlined.

And… sometimes it’s even worse, as nice people may considerately make the symbol even larger so that it can be more mobile-friendly. ⋅⋅⋅ I actually planned to make this button do nothing. But that would be too much of a troll. 🥲 And, oh dear, how can I ever resist clicking on this juicy, squishy button?

And this is when I usually reach for Reader Mode, which, as discussed above, doesn’t really work with inline sidenotes.

Anyway, this clicking, whether tempting or not, is quite against the philosophy of Tufte CSS in my opinion:

  • Tufte CSS styles links with only underlines and no special colors, because:

    Blue text, while also a widely recognizable clickable-text indicator, is crass and distracting.

  • It favors sidenotes over footnotes, because:

    Sidenotes are like footnotes, except they don’t force the reader to jump their eye to the bottom of the page, but instead display off to the side in the margin.

Collapsed sidenotes, likewise, don’t force the reader to move their eyes. Instead, now they require the reader to move their fingers. And with certain styling, they can be as distracting as blue links.

Tufte CSS also explains the collapsible design:

The goal is to present related but not necessary information such as asides or citations as close as possible to the text that references them. At the same time, this secondary information should stay out of the way of the eye, not interfering with the progression of ideas in the main text.

But when sidenotes are collapsed, they are nowhere to be seen and can’t be “as close as possible”; when they are expanded, they do interrupt the text flow.

4. My Sidenotes¶

Astute readers might have noticed that there are two (or three?) kinds of notes on this page:

  • Fake sidenotes, for demonstration purposes only.

    I didn’t bother implementing CSS counters for these notes, so they are always numbered “1”. Like this, I guess? Also, they don’t have backlinks.

  • Footnote-based notes:

    • Footnotes around “6”: instead of placing them at the bottom of the page, I manually placed them where I saw fit (like at the end of a section).
    • Footnotes, displayed as sidenotes.7

7

Like this! These footnotes are properly numbered and have backlinks.

The fake ones are indeed written in raw HTML, but the footnotes are directly generated from my Org-mode file, with a few workarounds to split up the footnote section. If you can convince your markup compiler to let you place the footnotes as you wish, then the following should generate the same footnotes-as-sidenotes for you:

  1. Write your sidenotes as footnotes, and place them right below the paragraph that references them:

    I'm sure this is also a CSS hack. [^1] [^1]: Feel free to roast me. :) Another paragraph.

  2. Now that the DOM is semantically correct, we can use all kinds of CSS hacks to make the footnotes appear on the side.8 And then make sure the footnotes remain as non-float blocks of footnotes on mobile with media queries.

  3. Enjoy!

However, as you might notice, other blog posts on this blog don’t actually use any sidenotes: there are only footnote blocks, whether you are on a mobile device or not.9 One of the reasons is that I don’t think I can make those sidenotes actually align with their references with CSS.10 But another reason is that I now think of “footnote blocks” as a way of manual “pagination” (or as lubricant, as a way to cheat when I’m too lazy to make two paragraphs logically coherent). I insert them where I see fit to insert a slight disruption, and just make sure they also look good and read smoothly in their textual, markup form, as plain-text files should.

9

I implemented this instead on another, more academically focused blog.

10

Also, unfortunately this blog has a sidebar (intentionally hidden on this page), which leaves very little space for sidenotes.

Comments

This one-pixel image serves as a page view tracker and nothing more. This feedback keeps me motivated, because very few people ever comment.

Compare original feed summary (7 words)
<p><a href="https://lobste.rs/s/i4igjb/would_you_reconsider_your_tufte_css">Comments</a></p>

What are you doing this week?

Work: Looking at job postings still. It doesn't look like my workplace is going to be bringing back regular hybrid work at any point in the near future.

Personal: I migrated my desktop and laptop to ZFS at the weekend, both seem to be working smoothly. On the laptop, I run alpine edge and got tired of KDE Plasma breaking every couple of months. With ZFS, I now have snapshots before and after every apk commit, so I can trivially roll back. On the desktop, I run Gentoo with systemd. I plan to set up restic on the desktop to back up my home directory to a hetzner storagebox at some point this week, I already have it working on the laptop.

Compare original feed summary (21 words)
<p>What are you doing this week? Feel free to share!</p> <p>Keep in mind it’s OK to do nothing at all, too.</p>

Let me Give You Worms ·

<p>More/meta here (how it was made, what it was made for): <a href="https://untested.sonnet.io/notes/let-me-give-you-worms/" rel="ugc">https://untested.sonnet.io/notes/let-me-give-you-worms/</a></p> <p><a href="https://lobste.rs/s/1omqhv/let_me_give_you_worms">Comments</a></p>

Gram 3.6.1 released

<p><a href="https://lobste.rs/s/6eokxr/gram_3_6_1_released">Comments</a></p>

I wrote a (free) book on Quantum Computing for Software Engineers

<p>Some time ago I received a grant from Unitary Foundation, a non-profit organization supporting open source and other initiatives in quantum computing. As a result, I've written and published a free (or pay-what-you-want) book "Quantum Computing for Software Engineers".</p> <p>I'm not a physicist; my background is software engineering, but I've been working in the quantum computing industry for the last 4.5 years, developing the vertical stack of superconducting quantum computers and quantum-classical hybrid infrastructure.</p> <p>I believe the quantum computing industry needs more professional software engineers, and this book is an attempt to demystify the field. It's being used by some companies/teams as part of onboarding new software engineers.</p> <p>Hope you like it.</p> <p>(related: last year I <a href="https://lobste.rs/s/uteeck/full_stack_quantum_computing_from" rel="ugc">posted my Pycon talk</a> about the topic)</p> <hr> <p>Here are the topics covered in the book:</p> <p>Part 1. Groundwork</p> <ul> <li>Chapter 1. Gaming die analogy</li> <li>Chapter 2. Quantum physics 101</li> <li>Chapter 3. Qubits and quantum gates</li> <li>Chapter 4. Crafting a qubit with superconductivity</li> <li>Chapter 5. Other modalities</li> </ul> <p>Part II. Levels of Abstraction of a Superconducting Quantum Computer</p> <ul> <li>Chapter 6. Quantum Circuits</li> <li>Chapter 7. Transpilation, routing, and optimization</li> <li>Chapter 8. Mid-circuit measurement</li> <li>Chapter 9. Compilation to pulse representation</li> <li>Chapter 10. Pulse-level control</li> <li>Chapter 11. Calibration</li> </ul> <p>Part III. Industry landscape</p> <ul> <li>Chapter 12. Software ecosystems</li> <li>Chapter 13. Hybrid computation</li> <li>Chapter 14. What’s next</li> </ul> <p><a href="https://lobste.rs/s/abzfxx/i_wrote_free_book_on_quantum_computing_for">Comments</a></p>