News for hackers. Stuff that matters.
Re:Why I’m Leaving Elm by olvn on Thursday April 09, 2020 @02:15PM (#22825533)
You can call out to JS using ports and custom elements and accomplish nearly everything you could possibly need. This blog post is focusing on a largely undocumented, always discouraged "feature" (used loosely, as even from its inception it was verboten, couldn't be distributed via the official package manager, etc.) which allowed users to hack library support directly into the Elm language while risking (and losing!) many of the guarantees Elm provides. Whether it's a good fit for your startup is another question, but I just wanted to assuage that concern.
Re:Why I’m Leaving Elm by toastal on Friday April 10, 2020 @06:07AM (#22831535)
This is untrue--and I'm not entirely sure you followed the article. You can't do synchronous tasks like Intl's format for strings from floats as many locales use "," over ".". It is a pure function `Float -> String`. This should not have to go through the entire update cycle to handle receiving these kinds of value. Using ports adds async to this equation which means you need to write the ports, and handle and store all temporary values which tightly couples and makes a mess everything.
Re:Why I’m Leaving Elm by maxhille on Friday April 10, 2020 @11:50AM (#22834248)
It is now 'Locale -> Float -> String' or do I miss something?
Re:Why I’m Leaving Elm by toastal on Friday April 10, 2020 @10:27PM (#22839232)
Conceptually it's `Float -> String` once the Intl object is instantiated, but you can't use it in Elm anyhow. You'd have to reimplement and ship the entire in-browser Intl spec.