Reactive extensions to unify async and events

145 views
Skip to first unread message

Naveen Michaud-Agrawal

unread,
Mar 13, 2013, 1:53:01 PM3/13/13
to lu...@googlegroups.com
Hi, 

I've been playing with Luvit for a bit (coming from a python twisted background) and I really like how clean it is. Recently I've been reading a lot about Microsoft's reactive extensions, which are basically first-class asynchronous push objects (like Lua's coroutines are synchronous pull). Has anybody done anything similar in the Lua world (microsoft also has a Js port)? Rx seems like a really nice way to compose both event streams (important in UIs, for example) and asynchronous data processing (IO, concurrency, etc).

Naveen


Ross Bencina

unread,
Mar 14, 2013, 9:31:11 AM3/14/13
to lu...@googlegroups.com
Hi Naveen,

I haven't implemented it in lua but I have been watching Rx too. And
I've been playing with luvit.

My understanding is that Rx is similar to other FRP systems. It seems to
be a kind of composable observer pattern. Elm is another example I've
been looking at: http://elm-lang.org/

Do you understand the underlying implementation mechanisms of Rx?

I'd be interested in working on a lua project like this if you have any
ideas about where to start. I don't think it would be too hard -- I
watched a video where Eric said that they implemented Rx in 2 weeks.

Ross.
> --
> You received this message because you are subscribed to the Google
> Groups "luvit" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to luvit+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Ross Bencina

unread,
Mar 15, 2013, 4:18:18 AM3/15/13
to lu...@googlegroups.com
> Do you understand the underlying implementation mechanisms of Rx?

Sorry to answer my own question, but I think these two videos contain
the main ideas of composable IObserver implementation:

http://channel9.msdn.com/Shows/Going+Deep/E2E-Erik-Meijer-and-Wes-Dyer-Reactive-Framework-Rx-Under-the-Hood-1-of-2
http://channel9.msdn.com/Shows/Going+Deep/E2E-Erik-Meijer-and-Wes-Dyer-Reactive-Framework-Rx-Under-the-Hood-2-of-2

Ross.

Ross Bencina

unread,
Mar 16, 2013, 11:30:30 AM3/16/13
to lu...@googlegroups.com
Hi again Naveen,

I hacked together a proof of concept for the observer mechanism and a
few combinators based on the videos I linked yesterday:

https://github.com/rbencina/Rxperimentalua

No luvit networking event stream yet but you get the general idea.

Probably I will work my way through http://www.introtorx.com/
and implement the core combinators.

I am interested in using this in a variety of contexts for the reasons
you list below.

Best wishes,

Ross.


On 14/03/2013 4:53 AM, Naveen Michaud-Agrawal wrote:

Naveen Michaud-Agrawal

unread,
Mar 16, 2013, 9:01:40 PM3/16/13
to lu...@googlegroups.com
Hi Ross,

Wow, that was quick! :) I'm still pretty rusty in Lua so I've been slowly making my way through the Lua book. I'm really interested in building highly responsive UIs that integrate with external data sources, so I've also been looking for a modern UI toolkit with Lua bindings (I already have experience with Qt).

I found this implementation in Actionscript with some decent wiki pages (https://github.com/richardszalay/raix/wiki), which might also help implementing all the operators.

Anyway, I look forward to following your progress with it.

Re:

Naveen Michaud-Agrawal

unread,
Mar 16, 2013, 9:02:58 PM3/16/13
to lu...@googlegroups.com
In particular, this is a nice summary of the operators:


Naveen

Ross Bencina

unread,
Mar 17, 2013, 10:57:13 AM3/17/13
to lu...@googlegroups.com
On 17/03/2013 12:02 PM, Naveen Michaud-Agrawal wrote:
> In particular, this is a nice summary of the operators:
>
> https://github.com/richardszalay/raix/wiki/Reactive-Operators

Thanks.

Rx Sandbox is a nice interactive explorer for Rx operators:

http://mnajder.blogspot.com.au/2011/05/rx-projects-update.html

I found the link while reading this:

http://stackoverflow.com/questions/1596158/good-introduction-to-the-net-reactive-framework

I use Qt a lot (from C++) but haven't explored Lua bindings for it.

Ross.
Reply all
Reply to author
Forward
0 new messages