pottery VS mpack

Compare pottery vs mpack and see what are their differences.

pottery

Pottery - A container and algorithm template library in C (by ludocode)

mpack

MPack - A C encoder/decoder for the MessagePack serialization format / msgpack.org[C] (by ludocode)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
pottery mpack
14 1
119 510
- -
1.8 1.1
about 2 years ago about 1 year ago
C C
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

pottery

Posts with mentions or reviews of pottery. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-03-22.
  • Popular Data Structure Libraries in C ?
    13 projects | /r/C_Programming | 22 Mar 2023
    Pottery - The page for open hash map reads "Documentation still needs to be written. In the meantime check out the examples."
  • So what's the best data structures and algorithms library for C?
    8 projects | /r/C_Programming | 15 Mar 2023
    "Using macros" is a broad description that covers multiple paradigms. There are libraries that use macros in combination with typed pointers and functions that take void* parameters to provide some degree of API genericity and type safety at the same time (e.g. stb_ds and, as you mentioned, my own CC). There are libraries that use macros (or #include directives) to manually instantiate templates (e.g. STC, M*LIB, and Pottery). And then there are libraries that are implemented entirely or almost entirely as macros (e.g. uthash).
  • Better C Generics: The Extendible _Generic
    9 projects | /r/C_Programming | 28 Jan 2023
    The prototype of CC used this mechanism to provide a generic API for types instantiated via templates (so basically like other container libraries, but with an extendible-_Generic-based API laid over the top of the generated types). This approach has some significant advantages over the approach CC now uses, but I got a bit obsessed with eliminating the need to manually instantiate templates.
  • C_dictionary: A simple dynamically typed and sized hashmap in C - feedback welcome
    10 projects | /r/C_Programming | 23 Jan 2023
  • Common libraries and data structures for C
    15 projects | news.ycombinator.com | 16 May 2022
    I think it's common for C programmers to roll their own. I did the same [0].

    I went pretty deep into composable C templates to build mine so it's more powerful than most. The containers can handle non-bitwise-movable types with full C++-style lifecycle functions and such, and the sort algorithms can handle dynamic and non-contiguous arrays (they are powerful enough to implement qsort() [1], which is more than I can say for any other C sort templates I've seen.) My reasoning for the complexity at the time was that any powerful container library is going to be reasonably complex in implementation (as anyone who's looked at STL source code knows), so it just needs to be encapsulated behind a good interface.

    I'm not so sure that's true anymore. These sorts of simpler libraries like the one linked here definitely seem to be more popular among C programmers. I think if people are using C, it's not just the C++ language complexity they want to get away from, but also the implementation complexity of libraries and such. There's a balance to be had for sure, and I think the balance varies from person to person, which is why no library has emerged as the de facto standard for containers in C.

    [0]: https://github.com/ludocode/pottery

  • C++ containers but in C
    8 projects | /r/C_Programming | 8 Mar 2022
  • Pottery – A pure C, include-only, type-safe, algorithm template library
    1 project | news.ycombinator.com | 23 Nov 2021
  • Ask HN: What you up to? (Who doesn't want to be hired?)
    25 projects | news.ycombinator.com | 1 Nov 2021
  • Type-safe generic data structures in C
    6 projects | news.ycombinator.com | 8 Apr 2021
    Yes! The include style of templates in C is way better than the old way of huge macros to instantiate code. The template code can look mostly like idiomatic C, it interacts way better with a debugger, it gives better compiler errors... everything about it is better and it's finally starting to become more popular.

    I've open sourced my own C template library here:

    https://github.com/ludocode/pottery

    Not only does it use the #include style of templates, but it actually makes the templates composable. It takes this idea pretty far, for example having a lifecycle template that lets you define operations on your type like move, copy, destroy, etc. This way the containers can fully manage the lifecycles of your types even if they're not bitwise movable.

    There's also this other more popular C template library, one that tries to more directly port C++ templates to C but with a lot less features:

    https://github.com/glouw/ctl/

  • Beating Up on Qsort (2019)
    2 projects | news.ycombinator.com | 14 Jan 2021
    This article doesn't really make it clear but the merge sort discussion is specifically about glibc's implementation of qsort(). glibc's qsort() and Wine's qsort() are the only ones I know of that use merge sort to implement qsort(). Most implementations use quick sort.

    I recently did my own benchmarking on various qsort()s since I was trying to implement a faster one. The various BSDs and macOS qsort() are all faster than glibc at sorting integers and they don't allocate memory:

    https://github.com/ludocode/pottery/tree/master/examples/pot...

    Of course sorting is much faster if you can inline the comparator so a templated sort algorithm is always going to be faster than a function that takes a function pointer. But this does not require C++; it can be done in plain C. The templated intro_sort from Pottery (linked above) is competitive with std::sort, as are the excellent swensort/sort templates:

    https://github.com/swenson/sort

mpack

Posts with mentions or reviews of mpack. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-11-01.
  • Ask HN: What you up to? (Who doesn't want to be hired?)
    25 projects | news.ycombinator.com | 1 Nov 2021
    I recently released a new version of my C MessagePack library MPack [1] with a cool new feature to dynamically calculate the size of maps and arrays during encoding. Having to always specify the size of containers up-front was a pain. I believe it's the only C/C++ MessagePack implementation that can do this. Of course bugs appeared immediately so I am working on a patch release.

    I am also working on and off on my C template library Pottery [2]. I haven't pushed any code in a while; having a day job and young children makes progress slow :(

    [1]: https://github.com/ludocode/mpack

What are some alternatives?

When comparing pottery and mpack you can also consider the following projects:

pdqsort - Pattern-defeating quicksort.

VW_Flash - Flashing tools for VW AG control units over UDS. Compression, encryption, RSA bypass, and checksums are supported for Simos18.1/6/10, DQ250-MQB, DQ381-MQB, and Haldex4Motion-Gen5-MQB.

mavis - opinionated typing library for elixir

py_regular_expressions - Learn Python Regular Expressions step by step from beginner to advanced levels

sc - Common libraries and data structures for C.

egglog0 - Datalog + Egg = Good

Klib - A standalone and lightweight C library

resholve - a shell resolver? :) (find and resolve shell script dependencies)

ctl - My variant of the C Template Library

datashare - A self-hosted search engine for documents.

libc - Raw bindings to platform APIs for Rust

adsb_deku - ✈️ Rust ADS-B decoder + tui radar application