Hacker News new | past | comments | ask | show | jobs | submit login

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.



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


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?


As I said, yoy can use any JS function with Elm. It’s just through ports, not inline.


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




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: