Re[2]: [Haskell] TABI 0.1: a typeful tagged cross-language calling convention

Hello Felipe, Tuesday, July 21, 2009, 7:38:44 PM, you wrote:
* passing complex datastructures between various languages forth and back, providing faster alternative to serialization approach
I've read the code and I don't see how tabi manages to do this.
it's not yet implemented :))) my idea is to provide one more basic type, TABI_TABLE=6, that allows to nest TABI_MAPs recursively. also arrays of TABI_* types may be supported
It is serializing as well but it is including the type and name information, so it seems that at best it would have the same overhead as just serializing the data without any metadata.
my first approach was to use just serialization (it was implemented in Lua sources included). but then i realized that it is monkey work - most time will be spent copying data to buffer, from buffer, searching for delimiters, processing type conversion. i'm pretty sure that C implementation of TABI_MAP will do its work (filling 3-4 words per parameter) an order of magnitude faster than serialization approach. also, serialized data anyway will be need to converted to datastructure like TABI_MAP in order to be used by calls like _str and _int for Haskell code, good optimized serialization library should have comparable speed. moreover, my current approach with malloc() calls probably makes encoding operations much slower if you have any specific needs, we can discuss it. my own needs is mainly combination of first and third clauses of quoted list, so second claim is somewhat artificial :) it is possible but only partially implemented -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On Tue, Jul 21, 2009 at 08:11:47PM +0400, Bulat Ziganshin wrote:
if you have any specific needs, we can discuss it. my own needs is mainly combination of first and third clauses of quoted list, so second claim is somewhat artificial :) it is possible but only partially implemented
I was just curious, because it seems to me that the only way of avoiding serialization costs would be having the same representation in memory for all languages and just passing pointers around instead of peek'ing and poke'ing everytime. Thanks, -- Felipe.

On Jul 21, 2009, at 10:37 AM, Felipe Lessa wrote:
it seems to me that the only way of avoiding serialization costs would be having the same representation in memory for all languages and just passing pointers around instead of peek'ing and poke'ing everytime.
Alternately, a whole slew of point-to-point translators might do the trick. Haskell to Lua (and back), Lua to Ocaml (and back), Ocaml to Ruby (and back), Ruby to Lua, etc., etc. That's a great deal of overhead beyond the "canonical representation" method, but it would achieve translation without explicit serialization. -johnnnnnn
participants (3)
-
Bulat Ziganshin
-
Felipe Lessa
-
John Melesky