top | item 7887575

Erik Meijer: Duality and the End of Reactive [video]

98 points| malbertife | 11 years ago |channel9.msdn.com | reply

65 comments

order
[+] AlexanderDhoore|11 years ago|reply
(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 Markdown file (and SolScript code is inside Markdown code blocks).

[link redacted]

[+] lomnakkus|11 years ago|reply
Just had a little glance (I'm on my way out the door), but if it's possible to construct arbitrarily large lists (as seems to be implied by the availability of e.g. "range N" for any N, how can you guarantee that e.g. "sum large_list" can actually terminate within the time bound set by the frequency?

Also there seems to be no actual proof of safety of the language's semantics (are the semantics formally specified?), but perhaps I missed it.

[+] jacquesm|11 years ago|reply
- 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 industry, so that has me curious.)

At the surface of it this looks like a 'textual spreadsheet' with the lines replacing the cells of the sheet.

This 'spreadsheet' is then evaluated 'x' times per second to satisfy the hard real time requirements.

How do you stabilize the results from one 'tick' to the next? Do you keep a shadow copy that you work on with all the results posted to the next generation?

There is something funny about a person working for a small software outfit choosing a format for textfiles (for really good reasons) because Microsoft or Apple might not be around when the files need to be read. I get your reasoning and agree with it completely but you have to balance that against the chances of your own company not being around anymore either.

How much of the software of the original Boeing 747 is still in use today? I'd imagine there are no fuselages that have not been upgraded multiple times since the first 747's took flight. So the lifespan of the documentation is roughly the same as the lifespan of the software.

Are there any public sources out there?

Here are some of the oldest 747 airframes known to be still on active duty:

http://www.airliners.net/aviation-forums/general_aviation/re...

But that does not say much about the avionics in them.

Do you intend to release the source to solscript in order to profit from the 'many eyes' out there to reduce the number of bugs in the runtime? (Which can't be written in solscript, so effectively will have to be written in some unsafe language.)

I like that markdown trick a lot, that's applicable to just about every programming environment, see:

http://michael-sokol.tumblr.com/post/13112309135/literate-pr...

[+] DavidSJ|11 years ago|reply
Very interesting work. Is there a development list or some other way to follow progress?
[+] vanderZwan|11 years ago|reply
Any reason why the thesis itself isn't presented a complete and valid SolScript program? ;)
[+] Pitarou|11 years ago|reply
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 category-theoretic dual of these types we get the observer and observable types.

So who needs reactive? ;-)

[+] seanmcdirmid|11 years ago|reply
What people really want is managed time.
[+] shaydoc|11 years ago|reply
i thought it was a good presentation, however, I recently watched a Netflix one, published by Matt Marenghi, which to me was infinitely better.

I think the description of events as just another collection, albeit a time based collection flow was nicer ( Observable === Collection + Time ), and also that this collection must have the ability to tell you that it has terminated.

https://www.youtube.com/watch?v=XRYN2xt11Ek

[+] brodo|11 years ago|reply
Watched both talks and the Netfix one is really way better.
[+] virtualwhys|11 years ago|reply
and Scala is now his favorite language, interesting stance to take for a previously prominent member of the Haskell community.
[+] skrebbel|11 years ago|reply
He's an independent consultant now. I suspect the market for companies willing to consider Scala is a lot bigger.

If you want statically typed functional programming, but also functional programming that stands a chance of adoption in many environments, then Scala is about your only choice.

[+] dominotw|11 years ago|reply
"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?

[+] auxon0|11 years ago|reply
He's saying people are turning it into a buzz word that is losing it's true meaning, so instead of the buzz word, think of what it's really all about: composing and managing side-effects. Take a look at Google Trends for "Reactive Programming", it spiked over the last year or so,: http://www.google.com/trends/explore#q=reactive%20programmin...

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.

[+] coldtea|11 years ago|reply
>This is the first time I've heard of reactive and read HN everyday

You're not paying enough attention. There were tons of articles on reactive on the front page, at least 1-2 per week, for the last year or so. See also: "functional reactive programming". See also: "React.js". See also: "Om".

https://www.google.com/search?q=site%3Anews.ycombinator.com+...

[+] stusmall|11 years ago|reply
He starts talking about that at ~23min. You will probably need to watch the whole video up to there to understand the context and why it is important to him.
[+] ahvetm|11 years ago|reply
tl;dr: Languages offer ways of composing side effects. Delay is just another side effect and "reactive" isn't that special.
[+] Pitarou|11 years ago|reply
I think there's a little more to it than that...
[+] noelwelsh|11 years ago|reply
The first six minutes alone are worth a listen if you're in a rabble-rousing mood.
[+] haberman|11 years ago|reply
Wow, I listened to the first six minutes on your recommendation and was pretty put off.

The speaker mocks his audience of Microsoft engineers (like not in fun, he is really saying their culture sucks).

He is dismissive of "reactive programming" as nonsense from architecture astronauts, without giving a remotely fair description of what it actually is. His straw-man of "var x = 10; println(x); x = 42; println(x)" is not reactive, because "x" is not a function of other mutable state in the model. I've never heard of reactive programming until five minutes ago, but I can tell this just by reading the Wikipedia excerpts from his own slides (and a little follow-up reading confirms this).

I'm all for rabble-rousing, but if you're throwing punches you should know what you're talking about.

At 17:30 he makes a joke about a Steve Jobs function that says "iPhone", "iPad", "iCloud", and then "terminates naturally". Holy bad taste.

EDIT: others have pointed out that with extra context this is more obviously a self-deprecating and good-natured shtick.

[+] leorocky|11 years ago|reply
I definitely wouldn't mind watching more of his presentations. He's pretty good.
[+] cbeach|11 years ago|reply
I'm confused as to why Erik would want anything to do with MSDN? He slates MS on a regular basis. Also, I suspect very few amongst the YC/HN developer community would touch Microsoft products.
[+] dtech|11 years ago|reply
Other than him having been employed by MS and making major contributions to .NET like LINQ and Reactive extensions?

Yeah I wouldn't know why he would want to have to do anything with MSDN