[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mapping data
Russ Ross <rgr22@cl.cam.ac.uk> writes:
> It's not limited to I/O, of course, but that seems to be a place
> where it comes up a lot. Shared memory, mmapped files, and network
> packets are the examples that come to mind where a specific data
> layout is required, often by an external source.
Since nobody else mentioned it..
Lisps like CMUCL provide primitives for directly accessing words of
memory, which can be used for e.g. C-struct or network packet
layouts. It seems reasonable to take a packet-description language
like Frode Vatvedt Fjeld's binary-types(*) and use it to generate
fast and safe code for munging network packets.
Existing binary-types backends convert between packets and native Lisp
datatypes like vectors and structures. This is convenient but it's not
up to really heavy lifting.
Cheers,
Luke
(*): http://www.cliki.net/Binary-types