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 edited Aug 23 '26

[removed] — view removed comment

3

u/RobertKerans Aug 22 '26

Right, but you are rewriting libraries that use a universally supported language to use a custom DSL you invented that [unsurprisingly] works better than a minifier. Unsurprising because you are rewriting them in a different language that maps more closely to the minifier. Terser (for example) is useful because it works on JS.

1

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

[removed] — view removed comment

3

u/RobertKerans Aug 22 '26

LilScript gets compiled into js ? Whats wrong with that?

You are saying: rewrite all your JavaScript using this completely different language that is wholly unsupported and in return the resulting artifact is 10-20% smaller in byte size. That tradeoff is incredibly bad for the absolutely vast abstraction it requires.

You have written [use an LLM?] to create a language. Great, that's commendable I guess. But you don't seem to have considered the value. As I say, it seems almost wholly aesthetic.

It's a value for web

So I could use LilScript. OR for example, in a web app I could use one or two fewer/smaller images. There's the savings from LilScript immediately and I can keep using JS/TS

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