Vesa Karvonen
Posts: 116
Nickname: vkarvone
Registered: Jun, 2004
|
|
Re: Automated Serialization using Templates
|
Posted: Sep 14, 2005 5:08 AM
|
|
This isn't immediately related to your technique, but I thought it might still be interesting to know about.
Standard ML (SML) does not include language support for serialization. Furthermore, although the SML Basis Library does contain a few overloaded operators, SML does not provide language support for overloading. Nevertheless, you can implement a fairly convenient combinator library for serialization as shown in the technical report "Type-Specialized Serialization with Sharing" by Martin Elsman: http://www1.itu.dk/sw5450.asp.
You'll need to be able to read SML to make most out of the TR, but Elsman's combinator library essentially allows you to implement serialization functions (pickling and unpickling functions) by specifying the type of the data using combinators. The TR gives an example implementation of serialization functions for a list of integer pairs:
let open Pickle in list (pair (int, int)) end
The identifiers "list", "pair", and "int" in the above snippet of code are not bound to types, but to combinators that produce serialization functions. The combinators are defined by the "Pickle" module. The idiom "let open DSL in ... end" is a common idiom in SML for using a Domain Specific combinator Library (or Language).
|
|