Hacker News new | past | comments | ask | show | jobs | submit login
Asynchronous JavaScript at Netflix (netflix.com)
109 points by rcsorensen on May 16, 2014 | hide | past | favorite | 18 comments

This talk has been given a number of times, but keeps getting better, such as at MountainWest JavaScript 2014: https://www.youtube.com/watch?v=XE692Clb5LU

Jafar Husain, and myself (Matthew Podwysocki) will also be giving the talk at QCon NYC in June: https://qconnewyork.com/presentation/end-end-reactive-progra... in addition to a great tutorial that we put together: https://qconnewyork.com/tutorial/functional-programming-js-w...

But, if you're interested in playing with it yourself, we have it listed here: http://reactive-extensions.github.io/learnrx/

I saw this at Yow! a couple of years ago. Really cool stuff.

Note that Netflix have a Java version here https://github.com/Netflix/RxJava

They certainly have some interesting technology.

> They certainly have some interesting technology.

I would hope so based on the salaries they pay their engineers

They pay roughly the same as Google or Facebook, except they put everything into the salary and leave it up to the employee to decide what to do with it. If you want stock options, you can just trade some cash for them (at a reduced rate). So their salaries are higher, but the total compensation is roughly the same.

Very interesting. By the way if someone is interested in more details about Reactive programming, there is a great coursera course about it (https://www.coursera.org/course/reactive)

I've been prototyping some bindings to make Firebase work with RxJava / RxJS, since the model seems like a good fit.

If anyone has the time and inclination, I'd love some feedback.

RxJava: https://gist.github.com/gsoltis/86210e3259dcc6998801 RxJS: https://gist.github.com/gsoltis/ee20138502a4764650f2

Also, is ReactiveCocoa what most people would use to do this in ObjC? https://github.com/Reactive-Extensions/Rx.ObjC doesn't seem particularly active.

First off, great work! I'm the primary authors of RxJS and made a quick comment on your Firebase interaction. We need to ensure that we minimize the number of handlers created. Comments should be inline! Keep up the great work!

Here's another javascript FRP library: https://github.com/baconjs/bacon.js (it was inspired by Rx)

I've been using bacon.js in conjunction with Facebook's React to write more of my application declaratively. React automatically updates the DOM when bacon properties change.

A number of people have been using React with RxJS as noted here: https://github.com/Reactive-Extensions/FutureJS . We also have native support in RxJS for jQuery/Zepto, Angular and Ember events natively (if of course they are referenced).

As the primary author of RxJS, I'm curious why you chose bacon.js over RxJS.

Anyhow, these architectures go well together!

Thanks for making RxJS!

> I'm curious why you chose bacon.js over RxJS

At the time I made the decision, Bacon had documentation and RxJS didn't (at least, not that I could find). I was new to FRP, so that made my decision for me -- I never went back and reconsidered.

Are you aware of any advantages RxJS has over Bacon? It looks a bit more extensive in general, so now I wonder what I'm missing out on :)

The conf talk on youtube by Matt Marenghi [linked in the post] is really awesome. Provides great examples and resources. Really worth 28-min.

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

Really glad to see reactive catching on. It really is a significant improvement over raw events, even in trivial cases.

As opposed to... Synchronous javascript?

Opinions on reactive vs promises?

Reactive (event) streams are a generalization of promises in a sense, from a single value to a stream of multiple ones. Both are monads.

Streams are to promises what lists are to maybes (options).

Reactive is really good for events which could happen zero to infinite times. The composition model is great for that, because we treat these as collections that you can query just as you would query an Array in JavaScript.

Promises on the other hand, are more for scalar values and composition is rather limited based upon that. However, RxJS plays very well with Promises such as the following: https://gist.github.com/mattpodwysocki/b57cf50a34f22ba39e4f . This really shows where Promises leave off and true good composition starts.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact