RDP outside of Haskell

112 views
Skip to first unread message

Justin P

unread,
Nov 28, 2013, 1:41:32 AM11/28/13
to reactiv...@googlegroups.com
Hi David,

I ran across your descriptions of RDP for the first time this evening and was intrigued by the idea of using it as a replacement for actor or pubsub based systems. Would RDP be viable in any language other than Haskell, and if so, do you know of any RDP implementation in other languages?

Thanks,
Justin

David Barbour

unread,
Nov 28, 2013, 11:50:01 AM11/28/13
to reactiv...@googlegroups.com

RDP is viable in almost any language. It could be represented with OO or procedural. Ross Angle has partially developed JavaScript implementations, and I'd like to compile to JS.

I'm currently developing a bytecode for RDP which also works well for procedural, functional.

--
You received this message because you are subscribed to the Google Groups "reactive-demand" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reactive-dema...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Robert Majewski

unread,
Nov 28, 2013, 5:24:21 PM11/28/13
to reactiv...@googlegroups.com
Hi David,

I'm a big fan of your efforts. I try to be in touch with your updates in awelon's github repository.
As far as I understand it, ABC bytecode (at least for env operators) is typeless. Is that correct? If so, when type inference takes place?

BR,
Robert

David Barbour

unread,
Nov 29, 2013, 12:36:50 PM11/29/13
to reactiv...@googlegroups.com
Hi, Robert. It's good to hear from new voices like yours and Justin's. :)

As you mention, the environment ops - represented as `{envOp}` - do not have a readily observable type. This can be mitigated by surrounding the invocation with some assertions about the input and outputs, such that a capability looks like:

    [ codeAssertingInput {envOp} codeAssertingOutput ]

ABC's basic operators are strongly typed. Thus, code manipulating input and output can be modeled implicitly. However, ABC has a more explicit operator to represent assertions: `K :: (a + b) * e → b * e` (basically "prove me right"). This can be combined with operators to observe structure of many inputs - e.g. `PK` asserts that a value is a pair, `NK` that a value is a number, `SK` that a value is a sum, and `BK` that a value is a block. (The only type that can't be observed is unit, but you could still represent that one is expected by use of operator `c :: (a * 1) → a`.)

Beyond this, I imagine that (for many use-cases) it is compilers that provide the powerbox to an application. That is, I expect to compile many ABC systems with static distribution of capabilities, to better support inlining. In these contexts, the compiler knows the expected types of those capabilities. And a compiler can directly map `{envOp}` to a type it understands internally.

ABC doesn't need to be statically typed to be executed. One can use ABC in a 'gradually typed' manner, then halt the program if there's an error at runtime. But most compilers will forbid 'obvious' errors at compile time. The philosophy I favor is close to:

* prove it right, pass it silently
* prove it wrong, raise an error
* indecision, pass with warning and check at runtime
* incrementally improve strategies to decide more programs

Anyhow, type inference will typically occur before every compilation... whether it is JIT or full application. And in a streaming model, it might be performed by the recipient on a per-paragraph basis.

Best Regards,

Dave

Rajiv Abraham

unread,
Oct 29, 2015, 10:49:59 PM10/29/15
to reactive-demand
Hi David,

I am an admirer of the breadth of your PL knowledge and love to read your answers on LTU.

I wanted to learn RDP by implementing it in another language. Regarding your mention in the previous email that RDP can be written in any language, I had a few questions.

- I was thinking of using Rust but Rust apparently does not support arrows[1] which I understand to be the one of the basic features in RDP. Would it still be possible to build something in Rust or do you see other difficulties as well.

- Is static types critical in RDP? Would it be worthwhile building it in Erlang/Elixir.

Regards,
Rajiv.


[1] - the first answer of https://m.reddit.com/r/rust/comments/2e76zs/rust_as_a_host_for_multilevel_languages_using/

David Barbour

unread,
Oct 29, 2015, 11:50:02 PM10/29/15
to reactive-demand

Arrows and static types aren't critical to RDP. They just provide some useful constraints, ensure more programs are valid before runtime.

Also Arrowized vs. Monadic APIs... this is less about syntax, more about whether you're working with and composing first class behaviors (signal -> signal) vs. directly manipulating signal values.

What arrows protect you from that monads do not, primarily, is introducing a signal value out of thin air. RDP forbids this (due to duration coupling). Fortunately, there are other ways to enforce or encourage the same property, e.g. ADTs or wrappers to prevent accidental construction of a signal.

Arrows did help me formalize RDP and understand it. But I may favor a monadic API the next time I implement RDP. It's more convenient for the ad-hoc data plumbing.

Static typing, of course, mostly prevents us from accidentally comparing apples and oranges and offers some performance benefits. I find it convenient, except when the type system isn't expressive enough (such as when modeling generic data plumbing or staged programming).

Anyhow, using Rust or Erlang should not be an issue. IIRC, a few people have partially implemented RDP in JavaScript and Arc.


--
You received this message because you are subscribed to the Google Groups "reactive-demand" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reactive-dema...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rajiv Abraham

unread,
Nov 3, 2015, 1:12:46 PM11/3/15
to reactiv...@googlegroups.com
Thanks David. I look forward to learning more about RDP.

--
You received this message because you are subscribed to a topic in the Google Groups "reactive-demand" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/reactive-demand/QD4-1YBS8gM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to reactive-dema...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Take care,
Rajiv

Manuel Simoni

unread,
Nov 3, 2015, 4:24:23 PM11/3/15
to reactive-demand
Hi Rajiv,

I've created a trivial 200-line implementation of some aspects of RDP in JavaScript you can look at:

Best,
Manuel

Rajiv Abraham

unread,
Nov 3, 2015, 10:07:52 PM11/3/15
to reactiv...@googlegroups.com
Hi Manuel,
I appreciated your high level description of RDP on your blog some time back. Thanks for bucky-rdp, I will check it out.

Regards,
Rajiv

Joe Blue

unread,
Nov 13, 2015, 5:38:14 PM11/13/15
to reactive-demand
Rdp looks like a nice system.

Anyone using it with golang ?
Reply all
Reply to author
Forward
0 new messages