SDS
crystal
Our great sponsors
SDS | crystal | |
---|---|---|
48 | 238 | |
4,752 | 19,050 | |
- | 0.4% | |
0.0 | 9.8 | |
6 months ago | 4 days ago | |
C | Crystal | |
BSD 2-clause "Simplified" License | Apache License 2.0 |
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.
SDS
-
Safest way to copy a string?
Even better, use a string handling library. Personally I am a big fan of (sds)[https://github.com/antirez/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
One nice application is length-prefixed string literals to complement dynamic string libraries:
-
C Strings and my slow descent to madness
With the woes of string.h being known, why not just use an alternative like https://github.com/antirez/sds ?
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
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.
crystal
-
Top Paying Programming Technologies 2024
27. Crystal - $77,104
-
Crystal 1.11.0 Is Released
I like the first code example on https://crystal-lang.org
# A very basic HTTP server
> What's the state of Windows support.
https://github.com/crystal-lang/crystal/issues/5430
> UPDATE 2023-04-24:
> All the main platform features for Windows are finished!
> There are still some smaller stories pending. Project board: https://github.com/orgs/crystal-lang/projects/11/views/5
> You can support the ongoing development financially: Windows suppport (https://opencollective.com/crystal-lang/projects/windows-sup...) project on Open Collective.
- Is Fortran "A Dead Language"?
- Odin Programming Language
- I Love Ruby
-
Ruby 3.3's YJIT: Faster While Using Less Memory
Obviously as an interpreted language, it's never going to be as fast as something like C, Rust, or Go. Traditionally the ruby maintainers have not designed or optimized for pure speed, but that is changing, and the language is definitely faster these days compared to a decade ago.
If you like the ruby syntax/language but want the speed of a compiled language, it's also worth checking out Crystal[^1]. It's mostly ruby-like in syntax, style, and developer ergonomics.[^2] Although it's an entirely different language. Also a tiny community.
-
Jets: The Ruby Serverless Framework
Ruby is a super fun scripting language. I much prefer it to python when I need something with a little more "ooomph" than bash. It's just...nice...to write in. Ruby performance has come a long way in the last decade as well. There's libraries for pretty much everything.
My modern programming toolkit is basically golang + ruby + bash and I am never left wanting.
I do find Crystal (https://crystal-lang.org/) really interesting and am hoping it has its own "ruby on rails" moment that helps the language reach a tipping point in popularity. All the beauty of ruby with all of the speed of Go (and then some, it often compares favorably to languages like rust in benchmarks).
-
Rage: Fast web framework compatible with Rails
> It always puzzled me why Crystal didn't catch up?
M:N wasn't added until late 2019 :( -- https://github.com/crystal-lang/crystal/pull/8112
What are some alternatives?
zig - General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
Nim - Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
Better String - The Better String Library
go - The Go programming language
Elixir - Elixir is a dynamic, functional language for building scalable and maintainable applications
mint-lang - :leaves: A refreshing programming language for the front-end web
Odin - Odin Programming Language
tree-sitter-crystal
android.cr - Create Android applications using Crystal and the NDK
rust - Empowering everyone to build reliable and efficient software.
v - Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
crow - Transpile/compile Crystal to Flow