Live data from Hacker News

Reactive.coffee: reactive programming and declarative UIs in CoffeeScript

yz.mit.edu

1–10 of 31 posts

Re: Reactive.coffee: reactive programming and declarative UIs in CoffeeScript

#3
Library author here - happy to answer questions! Canonical blog post is actually over at http://eng.infer.com/post/57598286968/introducing-reactive-c.... Project home page, courtesy of GitHub: http://yang.github.io/reactive-coffee/.

Also, our startup, Infer, is hiring great engineers, and we love open-source - come learn about us: https://www.infer.com/careers.html

(Thanks jashkenas!)

Re: Reactive.coffee: reactive programming and declarative UIs in CoffeeScript

#4

x = rx.cell(3) y = rx.cell(5) z = bind -> x.get() + y.get() #1 z.get() # 8 x.set(1) z.get() # 6 I wonder when #1 will be simply expressed as z <- x + y.

That would require a new language/syntax layer, which we wanted to avoid. (There's also something to be mentioned for being explicit and reducing "magic," which was part of what drove us to create this library in the first place.)

That said, you could imagine a simple implementation by reflecting on each sub-expression (or auto-lifting operators/functions), where something like `z

  z = bind ->
    tmp0 = if x instanceof ObsCell then x.get() else x
    tmp1 = if y instanceof ObsCell then y.get() else y
    tmp0 + tmp1
Rather than forking CoffeeScript for the `
  z = rx.expr('x + y')

Re: Reactive.coffee: reactive programming and declarative UIs in CoffeeScript

#5
Interesting project. I'm uneasy about zero HTML, and instead having most/all the HTML in .coffee. But I'm opened to it.

Is this project related to, or draw inspiration from, Reactive Extensions (Rx.NET, Rx.js, Rx.cocoa, etc.)? https://github.com/Reactive-Extensions/RxJS

Recently, I've seen the idea of reactive user interface pop up all over HackerNews and GitHub. What a lot of folks are missing is that whole applications themselves can be reactive, from UI to servers to data sources. I feel like many of these reactive UI libraries are missing this.

Re: Reactive.coffee: reactive programming and declarative UIs in CoffeeScript

#6
This looks like just the sort of thing I've been looking for. Reactivity is very convenient, but it's so often tangled up in a massive library that's trying to do much more at once.

I've learned the hard way to embrace the "best in breed small libraries" philosophy over the "monolithic do-everything framework" approach, and I'm particularly excited to see a small, simple reactive library that goes as far as to use efficient DOM diffs.

Can't wait to try it out!

Re: Reactive.coffee: reactive programming and declarative UIs in CoffeeScript

#7
post #5

Interesting project. I'm uneasy about zero HTML, and instead having most/all the HTML in .coffee. But I'm opened to it. Is this project related to, or draw inspiration from, Reactive Extensions (Rx.NET, Rx.js, Rx.cocoa, etc.)? https://github.com/Reactive-Extensions/RxJS Recently, I've seen the idea of reactive user interface pop up all over HackerNews and GitHub. What a lot of folks are missing is that whole applicat…

We elaborate briefly on various related work at http://yang.github.io/reactive-coffee/related.html, but absolutely - there's a large body of existing work and trailblazers we liberally draw inspiration from. In the case of RxJS in particular, the styles actually feel quite different - RxJS is more about explicitly merging streams and constructing the data flow graph with some set of combinators, whereas dependencies are inferred automatically in reactive.coffee (along with a UI-building layer).

We're also strong believers that the entire stack can be architected in this way. Stay tuned! For now, check out projects like Fun, Ur/Web, and Meteor/Derby:

http://marcuswest.in/essays/fun-intro/

http://www.impredicative.com/ur/demo/

http://www.meteor.com/

http://derbyjs.com/

Re: Reactive.coffee: reactive programming and declarative UIs in CoffeeScript

#8
post #4

x = rx.cell(3) y = rx.cell(5) z = bind -> x.get() + y.get() #1 z.get() # 8 x.set(1) z.get() # 6 I wonder when #1 will be simply expressed as z <- x + y.

That would require a new language/syntax layer, which we wanted to avoid. (There's also something to be mentioned for being explicit and reducing "magic," which was part of what drove us to create this library in the first place.) That said, you could imagine a simple implementation by reflecting on each sub-expression (or auto-lifting operators/functions), where something like `z z = bind -> tmp0 = if x instanceof O…

Right, I've been doing too much lisp recently, I assume macros everywhere.

Couldn't `bind` be ordered (meaning always reading its input) to avoid '.get()' ?

Re: Reactive.coffee: reactive programming and declarative UIs in CoffeeScript

#9

This looks like just the sort of thing I've been looking for. Reactivity is very convenient, but it's so often tangled up in a massive library that's trying to do much more at once. I've learned the hard way to embrace the "best in breed small libraries" philosophy over the "monolithic do-everything framework" approach, and I'm particularly excited to see a small, simple reactive library that goes as far as to use ef…

You may be interested in what we've built with React (http://facebook.github.io/react/). We're focused exclusively on rendering and wiring up event handlers and offer a super straightforward, highly performant reactive programming model. There is some particularly interesting technical aspects around how we keep state consistent between React and the browser as well as how we've architected the core (it's a bit like a game!). And it's been proven at scale (both userbase and eng org size) time and time again.

Re: Reactive.coffee: reactive programming and declarative UIs in CoffeeScript

#10
post #7
post #5

Interesting project. I'm uneasy about zero HTML, and instead having most/all the HTML in .coffee. But I'm opened to it. Is this project related to, or draw inspiration from, Reactive Extensions (Rx.NET, Rx.js, Rx.cocoa, etc.)? https://github.com/Reactive-Extensions/RxJS Recently, I've seen the idea of reactive user interface pop up all over HackerNews and GitHub. What a lot of folks are missing is that whole applicat…

We elaborate briefly on various related work at http://yang.github.io/reactive-coffee/related.html , but absolutely - there's a large body of existing work and trailblazers we liberally draw inspiration from. In the case of RxJS in particular, the styles actually feel quite different - RxJS is more about explicitly merging streams and constructing the data flow graph with some set of combinators, whereas dependencies…

Facebook's recent React framework is also worth mentioning (http://facebook.github.io/react/).

A nice JS library for reactive programming is Bacon.js - https://github.com/raimohanska/bacon.js - it's smaller, the source code is easier to read and I found it a little easier to use.

Post reply on HN