Properties, including methods
Owned fields and class methods can be renamed. Host names stay exact. That includes the names that would otherwise sit on a JavaScript prototype — when the type system owns them, they are safe to mangle.
Language · compiler · Lilpack
LilScript is a typed, compression-first language. The compiler mangles, reshapes, and scores a complete JavaScript artifact against the codec you pick — gzip, Brotli, or raw size. Lilpack is the Vite-based delivery path: fast reloads, a language server, the usual editor tools.
class Vector {
float x;
float y;
init(float x, float y) {
this.x = x;
this.y = y;
}
float lengthSquared() {
return this.x * this.x + this.y * this.y;
}
}
int[] values = [1, 2, 3, 4];
auto doubled = values.map((int value) => value * 2);
int sum = 0;
for (int i = 0; i < doubled.length; i++) {
sum += doubled[i];
}
Vector vector = new Vector(3.0, 4.0);
if (vector.lengthSquared() == 25.0) {
print(`sum=${sum}`);
}
var b=[1,2,3,4].map(a=>a*2|0);
var a=0,c=0;
while(a<b.length){
c=c+b[a]|0;
a=a+1|0;
}
console.log(`sum=${c}`)
01 · How it gets smaller
Minifiers rename locals after the objects already exist. LilScript proves what can disappear before JavaScript is spelled — then measures the finished file under the codec you chose.
Owned fields and class methods can be renamed. Host names stay exact. That includes the names that would otherwise sit on a JavaScript prototype — when the type system owns them, they are safe to mangle.
struct and class are not glue.
Non-escaping values scalar-replace into var /
let. Values that stay become compact arrays. That
helps transfer size, memory, and access cost.
javascript.cost_model is the score the search
actually uses. A shorter raw spelling can lose under Brotli.
Performance is a separate knob: size-first is the default;
performance-first keeps hotter shapes.
02 · Monaco · the VS Code editor
Two production pages. One is npm monaco-editor@0.56.
The other is the LilScript editor compiled from
entry.lil plus the monaco-editor-core catalog — not
monaco with a few files swapped. Microsoft’s TypeScript language
service is still on both sides.
03 · Libraries we actually port
Each card is a scoped contract: same behavior and the selected JavaScript measured independently with gzip-9 and Brotli-11, npm + Vite 8 unless noted. The arrow is baseline → LilScript. Open a card for the live pair, project page, or compare notes.
Compiled Lil editor + catalog versus npm monaco-editor. TypeScript
ts.worker is still Microsoft’s.
Every runtime export from Motion 13’s DOM entrypoint. All 16 behavior-matched browser demos ship smaller under Brotli.
Official js-framework-benchmark keyed table. Solid 2.0 versus the LilScript compile. Live pairs are on the SolidLil lab.
Complete ESM root namespace, aliases, and live array type.
MurmurHash 2 and 3, reusable root API, same checksums.
Full root entrypoint. Eligible on size and the 1.05× runtime gate.
Both published roots. Types let the wrappers disappear.
Published root. Eligible against Vite and Closure ADVANCED.
Geometric predicates. Large typed corpus, modest transfer cut.
Published browser entrypoint. Effectively even on Brotli.
Public API, 769 official tests. Compared with Vite 8 Oxc of the official ESM; the smaller DEV-stripped official build is a separate lane.
Parcel Market next to the Astro control. Same CSS and behavior.
Drop-in public API. Official jquery.min.js is still
the Brotli lane to beat. Public names stay a config choice.
GFM + CommonMark parse API with live option methods. 660/660 HTML match, smaller than the same parse-only sources through Oxc, and 13% faster in Chromium. No extension system.
The port passes 1,353 adapted official tests, but the old size
row counted only zod.core.js. The linked package is
62,763 B gzip / 52,583 B Brotli and exposes 192 ESM names versus
the official entry's 240, so the size claim is withdrawn until
those surfaces match.
UUID, flags, cookies, routing, rate limits, queue, bot detection,
and portable helpers from posthog-js@1.418.10, plus
five tabbed pack lanes: autocapture utilities, replay core,
surveys, error tracking, and OTLP. Autocapture is 24.4% smaller
and replay core is 18.6% smaller on Brotli versus Oxc. The kernel
is larger than Oxc on this compiler; this is not the published IIFE.
How to read this. Each percentage is recalculated as
(candidate / baseline − 1) × 100 from the byte pair
beside it. gzip-9 and Brotli-11 are independent codec measurements;
they can disagree, as Nano ID and posthog-js do. The 7.7% / 7.5%
headline is the median of the 15 currently comparable project rows,
not a byte-weighted blend. Zod stays visible but has no vote while
its package-surface mismatch is open. Subset ports (Preact, the
in-repo Zod 3 surface, Acorn, Redux
Toolkit) live on the compare page and are
labeled as such. The published Zod 4 port is
zodlil.
04 · Latest · updated 24 August 2026
A dated changelog for the work that used to disappear into the comparison grid. Each item links to the repository or lab carrying the evidence.
JavaScript spelling search now optimizes names, literals, declarations, and layout as one codec-scored artifact.
Read the compiler changeAutocapture utilities and session-replay core join surveys, error tracking, and OTLP in a tabbed, behavior-checked benchmark lab; the new Brotli cuts are 27.3% and 19.4% versus Oxc.
Open posthoglilThe port still passes 1,353 adapted official tests. Its old size row omitted the compatibility facade, though, and 192 exported names do not equal the official entry's 240. It is no longer in the aggregate until the package boundary is exact.
Open zodlilLive option methods and matched raw, gzip, and Brotli compiles are now published for the 18.0.10-compatible parse surface.
Open markedlil05 · Published ports
Each port has its own site: install the package, open the paired demos, read the receipts. The in-repo stage is still here for the rest of the corpus.
Solid 2.0 client and LSX. Official keyed table: 64.7% smaller gzip and 65.5% smaller Brotli.
yeargun.github.io/solidlil motionlil 0.1.2Full Motion 13 DOM runtime exports. 16/16 paired demos; 10.2% smaller gzip and 12.4% smaller Brotli in total.
yeargun.github.io/motionlil @itslil/mobxMobX 7 public API. 769 official tests; 0.9% smaller gzip and 0.4% larger Brotli than the Vite 8 Oxc lane.
yeargun.github.io/mobxlil @itslil/jqueryjQuery 3.7.1 public API. Published drop-in; the LilScript ESM is still 13.4% larger under gzip and 12.0% larger under Brotli than the official minified file.
yeargun.github.io/jquerylil @itslil/marked 18.0.1318.0.10-compatible parse API. 660 cases; 2.0% smaller gzip and 5.7% smaller Brotli than parse-only Oxc.
yeargun.github.io/markedlil @itslil/zodZod 4.4.3 classic-compatible API. The old core-only size claim is withdrawn; the linked package and official export inventories do not yet match.
yeargun.github.io/zodlil @itslil/posthog-jsCapture kernel plus five tabbed packs. Autocapture is 24.4% smaller and replay core is 18.6% smaller on Brotli than Oxc.
yeargun.github.io/posthoglil @itslil/monaco-editormonaco-editor 0.56, submodule-by-submodule, plus the paired IDE: 54.2% smaller gzip and 53.4% smaller Brotli.
yeargun.github.io/monacolil In-repo stageLastro, hashes, paired Closure cases, and the rest of the corpus on this site.
Browse every demo06 · Tooling
Closure’s Advanced mode is the closest ancestor. The Java stack around it is slow and awkward for everyday web work. LilScript is being built so reload, analysis, and editor support sit on par with the rest of the ecosystem.
lilpack dev turns candidate search off and keeps HMR
honest. Production uses the project lilscript.toml.
lilscript-lsp and the repo extension: highlight,
diagnostics, completion, hover, rename, format.
Codec, priority, mangling, inlining, layouts, chunks. The language page walks the ones that change behavior.
07 · Models, and the measured median
That was not the plan; it is just what we keep seeing. A library rewrite is often close to one-shot, and the compiled file is usually smaller once gzip or Brotli is applied. Across the 15 currently comparable rows, the median project result is 7.7% smaller under gzip-9 and 7.5% smaller under Brotli-11. Zod remains visible but is excluded until its package surface matches. This is a snapshot with one vote per project, including losses and near-ties — not a promise that every file will move that far.