Live data from Hacker News

Elm – functional reactive language for interactive applications

elm-lang.org

11–12 of 12 posts

Re: Elm – functional reactive language for interactive applications

#11

Earlier quoted context omitted.

>However, can someone please tell me why Elm needs two kinds of values? Because not all values depend on/change with time. A euclidean distance function is the same no matter when in time it exists. But, the distance between a player and an enemy is something that changes with time. So, you'd want to lift the euclidean distance function onto a signal like 'lift2 distance playerPos enemyPos'. I don't actually program…

But why not make the "lifting" implicit? If you put a signal into "distance", you get a signal back.

There was a discussion about this on the Elm mailing list: https://groups.google.com/d/topic/elm-discuss/PNtOH2CDHZo/di...

Re: Elm – functional reactive language for interactive applications

#12
post #9

Curious why the Mario demo is running at ~24FPS, and jumps to 45FPS when the keyboard is active. Is it throttling frames on purpose? Why can't it hit 60FPS for such a simple demo? It doesn't inspire much confidence for a language targeting interactive media. http://elm-lang.org/edit/examples/Intermediate/Mario.elm Otherwise it looks great. :)

The code for the Mario demo has a signal every 1/25th of a second due to the (fps 25) function call in it.

I'm not entirely sure why its updating more on keyboard, I just started using Elm but it could be related to the demo combining fps and key events into a single pipe and reacting on it. So by hitting keys you may be emitting extra events it needs to react to.

Post reply on HN