oz123 / awesome-c

A curated list of awesome C frameworks, libraries, resources and other shiny things. Inspired by all the other awesome-... projects out there.
Creative Commons Attribution Share Alike 4.0 International
9.18k stars 812 forks source link

Update README.md: add doc #206

Open yhh2021 opened 3 years ago

oz123 commented 3 years ago

Why is this comment necessary?

yhh2021 commented 3 years ago

Why is this comment necessary?

TL;DR: such technique are not standard and not widely supported. Many people's time will be wasted.

Long explanation: When I saw this section, I was surprised that there are GC implementations, but then I became puzzled: what? how does it work? just create some pointers and then they GC like a charm?

I then went to these projects' page, and similarly there are no explanation. (in fact one project explains, but it is too short that I didn't see it at the first time.) I then dig into the source, and finally, oops, just a wrapper to attribute stuff, which means I can not use them for the sake of cross-platform. My time is wasted, thus I add a comment to warn future visitors.

Maybe you didn't have to handle the problem of writing cross-platform code so you are used with the GNU extensions. Many GNU extensions are not supported somewhere or anywhere else. And when your project is required to run on another platform where its compiler do not accept such extensions, oops, you need to rewrite everything. The work can be tiny, and also can be huge. That's why portable code written in ANSI C is always welcomed, like sqlite.

Portability may be a minor consideration for the charming languages like Python, Haskell, Erlang, OCaml, Rust, Go etc., since even their language core is not quite portable. However, I believe many people have chose C for the sake of its portability - and I guess that's one of the most important reasons for some people choosing C. Hence, I think it is necessary to tag those libraries 1. not in ANSI C and 2. is not easy or impossible to port. I think those GC stuff using GCC's attribute fits the two requirements. I guess in fact some random compiler also support it, but generally it is not widely supported.

oz123 commented 3 years ago

Ok. Since you already dug into the source code, do you know which gc implementation uses attribute or is it all of them?