Code Monkey home page Code Monkey logo

nibbles's Introduction

Introduction

When dealing with network protocols and file formats, it's common to have to read or write 16-, 32-, or 64-bit datatypes in signed or unsigned flavors. Common Lisp sort of supports this by specifying :element-type for streams, but that facility is underspecified and there's nothing similar for read/write from octet vectors. What most people wind up doing is rolling their own small facility for their particular needs and calling it a day.

This library attempts to be comprehensive and centralize such facilities. Functions to read 16-, 32-, and 64-bit quantities from octet vectors in signed or unsigned flavors are provided; these functions are also SETFable. Since it's sometimes desirable to read/write directly from streams, functions for doing so are also provided. On some implementations, reading/writing IEEE singles/doubles (i.e. single-float and double-float) will also be supported.

In addition to centralizing such facilities, NIBBLES also aspires to become a place where compiler optimizations can be written once and used everywhere. The intention is that (eventually):

(nibbles:sb32ref/le vector index)

will compile (with any necessary safety checks) to a MOVSX instruction on an x86oid processor in SBCL (or other implementations) if vector and index are of appropriate types.

I remember reading a post on comp.lang.lisp that suggested the designers of Common Lisp ignored the realities of octets and endianness and so forth. This library is a small step towards remedying that deficiency.

nibbles's People

Contributors

froydnj avatar scymtym avatar brown avatar kenanb avatar flambard avatar eudoxia0 avatar fare avatar glv2 avatar rpgoldman avatar

Watchers

Cyrus Harmon avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.