Strings in C... tiring and unsafe. So I just made this lib. Am I doing it right, Reddit ?

This page summarizes the projects mentioned and recommended in the original post on /r/programming

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • libds

    A collection of data structures for C

  • So, I wrote a new library recently that works produces and consumes strings in the form that C already uses them in (making them more easily usable everywhere) - https://github.com/lelanthran/libds/blob/v1.0.5/src/ds_str.h

  • buf

    Discontinued C string buffer library (by alcover)

  • The commit history is...very clean https://github.com/alcover/buf/commits/master

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • SPString

    A C string library that's designed with embedded development in mind.

  • I've developped my own string library 15 years ago and used it in payment terminals with rather limited memory. if you are so concerned with string size, 2 bytes is enough for 65535 characters, which is enough for nearly everything. You are never going to allocate 8 bytes/string, that's stupid. If you need to work on more than that (a text editor for instance) you are not going to use C strings anyway, but some more complicated data structure. If you think adding 2 bytes per string is a problem, you probably are optimizing the wrong way. Pascal strings have been used since the 1970s and AFAIK have never been a problem memory-wise. And that's normal since they took exactly the same size as C strings.

  • SDS

    Simple Dynamic Strings library for C

  • How does this compare to https://github.com/antirez/sds ?

  • stb

    stb single-file public domain libraries for C/C++

  • Are you aware of the STB Stretchy Buffer? https://github.com/nothings/stb/blob/master/stretchy_buffer.h

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts