PureScript (0.15)

This assessment applies the coupling account — coupling as access to a shared resource, and the coupling floor [1], [2] — and the knowledge-embodiment theorem [3]; the language is assessed against its official reference [4].

1 Assessment

This page assesses PureScript in five parts: core coupling — what the language’s own constructs force; ecosystem coupling — what the surrounding platform, tooling, and community cost; engineering readiness — whether the artifact can be reproduced, verified, observed, worked in quickly, connected to other languages, and governed openly; the profile — the unscored facts a score cannot express; and the scoring detail — the mechanism marks and the arithmetic behind every score. A ✅ bullet marks a construct that helps. A ⚠️ or ❌ bullet marks a cost; the scoring model does not price every cost named here.

Core coupling 69/100 · Ecosystem coupling 68/100 · Engineering readiness 64/100

1.1 Core coupling

1.1.1 Type

  • ✅ All Haskell benefits plus algebraic effects: Effect system separates different effect types (unlike Haskell’s monolithic IO)
  • ✅ Row polymorphism for extensible records: Can decouple from exact record shape
  • ✅ Type classes with functional dependencies: More precise abstraction control
  • ❌ JavaScript FFI can bypass type safety: Interop creates coupling holes

1.1.2 Construction

  • ✅ Algebraic data types: A data declaration fixes the set of constructors, so every value is built through a declared shape
  • ✅ Smart constructors: A module can hide its constructors and export a validating function, so an invalid value cannot be built outside it
  • ✅ Records are built from a literal: { field: value } constructs a record directly, with no constructor tied to an allocation step
  • ✅ newtype wrappers are zero-cost: A one-constructor wrapper gives a distinct type without a runtime box
  • ✅ No global mutable state: A module binding is a pure value, so no module couples another to an initialization order

1.1.3 Memory

  • ✅ JavaScript GC decouples memory: Compiles to JS, inherits JS GC
  • ✅ Immutability simplifies: No cyclic mutable references
  • ⚠️ JavaScript GC pauses: Non-deterministic, inherited from JS runtime
  • ✅ No space leaks from laziness: Strict evaluation by default (unlike Haskell)
  • ⚠️ JS interop can create leaks: Foreign JS code may hold references

1.1.4 Error

  • ✅ Effect system makes errors explicit by type: Effect (console :: CONSOLE, exception :: EXCEPTION) Unit shows exactly what can fail
  • ✅ Explicit exception handling: No hidden runtime exceptions

1.1.5 Concurrency

  • ✅ Aff monad for async: Separates async coordination from sync logic
  • ❌ Single-threaded runtime: The compiled JavaScript runs on one thread, so two computations cannot run in parallel (K1)
  • ✅ Effect tracking prevents coupling: Can’t accidentally do async in sync code

1.1.6 Platform

  • ✅ Compiles to JavaScript: The output runs on any JavaScript engine — browsers, Node.js, Deno — rather than inside one vendor’s runtime
  • ✅ No proprietary runtime: PureScript ships no virtual machine of its own; compiled output depends only on the JavaScript platform
  • ✅ Cross-platform host support: Precompiled compiler binaries are published for macOS, Linux, and Windows
  • ✅ Community-maintained compiler: The compiler is developed in the open at purescript/purescript, not owned by a single vendor

1.1.7 Trade-offs (not coupling)

  • Type Safety vs. JavaScript Interop: FFI boundary loses all guarantees, couples to JS runtime behavior
  • Effect Granularity vs. Complexity: Fine-grained effect tracking increases cognitive load
  • Compile Target Constraints: Must fit JavaScript semantics, can’t have true parallelism
  • Ecosystem Size vs. Quality: Small community means fewer libraries but tighter coupling to available ones

1.2 Ecosystem coupling

1.2.1 Performance

  • ✅ Compiles to JavaScript: Inherits JS runtime performance characteristics
  • ⚠️ JS GC couples memory to runtime: No control over GC behavior
  • ✅ Strict evaluation: More predictable than Haskell, no space leaks from thunks
  • ❌ JS interop performance penalty: FFI boundary couples to marshaling cost
  • ✅ Tree-shaking support: Dead code elimination decouples bundle size from library inclusion

1.2.2 Ecosystem

  • ❌ Small ecosystem: Library availability couples to a niche community smaller than Haskell, so a project reinvents wheels or couples to specific libraries
  • ✅ Spago/purs package management: Standardized build system
  • ❌ Depends on JS ecosystem: Must interop with npm packages, couples to JS tooling
  • ✅ Excellent compiler errors: Error messages decouple debugging from trial-and-error
  • ⚠️ Niche community: Support couples to small contributor base

