Skip to content

Commit fa5dc83

Browse files
committed
Merge branch 'master' of https://github.com/hirrolot/datatype99
2 parents f6d996d + 6ac4f71 commit fa5dc83

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,23 +510,30 @@ Thanks to Rust and ML for their implementations of sum types.
510510

511511
### Q: Why use C instead of Rust/Zig/whatever else?
512512

513-
A:
513+
A: There is a lot of software written in plain C that can benefit from Datatype99; C is #1 programming language as of 2020, [according to TIOBE](https://jaxenter.com/c-programming-may-2020-171598.html). People use C due to technical and social reasons:
514514

515-
- Datatype99 can be seamlessly integrated into existing codebases written in pure C -- just `#include <datatype99.h>` and you are ready to go. On the other hand, other languages force you to separate native C files from their sources, which is clearly less convenient. There is a lot of software written in plain C that can benefit from Datatype99; C is #1 programming language as of 2020, [according to TIOBE](https://jaxenter.com/c-programming-may-2020-171598.html).
515+
- Datatype99 can be seamlessly integrated into existing codebases written in pure C -- just `#include <datatype99.h>` and you are ready to go. On the other hand, other languages force you to separate native C files from their sources, which is clearly less convenient.
516516

517517
- In some environments, developers strick to pure C for historical reasons (e.g., embedded devices, Linux and other operating systems).
518518

519-
- C has a stable ABI which is vital for some projects (e.g., plugin systems).
519+
- C has a stable ABI which is vital for some projects (e.g., plugin systems such as [MetaCall]).
520520

521-
- C has a complete specification, unlike Rust. This has far-reaching implications, such as multiple implementations and fixed language behaviour. I know a few stories in which Rust was rejected as a language for a new project since it lacks a complete specification, and I can understand this decision.
521+
- C is a mature language with a complete specification and a plenitude of libraries. Rust has no complete specification, and [Zig] is not yet production-ready. I know a few stories when these two languages were rejected for new projects, and I can understand this decision.
522+
523+
- Historically, C has been targeting nearly all platforms. This is not the case with Rust, which depends on LLVM as for now.
522524

523525
- Your company obligates you to use C.
524526

525527
- Etc.
526528

529+
[MetaCall]: https://github.com/metacall/core
530+
[Zig]: https://ziglang.org/
531+
527532
See also:
528533
- [_Rust is not a good C replacement_](https://drewdevault.com/2019/03/25/Rust-is-not-a-good-C-replacement.html) by Drew DeVault.
529534

535+
Overall, if you can afford a more modern/high-level language, I encourage you to do so instead of using old C. However, many people do not have this possibility (or it would be too costly).
536+
530537
### Q: Why not third-party code generators?
531538

532539
A: See [Metalang99's README >>](https://github.com/Hirrolot/metalang99#q-why-not-third-party-code-generators).

0 commit comments

Comments
 (0)