# Passing ruby literals over TPC as an alternative to Xml-Rpc

**URL:** <https://www.ruby-forum.com/t/passing-ruby-literals-over-tpc-as-an-alternative-to-xml-rpc/81370>\
**Category:** Ruby\
**Created:** [January 8, 2007, 3:35pm UTC](https://www.ruby-forum.com/t/passing-ruby-literals-over-tpc-as-an-alternative-to-xml-rpc/81370 "2007-01-08T15:35:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dolazy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eb8c5e/32.png) [@Dolazy](https://www.ruby-forum.com/u/Dolazy)\
**Post date:** [January 8, 2007, 3:35pm UTC](https://www.ruby-forum.com/t/passing-ruby-literals-over-tpc-as-an-alternative-to-xml-rpc/81370/1 "2007-01-08T15:35:49Z")

</div>

Passing ruby literals seems an easy way to let programs communicate  
with each other… And it eliminates the verbosity of XML.

I’ll give an example for those not familiar with literals or xml-rpc:  
Instead of sending:  
  
  
1404  
Something here  
1

you would be sending:  
[1404, “Something here”, 1]

Do you think it could be a valid alternative to Xml-Rpc?

I would love to hear your insights 🙂

Kind regards,  
Francis

---

<div class="post-metadata">

**Author:** ![Dolazy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eb8c5e/32.png) [@Dolazy](https://www.ruby-forum.com/u/Dolazy)\
**Post date:** [January 8, 2007, 3:51pm UTC](https://www.ruby-forum.com/t/passing-ruby-literals-over-tpc-as-an-alternative-to-xml-rpc/81370/2 "2007-01-08T15:51:52Z")

</div>

Dolazy wrote:

> Francis

But if you are using an XML-RPC library you will never see the XML. How  
is this a problem?

What you are suggesting would work but then you could also use bencoding  
(as used in torrent files), which has a smaller overhead than XML but is  
quite flexible.

Sure passing stuff over sockets would work 🙂 but why do you feel the  
need to replace XML-RPC? There is a little more to XML-RPC than the XML  
encoding, ok not much more but it is more than just stuffing things into  
XML. The advantages of using XML-RPC is that it will allow other  
programming languages to communicate with you without having to write  
libraries for your new protocol for half a dozen languages.

Now SOAP, that’s an abomination!

---

<div class="post-metadata">

**Author:** ![Dolazy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eb8c5e/32.png) [@Dolazy](https://www.ruby-forum.com/u/Dolazy)\
**Post date:** [January 8, 2007, 3:58pm UTC](https://www.ruby-forum.com/t/passing-ruby-literals-over-tpc-as-an-alternative-to-xml-rpc/81370/3 "2007-01-08T15:58:52Z")

</div>

Peter H. wrote:

> > ```
> > <value><i4>1</i4></value>
> > 
> > ```
> > 
> > Kind regards,  
> > quite flexible.
> 
> Sure passing stuff over sockets would work 🙂 but why do you feel the  
> need to replace XML-RPC? There is a little more to XML-RPC than the XML  
> encoding, ok not much more but it is more than just stuffing things into  
> XML. The advantages of using XML-RPC is that it will allow other  
> programming languages to communicate with you without having to write  
> libraries for your new protocol for half a dozen languages.
> 
> Now SOAP, that’s an abomination!

I’m sure YAML-RPC’s been suggested before, if XML verbosity makes the  
hairs on the back of your neck stand on end, and if cross-language  
compatibility isn’t an issue, DRb’s the way to go, surely…

---

<div class="post-metadata">

**Author:** ![Dolazy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eb8c5e/32.png) [@Dolazy](https://www.ruby-forum.com/u/Dolazy)\
**Post date:** [January 8, 2007, 7:31pm UTC](https://www.ruby-forum.com/t/passing-ruby-literals-over-tpc-as-an-alternative-to-xml-rpc/81370/4 "2007-01-08T19:31:30Z")

</div>

You could also take a look at Orbjson ([http://orbjson.rubyforge.org/](http://orbjson.rubyforge.org/)).

Luis
