70 lines
4.5 KiB
HTML
70 lines
4.5 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<title>CLiki: nibbles</title>
|
||
|
<link rel="alternate" type="application/atom+xml" title="ATOM feed of edits to current article"
|
||
|
href="https://www.cliki.net/site/feed/article.atom?title=nibbles">
|
||
|
<link rel="stylesheet" href="static/css/style.css">
|
||
|
<link rel="stylesheet" href="static/css/colorize.css">
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<span class="hidden">CLiki - nibbles</span>
|
||
|
<div id="content"><div id="content-area"><div id="article-title">nibbles</div><div id="article">Nibbles is a library for accessing octet-addressed blocks of data.<p>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.<p>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.<p>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):<p> (nibbles:sb32ref/le vector index)<p>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.<p>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.<p>Homepage: <a href="https://github.com/sharplispers/nibbles">https://github.com/sharplispers/nibbles</a><p>License: <a href="BSD.html" class="category">BSD</a><p><hr>
|
||
|
Topics: <a href="binary format.html" class="category">binary format</a> <a href="system programming.html" class="category">system programming</a></div></div>
|
||
|
<div id="footer" class="buttonbar"><ul><li><a href="nibbles.html">Current version</a></li>
|
||
|
<li><a href="https://www.cliki.net/site/history?article=nibbles">History</a></li>
|
||
|
<li><a href="https://www.cliki.net/site/backlinks?article=nibbles">Backlinks</a></li><li><a href="https://www.cliki.net/site/edit-article?title=nibbles&from-revision=3780292222">Edit</a></li><li><a href="https://www.cliki.net/site/edit-article?create=t">Create</a></li></ul></div>
|
||
|
</div>
|
||
|
<div id="header-buttons" class="buttonbar">
|
||
|
<ul>
|
||
|
<li><a href="https://www.cliki.net/">Home</a></li>
|
||
|
<li><a href="https://www.cliki.net/site/recent-changes">Recent Changes</a></li>
|
||
|
<li><a href="CLiki.html">About</a></li>
|
||
|
<li><a href="Text Formatting.html">Text Formatting</a></li>
|
||
|
<li><a href="https://www.cliki.net/site/tools">Tools</a></li>
|
||
|
</ul>
|
||
|
<div id="search">
|
||
|
<form action="https://www.cliki.net/site/search">
|
||
|
<label for="search_query" class="hidden">Search CLiki</label>
|
||
|
<input type="text" name="query" id="search_query" value="" />
|
||
|
<input type="submit" value="search" />
|
||
|
</form>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div id="pageheader">
|
||
|
<div id="header">
|
||
|
<span id="logo">CLiki</span>
|
||
|
<span id="slogan">the common lisp wiki</span>
|
||
|
<div id="login"><form method="post" action="https://www.cliki.net/site/login">
|
||
|
<label for="login_name" class="hidden">Account name</label>
|
||
|
<input type="text" name="name" id="login_name" class="login_input" />
|
||
|
<label for= "login_password" class="hidden">Password</label>
|
||
|
<input type="password" name="password" id="login_password" class="login_input" />
|
||
|
<input type="submit" name="login" value="login" id="login_submit" /><br />
|
||
|
<div id="register"><a href="https://www.cliki.net/site/register">register</a></div>
|
||
|
<input type="submit" name="reset-pw" value="reset password" id="reset_pw" />
|
||
|
</form>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body></html>
|