From: Robert Klemme on
On 17.08.2007 18:44, Dan Zwell wrote:
> ashishwave wrote:
>> i just was wondering that whether the heavy developers/users of
>> reactive languages like kanaputs or reactive-C etc will ever get
>> reactive features in ruby.
>>
>> in kanaputs, If the variable 'c' is defined as c = a + b; and if the
>> reactivity of 'c' is set (c.reactive = true;), then each time the
>> value of 'a' or 'b' changes then the value of 'c' is updated as the
>> result of the addition
>>
>>
>> bye :-)
>> Ashish
>> ashishwave(a)yahoo.com.
>>
>
> I haven't used reactive languages, but can't this be emulated by using
> methods and instance variables?
> To emulate:
> c = a+b; c.reactive = true
> use:
> def c; @a+@b; end
>
> Then you could pretend c was a variable. To reset the value, just
> redefine c().

I guess there is one major drawback of your approach: it will break as
soon as systems grow to a reasonable size because whenever you access a
variable you have to reevaluate the complete formula. I guess any
implementation that offers reasonable performance will have to do some
kind of dependency tracking and caching of current values.

The interesting question is how could this be done in Ruby so it's
nicely integrated or a clean DSL? For seamless integration you would
have to be able to redefine (or hook into) variable access (which would
be a nice feature btw). You also would need enhanced code inspection in
order to be able to determine what other variables a variable depends on.

> It would be simpler if all variables were methods, not
> instance variables. If you wanted, you could write a wrapper for that,
> so that set_reactive("c", "a + b") or set_reactive("c=a+b") would wrab a
> call to class_eval or instance_eval that defined the method as "def c;
> a() + b(); end". If you did this, however, you could never set a, b, or
> c by simple assignment.

Yep. Interesting topic nevertheless.

Kind regards

robert
From: M. Edward (Ed) Borasky on
Francis Cianfrocca wrote:
> On 8/17/07, James Edward Gray II <james(a)grayproductions.net> wrote:
>>
>>> (This in fact was precisely the reason that the EventMachine
>>> library was developed, and it's still on the roadmap.)
>> To someone like me who has been looking at Erlang recently, this is
>> very interesting. Can you share and of your plans for how
>> EventMachine might evolve into this? I'm just curious.
>
>
>
> Yes, I took a close look at the Erlang concurrency verbs (spawn, and the
> verbs for sending messages to Erlang "processes") and I sketched out an
> implementation of them above the standard EventMachine. I'd like to use
> Stomp for message-passing across "processes" that are in different OS-level
> processes or on different machines. When this gets done, current plans are
> to release it as EventMachine version 0.9.0.
>
> Any ideas, counterarguments, or offers to help?
>
Well, I'll certainly offer to *test* it. :)

From: Clifford Heath on
benjohn(a)fysh.org wrote:
> I'm about to go home. Damn.
> They called it Definative Programming (think
> reactive is a much better name, as it happens).

A strongly related, but possibly even more advanced technique is called
Constraint Logic Programming, CLP. It's been around since around 1981
or earlier. Doing it with real numbers (so-called CLP/R) has a lot of
hardcore difficulties, but it's being used in high-end architectural
design packages, for example. In such tools, the formula for the size
of a beam required to span two walls and support a particular load is
dynamically recalculated as you vary the wall spacing, just to give you
an idea of why you might want such a language.

Clifford Heath.
From: Ezra Zygmuntowicz on

On Aug 17, 2007, at 8:05 PM, Clifford Heath wrote:

> benjohn(a)fysh.org wrote:
>> I'm about to go home. Damn.
>> They called it Definative Programming (think
>> reactive is a much better name, as it happens).
>
> A strongly related, but possibly even more advanced technique is
> called
> Constraint Logic Programming, CLP. It's been around since around 1981
> or earlier. Doing it with real numbers (so-called CLP/R) has a lot of
> hardcore difficulties, but it's being used in high-end architectural
> design packages, for example. In such tools, the formula for the size
> of a beam required to span two walls and support a particular load is
> dynamically recalculated as you vary the wall spacing, just to give
> you
> an idea of why you might want such a language.
>
> Clifford Heath.
>


You will probably find this interesting: http://www.flapjax-lang.org/

Cheers-
-- Ezra Zygmuntowicz
-- Founder & Ruby Hacker
-- ez(a)engineyard.com
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)



From: Simon Krahnke on
* ashishwave <ashishwave(a)gmail.com> (2007-08-17) schrieb:

> in kanaputs, If the variable 'c' is defined as c = a + b; and if the
> reactivity of 'c' is set (c.reactive = true;), then each time the
> value of 'a' or 'b' changes then the value of 'c' is updated as the
> result of the addition

In a simple and slow implementation you can just put expression in a
string, and eval it everytime the value is needed.

mfg, simon .... l
First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: Checking Credit Cards (#122)
Next: Fwd: Quiz 67 Solution