From 86435f1df94517c966b20e6c57b69b825cd56428 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Wed, 21 Oct 2020 19:52:37 -0600 Subject: don't compile to C after all --- index.md | 6 ++---- safety.md | 7 ++++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/index.md b/index.md index 2d19c0a..4a92406 100644 --- a/index.md +++ b/index.md @@ -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. diff --git a/safety.md b/safety.md index 271edc1..8a03652 100644 --- a/safety.md +++ b/safety.md @@ -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 -- cgit v1.2.3