stricks
SDS
Our great sponsors
stricks | SDS | |
---|---|---|
8 | 43 | |
89 | 4,328 | |
- | - | |
0.0 | 0.0 | |
over 1 year ago | 4 months ago | |
C | C | |
GNU General Public License v3.0 only | BSD 2-clause "Simplified" License |
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.
stricks
-
Buffet
> I was thinking about Simple Dynamic Strings but I like this better.
Oh! here's my chance to plug https://github.com/alcover/stricks ! It follows the same principle as SDS (i.e user-facing type is char*) but is much faster (see bench) and frankly nicer to read through.
Not as feature complete, though.
-
Speeding past Redis/SDS strings
Mine is also variable (see https://github.com/alcover/stricks/blob/main/src/stx.c). Maybe they switch more often that necessary ?
The threads were very interesting. I got back to work and it's time to talk speed ! https://github.com/alcover/stricks#speed
- Show HN: Stricks, managed C strings library
SDS
-
C_dictionary: A simple dynamically typed and sized hashmap in C - feedback welcome
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: https://github.com/antirez/sds/blob/master/sds.h (which does a similar thing with the header struct).
-
Updated book to learn C
For example, you can use the C language with sds strings (see https://github.com/antirez/sds) 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: https://github.com/oz123/awesome-c
-
Convenient Containers: A usability-oriented generic container library
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.
Simple Dynamic Strings library for C
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
I always use antirez's (Redis creator) `sds` and advertise it whenvever I get the chance. It's a joy to use :
https://github.com/antirez/sds
From the Readme:
```
-
Is there a convention for "private" struct members?
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.
-
[Ultra C Noob] What projects to study/work on to boost portfolio, get better at software dev.
In doing so, you’ll probably want to use libraries, such as cURL and potentially SDS for strings and SQLite for storing data. Building C codebases that can link and run against these using tools of your choosing is quite the endeavor, and learning Make, Ninja, CMake, or any mix of the above is very handy for leveling up your C programming.
- Buffet
- BCHS: OpenBSD, C, httpd and SQLite web stack
What are some alternatives?
Better String - The Better String Library
libcpuid - a small C library for x86 CPU detection and feature extraction
Experimental Boost.MSM-lite - Boost.SML (formerly called Boost.MSM-lite)
ZXing - ZXing ("Zebra Crossing") barcode scanning library for Java, Android
C++ Format - A modern formatting library
stb - stb single-file public domain libraries for C/C++
STX - C++17 & C++ 20 error-handling and utility extensions.
DynaMix - :fish_cake: A new take on polymorphism in C++
SLRE - Super Light Regexp engine for C/C++
safestringlib
RE2 - RE2 is a fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python. It is a C++ library.
Serial Communication Library - Cross-platform, Serial Port library written in C++