2026-04-03ยท9 min readยทsota.io team

Deploy LML to Europe โ€” Lennart Augustsson ๐Ÿ‡ธ๐Ÿ‡ช + Thomas Johnsson ๐Ÿ‡ธ๐Ÿ‡ช (Chalmers University 1987), the First Compiled Lazy Functional Language That Built GHC, on EU Infrastructure in 2026

In 1987, two Swedish researchers at Chalmers University of Technology in Gothenburg solved a problem that many believed was unsolvable: they compiled a lazy functional language into efficient native code. The result was LML โ€” Lazy ML โ€” the language that proved lazy evaluation was not merely theoretical, demonstrated the G-machine abstract machine on real hardware, and directly shaped the design of GHC, the Glasgow Haskell Compiler. Every Haskell application running in production today carries LML's architecture in its runtime.

LML was created by Lennart Augustsson ๐Ÿ‡ธ๐Ÿ‡ช and Thomas Johnsson ๐Ÿ‡ธ๐Ÿ‡ช at Chalmers University of Technology in Gothenburg, Sweden, circa 1986โ€“1987. It was an implementation of a subset of Standard ML with lazy evaluation semantics โ€” the first such system to compile lazy functional programs to efficient native machine code. LML proved that lazy evaluation, widely considered too expensive for practical compilers, could produce programs fast enough to be used for real work. The Haskell committee, founded in 1987, studied LML closely. Simon Peyton Jones visited Chalmers and brought the lessons back to Glasgow. The STG machine (Spineless Tagless G-machine), which powers every GHC-compiled Haskell program today, is the direct architectural descendant of Thomas Johnsson's G-machine.

Chalmers University of Technology and the Gothenburg Functional Programming School

Chalmers University of Technology (Chalmers tekniska hรถgskola, CTH) in Gothenburg, Sweden was founded in 1829. It is Sweden's leading technical university and one of Europe's most productive sources of programming language research. The department that produced LML also produced:

The Chalmers group represented the European strand of Haskell development alongside the Glasgow and Yale groups. John Hughes's paper "Why Functional Programming Matters" (1984, Chalmers) remains one of the most widely read papers in programming language history. Lennart Augustsson was a founding member of the Haskell committee at the FPCA 1987 conference in Portland, Oregon.

Sweden joined the European Union in 1995. Chalmers research since 1995 has been EU-funded through ESPRIT, Framework Programmes (FP6, FP7), Horizon 2020, and Horizon Europe. The functional programming work that produced LML โ€” and all its descendants including GHC and Clash โ€” is European academic research.

Thomas Johnsson and the G-Machine

The theoretical foundation of LML was Thomas Johnsson's G-machine, described in his 1984 Chalmers licentiate thesis and elaborated in his 1987 PhD dissertation "Compiling Lazy Functional Languages, Part II."

The graph reduction problem: lazy functional languages evaluate expressions by reducing them to normal form โ€” a process naturally modelled as graph rewriting. A function application f x creates a graph node; when evaluated, that node is reduced to the result. The challenge was that graph reduction, as described in theory, required pointer chasing through heap-allocated data structures with unpredictable memory access patterns โ€” devastating for real hardware caches.

The G-machine solution: Johnsson's key insight was to compile lazy programs into sequences of instructions that manipulate a stack and heap, rather than directly reducing graphs. Each function compiled to a sequence of G-code instructions that:

  1. Build graph nodes for unevaluated thunks (suspended computations)
  2. Force evaluation only when a value is actually needed
  3. Update the graph in-place when evaluation completes (avoiding redundant re-evaluation)
  4. Use a conventional call stack for spine traversal

G-code could be compiled to efficient machine code by conventional techniques. The lazy semantics were preserved by the thunk representation, not by interpreter overhead. Programs compiled with the G-machine ran at speeds comparable to eager functional languages โ€” a result that surprised the community.

