Skip to content
CAI
Software that uses CAICheck a score

LPTK/simple-sub

60.5

Adequate · 20 September 2026

807

lines of production code

Scala

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a type inference engine for the 'simplesub' language, featuring constraint-based inference with support for recursive types, let-polymorphism, and records. It provides an interactive web-based demo that allows users to input code and view real-time type checking results and error messages directly in the browser. The implementation includes a custom parser, a type simplifier for handling complex type operations, and cross-compilation capabilities via Scala.js.

Features

Add JavaScript cross-compilation with interactive type-checking demo

Introduces a new JavaScript entry point (Main.scala) that enables the project to be compiled to JavaScript. This component provides a web-based demo where users can input code into a text area and see real-time type checking results rendered in the browser, including variable types and error messages. The implementation includes a custom type inference loop (inferTypesJS) to avoid stack overflow issues common in the original Scala version when running in JS environments, and integrates with the fastparse library for parsing.

js · high confidence

Add online demo for type inference

Users can now interact with the Simple-sub type inference algorithm directly in a web browser via a new online demo. This change introduces the necessary frontend assets, including an HTML interface, CSS styling, and the compiled JavaScript artifact, allowing users to input code and view inferred types without local setup.

(repo-wide) · high confidence

Introduction of a new type system with recursive type support and simplification

The \shared/src/main\ module now includes a complete type inference engine for the \simplesub\ language. This introduces a new \Parser\ for the language syntax, a \Typer\ that performs constraint-based type inference, and a \TypeSimplifier\ that handles complex type operations. Key capabilities include the canonicalization and merging of recursive types to prevent infinite expansion, a \CompactType\ representation for efficient simplification, and logic to extrude type variables across binding levels. The system also enforces stricter parsing rules, such as rejecting duplicated record fields and rebinding of boolean literals.

shared/src/main · high confidence

Removals

Removal of legacy type system components

The \Parser\, \Syntax\, and \Typing\ modules in \src/main/scala/simplesub\ have been removed. This eliminates the previous implementation of the type language (including the \Type\ ADT and \TypeShape\ inference engine) and the associated parser, effectively stripping out the old type representation and inference logic from the codebase.

src/main · high confidence

Fixes

Fixes stack overflow in the online algebraic subtyping demo

The \bin/simple-algebraic-subtyping-opt.js\ artifact, which powers the online demo for simple algebraic subtyping, has been updated to resolve a "Maximum call stack size exceeded" error. This fix ensures the tool runs reliably in the browser without crashing during type checking or simplification tasks.

bin · high confidence

Test coverage

Added comprehensive test suite for type inference and parsing; Removed legacy Scala test suites for type inference.

Dependencies

Upgrade Scala ecosystem dependencies and enable JavaScript cross-compilation

The project has upgraded core dependencies, including Scala 2.13.18, ScalaTest 3.2.20, fastparse 3.1.1, and sourcecode 0.4.4. It now supports JavaScript cross-compilation by adding Scala.js plugins and libraries (scalajs-dom 2.8.1, scalajs-jquery 1.0.0), creating separate JVM and JS targets under the 'simple-sub' name.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 60.

Lenses

  • Code Health 98
  • Architecture 69
  • Maturity 46
  • Readiness 65
  • Security 100

Changes since last survey

  • 189 commits — 179 feature/other, 10 fixes

By area

  • (root) — 70 commits
  • project/build.properties — 35 commits
  • project/plugins.sbt — 34 commits
  • shared/src — 27 commits
  • (repo) — 6 commits
  • src/main — 6 commits
  • src/test — 4 commits
  • bin/simple-algebraic-subtyping-opt.js — 3 commits
  • .github/workflows — 2 commits
  • js/src — 2 commits

Notable commits

  • fix: Add tests and fix minor problems
  • fix: Fix bug in canonicalization: keep track of entire types while detecting recursion
  • fix: Fix extrusion: handle recursive bound graphs
  • fix: Fix regression in previous extrusion tweak
  • fix: Fix strange JavaScript “RangeError: Maximum call stack size exceeded”
  • fix: Fix subtlety in type extrusion: both type var bounds should be extruded
  • fix: Fix warning introduced by new fastparse version
  • fix: Minor fixes
  • fix: Minor rec-types fix in expandType/compactType + some new tests
  • fix: Put some nonessential code back (debugging, JS, ...) + revert formatting
  • change: Add JavaScript cross-compilation with demo + README file
  • change: Add missing scalaTest dependency
  • change: Add new opt js file
  • change: Add online demo with index.html and fullOptJS artifact
  • change: Add some intersting tests
  • change: Clean up the code
  • change: Create .scala-steward.conf
  • change: Create LICENSE
  • change: First commit: simple-sub type inference; two representations of types
  • change: Implement cleaner type simplification strategy with CompactType
  • …and 169 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

LPTK/simple-sub was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 08eb3ac11170fd24c5cf81ed168f1519816d3640 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.