Bart De Smet: MinLINQ - The Essence of LINQ
Rx team members and programming super heroes Wes Dyer and Bart De Smet explain the latest powerful additions to Rx: Join and GroupJoin. Wes describes the approach they took to design and implement this reliable approach to programming streams of coincindence with Rx. All of the time is spent at the whiteboard. You can play with this by downloading the latest version of Rx:
Charles: Everyone can now see you do do work. (Reflection in Window).
Window reflecting Charles. It's actually subtly related to the topic at hand. Listen carefully.
C
The rx guys never sleep. They live in one big window of work.No but seriously I can see how those operators can be powerful! Great job.Keep it up guys.
@dream: Actually, Bart does not sleep.
Erik's team is the most productive team of developers I've ever seen. It's hard to believe how much great code they crank out in a 24 hour period. I can't talk about what they are currenly working on, but you can imagine it will be quite excellent!
One of the coolest things about Erik's team is that there is no ego maniacal madness hovering about. These folks are just pure engineers, humble, creative, passionate and brilliant.
C
Beautiful. I've read the name of the topic first as "Programming streams of Consciousness" ![]()
@Charles: They are the best indeed!
Hm, very interesting developments.
Now I'm thinking that IO<IO<T>> can actually model observable collections (not related to Rx, implementing INotifyCollectionChanged interface) with events being 'element is inside collection at specific position'. Then we can get LINQ to observable collections for free.
Just wanted to point out the that Window operator is really GroupBy. Which is how I implemented my generalized family of time sliced operators in my (small) personal Rx rewrite. The type signature Wes mentioned at the beginning of the video is also the same as IGroupedObservable<TKey, TValue>'s. I was expecting he would mention it.
GroupJoin seems like a very interesting find indeed, still've got to figure out what it implies exactly. What I'd like to ask is except for the Window derived branch, what other operators are you implementing/planning to with it? Join and CombineLatest are givens, are there any others I'm not quite seeing yet?
Finally, though, why all the secrecy? xD
Cheers. And yes, you rock.
@RafaelHTS:
Yep, GroupBy and Window are closely related. As you mention, IGroupedObservable<TKey, TValue> is really the same as IObservable<(TKey, IObservable<TValue>) which is the type that is indicated in the video. We are planning other related changes, so yes I think you will see more in this area.
Not sure if I get all of it, I guess I have to watch it again.
It would be very helpful to look at some samples. Also, it looks like the discussion is based on embedded assumption that observations of the events are direct. I wonder how it all change if observations were indirect - for example when you are trying to reconstruct flow of events based on gathering clues. Stream of clues is directly observable (and ordered in time), while pointers to the event stream of interest can be to the past or future times or be just durations without definite starting time points. Would Rx be useful in this case?
Nice interview and pretty novel ideas at play here.
(@Charles: I find humbleness a common trait in great programmers (and its opposite detractive). The slight arrogance afforded by someone who has crafted a superior solution doesn't hurt though (e.g. Erik bashing the mishmash that is the Java Iterator interface vs the simplicity of IO, and its IE duality.)
Interesting Interview
Is the trait an effect because they do programming?
An effect of being humbled by the compiler and/or runtime returning error and/or exceptions.
A great programmer thinks about problem, analyses it.
So is Programming a subset of Philosophy?
An observation of some people (particularly non-programmers) I know (no names) struggle with the basic concepts that programmers take almost for granted.
They make logical fallacy of
Both X and Y, I believe both to be True that this also implies Z must also be True.
That the same Effect (this happened) could be the result of different Causes.
Dealing with unknowns, they struggle accepting I don't knows;
"Where is {x}?"
"I don't know"
"What do mean you don't know?"
"I don't know where {x} is?"
You can replace with any question
.They think you're lying and do know, and then construct a conspiracy to support, that belief.
This suggests (to me) that Psychology also has role to play.
So how do you define a great programmer?
public class GreatProgrammer {
public Magic Magic { get; set; }}
;)
@Charles:[quote]
2 days ago, Charles wrote
@dream: Actually, Bart does not sleep.
Erik's team is the most productive team of developers I've ever seen. It's hard to believe how much great code they crank out in a 24 hour period. I can't talk about what they are currenly working on, but you can imagine it will be quite excellent!
One of the coolest things about Erik's team is that there is no ego maniacal madness hovering about. These folks are just pure engineers, humble, creative, passionate and brilliant.
C
[/quote]
Could not agree more, makes you kind of proud to be a part of this bunch called programmers/computer scientists:)
Kinda hard to imagine a non-sleeping Bart though;)
Kudos to you Charles for making it happen, thanks to You we can taste the technology straight from the oven:)
@dream: I produce my best code with little sleep, so I try to live such a rhythm
. Nothing's more lovely to watch than a new day being born in the summer with the first traces of daylight appearing around 5AM through the 21st floor windows. I think I'm one of the lucky few to survive on little sleep (~4 hours on weekdays).
Thanks for the kind words. Back to the bakery now, the oven is heating
.
If I understand this correctly, people entering/leaving a room can be modeled like so:
IObservable<Person> peopleEnteringRoom = ...;
class Person
{
public IObservable<object> LeaveRoom;
...
} In this case, I don't have any information to communicate when a person leaves the room, that's why I chose IObservable<object>. I've implemented a person leaving as such:
person.LeaveRoom.OnNext(null); person.LeaveRoom.OnCompleted();
Is this the correct, or recommended, way to implement this?
Great video! Sounds like Windowing is a powerful tool being added to the Rx toolkit. My question is how do you filter a stream of streams? I tried using BufferWithTimeOrCount in a Windows Phone 7 project using both the old version that returns a list and the new version that returns an IObservable. In the old version I could do simple Where x.Count == 1 to see if only one item was produced, but in the new version I can't figure out how to implement a where clause on an IObservable<IObservable<T>>. There is a xs.Count() method, but it retuns an IObservable<int> not an int.
I think some concrete examples would help. Also I think I need to sleep on it and try again in the morning ![]()
Why not model time as yet another stream of events? I know time is best looked at as continuous and there could be stability issues, but in a digital computer system, time is ultimately discrete.
That way, questions about coincidence of events can be addressed simply by determining order of events. Sliding windows are also trivially made by slicing a time stream.