G-machine (Thomas Johnsson ๐Ÿ‡ธ๐Ÿ‡ช, Chalmers PhD 1987)
    First abstract machine for compiled lazy evaluation
    G-code: stack + heap instructions โ†’ native machine code
    Thunk-based laziness: evaluate on demand, update in place

LML (Lennart Augustsson ๐Ÿ‡ธ๐Ÿ‡ช + Thomas Johnsson ๐Ÿ‡ธ๐Ÿ‡ช, Chalmers 1987)
    First compiler implementing G-machine on real hardware
    Subset of Standard ML + lazy evaluation semantics
    Native code output: first compiled lazy functional language

โ†“ GHC Early Backend (Simon Peyton Jones ๐Ÿด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ท, Glasgow, 1989)
    G-machine basis studied from LML
    Haskell 1.0 report (1990) compiled via G-machine variant

โ†“ STG Machine (Simon Peyton Jones ๐Ÿด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ท, Glasgow, 1992)
    "Implementing Lazy Functional Languages on Stock Hardware"
    Spineless: no spine stack (improves cache locality)
    Tagless: no tag bits on heap nodes (improves branch prediction)
    Direct improvement on G-machine lessons from LML
    Still the basis of GHC's code generator today (2026)

โ†“ GHC (ongoing, Glasgow + Community, 1989โ€“2026)
    Haskell's primary compiler: Servant, Yesod, Scotty
    All deployable on sota.io via Docker + Stack

Lennart Augustsson: From LML to Hardware Haskell

Lennart Augustsson ๐Ÿ‡ธ๐Ÿ‡ช is one of the most prolific contributors to the functional programming ecosystem. After LML and the early Haskell work at Chalmers, his trajectory illustrates the long reach of Swedish functional programming research into EU industrial practice.

Haskell Committee (1987โ€“1990): Augustsson was one of the founding members of the Haskell design committee formed at FPCA 1987. He contributed to the Haskell 1.0 (1990) and Haskell 98 (1998) standards. His implementation work informed key decisions about lazy evaluation semantics.

