You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-4Lines changed: 11 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -510,23 +510,30 @@ Thanks to Rust and ML for their implementations of sum types.
510
510
511
511
### Q: Why use C instead of Rust/Zig/whatever else?
512
512
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:
514
514
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.
516
516
517
517
- In some environments, developers strick to pure C for historical reasons (e.g., embedded devices, Linux and other operating systems).
518
518
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]).
520
520
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.
522
524
523
525
- Your company obligates you to use C.
524
526
525
527
- Etc.
526
528
529
+
[MetaCall]: https://github.com/metacall/core
530
+
[Zig]: https://ziglang.org/
531
+
527
532
See also:
528
533
-[_Rust is not a good C replacement_](https://drewdevault.com/2019/03/25/Rust-is-not-a-good-C-replacement.html) by Drew DeVault.
529
534
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
+
530
537
### Q: Why not third-party code generators?
531
538
532
539
A: See [Metalang99's README >>](https://github.com/Hirrolot/metalang99#q-why-not-third-party-code-generators).
0 commit comments