Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Why Reactive Programming For Databases Is Awesome

Soulskill posted about 10 months ago | from the because-of-the-free-ice-cream dept.

Databases 165

Nerval's Lobster writes "'Building on many lessons learned from spreadsheets, functional languages and model-driven application development environments, Reactive Programming (RP) is a recent approach to creating applications,' Val Huber, CTO of Espresso Logic, writes in a new column. 'In the RP paradigm, you can create complex applications from a series of simple declarative statements. Many of the details of implementation and work of gluing together various sorts of application constructs can be hidden because of the declarative approach.' He goes on to argue that RP makes maintenance easier and applications more adaptable, because RP offers automatic dependency management and reuse; at the same time, he also acknowledges that RP has some shortcomings. What say you?"

cancel ×

165 comments

Sorry! There are no comments related to the filter you selected.

why anonymous coward is awesome (-1)

Anonymous Coward | about 10 months ago | (#45622605)

frosty piss.

But... (0)

Anonymous Coward | about 10 months ago | (#45622639)

is it webscale?

Re:But... (1)

K. S. Kyosuke (729550) | about 10 months ago | (#45622657)

Well, yeah, after a fashion, since web servers themselves are reactive entities. ;-)

I for one would love to see DBs be more like Excel (5, Funny)

idioto (259918) | about 10 months ago | (#45622643)

I think excel is one of the greatest programs ever and reactive programming sounds great. This article isn't very specific as to how to get started though. Is it a concept, a product or something I have to implement myself?

Re:I for one would love to see DBs be more like Ex (4, Insightful)

rev0lt (1950662) | about 10 months ago | (#45622775)

Usually database manuals calls them triggers.

Re:I for one would love to see DBs be more like Ex (2)

VortexCortex (1117377) | about 10 months ago | (#45623569)

Yeah, and in client side systems they're known as call-backs or event driven, etc. etc.

I don't know about you, but if it's old let's call it new!

Re:I for one would love to see DBs be more like Ex (0)

Anonymous Coward | about 10 months ago | (#45624233)

Rx isn't really the same as callbacks, otherwise you wouldn't need this [npmjs.org] . And if you object to the terminology, blame Microsoft [microsoft.com] .

Re:I for one would love to see DBs be more like Ex (5, Informative)

blue trane (110704) | about 10 months ago | (#45624319)

In Coursera's Reactive Programming [coursera.org] MOOC, the difference between reactive programming event-handling and traditional event-handling is described in two slides from the introductory lecture:

http://subbot.org/coursera/reactive/callbacks.png [subbot.org]
http://subbot.org/coursera/reactive/howtodobetter.png [subbot.org]

A traditional Java event-handler is first presented, and the problems enumerated: it relies on a side-effect (the variable "count" in the example), which involves shared mutable state; events and their handlers are not first class. Reactive programming tries to do better so that complex handlers can be composed from primitive ones.

Re:I for one would love to see DBs be more like Ex (0)

Anonymous Coward | about 10 months ago | (#45622849)

Excel is the swiss army knife of applications. But if you want a DB to be more like Excel, let me introduce you to MS Access ...

Re:I for one would love to see DBs be more like Ex (2, Insightful)

LordWabbit2 (2440804) | about 10 months ago | (#45624509)

Good god (or in this case bad god)
Every damn company I have ever worked in has some (albeit smart) idiot who creates a smart excel/access application which does wonderful things.
Who then distributes it to xyz people
Then the datasource (ip address) changes and the thing breaks.
Or the datasource changes (database table changes) and the thing breaks
Or his hardcoded status codes changes or is expanded and the thing breaks
Then they call you out of the blue and say, please fix it!
Access is an evil which should die. Advocates of it are welcome to come debate the matter with me. I need fresh meat.
Excel is extremely powerful and a handy tool, but as soon as anyone adds a datasource they should come and debate the matter with me.

my database is reacting? (0)

Anonymous Coward | about 10 months ago | (#45622651)

Complex applications from simple declarative statements?

I have a button you can push and it will create an app for you.

Re:my database is reacting? (1)

ackthpt (218170) | about 10 months ago | (#45622721)

Complex applications from simple declarative statements?

I have a button you can push and it will create an app for you.

George Jetson, have you been playing with the time machine at Spacely Sprockets again?

How does this differ from Drools or Clips? (1)

Anonymous Coward | about 10 months ago | (#45622655)

How does this differ from what the rule engines Drools or Clips provide? They are reactive systems that update state by monitoring changes in the underlying data.

Re:How does this differ from Drools or Clips? (0)

Anonymous Coward | about 10 months ago | (#45622949)

It got a frontpage Slashvertisement brought to you by Dice.com?

"What say you?" (-1)

Anonymous Coward | about 10 months ago | (#45622661)

I say we should get this feces fiesta started! My fetid cock is all too eager to sink itself into that rancid asshole of yours! With your feces and my cum combined, we'll form The Elixir of Life! What say you?

Re:"What say you?" (-1, Offtopic)

Impy the Impiuos Imp (442658) | about 10 months ago | (#45622737)

Sigh. The asshole would be fetid, and the cock would be rancid.

Sounds like VHDL and similar approaches... (3, Interesting)

Lisias (447563) | about 10 months ago | (#45622697)

Interesting.

Code modeled in RP sounds like VHDL, Verilog et all - the languages used to model modern Programmable Logic Arrays, Programmable Gate Arrays and Programmable Logic Devices - aka, hardware.

No doubt this approach has its merits, but this kind or "programming" has its gotchas - a lot of gotchas.

I stand aside for now, looking with great interest.

Re:Sounds like VHDL and similar approaches... (1)

ackthpt (218170) | about 10 months ago | (#45622743)

I think they should change the "Reactive" to something like "Proactive" as Reactive has such a negative connotation.

It's late on Friday, lots of plans for the weekend, but need to hit a few stores on the way home and maybe top of the tank ...

then it hits, "Oh, you're still here we need WHUMP (massive request hits the inbox) kthxbaihavagudwkendlol" ... yuh.

Re:Sounds like VHDL and similar approaches... (0)

Anonymous Coward | about 10 months ago | (#45623805)

You gotta question the economics that makes them entitled to do this kind of crap and get away with it.

Re:Sounds like VHDL and similar approaches... (1)

mlts (1038732) | about 10 months ago | (#45622755)

I'm curious if this could be used with a FPGA card array to help with I/O or transaction processing, assuming the disk I/O isn't the bottleneck.

Spreadsheets? (4, Informative)

Animats (122034) | about 10 months ago | (#45622709)

Did this guy just reinvent spreadsheets? There's something to be said for this, but having written in Prolog, which works that way, the 'reactive programming' people have to make a better case than the article does.

On the other hand, one of the big problems in databases is change notification. Microsoft at one point had a research project on this. The concept was that you could make a request to be notified when something of interest changed in the database. This was expressed as an SQL SELECT statement. When some change was made that would affect the output of your pending SELECT, you'd be notified. The problem was to figure out some efficient way to do this with thousands or millions of pending SELECT statements.

Finance people use notifications like that all the time. Limits on stocks, limits on combinations of stocks, changes in key ratios, that sort of thing. But the systems for that are specialized, a special case of a more general problem. The most general form of the problem is that B wants to know when something has changed at A. Most of the solutions for this have problems. Polling is either inefficient or slow. B relying on A to message them on a change has a failure problem. Both approaches can result in overloading A with checks for events that aren't happening.

Re:Spreadsheets? (3, Insightful)

Anonymous Coward | about 10 months ago | (#45622889)

A trigger on INSERT or UPDATE of a watched entity should kick off an INSERT into a message queue, and a trigger on INSERT in the message queue should run a script to send the message where it needs to go. Now you have a self-managing, self-logging, asynchronous system that only uses system resources when needed.

Don't reinvent the wheel. Do learn your craft and become a master at it.

This was solved decades ago. Next question, please.

Re:Spreadsheets? (1, Flamebait)

MrBigInThePants (624986) | about 10 months ago | (#45623053)

A great answer with a completely unnecessarily Douchy tone thrown in for free - brought to you by "Misplaced Sense of Self Importance(TM)", arrogance and "Fragile Ego INC.".

Well done, sir, for keeping alive the IT stereotype...

Re:Spreadsheets? (3, Insightful)

sribe (304414) | about 10 months ago | (#45623109)

A trigger on INSERT or UPDATE of a watched entity should kick off an INSERT into a message queue, and a trigger on INSERT in the message queue should run a script to send the message where it needs to go. Now you have a self-managing, self-logging, asynchronous system that only uses system resources when needed.

Yes, exactly. OK, sometimes it can actually be a little tricky to figure out who needs notification and what data they need, but that's application/business logic that just needs to be worked out. (Example: client was not interested in a particular "master" record, and therefore has not received it, but the addition of a particular "detail" record means that client is now interested, so sending the changed record is not enough, the update needs to include the master and all related details. And so on and so forth, for a really rich app with rich workflow, there winds up being a surprising amount of logic required to get the right updates but no more than needed out to each client.)

This was solved decades ago. Next question, please.

Well... No, not really, at least not that I know of. The ability for "trigger on INSERT in the message queue should run a script to send the message where it needs to go" has actually *not* been around for decades. For way too long, this had to be a process *polling* the message queue. Triggers were limited to whatever "procedural SQL" flavor your db had, and had no access to file or network resources. Now you can write triggers in many languages, sometimes with full access to the system. Now you can from a SQL trigger send a notice, which a client can listen for via select/kqueue/libevent etc. But that's all much more recent.

Re: Spreadsheets? (1)

viperidaenz (2515578) | about 10 months ago | (#45623871)

Publish changes to a topic and have whatever needs notification subscribe to the topic. If they don't need all changes, apply a message filter to the subscriber.

Aka JMS and other messaging systems. Solved last century.

Re:Spreadsheets? (1)

KingOfBLASH (620432) | about 10 months ago | (#45623891)

Putting in things like triggers require fore thought as to what could change. This is a process that can take as much time (or even more) as your original task. If you are a clever programmer, you might still miss something. And if you're not a programmer, you may find this an impossible task.

Things like "reactive programming" make it easier for non-techies to process data. It is a little bit funny that they write it up in this manner (next up, an article about "round transportation" describing how to move things with no friction using circular objects!)

However, I think it's worth exploring things like this. These days people are tracking and storing vast amounts of data and non-DBAs are trying to find answers. Excel like ease of use makes data more accessible to people, and is going to be something you'll see more of in the future

Re:Spreadsheets? (1)

ubergeek65536 (862868) | about 10 months ago | (#45622981)

A SQL Server CLR trigger, a message bus, a reactive object. I'm off to try it. Thanks for the idea.

Re:Spreadsheets? (1)

VortexCortex (1117377) | about 10 months ago | (#45623595)

Did this guy just reinvent spreadsheets?

When I saw spreadsheets for the first time I said the same thing:

Did they just reinvent state machines?

Von Neumann would be proud.

Re:Spreadsheets? (1)

Horshu (2754893) | about 10 months ago | (#45623939)

They've got a framework extension for .Net that works similarly, not coincidentally named "Reactive Extensions". The typical sample usage is iterating through a collection of mouse events. The enumeration is observable, so the code can be written as a traditional foreach loop, but the iterator will increment a step every time a mouse event occurs. Simple, yet very powerful, like much of .Net's newer asynchronous constructs.

silver bullet (0)

Anonymous Coward | about 10 months ago | (#45622711)

I hope this silver bullet is better than the last one.

Re:silver bullet (1)

istartedi (132515) | about 10 months ago | (#45623007)

I hope this silver bullet is better than the last one.

"I'm not too worried about that" said every vampire on the planet.

Re:silver bullet (0)

Anonymous Coward | about 10 months ago | (#45623093)

I hope this silver bullet is better than the last one.

"I'm not too worried about that" said every vampire on the planet.

Best (true) statement ever! You can only push the complexity bubble elsewhere. At some point the complexity will need to be handled for anything other than the most trivial software.

Re:silver bullet (2)

philip.paradis (2580427) | about 10 months ago | (#45623131)

Vampires do not fear silver bullets. They fear stakes and sunlight. Werewolves fear silver bullets.

Re:silver bullet (1)

Wintermute__ (22920) | about 10 months ago | (#45623309)

Vampires do not fear silver bullets. They fear stakes and sunlight. Werewolves fear silver bullets.

That's why they said, "I'm not too worried about that"

Re:silver bullet (1)

khellendros1984 (792761) | about 10 months ago | (#45623577)

Blade [fightingmaster.com] wants a word with you.

Re:silver bullet (1)

mugnyte (203225) | about 10 months ago | (#45624209)

Everyone knows the last vampire was killed off by a teenage film series.

New buzzword? (2)

rev0lt (1950662) | about 10 months ago | (#45622715)

From the article description I couldn't figure out a) what is actually reactive programming; b) how will that help me build better applications. Complex applications are already built from a series of simple declarative statements. In fact, we call the most simple declarative statements language available "assembly". We call the machine representation of those very complex applications built with simple declarative statements "binary". On the other hand, Brainfuck also allows you to build complex applications with very simple statements, and I'm not migrating to it anytime soon.
Not cool, Slashdot, I'm going to have to read TFA!

Re:New buzzword? (1)

rev0lt (1950662) | about 10 months ago | (#45622759)

Ok, I've read the article diagonally (hey its slashdot!), and apparently someone will have a big surprise when arriving to the letter T (triggers) in their SQL manual. And if it is an actual PostgreSQL manual, imagine their surprise when they find out they can actually code said "triggers" using several high-level languages.
Next week I'm expecting a blog article explaining why it is a bad idea to embed application logic in the database... Then again, this will still be slashdot :P

Re:New buzzword? (1)

sribe (304414) | about 10 months ago | (#45623175)

Ok, I've read the article diagonally (hey its slashdot!), and apparently someone will have a big surprise when arriving to the letter T (triggers) in their SQL manual. And if it is an actual PostgreSQL manual, imagine their surprise when they find out they can actually code said "triggers" using several high-level languages.

You forgot "N" for "notify" ;-)

Re:New buzzword? (1)

rev0lt (1950662) | about 10 months ago | (#45623451)

Yes I did :D And that will actually come handy in a current project, tnx for the refresh!

Re:New buzzword? (1)

sribe (304414) | about 10 months ago | (#45623623)

Yes I did :D And that will actually come handy in a current project, tnx for the refresh!

Well then, don't forget kqueue (or libevent)--select is so nasty ;-) Also don't forget pq_consume_input...

Re:New buzzword? (1)

rev0lt (1950662) | about 10 months ago | (#45624051)

You're having fun heh? At least I'm learning something :D Thank you. Really

Re:New buzzword? (2)

ebno-10db (1459097) | about 10 months ago | (#45623087)

Complex applications are already built from a series of simple declarative statements.

I'm not being pedantic, as I'll be first to say that software buzzwords are not used consistently, but what you call declarative I believe they'd call imperative, as in "do this", whereas declarative is "this is the way it is (or I want it to be)". I don't know Prolog, but I believe that's considered declarative, as opposed to imperative (which describes most languages, C/C++, Java, Python, etc.).

Haskell, which I do know, is considered at least partly declarative. You declare the relationships between variables, and the compiler figures out how to compute the stuff. For that reason, you can make the declarations in any order. For example:

x = foo y
y = bar 3.14

is legal, but doesn't work the same as in imperative languages. All "variables" are immutable, and hence can only be assigned a value once (essentially initialization). In the above, y is computed first, then x is calculated using that value of y. The order of the declarations doesn't matter.

Re:New buzzword? (1)

rev0lt (1950662) | about 10 months ago | (#45623261)

This is my personal opinion, but the whole "lets fit languages into predefined buzzwords" is f*** bullshit. Every strong typed language has a declarative section with static or partially static values, that define data structure. So before the "do this", you define "where". Moving to your example, x = bar 3.14 and not necessarily y. Out-of-order declaration is allowed because there is no cascading dependency (eg. y value cannot change globally, so it doesn't matter where it is declared). That is syntax sugar (again, my opinion) that adds nothing to the problem. As an example, its a bit like declaring functions external (as references not solvable in compile time) and be surprised when the linker does its job.
In the end, its all ones and zeros. And AFAIK, processors don't eat up stuff like "this is the way it is", but rather direct, declarative/imperative (is there an actual difference?) statements.

Re:New buzzword? (2)

khellendros1984 (792761) | about 10 months ago | (#45623601)

I've done small amounts of both. Haskell definitely reminded me of Prolog in some ways. I used to think of programming Prolog as building a database of facts and relationships, then executing queries against the database.

Re:New buzzword? (2)

sribe (304414) | about 10 months ago | (#45623161)

Complex applications are already built from a series of simple declarative statements. In fact, we call the most simple declarative statements language available "assembly".

No we don't. We call assembly, and most every language in common use, "imperative", not "declarative", because, you know, that's what they actually are. Off the top of my head, I can think of exactly 1 declarative language that is in common use: SQL. (Well, OK, I know, it's not terribly precise to call SQL just 1 language...)

Re:New buzzword? (1)

rev0lt (1950662) | about 10 months ago | (#45623297)

So, what you're saying is that "Memory position X has value Y" is different from "Move Y to memory position X" in programmable logic?

Re: New buzzword? (1)

Great Big Bird (1751616) | about 10 months ago | (#45623457)

Essentially yes. One is saying a fact, the other telling it to do something. A good example is quick sort in Haskell vs C. In the former, you say what the sorted list looks like. In the latter you tell it the operations to perform.

Re: New buzzword? (1)

rev0lt (1950662) | about 10 months ago | (#45623491)

Again, programmable logic. Do you know the actual difference between one and the other? You could even do "push Y to stack / call X to decide what to do with it". and in both examples you provided, the generated code for programmable logic would be stuff like "memory position X has value Y; compare [X] with [Z]". There is no friggin difference, since most processors dont understand actual complex data structures (eg. a quicksort of a bunch of strings).

Re: New buzzword? (2)

DahGhostfacedFiddlah (470393) | about 10 months ago | (#45623895)

This article's about programming paradigms, not hardware implementation. There's no difference at the processor level between assigning a variable in javascript and assembly, but that doesn't make the languages equal.

Re: New buzzword? (1)

rev0lt (1950662) | about 10 months ago | (#45624001)

True, but the replies aren't against the (non) article - they are about me stating assembly is a declarative language. You add nothing to it.

Re:New buzzword? (1)

sribe (304414) | about 10 months ago | (#45623477)

So, what you're saying is that "Memory position X has value Y" is different from "Move Y to memory position X" in programmable logic?

Honestly, of the top hits in google for "declarative vs imperative programming", wikipedia explains it best [wikipedia.org] .

Re:New buzzword? (1)

rev0lt (1950662) | about 10 months ago | (#45623517)

The point is that *every* imperative or functional language has a declarative part. Even SQL. And in the end, every language that is compiled into dynamic programmable logic (as in actual microprocessor instructions) is translated into simple statements, and at that level there is no difference between declarative and imperative - there is usually no practical difference between "assume X is 5" or "move 5 to value of X". If you want to be "scholar" about it, go ahead. In the end, it's all ones and zeros, so I'd guess you'll have a hard time figuring out if they are declarative (as in defining rules and limits) or imperative (performing operations).

Re:New buzzword? (1)

sribe (304414) | about 10 months ago | (#45623673)

The point is that *every* imperative or functional language has a declarative part. Even SQL.

SQL is a declarative language, not an imperative one.

And in the end, every language that is compiled into dynamic programmable logic (as in actual microprocessor instructions)...

Yes, machine language is imperative. That has nothing whatsoever to do with which higher-level languages are imperative vs declarative.

...so I'd guess you'll have a hard time figuring out if they are declarative (as in defining rules and limits) or imperative (performing operations).

Actually, no, I would have not any difficulty at all figuring that out--it's really quite easy for me to spot whether or not a programming language requires/allows me to specify control flow. Really, please read the wikipedia article [wikipedia.org] before responding, because what you're saying strongly suggests that you don't know what declarative programming is at all.

Re:New buzzword? (1)

rev0lt (1950662) | about 10 months ago | (#45624033)

SQL is a declarative language, not an imperative one.

Actually, its not. DDL is declarative. DML, while usuallly vendor-dependent, its not necessarily declarative, and most often than not, is imperative. But anyway.

Yes, machine language is imperative.

Actually, its not. Machine language is declarative - you DESCRIBE values and operations (scroll up for people talking about VHDL and Verilog similarities) . Assembly is usually considered to be imperative. But, because of that, most languages are imperative at some level - regardless of how you describe shit. That is still the point.

Actually, no, I would have not any difficulty at all figuring that out--it's really quite easy for me to spot whether or not a programming language requires/allows me to specify control flow.

HTML allows you to specify control flow for some given browsers - does that make HTML a programming language?
Grow out of your shell. The world is not black and white.

Re:New buzzword? (1)

rev0lt (1950662) | about 10 months ago | (#45624207)

what you're saying strongly suggests that you don't know what declarative programming is at all.

Or I do and I still call it bullshit. Which one will make you think twice about stuff?

Re:New buzzword? (1)

sribe (304414) | about 10 months ago | (#45624615)

Or I do and I still call it bullshit. Which one will make you think twice about stuff?

Wait, call bullshit on what? The original article? Be my guest! Me? No, I actually know the difference pretty damned well.

Views? (1)

DogDude (805747) | about 10 months ago | (#45622745)

I had never heard of Reactive Programming before, but after reading the article, it seems that Reactive Programming is the same thing as using views, which have been a part of mature RDBMS's for several decades now. Am I missing something obvious?

Re:Views? (2)

beelsebob (529313) | about 10 months ago | (#45622809)

No, the article is just terrible at explaining what FRP is. The idea of FRP is that you stop simply having the idea of having values, and start having the idea of "time varying values". So instead of having an int, which I change the state of at a bunch of times, I can have a Reactive which represents the value of the int at all possible times. You can then treat these as first class citizens, which you can manipulate, so if you have a Reactive representing the time, you can do things like time + 1, and get a new reactive int representing one second later than the current time.

These can be combined in much more complex ways to produce much more interesting behaviours than "hey, what will the time be in one second".

You can see a simple example of this, describing the n-bodies problem here http://noordering.wordpress.com/2009/02/01/simulating-n-bodies-and-functional-programmingre/ [wordpress.com]

Re:Views? (1)

DogDude (805747) | about 10 months ago | (#45622931)

Right. I understand. You're still describing Views [wikipedia.org] .

Re:Views? (0)

Anonymous Coward | about 10 months ago | (#45622985)

Yes, but he is using hipster marketing speak. You're using boring fuddy duddy, old people lingo.

Re:Views? (1)

rev0lt (1950662) | about 10 months ago | (#45622989)

Expressing variables as functions is not new - most modern languages allow you to use them to some extent, and many database systems also - specially considering the NoSQL kind. Automata and state machines are also not new (counting decades), and actually I find your link way more interesting and informative than TFA.

Re:Views? (1)

Desler (1608317) | about 10 months ago | (#45623139)

and actually I find your link way more interesting and informative than TFA.

That's because the article is a fluff piece.

Re:Views? (1)

rev0lt (1950662) | about 10 months ago | (#45622825)

Yes. "Views" and "Mature" are not cool buzzwords for CTOs.

End of the world! (0)

Anonymous Coward | about 10 months ago | (#45622767)

A = B + C;
B = A + C;
C = A + B;

C = 42;

*POOF* and magic smoke and stuff.

Re: End of the world! (0)

Anonymous Coward | about 10 months ago | (#45623741)

magic smoke

That's not magic smoke, that your CPU catching fire trying to process your logic.

Spreadsheet programming (3, Insightful)

ilsaloving (1534307) | about 10 months ago | (#45622785)

I can see this being useful for problems that are extremely linear and require extreme parallelization on large quantities of data, but that's about it.

I've done this 'methodology' many times using Excel. I did it because I I needed to give the spreadsheet to other people, and wanted to avoid having Office nag about 'potentially dangerous VBA'.

It makes it very easy to see *exactly* how your data is flowing, which is a bonus. It also uses a *lot* more ram because you are now maintaining a permanent block of memory for every single operation, for every different piece of data you are coding against. Of course, the second you get a cyclic dependency, the whole thing blows up.

But this method of 'programming' was a natural and convenient extension based on how Excel (or any spreadsheet) operates. Nothing more.

Is it just me, or does it seem like everyone now-a-days is trying very hard to come up with new methodologies and paradigms and web 6.5isms, so they can get their 5 minutes in the lime light?

Re:Spreadsheet programming (1)

rk (6314) | about 10 months ago | (#45623573)

Is it just me, or does it seem like everyone now-a-days is trying very hard to come up with new methodologies and paradigms and web 6.5isms, so they can get their 5 minutes in the lime light?

Hey! You're violating my business process patent! ;-)

Re:Spreadsheet programming (1)

KingOfBLASH (620432) | about 10 months ago | (#45623911)

Is it just me, or does it seem like everyone now-a-days is trying very hard to come up with new methodologies and paradigms and web 6.5isms, so they can get their 5 minutes in the lime light?

Hey! You're violating my business process patent! ;-)

Watch out! Someone might have patented finding people to patent troll via slashdot.

Re:Spreadsheet programming (1)

gtall (79522) | about 10 months ago | (#45623677)

"Of course, the second you get a cyclic dependency, the whole thing blows up." Yes and no.

Think of a state machine with one equation:

      s = a s

You can code that in Haskell because Haskell has lazy evaluation. The equation (actually we'd call this a co-equation) describes an infinite string of 'a's. There is even a set theory to go with it, non-wellfounded set theory. What you cannot execute is

    s = s

It is "non-productive". Many process algebra expressions are stated with co-equations. They also come with their own proof method, co-induction. It is a theorem of most process algebras that any well-formed series of equations has solution. Stated this way, it becomes a way of axiomitizing non-wellfounded set theory.

New? (2)

mwvdlee (775178) | about 10 months ago | (#45622791)

I remember experimenting with a C++ framework that would work somewhat similar. Lazy evaluation and such. http://sourceforge.net/projects/ditto [sourceforge.net] , it's long since been abandoned because, well... the only thing this way of programming solves is a small part of the "R" in "CRUD". It worked brilliantly for showing information on screen and automatically updating all kinds of stuff whenever some data changed, but in the end it only solved the least difficult part of creating an application, and doing so at a relatively high CPU% cost.

It was also supposed to have lazy/dynamic/late-binding expressions (i.e. lazy_int a = b + c;), but it turns out you only very rarely have any use for that type of expressions. At the time, there were also far superiour C++ frameworks being developed which could do these things as a side effect of supporting more useful programming models.

This RP thing doesn't really seem to do anything more than that.

Re:New? (0)

Anonymous Coward | about 10 months ago | (#45623951)

I only touched the Rx a little bit. Based on my limited experience, reactive programming is not just lazy evaluation. It basically means async observer pattern with the data or exception wrapped inside a monad. The customer just handle the different cases of the incoming monads without the blocking async calls, call-backs and explicit exceptions handling (try-catch).

The article may be bullshit, but reactive is cool! (0)

Anonymous Coward | about 10 months ago | (#45622837)

The article may be bullshit, but reactive is really interesting. And yes, this is similar to views, but with networking in the middle. Take a look at what meteorjs guys are doing: http://meteor.com/

Not an app (1)

Todd Knarr (15451) | about 10 months ago | (#45622869)

This won't create an application. It just automates calculations that populate form fields. That's the easy part of most applications. The hard parts are the business logic that isn't just figuring out the values for form fields. In addition, you have nasty cascade effects. What happens in this system when the price for an item changes at the same time the customer's changing the number of that item they want to order, the customer's credit limit is being updated and payments are being applied to his 26 orders each of which causes an update to his balance due? You end up with a massive cascade of updates propagating up the chain, with each change causing changes to values that depend on it which in turn cause yet more changes. Multiply that by thousands of customers and it can kill the systems dead. Meanwhile a non-RP system will handle it cleanly and without dying by simply not updating values until everything's finalized. So as the accounts payable system applies payments to his 26 invoices his balance doesn't change, then when payments are done it updates the balance once to reflect the payments.

I'd use RP to help with things like forms where I want live updates and RP will help automate what I need done anyway. Lots of other areas... not so much. It'd be just another tool in the toolbox, and it's not quite as useful in the real world as it appears in simple academic examples.

Part of it's that the people describing these things often haven't dealt with truly large, complex applications before. Simple example: we have 5 fields in a request, each data file has a match value for each of those fields, and we want to grab the file that matches any one of the fields in the current request. "The" file? Um, what happens when I have 3 files each of which matches a different field of the request? Which one should be grabbed? Nobody thought of that. They say "It doesn't matter, just grab one.". And then later "We wanted file 17 that matched field 3 being X, why aren't we getting that file?", answer "Because file 9 matches when field 1 is A, which it is in your request, and we find file 9 first when checking.". Simple request, just grab an arbitrary file. Translated into the real world, complications pile up that were always there but nobody wanted to talk about because they were... well, complicated.

Re:Not an app (0)

Anonymous Coward | about 10 months ago | (#45624539)

It is for more than just form fields. An example of where this comes up in game programming:
        You always want to know the current to-hit chance and damage of the player's attacks (to display on the UI, in addition to having them available when the player swings). These depend on the currently equipped weapon and the player's strength; the players current strength depends on whether or not the player has status effects like "poisoned"...
      This is actually really easy to express if you have a reactive engine for stats. There are some "base stats" that are set directly, and then you have a slew of "derived stats" that are expressed as some formula involving base stats and other derived stats.

As long as you can remember to avoid circular references (which will make things go ambiguous), and you can avoid situations where the "base stat" is going to update constantly (don't make anything depend on the player's position, which will change every frame, because then you'll get a cascade of recalculations every frame...)... it's a nice system, which makes it very easy to express how stats inter-relate, is easy to debug, and makes the transition from "here's the code" to a format that a non-technical designer or player can understand much better than most code.

Where do I comment? (1)

wjcofkc (964165) | about 10 months ago | (#45622875)

I don't understand this new slashdot scheme where the link to the story in the summary, leads to another story under the slashdot domain. Slashdot Business Intelligence? It's still slashdot... The summary on slashdot.org proper and the story under Slashdot Business Intelligence both offer a comments section. Am I supposed to double post or what? I'm posting this here out of habit but in the midst of confusion. The road to hell is paved by websites that suffered unrecoverable identity crisis.

Re:Where do I comment? (1)

Lunix Nutcase (1092239) | about 10 months ago | (#45623009)

They're trying to increase page hits and ad impressions on the BI sites that next to no one cares about. It's one of those Dice.com side effects.

It is awesome. (1)

ubergeek65536 (862868) | about 10 months ago | (#45622905)

I started using reactive extensions for .Net for over a year ago and am constantly learning new ways to use it. UI, message busses, async calls, business objects, the list keeps growing. It is by far the most useful programming concept I've learned in the last year. There is one for javascript if you are not into .Net

Why Reactive Programming For Databases Is Stupid (1)

ttucker (2884057) | about 10 months ago | (#45622925)

This article is just marketing bullshit double speak without a concrete implementation.

Is auto-recaluation always a good thing? (1)

JoeyRox (2711699) | about 10 months ago | (#45623003)

I like the idea of having variables auto-recalculate based on a dependency tree built automatically by a tool. But recalculating vars sounds kinda slow, esp when resolving the dependency calculations involves time-consuming operations like database fetches. What control does the tool provide in limiting the timing and scope of the recalcs?

I did quite a bit with Openlazlo (1)

rsilvergun (571051) | about 10 months ago | (#45623031)

which I think fits into this model. It was neat, but kind of a mess. As soon as I wanted to do something the creators of OL didn't think of I ended up writing a lot of JavaScript and stuffing it in weird places.

I like the HTML/Android approach: Use Declarations for the UI layout and let old fashion code control the logic.

Fri5t 4sot (-1)

Anonymous Coward | about 10 months ago | (#45623075)

To underscore Of OpenBSD. How United States. networking test. Benefits of being 4, which by all are just way over of Jordan Hubbard

The microfilm (2)

Mister Liberty (769145) | about 10 months ago | (#45623229)

is in its usual place.

Circular dependacy? (0)

Anonymous Coward | about 10 months ago | (#45623155)

I guess the compiler checks if the reactions cause more reactions in a loop?

Im still trying to get accustomed (2)

Mister Liberty (769145) | about 10 months ago | (#45623207)

to /active/ programming.

Anyways, seriously, please, please please my fellow programmers. Don't jump
on this just because it looks or sounds esoteric.

R++ anyone? (0)

Anonymous Coward | about 10 months ago | (#45623213)

This sounds very similar to (if not identical to) a (still non-existent) product called "R++" that Bell Labs STILL hasn't developed/released 18+ fricking years later:

http://cm.bell-labs.com/who/pfps/rpp
http://cm.bell-labs.com/who/pfps/rpp/UserManual.ps

ftp://cm.bell-labs.com/cm/cs/who/pfps/rpp
ftp://cm.bell-labs.com/cm/cs/who/pfps/rpp/oopsla95.ps

I originally downloaded their postscript User Manual and converted it to PDF years and YEARS ago, and have been waiting for them to get their shit together and release a commercial product ever since, like they promised to.

They STILL haven't, so screw 'em.

Someone should start an Open Source project to create an R++ preprocessor anyway since it's obvious they're never going to.

It's not like they'd be losing money either, since they're don't have such a product of their own to sell even though they've had 18+ fricking years to create one.

(I hate companies that sit on good technology to the detriment of the rest of society)

HDL (1)

Omega Hacker (6676) | about 10 months ago | (#45623223)

Tl;DR [yet], but initially this sounds a lot like HDL's like Verilog and VHDL. The two fundamental constructs there are things that happen continuously (collections of simple logic gates) and things that happen based on a clock (registers, built around flip-flops). At a high level, this sounds like A = B+C is a continuous adder, and A is changed instantaneously with B and C. In the HDL world, this gets "compiled" down to silicon, but in a software world this would be radically harder to do, because you have to notify anybody listening to A that B and/or C has changed. Yes, it's like a spreadsheet in that sense.

The programmer still has to think (2)

istartedi (132515) | about 10 months ago | (#45623253)

OK, B+C can be evaluated once when you assign A, or it can be evaluated every time you evaluate A. Sometimes you know that A will not change after you calculate it, or that a fresh value of A is required, and sometimes you don't.

Delaying the evaluation of A is usually safe; but it can sometimes be very slow. Like it or not, performance still matters. If you evaluated A unnecessarily inside a tight loop in a game, you'd be dead. Even less CPU intensive thinks like web apps could be killed by this kind of thing, if A is evaluated in JavaScript every time you move your mouse pointer.

Evaluating A every time is not only slow, it might not even be correct. Let's say you pull in some weather data and then render a map. The frontal zone should be a smooth line. If you pull in new frontal boundary data while rendering the map... you'll render a broken front.

Sorry. It looks like the programmer still has to think. Re-calculating A every time the symbol A occurs may or may not be required.

recent? (1)

stenvar (2789879) | about 10 months ago | (#45623321)

Reactive Programming (RP) is a recent approach to creating applications,

That is "recent" as in "about half a century old"?

Re:recent? (1)

3dr (169908) | about 10 months ago | (#45623657)

Exactly. So far RP in the article sounds a lot like data-flow engines (spreadsheets, various visualization tools, DB triggers, even make builds). It has spanned decades and fields, too. Many artificial intelligence systems used this type of reactive engine; for example, the CLIPS engine "reacted" by matching conditions to a subset of currently-asserted facts to trigger actions (which can then cascade by asserting new facts and causing other patterns to match). The common aspect to all these applications of a data-flow engine is that a Result has Dependencies, and those Dependencies may be "atomic" (like a file timestamp in make), or a Result from an earlier conclusion. At any point in time, the entire scenario can be paused, and each pending Result has a list of Dependencies that may or may not be satisfied at that point. Spreadsheet calculation 101.

Yet another attempt to redesign programming (0)

Anonymous Coward | about 10 months ago | (#45623373)

These "rethinking programming thinking" efforts almost never work out. I mean, I applaud the effort and encourage experimentation, that part is all to the good. However don't get too excited. What has been working in recent years is new programming languages. They are fairly conventional languages though, not entire new programming models.

Views, Materialized views? (1)

slimdave (710334) | about 10 months ago | (#45623545)

The idea of embedding a calculation into the system that is automatically updated by underlying data changes -- is that not just a database view?

We use this sort of technique quite widely in a Ruby on Rails app I work on -- complex calculations such as for profitability and cash flow are defined as views in Postgres, and referenced by the app as read-only models. Thus we can: Profitability.where(product_id: 27).group(:month).sum(:value)

Performs monstrously fast, as is extremely flexible. It breaks the whole "for the love of gods don't put business logic in the database" separation of concerns idea, but we have a system to ship right now and we can't wait for RoR performance and flexibility to catch-up that much.

Arg NOOOOOOO (1)

Press2ToContinue (2424598) | about 10 months ago | (#45623579)

Event-driven programming is HELL, except for interfaces. Every once in a while a DB trigger is justified, but event-driven languages have failed time and time again because... it's impossible to predict what will happen when and avalanche of eventual complexity causes the system to implode under its own weight.

For a programming language to make the cut, it must be utterly predictable down to the last side-effect.
 

at a db level if I want to react to a change I'll (0)

Anonymous Coward | about 10 months ago | (#45623655)

Or if I need reverse queryable reaction to change, materialised views fit the bill... actual cascading data modification based on reverse trigger like syntax would seem to have the level of intelligent design choice on par with Intercal's comefrom statement.

Basic design patterns being discussed (1)

WinstonWolfIT (1550079) | about 10 months ago | (#45623663)

I'm just seeing an observer pattern with publishers and subscribers. It's been done time and again in probably all the major languages. In the .NET space, using aspect-oriented decoration and an expression store, both of which are declarative, well understood, and promote reuse, this concept is already covered. Regardless of the platform, any implementation is going to be constructed in the context of the domain being addressed, and I believe any one-size-fits-all approach would lead to a confusing mess.

Oh Great (1)

sexconker (1179573) | about 10 months ago | (#45623669)

'In the RP paradigm, you can create complex applications from a series of simple declarative statements. Many of the details of implementation and work of gluing together various sorts of application constructs can be hidden because of the declarative approach.'

Sounds like another wishy-washy piece of shit language designed to be "easy", "fast", and "human readable" that will end up being kludgey, slow, and a pain in the ass.

I don't get it (0)

Anonymous Coward | about 10 months ago | (#45623995)

This is what database indexes already do.

Examples? (1)

GWBasic (900357) | about 10 months ago | (#45624053)

Are there any examples of real-world reactive databases in production or development?

Hiypercard, anyone? (1)

dltaylor (7510) | about 10 months ago | (#45624073)

'In the RP paradigm, you can create complex applications from a series of simple declarative statements. ..."; or, even , visually:

http://hypercard.org/ [hypercard.org]

It's too bad the Newton wasn't just a hypercard engine, preloaded with a couple of removable apps.

like XAML (0)

Anonymous Coward | about 10 months ago | (#45624585)

The UI made by XAML is a bunch of rules, like TextBox monitoring user.name, or TabControl.TabIndex monitoring product.type to switch different views based on type of selected product, or GroupBox.IsEnabled monitoring your permissions. It supports complex paths and custom type converters (although M$ provides none themselves) which set it apart from old simple data-binding.

Most of time you need no programming if your data-model is RP-ready - with notifications of property changes and collection changes. But when you do, it's very difficult due to asynchronous programming everywhere and lack of support from framework and language (C#) - you can't do things as in XAML like { MyProperty = OtherObject1.A.B + OtherObject2.C.D, set when ready } or wait until all objects in the path become non-null and the path is ready to evaluate. I suppose it can be easily done by LINQ and custom evaluator, but again M$ is not providing that.

You won't find true examples of RP in M$'s own samples either. Their samples are all fucked up by mixing the simplest data-binding and manual data loading, hell of code-behind programming with added ViewModel layer to bridge the two (which they deem as incompatible but they're NOT) to accomplish very simple tasks. Basically as brainless as Sun's server-side java examples.

One problem with RP is that you need a higher-level infrastructure to track when the tables/data-model are changed, without writing extra lines of code (in XAML you do, and they introduce weak-reference to event handler). And in real world you also need to consider the frequency of updates because it a database with 10 tables but 1000 triggers and 10,000 event notifications to update client's data model or view is like to have some problem, at the same time you have to keep DB consistency.

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?