Hugs (co-developed with Mark P. Jones ๐Ÿ‡ฌ๐Ÿ‡ง, 1992): Augustsson collaborated on Hugs (Haskell User's Gofer System), the lightweight Haskell interpreter that made Haskell accessible to students and researchers who could not run the full GHC pipeline. Hugs was the dominant Haskell learning tool throughout the 1990s.

Lava (Augustsson ๐Ÿ‡ธ๐Ÿ‡ช, Claessen ๐Ÿ‡ธ๐Ÿ‡ช, Sheeran ๐Ÿ‡ฌ๐Ÿ‡ง/๐Ÿ‡ฎ๐Ÿ‡ช, Chalmers, 1998): Lava was a Haskell library for describing synchronous hardware circuits. The key insight: hardware description is a functional program over signal streams. A combinational circuit is a pure function from inputs to outputs; a sequential circuit is a function over time. Lava circuits could be:

Lava established the pattern that Clash later generalised: Haskell types can represent hardware circuits, and the Haskell type checker can catch hardware design errors at compile time.

Clash (Christiaan Baaij ๐Ÿ‡ณ๐Ÿ‡ฑ, University of Twente ๐Ÿ‡ณ๐Ÿ‡ฑ, 2009โ€“2015, built on Lava's foundations): Clash extends the Lava idea into a full compiler. Clash takes ordinary Haskell code โ€” using standard GHC with type class polymorphism, dependent types via type families, and the full Haskell 2010 language โ€” and compiles it to:

Clash is actively used in the EU:

The lineage from Johnsson's 1984 G-machine to Clash running in NXP's ASIC design flows is direct and traceable.

EU Context: The Chips Act and Functional Hardware Design

The EU Chips Act (Regulation 2023/1781, signed August 2023) commits โ‚ฌ43 billion to strengthening European semiconductor design and manufacturing through 2030. Its goals include:

Clash and Lava-descended tools are directly relevant to this policy goal. EU semiconductor companies (NXP ๐Ÿ‡ณ๐Ÿ‡ฑ, Infineon ๐Ÿ‡ฉ๐Ÿ‡ช, STMicroelectronics ๐Ÿ‡ซ๐Ÿ‡ท๐Ÿ‡ฎ๐Ÿ‡น, Renesas EU subsidiaries) need hardware design tools that:

Haskell's strong type system โ€” inherited from LML's typed ML foundation โ€” enables exactly this: hardware designs expressed in Clash carry type-level proofs about bit widths, clock domains, and signal types that catch entire categories of hardware bugs at compile time, before any silicon is taped out.

GDPR, EU AI Act, and NIS2 Angles

GDPR Art. 25 โ€” Data Minimisation by Design: Lazy evaluation is the computational embodiment of data minimisation. A Haskell program using lazy lists only evaluates the elements it actually needs. A streaming pipeline processes data one element at a time without materialising the full dataset. The GDPR's "collect only what you need" principle is enforced by the evaluation strategy itself โ€” not by developer discipline.

-- Only processes the first 10 EU user records that match โ€” never loads the full table
import Database.PostgreSQL.Simple
import Control.Monad (forM_)

getCompliantUsers :: Connection -> IO ()
getCompliantUsers conn = do
  -- Lazy streaming query โ€” GDPR Art. 25: process only what you need
  rows <- query_ conn "SELECT id, email FROM users WHERE gdpr_consent = true LIMIT 10"
  forM_ (rows :: [(Int, String)]) $ \(uid, email) ->
    putStrLn $ "Processing user: " ++ show uid
  -- Connection cleaned up; no full table materialised in memory

EU AI Act Art. 13 โ€” Transparency and Explainability: Pure functional programs are referentially transparent: every function call with the same arguments produces the same result, with no hidden state. This makes AI pipelines written in Haskell naturally auditable โ€” you can reason about what the system does by reading the code, without tracking mutable global state.

NIS2 Directive โ€” Cybersecurity by Design: LML/Haskell's immutability-by-default eliminates entire classes of vulnerabilities:

These properties are not added as libraries โ€” they are enforced by the language semantics that trace back to LML's typed lazy core.

Deploy Haskell (LML's Direct Descendant) on sota.io

Every Haskell application compiled with GHC is, architecturally, an LML descendant. The G-machine that Johnsson designed at Chalmers in 1984, refined by LML in 1987, improved by Jones's STG machine in 1992, and continuously optimised in GHC since โ€” that machine runs your Haskell server.

# Haskell/Servant on sota.io โ€” LML's great-grandchild in production
FROM haskell:9.8 AS build
WORKDIR /app
COPY *.cabal cabal.project ./
RUN cabal update && cabal build --only-dependencies
COPY . .
RUN cabal build && cabal install --installdir=/usr/local/bin

FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y libgmp10 libffi8 && rm -rf /var/lib/apt/lists/*
COPY --from=build /usr/local/bin/app /usr/local/bin/app
EXPOSE 8080
CMD ["app"]

Stack-based deployment (recommended for reproducible builds):

FROM fpco/stack-build:lts-22.39 AS build
WORKDIR /app
COPY stack.yaml stack.yaml.lock package.yaml ./
RUN stack setup && stack build --only-dependencies
COPY . .
RUN stack build --copy-bins

FROM ubuntu:22.04
RUN apt-get update && apt-get install -y libgmp10 ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=build /root/.local/bin/app /usr/local/bin/app
EXPOSE 8080
CMD ["app"]

Servant API example (type-safe REST API, GDPR-compliant by construction):

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
module Api where

import Servant
import Data.Text (Text)

-- Type-level API definition โ€” route errors are compile-time type errors
type UserAPI =
  "users" :> Get '[JSON] [User]              -- GET /users
  :<|> "users" :> ReqBody '[JSON] NewUser
               :> Post '[JSON] User          -- POST /users
  :<|> "users" :> Capture "id" Int
               :> DeleteNoContent            -- DELETE /users/:id
  -- GDPR Art. 17 Right to Erasure: Delete endpoint is type-checked at compile time
  -- Removing it from the type breaks all callers โ€” accidental omission is a type error

data User = User { userId :: Int, userEmail :: Text }
  deriving (Show, Generic, ToJSON, FromJSON)

Deploy to sota.io:

# One-line deployment โ€” EU-native, GDPR-compliant by default
sota deploy --region eu-central
# Builds via Docker, deploys to German infrastructure
# Managed PostgreSQL 17 included โ€” no separate database setup

The Chalmers Lineage: LML to the Present

Chalmers University of Technology ๐Ÿ‡ธ๐Ÿ‡ช (Gothenburg, Sweden)
    Founded 1829 โ€” Sweden in EU since 1995

1984 โ€” G-machine (Thomas Johnsson ๐Ÿ‡ธ๐Ÿ‡ช, Chalmers PhD)
    First abstract machine for compiled lazy evaluation

1987 โ€” LML (Lennart Augustsson ๐Ÿ‡ธ๐Ÿ‡ช + Thomas Johnsson ๐Ÿ‡ธ๐Ÿ‡ช)
    First compiled lazy functional language
    Direct input to GHC design

1987 โ€” Haskell Committee (Augustsson ๐Ÿ‡ธ๐Ÿ‡ช, Hughes ๐Ÿ‡ฌ๐Ÿ‡ง, and others)
    ISWIM (#116) โ†’ SASL (#109) โ†’ KRC (#110) โ†’ Miranda (#78) โ†’ Haskell

1992 โ€” STG Machine (Simon Peyton Jones ๐Ÿด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ท, Glasgow)
    Improves on G-machine: spineless + tagless for cache efficiency
    All modern GHC output runs on STG

1998 โ€” Lava (Augustsson ๐Ÿ‡ธ๐Ÿ‡ช, Sheeran ๐Ÿ‡ฌ๐Ÿ‡ง/๐Ÿ‡ฎ๐Ÿ‡ช, Claessen ๐Ÿ‡ธ๐Ÿ‡ช, Chalmers)
    Haskell as hardware description language
    FPGA synthesis via VHDL backend

1999 โ€” QuickCheck (Claessen ๐Ÿ‡ธ๐Ÿ‡ช + Hughes ๐Ÿ‡ฌ๐Ÿ‡ง, Chalmers)
    Property-based testing โ€” now standard in Haskell, Erlang, Rust, Python

2007 โ€” Agda (Ulf Norell ๐Ÿ‡ธ๐Ÿ‡ช, Chalmers)
    Dependently typed programming language
    EU formal verification of safety-critical systems

2009 โ€” Clash (Christiaan Baaij ๐Ÿ‡ณ๐Ÿ‡ฑ, University of Twente ๐Ÿ‡ณ๐Ÿ‡ฑ)
    Built on Lava foundations
    Haskell โ†’ VHDL/SystemVerilog/SystemC
    NXP ๐Ÿ‡ณ๐Ÿ‡ฑ + Ericsson ๐Ÿ‡ธ๐Ÿ‡ช + ESA ๐Ÿ‡ณ๐Ÿ‡ฑ in production

2026 โ€” sota.io (EU-native PaaS, Germany ๐Ÿ‡ฉ๐Ÿ‡ช)
    Deploy GHC-compiled Haskell to EU infrastructure
    GDPR + NIS2 + EU AI Act compliant by design

See Also


sota.io is the EU-native PaaS built for developers who need European data residency. Deploy Haskell, Rust, Go, Python, OCaml, and 110+ other languages to German infrastructure with managed PostgreSQL 17, automatic TLS, and zero DevOps. GDPR-compliant by default. No US cloud involved.

LML proved in 1987 that lazy functional programming was practical. Chalmers proved that European academic research could shape global software infrastructure. sota.io is where that infrastructure runs โ€” in Europe, for Europe.