Live data from Hacker News

Small Assets without the Headache in Elm 0.19

elm-lang.org

71–80 of 129 posts

Re: Small Assets without the Headache in Elm 0.19

#71
post #32

Earlier quoted context omitted.

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?

https://web.archive.org/web/20151029152324/http://ericleads....

https://weblogs.asp.net/bleroy/crockford’s-2014-object-creat...

Once you start doing this, most other languages become obsolete. Because you avoid most of the problems of JS that things like elm try to fix, while maintaining the freedom and also writing a lot less code because you don’t have to write a “recipe” for half the things you write.

The disadvantage of JS is that it’s actually going in the wrong direction. Class is an attempt to copy C-style languages, and that really what you don’t want to do, because as soon as you use inheritance, the “this” keyword or “new” you’re basically doing JAVA/C#/whatever with all the downfalls of JS.

Re: Small Assets without the Headache in Elm 0.19

#72
post #32

Earlier quoted context omitted.

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?

I had to find out: this is Douglas Crockford on it: https://youtu.be/DxnYQRuLX7Q?t=2734

Re: Small Assets without the Headache in Elm 0.19

#73
post #66

Earlier quoted context omitted.

> Once people start using Elm the way it was designed to be used, things become simple and start to flow. But how will anyone ever get anything done, when they can't make everything in their code exceptionally clear by wrapping it all up in a 15 monad thick monad-combinator? /s But yes, I totally agree. Elm is a simpler, safer and easier Haskell for the front-end. I just love it :)

The idea that wanting to use typeclasses in Elm is an impedance mismatch would be more convincing if Elm and its standard library truly did everything without them, using alternate approaches like explicit dictionary passing. But as you probably know, they don’t. Instead, the language has special syntax for three builtin “typeclasses”: comparable, appendable, and number. And the standard library uses them: its Dict,…

While I agree, I honestly don't care. It's a bit of magic, yeah, but at least we're rid of the insane amount of mental masturbation that permeates the Haskell ecosystem.

Re: Small Assets without the Headache in Elm 0.19

#74

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.

To target the web, you need a team dedicated to building HTML library stuff like interaction with the DOM. It's unclear whether Go even has that, and it will take longer to see if it proves popular, so waiting for Go for generic UI seems very premature.

On the other hand, Elm is not 1.0 yet. They are still breaking the ecosystem with new releases.

Re: Small Assets without the Headache in Elm 0.19

#75
post #32

Earlier quoted context omitted.

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?

https://web.archive.org/web/20151029152324/http://ericleads.... https://weblogs.asp.net/bleroy/crockford’s-2014-object-creat... Once you start doing this, most other languages become obsolete. Because you avoid most of the problems of JS that things like elm try to fix, while maintaining the freedom and also writing a lot less code because you don’t have to write a “recipe” for half the things you write. The disadvan…

That's not classless. It's just class using factory instead of constructor for object instantiation.

Re: Small Assets without the Headache in Elm 0.19

#76
post #66

Earlier quoted context omitted.

> Once people start using Elm the way it was designed to be used, things become simple and start to flow. But how will anyone ever get anything done, when they can't make everything in their code exceptionally clear by wrapping it all up in a 15 monad thick monad-combinator? /s But yes, I totally agree. Elm is a simpler, safer and easier Haskell for the front-end. I just love it :)

The idea that wanting to use typeclasses in Elm is an impedance mismatch would be more convincing if Elm and its standard library truly did everything without them, using alternate approaches like explicit dictionary passing. But as you probably know, they don’t. Instead, the language has special syntax for three builtin “typeclasses”: comparable, appendable, and number. And the standard library uses them: its Dict,…

Elm handles those things the way Standard ML does, not the way Haskell does.

It's cool if you prefer the way Haskell does it, though! You should check out PureScript, which chose to do it the way Haskell did it.

Re: Small Assets without the Headache in Elm 0.19

#77
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.

Just wanted to say what a joy it has been to work with the 0.19 compiler. For the project at https://knode.io, it was a game-changer: the elm/parser library is so fast that it makes live rendering of LaTeX to HTML a reality.

See

- Demo: https://jxxcarlson.github.io/app/miniLatexLive/index.html

- Blog post: https://medium.com/@jxxcarlson/elm-0-19-its-parser-and-minil...

Many thanks to Evan for this amazing release. The wait for it was very much worth while. Faster compiling, smaller asset size, and more. Yay!!

Re: Small Assets without the Headache in Elm 0.19

#78
post #40

Earlier quoted context omitted.

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

I guess it all boils down to how you want to spend your time. Elm typically requires at least 4x the lines of code and at least 10x the time of dealing compilation issues compared to Clojurescript. So ultimately I think this is just a question of a desired workflow in one language vs. another. Any time spent on Closure-related issues (which have never personally bit me on any project -- I just use the library itself…

Your experience is different than mine, but I don't believe externs inference was in last time I built a cljs web app.

I still use Clojure as a backend language (I'll never give up Datomic) and while writing code in Clojure is usually faster, I spend much, much more time in debugging, often because of type errors, and especially after re-factoring. In Elm I spend more time up front, but less time overall.

I've been writing Clojure for six years now, Elm for three. There are definitely usecases where I'd pick Clojure(Script) over Elm, but for those usecases where it doesn't matter which of those you pick, I'd choose Elm any day of the week.

This is not to say Clojure(Script) is bad. In my opinion, Clojure and Elm are the best languages around.

Re: Small Assets without the Headache in Elm 0.19

#79

Earlier quoted context omitted.

> Additionally I'm glad .19 finally came out. But 18 months was really long. On the basis that nothing was actually broken 18 months is not that long. I think there are benefits to be derived from working with a language/platform/ecosystem that doesn't change every few weeks. Just think about how many changes Angular has had in that time...

Not sure if "nothing was actually broken" is true... very few of the dependencies from my 0.18 project work with 0.19.

I think he was saying that during those 18 months of 0.19 development, everything was stable.

0.19 is very much a breaking change.

Re: Small Assets without the Headache in Elm 0.19

#80
Since there are some Elm users in this thread, I'll ask here: What's currently the best way to integrate an interactive map (i.e. zoom, pan, draw polygons, etc.) into an Elm application (something like leafletjs)?

If I search for it, I find https://package.elm-lang.org/packages/kennib/elm-maps/latest but the examples are not working for me, it feels like some mouse events get missed?

E.g. here: https://kennib.github.io/elm-maps/examples/Fullscreen

[edit]

Ok, it's not working for me on Firefox, but does seem to work better on Chromium (although some tiles are not rendered, but that might also be a server-side issue). Map support is crucial for me and was the reason I didn't dive into Elm so far, but maybe the problem is resolved now?

Post reply on HN