Live data from Hacker News

IBM releases Elm-powered app

discourse.elm-lang.org

121–130 of 199 posts

Re: IBM releases Elm-powered app

#121

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…

Or use some 100% pure referential transparent functions in Elm.

https://medium.com/@eeue56/top-6-ways-to-make-your-elm-app-c...

>>> I'll stay in North Korea

Please do.

Re: IBM releases Elm-powered app

#122

Now that we have ReasonML, which has a more predictable and sustainable release cycle, and large support, as well as functional programming from OCaml and smoother JS interop when that's desired, what does Elm still bring to the table? When Elm was originally developed, there wasn't a viable alternative for those who wanted good statically-typed FP in the browser, but it would seem now that new apps in this style of…

I would take F# + Fable over Reason since Reason doesn't have computation expressions or do-notation

Re: IBM releases Elm-powered app

#123

Earlier quoted context omitted.

> 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 literally have never experienced a bug because of the existence of Math.random(). I don’t think I’ve ever used it outside of a coding interview. Similarly, I don’t spend time debugging runtime errors caused by document.querySelector()? If I do it’s usually only once when I write the initial query. I don’t understand your last argument: why would I divide by 0? Everyone’s relationship to their tools of choice has an…

The core question is, "have you ever experienced a runtime error?" Have you ever spent time debugging a runtime error deployed to production?

You can't get those in Elm.

Re: IBM releases Elm-powered app

#124

This inspired me to look up the Elm docs, and came across this gem: view model = div [] [ button [ onClick Decrement ] [ text "-" ] , div [] [ text (String.fromInt model) ] , button [ onClick Increment ] [ text "+" ] ] The html elements themselves are Elm functions. Code looks like data. Nice. Now considering Elm to be potentially useful tool to know.

That's how literally every VDOM-based framework looks, including React. Elm isn't special in this regard. It is special in many other regards, however, and I appreciate it for that. It's also interesting as one of the few languages that have parametric polymorphism but no ad-hoc polymorphism, which leads to some interesting designs. I don't like how only the BDFL is allowed to do certain things, like create new opera…

"I don't like how only the BDFL is allowed to do certain things, like create new operators in external libraries"

Isn't this true for like, 95% of languages? Yes, Elm breaks from it's Haskell heritage in this regard, but this is a very common lack of feature.

Re: IBM releases Elm-powered app

#125

Earlier quoted context omitted.

> 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 literally have never experienced a bug because of the existence of Math.random(). I don’t think I’ve ever used it outside of a coding interview. Similarly, I don’t spend time debugging runtime errors caused by document.querySelector()? If I do it’s usually only once when I write the initial query. I don’t understand your last argument: why would I divide by 0? Everyone’s relationship to their tools of choice has an…

>>> I literally have never experienced a bug because of the existence of Math.random().

You must be doing something wrong than. :)

The world is impure. Pretending it is not is just laughable. I am saying this and I am actually writing only functional code for living, but I understand when I cannot solve the problem with functional concepts.

Few example:

- now()

- random()

- runSqlQuery()

- open a file

My code might be 90% pure functions but the rest is mutations, handling non-idempotent things, dealing with state, as the world is.

Re: IBM releases Elm-powered app

#126
post #82

Earlier quoted context omitted.

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.

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

That's exactly what I'm talking about. I'd also like to pick up some "silver bullet", like Elm(if I got you right), for any new project.

Unfortunately, real world is usually a little bit more complicated than "I'm free to pick up any technology that I want. All browsers are the same, their behavior is consistent, mobile web is pure joy and all of our users know their plugins might cause an issue to our app, therefore they're disabling them when they launch our app".

Anybody who does webdev knows that. Different projects, different requirements(sometimes very, very strange), brand new requirements right before the release, deadlines, etc. There're lots of things you have to deal with to end up with a good website\app. Picking a language with nice "correctness guarantees", is not going to help you much.

There were times, long time before 0.19, when there were at least discussions on effect managers, extending the type system, native modules were a nice escape hatch to fix your problem at hand with nasty browser bug or even Elm runtime issue. Those were times when I was so excited to use Elm, did some tiny (sub)projects in it, did a workshop at the office.

Since then, many things have changed to the worse, imho. Some features were removed, not even deprecated. No public discussions, no roadmap, no bugfix releases, no escape hatches for special cases. But who cares what some random guy on the internets thinks :)

Don't get me wrong, I think Elm is a great experiment in the land of static languages, lots of great stuff is getting into mainstream languages(like Elm architecture, error msgs). I still hope we'll see the 1.0 version and things might get better in terms of feature stability, feedback and building things a little bit more complex than counter apps without hitting even more pain points than we have with modern JS\TS.

Re: IBM releases Elm-powered app

#127
post #105

Earlier quoted context omitted.

> guaranteed support for time-traveling debugger and model serializability. How would one do this in OCaml if it allows mutable data (possibly cycle dependencies) and JS FFI? The ReasonML debugger supports time-travelling as one of its features. The Bucklescript compiler that backs ReasonML provides dead-code elimination.

> The ReasonML debugger supports time-travelling as one of its features. Yes, but the question is: does it guarantee to be working or is it only "sort of" working? Can your view do side-effects? Can it call JS? If yes -- it will break soon. > The Bucklescript compiler that backs ReasonML provides dead-code elimination. I didn't say it doesn't. I said it will be way more poor than the one Elm has. I don't have the lin…

Interesting since OP says time-traveling is not mature in ELM

Tooling isn’t mature. IDE plugins, time travel “debugger” : they cannot compare yet with our usual Dev XP for TS

Re: IBM releases Elm-powered app

#129
post #36

Shameless plug - I'm trying to improve upon Elm and React's programming model with my Concur UI framework. Its programming model is a bit unusual, it uses Monads to sequence widgets in time, but it is designed to be extremely simple to use, and you don't need to actually understand Monads to use it. An advantage is that it's not artificially restricted like Elm, and allows you to use advanced Functional Programming t…

I've always thought that Elm was like Purescript in the way that it was just another way to bring the good parts of Haskell (a good type system) into JS. I didn't consider elm's architecture as the main value proposition -- if you squint it looks just like every other data management model for component-based approaches these days -- flux, redux, etc all work in a similar way, +/- immutability. Hopefully people aren'…

Elm isn't a general purpose programming language. You can only write web-apps with it you can only use TEA (the elm architecture). In that way, the TEA really is it's main value proposition.

Re: IBM releases Elm-powered app

#130

Earlier quoted context omitted.

I literally have never experienced a bug because of the existence of Math.random(). I don’t think I’ve ever used it outside of a coding interview. Similarly, I don’t spend time debugging runtime errors caused by document.querySelector()? If I do it’s usually only once when I write the initial query. I don’t understand your last argument: why would I divide by 0? Everyone’s relationship to their tools of choice has an…

>>> I literally have never experienced a bug because of the existence of Math.random(). You must be doing something wrong than. :) The world is impure. Pretending it is not is just laughable. I am saying this and I am actually writing only functional code for living, but I understand when I cannot solve the problem with functional concepts. Few example: - now() - random() - runSqlQuery() - open a file My code might b…

> The world is impure. Pretending it is not is just laughable.

Not a single "pure FP zealot" would argue against this. The fact that you imply this again reveals your ignorance.

People who know what they're talking about know that you can't model effectful routines with pure functions. That's why a function that gets the current time, or generates some random number, or talks to a database, or talks to the filesystem, has `IO` in the type signature.

I have already demonstrated this to you. Perhaps you have some difficulty with reading.

FP folks would never pretend a program that has zero effect on the world is useful.

Post reply on HN