ATS and functional reactive programming

103 views
Skip to first unread message

gmhwxi

unread,
Apr 6, 2015, 10:48:55 PM4/6/15
to ats-lan...@googlegroups.com

I taught a bit of functional reactive programming (FRP) recently.

Since Bacon.js is getting quite popular these days, I built a tiny interface
in ATS for some functions in Bacon.js. Here are some links to several short FRP
examples making use of this interface:

http://www.cs.bu.edu/~hwxi/academic/courses/CS520/Spring15/assignments/08
http://www.cs.bu.edu/~hwxi/academic/courses/CS520/Spring15/code/lecture-04-06/Bacon.js/
https://github.com/githwxi/ATS-Postiats-contrib/blob/master/contrib/libatscc/libatscc2js/SATS/Bacon.js/baconjs.sats

Personally, I find doing this kind of FRP in ATS quite interesting. Typechecking
in ATS can go a long way to detect potential coding errors, resulting in the generated
JS code (from ATS source) being of quite high quality as far as  correctness is of the
main concern.

Brandon Barker

unread,
Apr 7, 2015, 1:37:40 AM4/7/15
to ats-lang-users
Incidentally, I just got this in my email shortly after this message: https://www.coursera.org/course/reactive
Though, it is in Scala.

--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/702567eb-ecba-4aa5-beea-de0f11a3471c%40googlegroups.com.



--
Brandon Barker
brandon...@gmail.com

Andrea

unread,
Apr 7, 2015, 5:36:25 AM4/7/15
to ats-lan...@googlegroups.com
Yep, lot of Scala and Akka. But some more generic stuff too. The only thing is that I can't follow Erik Meijer so easily

Raoul Duke

unread,
Apr 7, 2015, 1:41:44 PM4/7/15
to ats-lang-users
So BTW FYI there are *actual nuances* to Reactive engines, I think.
There are various flavours; there are various optimizations. That's
all I know. I'm not experienced or smart enough to be able to explain
what they all are. I know some depend on the programming language used
e.g. Monads vs. Arrows in Haskell implementations of FRP. There's Elm,
there's RDP, etc. My point being that when I hear that somebody has
made a reactive engine, I am suspicious -- did they do it RIGHT? Did
they know enough to do it right? Or to even know that they aren't
doing it right? Do they have glitches, transient states, can they
handle cycles, do they have time/space leaks, etc.

gmhwxi

unread,
Apr 7, 2015, 2:00:03 PM4/7/15
to ats-lan...@googlegroups.com

You ask too many tough questions :)

A claim often made by some proponents of FRP is that it can help
simplify reasoning involved in reactive programming. This may or may not
be true depending on whether you consider clearly understanding the underlying
implementation of FRP is a prerequisite.

I think I do see some values of FRP. However, writing code in FRP style does
seem to require one's ability to perform "mental acrobatics" from time to time.

 

Yannick Duchêne

unread,
Apr 7, 2015, 2:56:34 PM4/7/15
to ats-lan...@googlegroups.com


Le mardi 7 avril 2015 04:48:55 UTC+2, gmhwxi a écrit :

I taught a bit of functional reactive programming (FRP) recently.


I did not knew about this buzz before this thread. I'm reading this: https://www.zweitag.de/en/blog/technology/functional-reactive-programming-frp

That's not something new to me (I already did similar things). If this buzz can help to define some common vocabulary for these idioms, then it may be nice (naming idioms is often hard).
Reply all
Reply to author
Forward
0 new messages