Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you want a nice alternative to MVC (or event-based systems in general), take a look at functional reactive programming (FRP). Instead of modelling time implicitly using mutable state and callbacks, FRP provides time-varying values as first-class citizens. I've found FRP to create much neater code for most of the UI tasks I've worked with.


Thanks for that, made me finally go and look up FRP, finding this (again, I think):

http://elm-lang.org/learn/What-is-FRP.elm

It's a nice abstraction when(if) the alternative is to work with the DOM, javascript and browsers -- but the examples would be trivial in a smalltalk-like environment: The various labels would reference the mouse, and on redraw they'd use the current value. So I'm not sure it's so much an alternative to MVC as it is a fix for our broken environment (the browser+dom+i/o as a GUI system).


Bookmarked, thank You.

Mind sharing a bit about Your experiences? Are the initial investments cost high or low? Are there any drawbacks which inhibit any other functionality (what to do to avoid memory leaks)? Is the end-product really mantainable? Does compose easily?

I'm eager to learn :)




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: