Live data from Hacker News

IBM releases Elm-powered app

discourse.elm-lang.org

81–90 of 199 posts

Re: IBM releases Elm-powered app

#81
post #25

Anybody who liked elm is highly recommended to check out Scala.js. With scalatags, it looks close to what elm does AND you have the entire power of jvm libs. And you get code sharing across client and server as its just plain old scala. I believe elm is not big server side.

Scalatags is not a VDOM implementation, though, and the Elm architecture (one giant state machine) is very different to what you'd typically see in a Scala.js application. A closer analog, in my opinion, would be ClojureScript + Reagent, but even that doesn't feature Elm's focus around immutability.

ScalaTags is indeed not relevant here, but Scala.js has its fair share of reactive UI libraries such as my own Laminar https://github.com/raquo/Laminar

Re: IBM releases Elm-powered app

#82

Earlier quoted context omitted.

Have you seen ReasonML? [@bs.val] external pi : float = "Math.PI"; let tau = pi *. 2.0; [@bs.val] external alert : string => unit = "alert"; alert("hello"); Elm was trying to make it very hard to use JS in Elm which is always a bad idea when you are a transpiled language. Clojure is so popular because you have access to most of Java and the libraries written in Java. ReasonML makes super easy to use JS (or other lang…

I do not agree that it is "always a bad idea". That is why I use Elm, and not some other compile-to-JS language that allows me more freedom. I don't want freedom. I want constraints. Freedom is the rope with which I can hang myself. Constraints keep my bug tracker silent.

I was(am? will be again?) a fan of Elm. Constraints can be helpful and even liberating(in some sense). But that's something that should be balanced carefully with other things, like rules\laws that are clear, universal and follow the common sense. Unfortunately, during my Elm journey, I've found that's not the case for Elm.

> Freedom is the rope with which I can hang myself.

If you'd like to, why not? It's up to you. You're not forced to do, though.

On the other side, being a hostage of some secret plans in "people in power" minds, you might be forced to do any kind of staff. New constraints are here and they're enforced on anyone. That's a catch with constraints, you can be OK with existing, but you'll never know what comes tomorrow.

Re: IBM releases Elm-powered app

#83

Earlier quoted context omitted.

I never had that impression when I was building projects with Elm, in fact, it felt like I was focusing on the app itself instead of the language and boilerplate. I compared it with JS mess though.

It's quite "vertical" though (which is fine, it just makes LOC comparisons a bit less useful)

That was my thought as well. From what I've seen, canonical Elm uses lines which are quite short.

It's a lot of lines, but how many characters is it?

Re: IBM releases Elm-powered app

#84
post #8

In a comment below the main post they say that the app they wrote is approximately 45,000 lines of code over 170 Elm files. That's one of the largest (and apparently most useful) Elm apps in the wild that I've heard of, and the fact that it exists and they had an overall good experience with it inspires me even more to try to learn and use Elm.

> In a comment below the main post they say that the app they wrote is approximately 45,000 lines of code over 170 Elm files. One thing I've found a bit weird about the Elm community is how common it is to highlight or even brag about the size of the codebases. One of the reasons I have come to particularly enjoy Clojurescript on the front-end is because of how much code I don't have to write. I once ported an Elm ap…

I think you should read this as being an otherwise 150kloc project in Java.

Seriously, at this point IBM should fork a couple hundred thousand dollars just to know how anyone on their staff can recreate this in idiomatic java (or whatever OO language they want) and have you do it in idiomatic clojure/script. I'd be surprised if you managed less than 30k and very surprised if the OO implementation managed less than 100k.

Hard data on this kind of debate being hard to come by, we'd learn something from the experiment.

Re: IBM releases Elm-powered app

#85

I don't understand why this is noteworthy. I think maybe this is when you decide 'maybe our language has failed'. Or at least admit it's a toy language that hasn't been properly engineered to be effectively used commercially. When it's a 'worth mentioning' when a single app has been written in it by some dying company. I mean, imagine if we had a headline on the frontpage of HN for every app written in C or C++ or Ja…

> Functional languages are great toys but nobody uses them to get work done, almost without exception. I run my own businesses on functional programming languages (Haskell and Elm) almost exclusively. 100% of my income comes from the three software products I own, all primarily written in Haskell. You're displaying a pretty amazing level of ignorance here.

[deleted]

Re: IBM releases Elm-powered app

#86

> Ports == lots of boilerplate and “loose” typing This is a common criticism of Elm, and I've never understood it. The criticism seems to be that "Elm is bad because I still need some JavaScript, and JavaScript is dangerous." Like, what's the alternative? More JavaScript?

Have you seen ReasonML? [@bs.val] external pi : float = "Math.PI"; let tau = pi *. 2.0; [@bs.val] external alert : string => unit = "alert"; alert("hello"); Elm was trying to make it very hard to use JS in Elm which is always a bad idea when you are a transpiled language. Clojure is so popular because you have access to most of Java and the libraries written in Java. ReasonML makes super easy to use JS (or other lang…

Elm is different to ML in that it is explicitly designed to be a pure language. Purity is important for the Elm architecture and allowing arbitrary side effects in your apps would break everything.

That said, you could add effects and a JavaScript FFI using monads or algebraic effects. You could also get rid of a lot of boilerplate in the Elm architecture using existential types. It's a safe bet that the Elm developers know this. But all of these extensions would make the language less approachable. I think one of the reasons why Elm is doing so well is because it's not Haskell. :)

Re: IBM releases Elm-powered app

#87

Earlier quoted context omitted.

I do not agree that it is "always a bad idea". That is why I use Elm, and not some other compile-to-JS language that allows me more freedom. I don't want freedom. I want constraints. Freedom is the rope with which I can hang myself. Constraints keep my bug tracker silent.

Most of the people want freedom and not some North Korean style crap. The example I gave was explicitly displaying how it is possible to use something from JS on a type safe way. Not sure how could you hang yourself with that. I guess you are just very creative.

> North Korean style crap

This confirms my belief that most criticisms of Elm are emotional responses, not rational ones.

Allowing arbitrary JS functions to be called from wherever would indeed break everything. Want to use `Math.random()`? Whoops! There goes referential transparency. Want to use `document.querySelector()`? Hello runtime errors my old friend. Want to use `function(x) { return x / 0; }`?

Yeah, have fun with that. I'll stay in North Korea ¯\_(ツ)_/¯

Re: IBM releases Elm-powered app

#88

Earlier quoted context omitted.

Of course you can't hang yourself with `Math.PI` or `window.alert`. Try `Math.random()` and `window.confirm` instead, or much more relevant: `document.getElementById`.

I am not saying that everything is going to be super easy to do this way but taking away my ability of using Math.PI because of document.getElementById is silly.

No, it is not silly. It is referential transparency.

Re: IBM releases Elm-powered app

#89
post #82

Earlier quoted context omitted.

I do not agree that it is "always a bad idea". That is why I use Elm, and not some other compile-to-JS language that allows me more freedom. I don't want freedom. I want constraints. Freedom is the rope with which I can hang myself. Constraints keep my bug tracker silent.

I was(am? will be again?) a fan of Elm. Constraints can be helpful and even liberating(in some sense). But that's something that should be balanced carefully with other things, like rules\laws that are clear, universal and follow the common sense. Unfortunately, during my Elm journey, I've found that's not the case for Elm. > Freedom is the rope with which I can hang myself. If you'd like to, why not? It's up to you.…

> If you'd like to, why not? It's up to you. You're not forced to do, though.

Well, yeah. If I'd like to hang myself, I'd pick a technology with fewer correctness guarantees. As it turns out, that's not what I want. This is self-evident.

It's also not a valid criticism for you to say that you've found Elm doesn't "follow the common sense". This is too vague to be any kind of constructive criticism.

Re: IBM releases Elm-powered app

#90

Earlier quoted context omitted.

Most of the people want freedom and not some North Korean style crap. The example I gave was explicitly displaying how it is possible to use something from JS on a type safe way. Not sure how could you hang yourself with that. I guess you are just very creative.

> North Korean style crap This confirms my belief that most criticisms of Elm are emotional responses, not rational ones. Allowing arbitrary JS functions to be called from wherever would indeed break everything. Want to use `Math.random()`? Whoops! There goes referential transparency. Want to use `document.querySelector()`? Hello runtime errors my old friend. Want to use `function(x) { return x / 0; }`? Yeah, have fu…

I gave you examples of using JS type safe way. You don't care. One question I alway use to tilt FP purist zealots:

How about Time.now()? :) Source of disturbance, it should not be allowed to be used in programming etc. etc.

Post reply on HN