News for hackers. Stuff that matters.
Re:IBM releases Elm-powered app by the_gipsy on Thursday January 10, 2019 @06:37AM (#18873139)
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`.

Re:IBM releases Elm-powered app by StreamBright on Thursday January 10, 2019 @07:00AM (#18873246)
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.
Re:IBM releases Elm-powered app by the_gipsy on Thursday January 10, 2019 @08:47AM (#18873752)
If you absolutely must run unsafe JS interop inline then maybe Elm is not for you, but it doesn't make its approach "silly".

You can run absolutely any JS code, just through the ports API. Trivial things like Math.PI are in the core[1] or some package.

[1] https://package.elm-lang.org/packages/elm-lang/core/5.1.1/Ba...

Re:IBM releases Elm-powered app by StreamBright on Thursday January 10, 2019 @02:54PM (#18877430)
Again, I could not care less what is in core (which might not be there anymore without a deprecation warning) but I want to use JS functions if I need to. How hard is to understand these requirements?
Re:IBM releases Elm-powered app by the_gipsy on Thursday January 10, 2019 @04:43PM (#18878541)
As I said, yoy can use any JS function with Elm. It’s just through ports, not inline.
Re:IBM releases Elm-powered app by yakshaving_jgt on Thursday January 10, 2019 @07:45AM (#18873420)
No, it is not silly. It is referential transparency.