**GSoC Idea: Common (De)Serialization Infrastructure** %|||% &|Areas | (De)serialization, RPC |& &|Good if student knows | Tcl, C |& &|Priority | Medium to Low |& &|Difficulty | Medium to High |& &|Benefits to the student | Learning about data serialization, the challenges therein. |& &|Benefits to Tcl | Enhanced ability to exchange data with other languages |& &|Mentor | [AK], others |& &|Related Projects & Ideas| [GSoC Idea: Tcl Binding to Protocol Buffers] <
> [GSoC Idea: Tcl Binding to MessagePack] <
> [GSoC Idea: Updated Tcl bindings for ZeroMQ] <
> [https://chiselapp.com/user/andreas_kupries/repository/tclyaml%|%Tcl YAML]|& **Project Description** We currently have three possibilities of handling the (de)serialization of Tcl data structures to other formats. The main constraint in the design is that most (all?) (de)serialization formats around are (strongly) typed, whereas Tcl's basic data structures are not. The main ways of dealing with this impedance mismatch are: 1. Inbound map the serialized data to simple Tcl data structures, and ignore the type information. Outbound then requires constructor commands and/or additional data structures describing the data to generate and providing the necessary type information, implicitly or explicitly. 1. Inbound map the serialized data to simple Tcl data structures, but keep the type information somehow, for example as type tags. Outbound a generric converter can the directly serialize such a type-tagged structure without the need for helper structures. 1. '''Fill out''': TclOO structures mimicking simple Tcl structures and other types, with accessor methods. Each of these methods has their own advantages and disadvantages. Examples of both (1) and (2) can be found in [https://chiselapp.com/user/andreas_kupries/repository/tclyaml%|%Tcl YAML], with (1) using separate type description data structures. The pair of [https://core.tcl.tk/tcllib/doc/trunk/embedded/www/tcllib/files/modules/json/json.html%|%json] and [https://core.tcl.tk/tcllib/doc/trunk/embedded/www/tcllib/files/modules/json/json_write.html%|%json::write] packages of [Tcllib] are another example of (1), using constructor commands on the outbound side. Regarding approach (3) I am not aware of existing examples. This is what I am interested in here, with this idea. If that is a feasible approach, and if yes, what are its (dis)advantages ? **References** * to be filled in. <> **Comments & Discussion** <> <>GSoC