Why Reactive Programming For Databases Is Awesome 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?"
I for one would love to see DBs be more like Excel (Score:5, Funny)
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 (Score:5, Insightful)
Re: (Score:3)
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 (Score:5, Informative)
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: (Score:2)
There is a nice book about composing complex systems from more primitive ones: Structure and interpretation of Computer Programs [mit.edu]
Re: (Score:2)
I guess you're talking about http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-22.html#%25_sec_3.3.4 [mit.edu] "A Simulator for Digital Circuits":
I suppose the modern version uses events more for user interaction, and also gets rid of lots of idiotic, stupid parentheses.
Re: (Score:2)
The rules engine I've seen (BRMS) utilizes the Rete algoritm (http://en.wikipedia.org/wiki/Rete_algorithm)
Re: (Score:2)
Just instinct, but I'm guessing you can buy something that does it from Espresso Logic, of which Val Huber is the CTO.
Re: (Score:2, Insightful)
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 sh
Sounds like VHDL and similar approaches... (Score:4, Interesting)
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: (Score:2)
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: (Score:2)
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? (Score:5, Informative)
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: (Score:3, Insightful)
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: (Score:2, Flamebait)
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? (Score:4, Insightful)
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? (Score:2)
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? (Score:2)
It's only fairly recent in MySQL, MariaDB or whatever web people use these days. Real databases already had this decades ago.
Re: (Score:2)
It's only fairly recent in MySQL, MariaDB or whatever web people use these days. Real databases already had this decades ago.
No, they did not. They had triggers. They had neither active notifications, nor any way to write a trigger that accessed the file system or network "decades ago". (I'm talking specifically about the "Big Two" of times past, Oracle and Sybase.)
Re: (Score:2)
PostgreSQL has allowed functions to be written in plenty of programming languages for at least 10 years. .NET support around 2003 or so.
Also, with Oracle it was possible to use Java in addition to PL/SQL since 2002. I don't know about Sybase but I guess it probably got
Re: (Score:2)
PostgreSQL has allowed functions to be written in plenty of programming languages for at least 10 years. Also, with Oracle it was possible to use Java in addition to PL/SQL since 2002. I don't know about Sybase but I guess it probably got .NET support around 2003 or so.
Perhaps you failed to notice, but 2002 is only just shy of 12 years ago. The word "decades" (note the fact that this is the plural not the singular) implies at least 20 years. So, the poster you replied to was exactly correct, they did not have this "decades ago".
Re: (Score:2)
Perhaps you failed to notice, but 2002 is only just shy of 12 years ago. The word "decades" (note the fact that this is the plural not the singular) implies at least 20 years. So, the poster you replied to was exactly correct, they did not have this "decades ago".
Yes, and I, the poster he replied to, have been doing this kind of work for 3 decades, so I know good and damned well that the capabilities being discussed were not around 20 years ago ;-)
But this being /., home to "highly oppositional" personalities, I'm sure that next we'll hear that 1.2 decades is most certainly more than 1 decade, therefore plural. Then we can devolve into arguing about whether the linear scale is correct, or whether we should use a logarithmic one ;-)
Re: (Score:2)
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 m
Re: (Score:2)
Re: (Score:2)
In general, it is bad form to peek under the sheets in the database. However, it could be extremely useful to tie a trigger to a primary key + address for these specific cases. The database should also not block on it if there is no DML or DDL going on -- just piping to a message queue or executing an external script or whatever.
Blue-skying. It's still early, here.
-l
Re: (Score:2)
A SQL Server CLR trigger, a message bus, a reactive object. I'm off to try it. Thanks for the idea.
Re: (Score:2)
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.
New buzzword? (Score:3)
Not cool, Slashdot, I'm going to have to read TFA!
Re: (Score:2)
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
Re: (Score:2)
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: (Score:2)
Re: (Score:2)
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: (Score:2)
Re: (Score:3)
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 varia
Re: (Score:2)
Re: (Score:3)
Re: (Score:3)
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: (Score:2)
Re: New buzzword? (Score:2)
Re: (Score:2)
Re: (Score:2)
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: (Score:2)
Re: (Score:2)
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: (Score:2)
Re: (Score:2)
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
Re: (Score:2)
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
Re: (Score:2)
Actually, its not. DDL is declarative. DML, while usuallly vendor-dependent, its not necessarily declarative, and most often than not, is imperative. But anyway.
Wrong. DML is declarative as well.
Actually, its not. Machine language is declarative - you DESCRIBE values and operations (scroll up for people talking about VHDL and Verilog similarities) .
Wrong again.
HTML allows you to specify control flow for some given browsers - does that make HTML a programming language?
Meh. I wouldn't go that far. The thing is, HTML doesn't really have the other elements of a programming language, in particular you can only branch on that very limited set of conditions, and you don't have any way to store a computed value, much less any way to branch on it.
Grow out of your shell. The world is not black and white.
The world, no? Some technical definitions, yes. If the language has no explicit flow control it's declarative. If it has explicit flow control, it's imperative.
Re: (Score:2)
I'm not sure how you can argue that "INSERT INTO foo VALUES (bar)" is anything other than a command to do something. The subpieces of DML may be declarative, but then again, to some extent, so are big groups of mathematical operations in C (if they don't have side-effects).
Re: (Score:2)
Re: (Score:2)
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: (Score:2)
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.
Spreadsheet programming (Score:4, Insightful)
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: (Score:2)
Hey! You're violating my business process patent! ;-)
Re: (Score:2)
Hey! You're violating my business process patent! ;-)
Watch out! Someone might have patented finding people to patent troll via slashdot.
Re: (Score:2)
"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-e
Re: (Score:2)
That's nothing. My new product turns the light plaid.
Re:Spreadsheet programming (Score:5, Informative)
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.
That's the danger: Relying on your own lack of imagination to support your argument. If you cared to google a little you would realize that there are many other areas where RP could be relevant.
Erik Meijer who pioneered the RP push at Microsoft and which lead to the Reactive Extensions for C# and JavaScript (on which the current implementations in Java are based) wrote an article with a thoughtful title: "Your mouse is a database". I could as "so is your finger".
The idea is that a mouse is a series of "rows" with mouse positions and button states. Instead of viewing them as series of *events*, RP views them as streams of objects. That allows you to apply filters, actions, transformations etc.
Suddenly, the events become *composable*.
Think of a touch interface. The touch surface fires events. But if you view the events as streams of objects you can define filters and transforms which let only certain "events" through, like a stream which accepts objects starting/resetting at the "touch" but only accepts messages as long as they describe an ever longer diatance in a certain direction until the finger is lifted again. Now you have a composable stream of "flicks". You can define similar streams which will filter/generate circular moves, pinching with 2, 3 or 4 fingers.
Think of the problem of cache eviction. You can define sweeping/eviction algorithms as (simple) streams.
Think of asynchronous programming in a web browser. Parred with web sockets (or in .NET the awesome SignalR which uses web sockets but automatically falls back to other channels when web sockets are not available) you can build responsive, asynchronous interfaces where you *declare* what should happen as server messages are received.
Think of a dealer system where the dealer wants to track certain papers, positions, rates. RP enables you to build a chained, composable filter where alarms are raised (alarms being messages on streams) when a rate changes more than a certain percentage within a given time period.
I've done this 'methodology' many times using Excel.
Sure. Haven't we all?
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.
Not neccesarily . In .NET, Reactive Extensions are integrated with LINQ. As a supplement to IObservable, Reactive Extensions also define IQbservable (a *queryable* observable). Analogous to LINQ for IQueryable, LINQ applied to a IQbservable is actually capable of combine criterias and transformations "up the chain" all the way to the source. I.e. if the "event" source is capable of filtering/transforming - like a SQL database or a RSS based web feed is - LINQ for Reactive Extensions can apply the filter very early in the chain and avoid uneccesary progression of objects which would be masked later anyway.
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?
It is not just you. There a scores of other people out there who have always done it before 20 years ago.
Grow up. Sometimes Computer Science does see advanced. Realizations. Erik Meijer did an awesome job with Reactive Programming. He found a *duality* between actively "pulling" objects from sequences and reactively receiving "pushed" objects from a source. Given the mathematical duality he even managed to find places where the LINQ pull model was not complete yet.
Reactive Programming is not new. Nor was OO when it really took off. OO actually was don back in the 1970ies with Simula (IIRC). But now RP has *matured* as
Re: (Score:2)
You make your points very well and I found your post to be very informative However, the conclusion of your post is unreasonably harsh, for a variety of reasons.
Despite having been around for a long time, it has never really caught on. I had never heard of reactive programming until this particular article appeared, and I've been doing software development for a long time. To me that means it is nowhere near as good in practise, as it sounds in theory. Maybe it was too impractical to implement before no
Apologize (Score:2)
I sincerely apologize for the harsh tone. That was uncalled for, and I shot off without reading what I wrote and how it comes across. Again, I apologize.
Like you I have some "triggers". One of my triggers is blanket dismissal. I think what I perceived as your blanket dismissal was what triggered. You are correct about Ruby-on-Rails. It turned out that it was not up to the job. But at the same time it *did* popularize the "web-MVC" pattern in a way that Java frameworks (e.g. Struts) never achieved.
When someo
Re: (Score:2)
Thank you. I apologize as well, as my original message was prematurely dismissive. So in that respect I deserved some chastising because I should have spent a little more time researching before I commented.
That being said, as developers we are being bombarded by so many new things on a regular basis, there simply isn't enough time in the day to get involved with more than a handful. But this definitely looks like it's worth taking a closer look at. Apparently Netflix made a Java version available too.
I
New? (Score:3)
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.
Not an app (Score:2)
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 ord
Re: (Score:2)
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?
At a first glance, I would imagine a real-world RP transaction processing system would handle that problem much the same way real-world paper based transaction processing systems have handled it for hundreds of years: by grouping field updates into documents, and then talking about updates to and within documents. For example, at the time the customer creates a 'new order' form they would get a frozen local value of the current price for the widget at the time they placed the order and further updates would
Re: (Score:2)
Except that then you remove the basic principle of RP: that updates are done live. Freeze things like that and you've reduced it to the current model where you just dump values into variables and then run calculations on them to set the values of other variables which then don't change until you go and recalculate them yourself.
Re: (Score:2)
Except that then you remove the basic principle of RP: that updates are done live. Freeze things like that and you've reduced it to the current model where you just dump values into variables and then run calculations on them to set the values of other variables which then don't change until you go and recalculate them yourself.
Not quite. As I understand it, the big idea of RP is not that everything has to be live, but that everything is capable of being live. If you have pervasive liveness given to you by an underlying framework in a safe and cheap manner, it becomes a lot simpler for the programmer to turn it off in the cases where you want to freeze a value, than to manufacture it out of nowhere in the places where you finally realise you need constant event-driven updates.
The former could take just one keyword in a reactive-de
Re: (Score:2)
Those above are just form fields by another name. And the game engine, the application, is doing a lot more than just calculating those stats.
Also, an awful lot of what's being calculated does in fact depend on things like position relative to the mob. How hard a mob's attacks hit, for instance, often depends on how far away the player is. How effective the player's attacks are depends on whether they're in front of the mob, off to one side or behind it. Which means in practice you can't avoid that kind of
Re: (Score:2)
Also, an awful lot of what's being calculated does in fact depend on things like position relative to the mob. How hard a mob's attacks hit, for instance, often depends on how far away the player is. How effective the player's attacks are depends on whether they're in front of the mob, off to one side or behind it. Which means in practice you can't avoid that kind of frame-by-frame recalculation using the RP model. Conventional models avoid it by only updating the base numbers frame-by-frame, then doing the full calculations based on the current situation only when needed. Eg. you update the player's position relative to the mob frame-by-frame, but only calculate how effective his attacks are when he actually attacks (with game clients running at 30+ FPS and player attacks happening once every 1-3 seconds, you avoid 30-90x the calculations).
Right. So, a back-of-the-envelope sketch on how you might do this in RP:
* Don't try to have each mob directly checking every other mob's position all the time, since that requires geometric time
* Instead create 'attack' objects which represent attacks in progress. They're only created when an actor pushes the 'attack' button. You probably already need this, since attacks probably have stats linked to them: animation cycles, cooldowns, maybe coordinates of their own if they're projectiles
* Have a container o
Where do I comment? (Score:2)
Re: (Score:2)
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. (Score:2)
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 (Score:2)
Is auto-recaluation always a good thing? (Score:2)
I did quite a bit with Openlazlo (Score:2)
I like the HTML/Android approach: Use Declarations for the UI layout and let old fashion code control the logic.
Im still trying to get accustomed (Score:3)
to /active/ programming.
Anyways, seriously, please, please please my fellow programmers. Don't jump
on this just because it looks or sounds esoteric.
HDL (Score:2)
The programmer still has to think (Score:3)
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? (Score:2)
That is "recent" as in "about half a century old"?
Re: (Score:2)
Re: (Score:2)
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.
Yes. But it's been reinvented differently on an ad-hoc basis with different semantics each time. And each implementation does a slightly different subset of the same idea, and can't communicate natively with the others. Imagine if, say, there were no lambda calculus and everyone writing a programming language had to take a stab at rebuilding from scratch all the underlying mathematical axioms of computation. (Or - to put it in more modern terms - imagine if everyone were using object oriented programming, a
Arg NOOOOOOO (Score:2)
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.
Re: (Score:3)
Event-driven programming is HELL
Isn't that right there a good reason for it being implemented once, correctly, as a core OS/language feature so that the programmer doesn't have to micromanage all the interactions, and instead just say 'this is a dependency on that; event engine, you sort it out'?
For better or worse, ever since the mouse we've lived in an event-driven world. From what I can see, it's mostly worse, because our software tools haven't adapted to minimise the complexity, so we have the monstrous Byzantine complexity of signals
Oh Great (Score:2)
'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.
Examples? (Score:2)
Re: (Score:2)
Are there any examples of real-world reactive databases in production or development?
yes: http://technet.microsoft.com/en-us/library/hh750618(v=sql.10).aspx [microsoft.com]
Hiypercard, anyone? (Score:2)
'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.
A mixture of prolog (1970) and lisp (1958)? (Score:2)
Yeah but if we can put it in the Web 2.0 then its for sure something new.
ah.... (Score:2)
In the RP paradigm, you can...
I'm sorry, but as soon as I read the word "paradigm" I knew you were management and therefor had no idea what you were talking about. I could be wrong, but I can' risk reading any more of the post for fear of running into that word again. I don't want to get contaminated.
Re: (Score:2)
I see that you've used that word in your reply, and therefore I have to conclude that you have no idea what you were talking about. ;-)
Re: (Score:2)
Re: (Score:2)
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?
Re: (Score:3)
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
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
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: (Score:3)
Vampires do not fear silver bullets. They fear stakes and sunlight. Werewolves fear silver bullets.
Re: (Score:2)
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: (Score:2)
Re: (Score:2)
Everyone knows the last vampire was killed off by a teenage film series.
The microfilm (Score:3)
is in its usual place.
Re: (Score:2)
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.
Right, I don't think current DB technology, based as it is on 1970s timesharing mainframes, is up to the task. I suspect to make RP work nicely with distributed updates you would need to abstract out the idea of 'database' a bit; make it more like the Git/Mercurial model, where there's a big tree of data that anyone can hook into and receive updates, but can't affect anyone else directly.
This is the direction I think the Net will eventually have to evolve; things like Content Centric Networking are a step i