Code Monkey home page Code Monkey logo

accretions's Introduction

Accretions

OLD OLD OLD OLD OLD rewrite in progress

Home — Manual — Issues

Accretions is a collection of data structures that aren’t present in standard Common Lisp. Of course, we already have lists, and most CL implementations have performant hash tables, yet there remain other data structures essential to certain applications that are missing from the standard. Accretions is my collection of good (or, at least useful) implementations of them. If I’ve needed it more than once, and the code is good enough, here is where it winds up. [1]

Accretions would not exist without the essential work of Donald Knuth, Robert Sedgewick, Jon Bentley, Doug Hoyte, and others.

Certainly, Accretions isn’t alone in its implementations. With the slightly possible exception of ternary search trees, everything in here must already exist, scattered somewhere on the web. [2] Performance isn’t always discussed, however, and it’s never clear how tight or loose the code is. Here in Accretions, each algorithm or container comes with at least some analysis of how well it’s likely to perform in practice. It hopes to be a little faster, maybe a little more efficient, and maybe a little more consistent than other implementations out there.

What You Need

Strictly speaking?

Nothing. Individual lisp files can be compiled or evaluated as you need. Accretions is written to the Common Lisp specification, and relies on no external systems or packages in its source.

Loosely speaking?

If you want to use the asd system definitions that come with Accretions (of course you do), you’ll need ASDF 3.1.2 or later (along with associated systems like UIOP). This should be no problem, every major lisp environment is already including even later versions ASDF, and has been for years.

Very loosely speaking?

If you want to run the tests that are packaged in Accretions, then you’ll need the FiveAM test framework. It’s available via Quicklisp, so if you have that, FiveAM is but a quickload away.

What You Get Now

Bags

Also known as Multisets, these are simple unordered collections of items.

Ternary Search Trees

A really nice collection filling the space somewhere between hash tables and tries; great for dictionaries! The Accretions implementation allows for any key sequence, not just strings. It provides the functionality of a trie without the unfortunate space overhead. [3]

Red-Black Trees

Notes on 2-3 and red-black go here.

Hash Tables

The Common Lisp standard is built around an implementation-provided sxhash function that cannot be replaced [4] and a hash space built around it using fixnums and lists. Accretions offers a hash table implementation that allows for updating hash algorithms, evaluating alternate algorithms (e.g., Murmur, CityHash, FarmHash) as well as functions provided by the client.

What You Get in the Future

Quicklisp

I’ll submit this for distribution via Quicklisp once I feel it’s good enough.

More Containers

Or more algorithms? Feel free to suggest something!

What You Probably Won’t Get

I’ve experimented with functional data structures (as described by Osazaki) and it’s true, they have very promising characteristics in persistence and safety. I really like them for that. However, their overhead in space (albiet temporary) can be prohibitive for larger applications, and so I’ll revisit this another time if I can. Especially, I encountered some very interesting approaches, including treating data as streams instead of contiguous blobs of memory that really bear further investigation.

Next Step

Okay, so go hit the Manual!

Accretions License

Accretions is available under the MIT Open Source License.

Copyright © 2018, 2019 Robert S. Krzaczek

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.


1. Yes, I’m through re-implementing these wheels from scratch, over and over…​
2. No, I haven’t checked personally.
3. Especially in this age of Unicode.
4. Well, okay, some implementations allow you to supply a hash function of your choice, but it’s not as common as you’d hope.

accretions's People

Contributors

krz8 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.