3 ms·
I am writing a game engine in Scheme that uses FRP. My implementation may not be robust since I'm the only user, but perhaps seeing what it can do will help so
by davexunit 12y ago
I am writing a game engine in Scheme that uses FRP. My implementation may not be robust since I'm the only user, but perhaps seeing what it can do will help someone. My implementation was heavily inspired by Elm.
Blog post with screencast to demonstrate:
http://dthompson.us/functional-reactive-programming-in-scheme-with-guile-2d.html http://dthompson.us/functional-reactive-programming-in-schem...
Implementation details:
https://gitorious.org/sly/sly/source/8cf0096791821c7711c9dc2431e4d920f0b678ba:sly/signal.scm https://gitorious.org/sly/sly/source/8cf0096791821c7711c9dc2...
2048 clone written in a reactive style:
https://gitorious.org/sly/sly/source/8cf0096791821c7711c9dc2431e4d920f0b678ba:examples/2048/2048 https://gitorious.org/sly/sly/source/8cf0096791821c7711c9dc2...
Reading the explanation from the Elm folks is what made things click for me:
http://elm-lang.org/learn/What-is-FRP.elm http://elm-lang.org/learn/What-is-FRP.elm
Edit: Also, SICP has 2 sections that describe systems that are reminiscent of reactive programming systems.
A Simulator for Digital Circuits:
https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-22.html#%_sec_3.3.4 https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-22.htm...
Propagation of Constraints:
https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-22.html#%_sec_3.3.5 https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-22.htm...
- seanmcdirmid 12y agoWhy not look at Gregory Cooper et. al.'s FrTime? Its the first FRP system I'm aware of for Scheme, and its quite well used in Racket. It is also a predecessor of Flapjax. http://docs.racket-lang.org/frtime/ http://docs.racket-lang.org/frtime/
- davexunit 12y agoI've read some of this source, too. Thanks.