1.2.3 Evolution

  • ✅ Stable core: Breaking changes are rare and well-documented
  • ⚠️ Pre-1.0 for long time: Language evolution couples to experimental status
  • ✅ Effect library updates separate: Can upgrade effects without changing core language
  • ❌ Small team: Development pace couples to limited resources

1.2.4 Domain

  • ✅ Excellent for frontend development: Type safety in browser decouples from JS runtime errors
  • ✅ Strong for web apps: Effect system handles async/DOM naturally
  • ❌ Limited backend use: Node.js backend couples to JS ecosystem limitations
  • ⚠️ Niche adoption: Team expertise couples to hiring/training challenges

1.2.5 Learning

  • ❌ Very steep: All Haskell concepts plus row polymorphism and effect systems
  • ✅ Better than Haskell for JS devs: Familiar runtime, compilation target
  • ✅ Excellent docs: PureScript by Example book decouples learning from experimentation
  • ⚠️ Requires Haskell knowledge: Learning couples to functional programming expertise

1.2.6 Syntax

  • ✅ Haskell-like syntax: Familiar to FP developers
  • ✅ Less operator noise than Haskell: More consistent naming
  • ✅ Row polymorphism elegant: Extensible records without boilerplate
  • ⚠️ FFI syntax verbose: foreign import couples JS interop to boilerplate

1.2.7 Testing

  • ✅ QuickCheck/Spec available: Property testing support
  • ✅ Pure functions easy to test: No side effect coupling
  • ❌ Debugging via JS: Must debug compiled output, couples to source maps
  • ⚠️ Browser DevTools help: Can debug in browser, but stack traces couple to compiled code

1.2.8 Security

  • ✅ Memory safe: JS GC prevents memory bugs
  • ✅ Type safety: Prevents type confusion
  • ✅ Effect system tracks side effects: Can’t accidentally perform unsafe operations
  • ❌ JS interop escape hatch: unsafeCoerce and FFI bypass safety, couple correctness to discipline

1.3 Engineering readiness

1.3.1 Reproducibility

  • ❌ Builds are not byte-reproducible by default.

1.3.2 Supply chain

  • ⚠️ Published packages carry no signed provenance by default.
  • ⚠️ The package registry is a flat name space.

1.3.3 Observability

  • ⚠️ No stable tracing and metrics standard.
  • ⚠️ The standard library has no structured logging.

1.3.4 Feedback

  • ✅ No charged mechanism in this dimension.

1.3.5 Interop

  • ⚠️ No maintained portable target.

1.3.6 Governance

  • ✅ No charged mechanism in this dimension.

1.4 Profile

Unscored, and kept separate from every score on purpose. The profile records what a mechanism price cannot express: what a running program costs, how well a coding model and an agent work in the language, and whether a safety-critical path exists.

1.4.1 Energy and cost

What this axis asks: what does a running program cost in energy and time?

  • ⚠️ Runs on a virtual machine, above native code in the energy and time benchmarks [5]; a causal re-analysis attributes most of the gap to execution time [6].

1.4.2 AI and agent readiness

What this axis asks: how well does a coding model and an agent work in this language?

  • ❌ Sparse training data: models write it unreliably [7].

1.4.3 Safety certification

What this axis asks: is there a certified or standards-qualified path to a safety-critical system?

  • ⚠️ No certified or standards-qualified path for safety-critical systems.

1.5 Scoring detail

1.5.1 Core coupling Dimensions

Dimension Mechanism Description Present Cost
Type T1 dynamic no static check — 0
T2 weak static — 0
T3 dynamic/duck dispatch — 0
T4 no sum types — 0
T5 no generics — 0
T6 no namespaces — 0
T7 type erasure/reflection — 0
T8 operator overloading — 0
T9 inheritance required for polymorphism — 0
T10 no null-safety — 0
T11 no module boundary — 0
T12 no effect tracking — 0
T13 async/sync colouring — 0
T14 unchecked foreign boundary ✅ −4
Type subtotal −4
Construction C1 global mutable state by default — 0
C2 no immutability by default — 0
C3 constructors coupled to allocation — 0
C4 no constructor/validation — 0
Construction subtotal 0
Memory M1 manual deallocation — 0
M2 GC non-deterministic pauses ✅ −8
M3 no RAII ✅ −4
M4 no ownership model — 0
Memory subtotal −12
Error Er1 no structured path — 0
Er2 unchecked exceptions only — 0
Er3 errors ignored/non-exhaustive — 0
Er4 no composable result type — 0
Error subtotal 0
Concurrency K1 GIL/no parallel ✅ −15
K2 shared mutable state default — 0
K3 manual sync no race detection — 0
K4 no structured concurrency — 0
K5 no primitives — 0
Concurrency subtotal −15
Platform P1 cannot function outside one vendor/domain — 0
P2 single-vendor but other uses — 0
P3 legacy/discontinued platform — 0
Platform subtotal 0

