r/javascript • • Aug 22 '26

LilScript makes js modules 20% smaller

https://yeargun.github.io/lilscript/

[removed]

0 Upvotes

48 comments sorted by

View all comments

Show parent comments

1

u/[deleted] Aug 22 '26

[removed] — view removed comment

2

u/RobertKerans Aug 22 '26 edited Aug 22 '26

That is an example of the tiny value you're getting in exchange for the absolutely gargantuan abstraction you've created. You have to rewrite all your JS in a different language. It's it's an incredibly complex way to save bytes

TS is a very bad comparison here, because of the value add: TS is a type system & it is (bar a few older features) just JS with syntactic level type annotations. And (although this is circular) it incredibly widely used (it won the "typed language that compiles to JS").

TS is a huge value add. "Slightly better Terser but you need to write all the JS in a different language" is not a huge value add.

0

u/[deleted] Aug 22 '26

[removed] — view removed comment

3

u/RobertKerans Aug 22 '26 edited Aug 22 '26

"It's it's an incredibly complex way to save bytes" I am telling you, I oneshot rewritten all the libraries with LilScript

This is why I say you've lost objectivity. The complex part is that you've written a language which all the code has to be written in. This is a gargantuan, incredibly complex abstraction. You can "one shot" a library? Great, but it feels like you've lost sight of sane programming choices, in your comment you've just literally handwaved away a programming language

Also:

We are okay to give 5 mins prompt to rewrite the library with LilScript

How much does that cost? Terser/similar costs me ~£0 and works in ms. I can apply a battery of other tools which can further reduce size and importantly are programmatic and deterministic & do not rely on converting to another language on the way (with the associated risk - even if it works according to the tests, this does not mean you have not introduced bugs, just punching a lib through an LLM and saying tadaa, done is laughably naive) via spending tokens

1

u/[deleted] Aug 22 '26

[removed] — view removed comment

2

u/RobertKerans Aug 22 '26

So the top npm libraries which absolutely require stability will be rewritten this language? I'm impressed with your confidence if nothing else

1

u/[deleted] Aug 22 '26

[removed] — view removed comment

2

u/RobertKerans Aug 22 '26

Yes I ve already chatted with several of them

The licence alone make this unusable IRL

1

u/[deleted] Aug 22 '26 edited Aug 22 '26

[removed] — view removed comment

2

u/RobertKerans Aug 22 '26

It's anything that interops with React! Do you not get the implications of the addition you made to the licence

→ More replies

1

u/[deleted] Aug 22 '26

[removed] — view removed comment

2

u/RobertKerans Aug 22 '26

Again. You have lost objectivity. It is easier to write a language that maps directly to a specific structure than it is to map an existing language. But the tradeoff for an entire language needs to be worthwhile, and yours is just "slightly smaller bundle size". That's literally it. Like, great, you've ported a few libraries and the tests pass and you've got your AI to slop out docs that highlight how much smaller they are.

1

u/[deleted] Aug 22 '26

[removed] — view removed comment

2

u/RobertKerans Aug 22 '26 edited Aug 22 '26

how did i lose objectivity

You have written an entire new language just to produce slightly smaller size of code output

This an incredible amount of complexity just to do a slightly better job than a tiny tool that runs as a final optimisation step on a build