3 ms·
> North Korean style crap This confirms my belief that most criticisms of Elm are emotional responses, not rational ones. Allowing arbitrary JS functions to b
by yakshaving_jgt 8y ago
> 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 ¯\_(ツ)_/¯
- StreamBright 8y agoI 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.
- yakshaving_jgt 8y agoUhh… What? I’m confused. Did you think this would be a smoking gun to your argument? Of course Time.now() is an effectful routine. This is not a strange idea to “FP purist zealots” either. How is it defined in Elm? Time.now : Task x Posix How is it defined in Haskell? Data.Time.Clock.getCurrentTime :: IO UTCTime And no, you have not given any examples of using JavaScript in a type-safe way. If you think you have, it means you don’t adequately understand type-safety.
- chickenfries 8y agoI 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 emotional component. Check out this talk, you might find it interesting: “The Pervert’s Guide To Programming Languages” https://youtu.be/mZyvIHYn2zk https://youtu.be/mZyvIHYn2zk
- yakshaving_jgt 8y agoYour logical fallacy is either Personal Incredulity[0], or Anecdotal[1], or both. [0]: https://yourlogicalfallacyis.com/personal-incredulity https://yourlogicalfallacyis.com/personal-incredulity [1]: https://yourlogicalfallacyis.com/anecdotal https://yourlogicalfallacyis.com/anecdotal
- aarpmcgee 8y agoThe 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.
- sawady 8y agoList.tail []
- yakshaving_jgt 8y agotail : List a -> Maybe (List a) Nice try though. https://github.com/elm/core/blob/master/src/List.elm#L548 https://github.com/elm/core/blob/master/src/List.elm#L548
- sawady 8y agoHaha, sorry. You know what I mean, a partial function.
- yakshaving_jgt 8y agoExcept in Elm, the function isn't partial. You're thinking of the partial functions from Haskell's Prelude.
- StreamBright 8y agohttps://medium.com/@eeue56/top-6-ways-to-make-your-elm-app-crash-at-runtime-562b2fa92d70 https://medium.com/@eeue56/top-6-ways-to-make-your-elm-app-c...
- StreamBright 8y agoOr use some 100% pure referential transparent functions in Elm. https://medium.com/@eeue56/top-6-ways-to-make-your-elm-app-crash-at-runtime-562b2fa92d70 https://medium.com/@eeue56/top-6-ways-to-make-your-elm-app-c... >>> I'll stay in North Korea Please do.
- yakshaving_jgt 8y agoAh. So because the implementation has some bugs, then the concept is fundamentally flawed. Got it. r/iamverysmart