Simple Dynamic Strings library for C (by antirez)

SDS Alternatives

Similar projects and alternatives to SDS

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better SDS alternative or higher similarity.

SDS reviews and mentions

Posts with mentions or reviews of SDS. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-05-06.
  • Safest way to copy a string?
    3 projects | /r/C_Programming | 6 May 2023
    Even better, use a string handling library. Personally I am a big fan of (sds)[] from the Redis creator. It's not even a dependancy you can just copy the .c and .h to your project.
  • New C features in GCC 13
    3 projects | /r/C_Programming | 4 May 2023
    One nice application is length-prefixed string literals to complement dynamic string libraries:
  • C Strings and my slow descent to madness
    3 projects | | 6 Apr 2023
    With the woes of string.h being known, why not just use an alternative like ?

    I’ve also been having a blast with C because writing C feels like being a god! But the biggest thing that I like about C is that the world is sort of written on it!

    Just yesterday I needed to parse a JSON… found a bunch of libraries that do that and just picked one that I liked the API.

  • C_dictionary: A simple dynamically typed and sized hashmap in C - feedback welcome
    10 projects | /r/C_Programming | 23 Jan 2023
    d) everything being a macro seems overkill for me (and possibly dangerous, see b)). Maybe implement more as static inline functions, see the sds header: (which does a similar thing with the header struct).
  • Updated book to learn C
    2 projects | /r/C_Programming | 15 Jan 2023
    For example, you can use the C language with sds strings (see if you want to have an easier time with string formatting and don't want to worry about using the famously unsafe string.h functions correctly. You'll still program in ISO C, but just not in the standard library. The same applies to pretty much all parts of the standard library, the only part unsurpassed is pretty much just printf and the math headers (math.h, fenv.h, tgmath.h, complex.h) imo, and the occasional call to exit. A good place to look for libraries if you want to go that route is the awesome-c collection:
  • Convenient Containers: A usability-oriented generic container library
    4 projects | /r/C_Programming | 26 Dec 2022
    One way around this problem is to declare the container as a pointer to the element type and then store the container’s metadata, alongside its elements, in the heap block to which the pointer points. This approach is already used for dynamic arrays in several container libraries, most notably stb_ds and sds. They place the metadata before the elements and provide the user with a pointer to the elements themselves (this has the nice effect that users can use the [] operator to access elements).
  • A convenient C string API, friendly alongside classic C strings.
    7 projects | /r/programming | 3 Dec 2022
    Simple Dynamic Strings library for C
    7 projects | /r/programming | 3 Dec 2022
    The canonical library for this is SDS. Any new claimant to the C-string throne should explain the advantages/disadvantages/trade-offs of its use in comparison to SDS.
  • Show HN
    3 projects | | 3 Dec 2022
    I always use antirez's (Redis creator) `sds` and advertise it whenvever I get the chance. It's a joy to use :

    From the Readme:


  • Is there a convention for "private" struct members?
    2 projects | /r/C_Programming | 17 Nov 2022
    The approach you suggest works in some cases, but I don't think the one you suggest is very good. I think a good example of such use, is sds string. He uses a hidden prefix, instead of suffix, but that is just an implementation detail. It works because he is returning a pointer to the user data. However, sds string should only be manipulated via functions, while user data can be manipulated like C strings. There is only one public header, but what user is concern with, is just the opaque pointer 'sds', which is manipulated by functions, so those structs that sds string are could as well be in a private header.
  • A note from our sponsor - InfluxDB | 27 Sep 2023
    Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge. Learn more →


Basic SDS repo stats
27 days ago

antirez/sds is an open source project licensed under BSD 2-clause "Simplified" License which is an OSI approved license.

The primary programming language of SDS is C.

Static code analysis for 29 languages.
Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.