Live data from Hacker News

Small Assets without the Headache in Elm 0.19

elm-lang.org

31–40 of 129 posts

Re: Small Assets without the Headache in Elm 0.19

#31

Earlier quoted context omitted.

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 t…

Just glanced through the code for 0.19 (I originally wrote an issue about the advanced opts incompatabilities for 0.18) and the things which caused problems before are gone.

That's not to say that there are not other issues, though.

Re: Small Assets without the Headache in Elm 0.19

#32
post #3

I'm so glad to see this, congrats to Evan and everyone who helped get 0.19 out the door! I've been working in Elm for about a year now and it is a joy to work with, moving from vanilla JS/Angular/React to Elm has been a boon to productivity and I actually have confidence that when I refactor something and have fixed any compiler errors that it is going to work.

We had a lot of trouble doing things without typesafety and declarations, so we tried a few things. Elm was one of the better ones, and we migrated a few minor systems to it. A few others to typescript and we even made a few pocs with Xamarin and Wasm. Then one of my older employees randomly watched “JavaScript the better parts”, and recommended it to me and we’ve been doing classless JavaScript ever since. Elm is gr…

What is classless JavaScript? I don't understand how you had trouble doing things without typesafety but found that going from JavaScript to Elm is a step backwards? Maybe I'm missing something here?

Re: Small Assets without the Headache in Elm 0.19

#34

I’m an happy Elm user; but I wonder if it’s a worth investment to start using Elm when we’re heading to a new ecosystem on top of WebAssembly. I use Go on backend, and would feel satisfied when Go and Webassembly works together fine.

WebAssembly is still far away from being any sort of default for web development yet (if only because IE11 doesn't support it).

I also wouldn't be surprised if Elm compiled to wasm in the future.

Re: Small Assets without the Headache in Elm 0.19

#35
post #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…

This is almost never a problem since you simply use normal externs file for whatever library you are using. You never take an external library and run it through the closure compilation process, only your clojurescript code is put through those optimizations.

Re: Small Assets without the Headache in Elm 0.19

#36

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!

Hey thanks for the pointer! I'd never heard of the realworld example apps repo

Re: Small Assets without the Headache in Elm 0.19

#37
post #34

I’m an happy Elm user; but I wonder if it’s a worth investment to start using Elm when we’re heading to a new ecosystem on top of WebAssembly. I use Go on backend, and would feel satisfied when Go and Webassembly works together fine.

WebAssembly is still far away from being any sort of default for web development yet (if only because IE11 doesn't support it). I also wouldn't be surprised if Elm compiled to wasm in the future.

It's openly a desired/considered goal for Elm to compile to wasm.

Re: Small Assets without the Headache in Elm 0.19

#38
Any upgrade guide? My 0.18 elm project doesn't seem to work with the latest version and the links it tells you to go to don't exist.

This is pretty much consistent with my elm experience, I've never found it professional enough to consider for a production application.

Re: Small Assets without the Headache in Elm 0.19

#40
post #30

Earlier quoted context omitted.

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…

This is almost never a problem since you simply use normal externs file for whatever library you are using. You never take an external library and run it through the closure compilation process, only your clojurescript code is put through those optimizations.

> This is almost never a problem since you simply use normal externs file for whatever library you are using.

"almost never" and "simply use externs file (which you may or may not need to write yourself)" does underpin my point that you have to take care. I'm not saying it is necessarily difficult or takes a long time to get right, but it does require that someone makes sure everything survives the advanced opts compilation.

This has burned me on a past cljs project, it's not even a concern on my Elm projects.

Post reply on HN