Live data from Hacker News

Small Assets without the Headache in Elm 0.19

elm-lang.org

21–30 of 129 posts

Re: Small Assets without the Headache in Elm 0.19

#22

They forgot Mithril[0] in the size comparisons -- I haven't seen anything useful beat it in size/value ratio. [0]: https://mithril.js.org/

The comparison was of RealWorld apps - you should contribute a Mithril one so that comparison would be possible next time!

Here's the link:

https://github.com/gothinkster/realworld/blob/master/README....

Have fun!

Re: Small Assets without the Headache in Elm 0.19

#23

> If you have ever tried to use ADVANCED_OPTIMIZATIONS in Google Closure Compiler, you know that this is extremely difficult even when you write all the code yourself Perhaps, but it’s quite nice when you use languages that were built to support Google Closure from the beginning, like Clojurescript. Then it is painless and built into the build process automatically, and you get to benefit from all the other great adv…

CLJS is awesome too! For what it's worth, Elm 0.19 likely also works with Closure Compiler in Advanced Mode - it did in a quick proof of concept I tried, but obviously that's something you want to be really confident in before suggesting people use it!

Re: Small Assets without the Headache in Elm 0.19

#24

They forgot Mithril[0] in the size comparisons -- I haven't seen anything useful beat it in size/value ratio. [0]: https://mithril.js.org/

Out of curiosity, I've downloaded the Mithril implementation of Conduit from

https://realworld-mithril.netlify.com/

I have minified and gzipped `main.js` and it end up around 26k.

Re: Small Assets without the Headache in Elm 0.19

#26

> If you have ever tried to use ADVANCED_OPTIMIZATIONS in Google Closure Compiler, you know that this is extremely difficult even when you write all the code yourself Perhaps, but it’s quite nice when you use languages that were built to support Google Closure from the beginning, like Clojurescript. Then it is painless and built into the build process automatically, and you get to benefit from all the other great adv…

Leveraging what is already in Closure Compiler was (and is) such a brilliant maneuver by ClojureScript - over the last few years I've seen various current tools gradually gain optimizations that were already in the box with ClojureScript when I built some things with it "forever ago".

The big surprise though, is how few other new library/framework/platform/languages/whatever have followed this path.

Re: Small Assets without the Headache in Elm 0.19

#28

> If you have ever tried to use ADVANCED_OPTIMIZATIONS in Google Closure Compiler, you know that this is extremely difficult even when you write all the code yourself Perhaps, but it’s quite nice when you use languages that were built to support Google Closure from the beginning, like Clojurescript. Then it is painless and built into the build process automatically, and you get to benefit from all the other great adv…

Yes everything I write in Clojurescript gets ADVANCED_OPTIMIZATIONS and works fine. Also I have found that I get a lot more gain without having the language get in my way with functional programming vs strong static typing. Especially when you want to interact with the rest of the JavaScript ecosystem. The development story in Clojurescript is amazing too with figwheel.

Re: Small Assets without the Headache in Elm 0.19

#29

> If you have ever tried to use ADVANCED_OPTIMIZATIONS in Google Closure Compiler, you know that this is extremely difficult even when you write all the code yourself Perhaps, but it’s quite nice when you use languages that were built to support Google Closure from the beginning, like Clojurescript. Then it is painless and built into the build process automatically, and you get to benefit from all the other great adv…

CLJS is awesome too! For what it's worth, Elm 0.19 likely also works with Closure Compiler in Advanced Mode - it did in a quick proof of concept I tried, but obviously that's something you want to be really confident in before suggesting people use it!

Did Elm change how it uses strings as a fundamental part of certain language constructs? That would break the advanced optimizations. According to the github issues tracker as well as mailing list comments from last year, these were not likely going to change in the language and therefore advanced optimizations are very fragile and likely to break on code in subtle ways.

Note that Elm has always appeared to work on the surface with advanced optimizations, but the bugs would creep in and show up eventually, and the official advice has always been not to use those optimizations.

Re: Small Assets without the Headache in Elm 0.19

#30

> If you have ever tried to use ADVANCED_OPTIMIZATIONS in Google Closure Compiler, you know that this is extremely difficult even when you write all the code yourself Perhaps, but it’s quite nice when you use languages that were built to support Google Closure from the beginning, like Clojurescript. Then it is painless and built into the build process automatically, and you get to benefit from all the other great adv…

The "problem" with ClojureScript's integration is that you have to be careful when integrating other javascript libraries (which ClojureScript encourage you to do to save code size) as they might not be compatible with advanced mode. You could also write code in cljs which isn't compatible with advanced mode. Elm doesn't have this problem.

Elm also outputs smaller assets than cljs+closure.

That being said, I do love cljs, having used it on numerous projects myself :)

Post reply on HN