Markup Typography on WebAssembly

Abstract

Modern document preparation systems demand both instant feedback and high typographical precision. While traditional systems like LaTeX provide rich typesetting capabilities, their compilation latency and complex dependencies hinder cloud-native interactive workflows. Typst introduced a modern syntax and incremental layout model.

In this work, we present moon-typst, a typographical compiler implemented in MoonBit. Its parser, box layout, and vector renderers can be measured separately with the checked-in benchmark.

Mathematical Foundation

The vertical spacing distribution model follows standard typographical baseline kinetics:

E = mc ^ 2

Furthermore, inline formulations such as fx = √x ^ 2 + 1 and fraction derivations:

fraca + b , c + d

maintain harmonic font metrics and balanced baseline alignments across heterogeneous output devices.

Architecture Overview

The system pipeline consists of three decoupled phases:

Empirical Results

Run moon bench benchmarks --target wasm-gc --release --deny-warn and record the host, MoonBit version, and raw results before making WebAssembly performance comparisons.