Core Dimensions score: 69/100 — total cost = −31 (per-dimension subtotals are capped at −15; an uncapped cost is shown in parentheses where the cap bites).

1.5.2 Ecosystem coupling Dimensions

Dimension Mechanism Description Present Cost
Performance R1 interpreted no AOT/JIT — 0
R2 GC pauses ✅ −8
R3 JIT warmup — 0
Performance subtotal −8
Ecosystem Ec1 no package manager — 0
Ec2 fragmented tooling — 0
Ec3 small/niche/discontinued ✅ −8
Ec4 proprietary — 0
Ec5 platform-locked tooling — 0
Ec6 monoculture — 0
Ec7 legacy burden — 0
Ecosystem subtotal −8
Evolution V1 breaking changes — 0
V2 frozen — 0
V3 discontinued — 0
V4 glacial standards — 0
Evolution subtotal 0
Domain D1 domain/vendor lock-in — 0
D2 poor domain fit — 0
D3 framework forces architecture — 0
Domain subtotal 0
Learning L1 steep ✅ −8
L2 large surface/multi-paradigm — 0
L3 sparse docs — 0
Learning subtotal −8
Syntax S1 verbose — 0
S2 inconsistent — 0
S3 punctuation-heavy — 0
Syntax subtotal 0
Testing G1 weak tooling — 0
G2 poor debugging ✅ −8
G3 runtime-only errors — 0
Testing subtotal −8
Security Q1 memory-unsafe — 0
Q2 dynamic/weak typing risk — 0
Q3 known vulnerability/injection — 0
Security subtotal 0

Meta Dimensions score: 68/100 — total cost = −32 (per-dimension subtotals are capped at −15; an uncapped cost is shown in parentheses where the cap bites).

1.5.3 Engineering readiness Dimensions

Dimension Mechanism Description Present Cost
Reproducibility Y1 build not reproducible ✅ −8
Y2 dependencies not pinned — 0
Reproducibility subtotal −8
Supply chain Y3 no signed provenance ✅ −8
Y4 registry without namespacing ✅ −4
Supply chain subtotal −12
Observability Y5 no stable tracing standard ✅ −8
Y6 no structured logging ✅ −4
Observability subtotal −12
Feedback Y7 slow build — 0
Y8 no fast in-editor analysis — 0
Feedback subtotal 0
Interop Y9 no foreign-function interface — 0
Y10 no portable target ✅ −4
Interop subtotal −4
Governance Y11 single-vendor governance — 0
Y12 closed specification — 0
Governance subtotal 0

Readiness Dimensions score: 64/100 — total cost = −36 (per-dimension subtotals are capped at −15; an uncapped cost is shown in parentheses where the cap bites).

Verdict: PureScript improves on Haskell’s coupling properties by separating effect types. Effect system prevents coupling different concerns (console, network, state) into one IO bucket. Main weakness: JavaScript interop creates coupling escape hatches.


The formal development. The definitions, theorems, and proofs behind this page are published in:

All published papers

References

[1]
Y. Loth, “On the nature of coupling: All coupling as shared resource access.” Zenodo, Aug. 2026. doi: 10.5281/zenodo.21925122.
[2]
Y. Loth, “Coupling as a consequence of cohesion: Decomposition, the coupling floor, and domain-imposed coupling.” Zenodo, Aug. 2026. doi: 10.5281/zenodo.21925201.
[3]
Y. Loth, “On the nature of cohesion: Cohesion as correctness relative to a partitioning rule.” Zenodo, Jul. 2026. doi: 10.5281/zenodo.21703193.
[4]
P. Freeman, “PureScript by example.” PureScript, 2024. Available: https://book.purescript.org/
[5]
R. Pereira et al., “Energy efficiency across programming languages: How do energy, time, and memory relate?” in Proceedings of the 10th ACM SIGPLAN international conference on software language engineering (SLE), 2017, pp. 256–267. doi: 10.1145/3136014.3136031.
[6]
N. van Kempen, H.-J. Kwon, D. T. Nguyen, and E. D. Berger, “It’s not easy being green: On the energy efficiency of programming languages,” in Proceedings of the 40th IEEE/ACM international conference on automated software engineering (ASE), 2025. doi: 10.1109/ASE63991.2025.00131.
[7]
S. Joel, J. J. Wu, and F. H. Fard, “A survey on LLM-based code generation for low-resource and domain-specific programming languages,” ACM Transactions on Software Engineering and Methodology, 2025, doi: 10.1145/3770084.