TL;DR Reactive programming is ill-defined and over-hyped, so let's talk about types and math instead (plus some not-very-subtle in-jokes about Microsoft). An enumerator is basically a getter with the ability to fail and / or terminate. It might also return a promise rather than a value. An enumerable is a getter that returns an enumerator. We can express all this very cleanly in generic types. And if we take the cate…
What people really want is managed time.
Erik Meijer: Duality and the End of Reactive [video]
51–60 of 68 posts
Re: Erik Meijer: Duality and the End of Reactive [video]
#52(Shameless self-promotion) I just finished by thesis on a new programming language called SolScript, which is reactive and based on "math". It's a hard real-time language for avionics software, BUT it has type inference and duck typing (everything is "symbolic"). SolScript is supposed to look familiar to anyone with a basic knowledge of mathematics. It's also a literate language, because every SolScript file is a Mar…
Re: Erik Meijer: Duality and the End of Reactive [video]
#53Earlier quoted context omitted.
- real time - avionics - type inference - duck typing You like challenges don't you? ;) I like the literate component a lot, I can see why that would be a very big plus when you're building avionics software. Bookmarked your thesis. What was your reason for going for 'duck typed' and 'scripted' rather than strongly typed and compiled? (Which I would assume to be a whole lot more suited for the intended branch of indu…
Haha, that's a lot of questions. Let me try to go over them. I say SolScript is "duck typed" and "scripted", because that's how it feels to program SolScript. However, under the hood, SolScript is a statically typed, compiled language. About the "spreadsheet" idea, that is exactly what the SolScript IDE (Solide) is going to be. There will be a spreadsheet mode, which displays the source code as a spreadsheet. The las…
Duck typing refers to the ability of making shit up at runtime, as in the ability for functions, classes or code to manifest at runtime and to respond to user queries based on runtime info. It doesn't refer to a lack of explicit types in your code, since in a static language types are still there and still have to be something concrete and solvable at compile-time. It doesn't even refer to structural typing, because again, the types themselves have to be solvable at compile time.
I'm a static languages fan and I've also worked a lot with dynamic languages. The ability to make shit up at runtime is much more than the ability to call a method on an object without being explicit about the interface used. This is not about succinctness as as it about programming style. With an expressive static language used to its strengths, as a developer you want to write code that is as close to provably correct as possible, so even if the static language used is very expressive, the style is oriented around modeling the problem domain with types. In a dynamic language on the other hand, the focus is on the raw data that needs to be manipulated and code is written to make shit up on the fly (i.e. method_missing, eval, classes manifested at runtime by means of meta-programming, etc...).
Hence my opinion that duck typing shouldn't be used outside the context of dynamic languages, because people might get the wrong idea about it.
Re: Erik Meijer: Duality and the End of Reactive [video]
#54Earlier quoted context omitted.
What people really want is managed time.
What kind of scenario are you thinking of? Rx has virtual time with the use of schedulers that enables you to abstract over time, which is very cool. http://channel9.msdn.com/shows/Going+Deep/Wes-Dyer-and-Jeffr...
[1] http://dl.acm.org/citation.cfm?id=3988
Rx is a one trick pony that focuses exclusively on the duality between event streams and data streams. Management of time in any real sense is completely missing from the framework. No continuous bindings, control flow must all be buried as data flow, etc...
React is a much better solution for writing reactive programs than Rx.
Re: Erik Meijer: Duality and the End of Reactive [video]
#55"Reactive is the new agile. Everyone is talking about reactive. Reactive is this, reactive is that" This is the first time I've heard of reactive and read HN everyday. > Java's enumerable( Iterable?) is broken anyone know what how its broken?
Take a look on GitHub at all the projects with reactive in the name or descriptions; it's become a buzzword that people use to describe various things that don't have any relationship to the original.
Iterable is broken, as Erik said, because it has a hasNext() method, and a next() method, which is a problem because hasNext() causes side-effects to be evaluated.
Imagine if the implementation of the iterator has to execute a long running function, or wait for the next value in an observable to be pushed, like an event. So, if call hasNext() twice, then it may cause a side effect so that next() actually has a different result than it would without the side effect. Thus, it is not mathematically, a function, and can't really be used to build monads.
So, unfortunately, due to backwards compatibility, Java classes that implement Iterable/Iterator can't automatically get the benefits of list monads etc..., by simply defining a library of operators that take Iterable/Iterators, like C# could with IEnumerable/IEnumerator.
In C#, IE only has side effects in the MoveNext() method, which returns true or false if there's another element, and the effect is explicit in the name, which helps. However, more importantly, if you get the value from Current, there is no side effect, and you can do that as many times as you like.
With Iterable, if you call next() it moves to the next element. So, it is impossible to get the same value twice with a guarantee of no side effects, and impossible to guarantee mathematically sound composition of Iterables. The interface is broken, and changing it would break nearly every Java program.
Re: Erik Meijer: Duality and the End of Reactive [video]
#56Earlier quoted context omitted.
What kind of scenario are you thinking of? Rx has virtual time with the use of schedulers that enables you to abstract over time, which is very cool. http://channel9.msdn.com/shows/Going+Deep/Wes-Dyer-and-Jeffr...
This isn't really virtual time though, at least as realized by time warp. It's a virtualization of time, for sure, but almost completely unrelated to DR Jefferson's work [1]; no rollback of bad interactions or anything like that. [1] http://dl.acm.org/citation.cfm?id=3988 Rx is a one trick pony that focuses exclusively on the duality between event streams and data streams. Management of time in any real sense is comp…
Are you speaking about React.js? Erik's point about reactive being a buzzword and distorted is proven by that because it's not the same thing at all. React.js is cool and all that but it has nothing to do with guaranteed composition and dealing with side-effects and monadic operators. That's like saying Angular.js is better than list operations and functions that operate on lists.
[1] http://dl.acm.org/citation.cfm?id=37508&CFID=356264587&CFTOK... [2] http://channel9.msdn.com/Shows/Going+Deep/Expert-to-Expert-R...
Re: Erik Meijer: Duality and the End of Reactive [video]
#57Earlier quoted context omitted.
This isn't really virtual time though, at least as realized by time warp. It's a virtualization of time, for sure, but almost completely unrelated to DR Jefferson's work [1]; no rollback of bad interactions or anything like that. [1] http://dl.acm.org/citation.cfm?id=3988 Rx is a one trick pony that focuses exclusively on the duality between event streams and data streams. Management of time in any real sense is comp…
Brian Beckman worked on the Time Warp OS, with Dr. Jefferson [1] and was involved with the development of Rx virtual time. You can read his comment about how Rx virtual time could be used to create a Time Warp monad. [2]. Are you speaking about React.js? Erik's point about reactive being a buzzword and distorted is proven by that because it's not the same thing at all. React.js is cool and all that but it has nothing…
My point was that if you were building user interfaces, react would get you much further than Rx, which is a hammer looking for a problem where it is actually better.
If you want the ability to deal with side effects, I'm working that in my own work while avoiding burying everything in data flow:
http://research.microsoft.com/apps/pubs/default.aspx?id=2112...
Ironically, I started this work while working for Martin with the goal of making the scala compiler more "reactive" (the ability to responsively react to change); I actually succeeded while making minimal changes to scalac. Like actors or FRP, Rx can't be applied to scalac either, which desperately needs to be reactive to fit into the IDE. Rx's idea of reactivity revolves around event streams, virtual, managed time and frameworks like react attack the problem of change directly. Erik is right about useless definitions, but one based around change really works.
Re: Erik Meijer: Duality and the End of Reactive [video]
#58Earlier quoted context omitted.
When you say that he's mocking Microsoft engineers, is that because of the Visual Basic comments? Because Erik actually enjoys VB and was responsible for adding some features to it. He's a former employee, so there's context... And I don't think he's being dismissive of reactive programming, he's dismissive of that definition, which is too broad. He was one of the main proponents of Reactive programming inside Micros…
> When you say that he's mocking Microsoft engineers, is that because of the Visual Basic comments? "In Redmond, like a lot of people talk about code but don't write it, so I think Microsoft can only come back if, you know, they start writing more code." > And I don't think he's being dismissive of reactive programming, he's dismissive of that definition, which is too broad. The definition seems pretty reasonable to…
Re: Erik Meijer: Duality and the End of Reactive [video]
#59Earlier quoted context omitted.
I definitely wouldn't mind watching more of his presentations. He's pretty good.
There's a classic one where he spends 20 minutes mocking the Gang of Four for not realizing that Iterators and Iterables should have a dual. I'll try and find the link.
Re: Erik Meijer: Duality and the End of Reactive [video]
#60Earlier quoted context omitted.
Same here. For the record I think Rx is a lovely piece of work (as is LINQ btw). I can't think of anything I'd change in the bits of Rx that I've used so far.
One criticism is a lack of ability to express things like "back-pressure" where consumers indicate to producers to slow down, stop, etc..
I think ISubject has the interface for a pipe, with IObservable being a Producer equivalent, and IObserver being a Consumer equivalent. So there may be some cunning that could be done with your own implementations [to create an Effect]. (This is just wild brainstorming without looking at the code, so take all of this with a large pinch of salt).
Working within the Rx system, there'd be two ways of doing this:
The Observable has a mechanism for slowing down, but obviously it can't get instruction from observers - so it would have to make a judgment on what is 'too much'; a slow down would affect all observers. Definitely (well probably) not what you want.
The other way is to use the various buffering functions in Rx on the subscription, or roll your own function that has some intelligence. That localises the 'backing up' on a per observer basis, but doesn't slow down the observable itself.
To 'Stop' you could switch your subscription to Observable.Never until you're ready to receive messages. Obviously you'll miss messages generated on the other stream whilst you were not listening.