frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: LilScript makes JavaScript libraries smaller

8•yeargun•28m ago
LilScript is a typed, compression-first language that compiles into js and sometimes into exec(will be more stable in future). The compiler mangles, reshapes the program into optimized js that happens to be 5-15% smaller (after gzip/br compression or raw) compared to the best performing JS toolchains like oxc/esbuild/terser/..

## What has been proven to work with LilScript?

- makes VSCode's core js modules 20% smaller on average - makes the world's most performant & small markdown rendering npm library, marked, 5-7% smaller and 10% faster - and many more demos.. works with pretty much any js/ts library

## How it is compressing js finer than vite/oxc/terser/esbuild/..

### 1. By changing the app.

``` 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}`); } ```

Above code compiles into this:

``` var b=[1,2,3,4].map(a=>a2|0); var a=0,c=0; while(a<b.length){ c=c+b[a]|0; a=a+1|0; } console.log(`sum=${c}`) ```

This is not minification of the same program. The compiler changed the app.

oxc / esbuild / terser / .. starts from JS and mostly keeps the shape of the app. Meanwhile LilScript the language is designed from scratch to give compiler any extra knowledge that could help the compiler's compilation. Just like Google Closure Compiler - Advanced Mode, and beyond.

### 2. Tryhard property mangling.

Visit the world's most used web applications, chatgpt.com, and read the source codes. You will see that, there are lots of framework related js properties that dont get minified, and are indeed human readable.

Those names stay in the bundle because the toolchain cannot prove they are local. A property might be a public API, a DOM field, a framework hook, or something a plugin reads by string. So the minifier leaves it.

LilScript:

- *a-* does both eliminates the objects, weird code structures into more optimized variables/arrays - *b-* rename any variable into mostly occured, short versions, field cleverly to minimize entropy (based on the objective compression algorith. gzip/brotli) so that the end result is highly compressed.

*(a)* is the same move as the `Vector` example, at library scale: objects and classes that only exist as a programming convenience get flattened into scalars, arrays, and tight loops.

*(b)* is not "make every name 1 letter." gzip and brotli win when the same short tokens repeat. The compiler picks the names that show up the most, and scores the spelling against the compression algorithm you asked for (gzip, brotli, or raw). Different `cost_model` → different names → a different file that is smaller

after* that codec.

That is why the same program can be 5-15% smaller after gzip/br compression or raw: the JS is shaped and named for the compressor, not just for a human reading the AST.

Feel free to PR, experiment (Please respect the modified MIT license)

LLM models can oneshot implement your library with LilScript. For non optimized libraries, it could end up 20%+ size reduction and somewhat performance improvements (which usualy matters very little)

Please share your opinions, would love to discuss about the future direction for the language and the compiler

Where Does Computation End?

https://sslog.dpdns.org/where-does-computation-end.html
1•Shaurya_Sharma•48s ago•0 comments

How HN: Pulse: A free, multi-signal alternative to Alexa Rank and SimilarWeb

https://www.pulstraffic.com
1•tvictano•55s ago•0 comments

Show HN: Bisecto – A minimalist game about cutting shapes into 50/50 halves

https://bisecto.com/
1•bpx51•2m ago•0 comments

An elliptic curve of rank ≥ 30

https://elliptic-rank.icarm.cloud/curve/273
1•robinhouston•3m ago•0 comments

Bun 1.4 Released

https://github.com/oven-sh/bun/releases/tag/bun-v1.4.0
2•andsoitis•3m ago•0 comments

Fastest known star could reveal the spin of our galaxy's giant black hole

https://www.science.org/content/article/fastest-known-star-could-reveal-spin-our-galaxy-s-giant-b...
1•Brajeshwar•3m ago•0 comments

Exploding a CD by Spinning it at high speeds [video]

https://www.youtube.com/watch?v=0yNAbHKF8pY
1•vismit2000•4m ago•0 comments

Private Startups Are Rapidly Advancing Canadian Rockets

https://spectrum.ieee.org/canadian-rockets
1•rbanffy•4m ago•0 comments

A look under our trunk: what's in our compute

https://waymo.com/blog/2026/08/look-under-our-trunk/
1•ra7•4m ago•0 comments

SEO Skills AI – Universal Open-Source SEO Agent for Claude, Cursor, Windsurf

https://github.com/seoskillsai/seo-skills-ai
2•seoskillsai•6m ago•0 comments

Skills over MCP

https://aaif.io/blog/skills-over-mcp
2•mooreds•7m ago•0 comments

The Prompt Cacheing Cheatsheet

https://coolhandlabs.com/updates/llm-prompt-caching-what-it-is-and-key-terms-explained
2•mikecarroll•7m ago•0 comments

Bun 1.4

https://bun.com/blog/bun-v1.4
7•meetpateltech•8m ago•1 comments

I gave a matcher 43k unlabelled reports; it found 9/10 known events

https://theanomalynetwork.com/method
2•kyleclouthier•8m ago•0 comments

Hacking with Claude on a $27 Smart Watch

https://www.mikekasberg.com/blog/2026/08/19/hacking-with-claude-on-a-27-smart-watch.html
2•speckx•10m ago•0 comments

IBM Pushes System Design to Reach Ultra-Cold Temperatures for Quantum

https://www.nextplatform.com/compute/2026/08/19/ibm-pushes-system-design-to-reach-ultra-cold-temp...
2•rbanffy•12m ago•0 comments

Mindlas catches your coding agent drifting before the bad code

https://github.com/Evolutionairy-AI/MINDLAS
2•Bluestein•12m ago•1 comments

'Not a theoretical risk,' feds warn as attackers use AI-made code

https://www.theregister.com/security/2026/08/19/not-a-theoretical-risk-feds-warn-as-attackers-use...
3•nyku•13m ago•0 comments

Nat: The Natural Unit of Information

https://en.wikipedia.org/wiki/Nat_(unit)
2•lioeters•13m ago•0 comments

Stwipe Acquires OpenWouter

https://stwipe.com/
3•eatonphil•13m ago•0 comments

Guess which of these LLM outputs is watermarked

https://sgoedecke.github.io/watermark-quiz/
2•gfysfm•14m ago•0 comments

A registry and transparency log for discovering and verifying AI agents by name

https://github.com/agentnameservice
2•mooreds•14m ago•0 comments

Viaduct – Tool to Convert a Google Chrome Extension into a Safari Web Extension

https://github.com/magicelk235/Viaduct-CLI
2•microflash•14m ago•0 comments

The Great Android Stack Reset – A history of mobile system design

https://returnzero.dev/articles/android-mobile-system-design-history
1•rotemmiz•14m ago•0 comments

How Control Moves Through Code, Chips, and Nations [video]

https://fosdem.org/2026/schedule/event/NS7DF7-hidden-life-of-infrastructure/
1•mooreds•14m ago•0 comments

Show HN: A light-weight CLI that keeps your skills and rules in sync

https://github.com/nicolasakf/unity
2•nicolasakf•16m ago•0 comments

Where Did the Productivity Gains Go?

https://idiallo.com/blog/where-did-the-productivity-gains-go
3•surprisetalk•16m ago•0 comments

Arthur Eddington's Theory of Everything (2015)

https://arxiv.org/abs/1510.04046
2•lioeters•17m ago•0 comments

Where 66 stands among init systems

https://docs.obarun.org/66/0.9.1.0/66-vs-other-init-systems.html
2•smartmic•17m ago•0 comments

Tetragrammaton with Rick Rubin: Tyler Cowen

https://open.spotify.com/episode/0c4TLkvL0clEHDvqM4wmj7
2•nradov•17m ago•0 comments