Lightweight Typed Customizable Unmarshaling

Pascal Cuoq 1 Julien Signoles 1 Damien Doligez 2, *
* Corresponding author
1 LSL - Laboratoire Sûreté des Logiciels
DILS - Département Ingénierie Logiciels et Systèmes : DRT/LIST/DILS
Abstract : 1. Abstract The contribution of this work is threefold. First, we offer an OCaml unmarshaling algorithm that uses a lightweight type-directed de-scription of the expected structure of data to make consistency checks. The second contribution is the opportunity to specify func-tions to be systematically applied on values as they are being un-marshaled. Our third contribution is a type-safe layer for these functions and for the unmarshaling algorithm itself. 2. Description The standard OCaml unmarshaling function is input value: in channel → α. The aforementioned first contribution is a function descr input val with type in channel → descr → α. One value of type descr that can be passed as second argu-ment is Abstract, and then the behavior is exactly identical to input value. The programmer can provide as much information as (s)he wants for the additional consistency checks. For instance, (s)he can pass the value (t array Abstract) to specify that the value being read is an array of undescribed values. Our unmar-shaling algorithm maintains a cursor into the structure description, allowing it to know what the current loaded value should look like.
Document type :
Conference papers
Complete list of metadatas

Cited literature [12 references]  Display  Hide  Download

https://hal.inria.fr/hal-01091947
Contributor : Damien Doligez <>
Submitted on : Wednesday, February 4, 2015 - 5:29:05 AM
Last modification on : Thursday, February 7, 2019 - 2:21:26 PM
Long-term archiving on : Tuesday, May 5, 2015 - 10:05:55 AM

File

unmarshal-final.pdf
Files produced by the author(s)

Identifiers

  • HAL Id : hal-01091947, version 1

Collections

Citation

Pascal Cuoq, Julien Signoles, Damien Doligez. Lightweight Typed Customizable Unmarshaling. ACM SIGPLAN Workshop on ML, Sep 2011, Tokyo, Japan. ⟨hal-01091947⟩

Share

Metrics

Record views

299

Files downloads

121