diff options
author | Melody Horn <melody@boringcactus.com> | 2020-10-21 19:52:37 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2020-10-21 19:52:37 -0600 |
commit | 86435f1df94517c966b20e6c57b69b825cd56428 (patch) | |
tree | 020f636fc0d28450eb394729dc7a5381fbbf741e | |
parent | 489469a7b6668bcf27362896f7a9ed4bc2a99de1 (diff) | |
download | spec-86435f1df94517c966b20e6c57b69b825cd56428.tar.gz spec-86435f1df94517c966b20e6c57b69b825cd56428.zip |
don't compile to C after all
-rw-r--r-- | index.md | 6 | ||||
-rw-r--r-- | safety.md | 7 |
2 files changed, 6 insertions, 7 deletions
@@ -1,13 +1,11 @@ Crowbar: the good parts of C, with a little bit extra.
-**This is entirely a work-in-progress, and should not be relied upon to be stable in any way.**
+**This is entirely a work-in-progress, and should not be relied upon to be stable (or even true) in any way.**
-Crowbar is a language that compiles directly to [C99](https://en.wikipedia.org/wiki/C99), and aims to remove as many [footgun](https://en.wiktionary.org/wiki/footgun)s and as much needless complexity from C as possible while still being familiar to C developers.
+Crowbar is a language that is derived from (and, wherever possible, interoperable with) C, and aims to remove as many [footgun](https://en.wiktionary.org/wiki/footgun)s and as much needless complexity from C as possible while still being familiar to C developers.
Ideally, a typical C codebase should be straightforward to rewrite in Crowbar, and any atypical C constructions not supported by Crowbar can be left as C.
-In principle, there's no reason it would be impossible to write a compiler directly for Crowbar, skipping the C step entirely, but that would take a lot of work.
-
# Removals
Some of the footguns and complexity in C come from misfeatures that can simply not be used.
@@ -46,11 +46,12 @@ bounds checking, dubious-pointer checking ## Use after free
-`free(x);` not followed by `x = NULL;` is a compiler error
+`free(x);` not followed by `x = NULL;` is a compiler error.
+`owned` and `borrowed` keywords
# Uninitialized variables
-C already warns about these in most cases, so we're good.
+forbid them in syntax
## Null pointer dereference
@@ -58,7 +59,7 @@ dubious-pointer checking ## Wild pointers
-let C handle it
+dubious-pointer checking
# Memory leak
|