From edf87f09045e8f56576b37078b4a0d220d6ddf55 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Wed, 28 Oct 2020 17:01:55 -0600 Subject: start using Sphinx for doc generation --- vs-c.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'vs-c.md') diff --git a/vs-c.md b/vs-c.md index 926973c..116870a 100644 --- a/vs-c.md +++ b/vs-c.md @@ -1,14 +1,12 @@ ---- -title: Comparison to C ---- +# Comparison to C What differentiates Crowbar from C? -# Removals +## Removals Some of the footguns and complexity in C come from misfeatures that can simply not be used. -## Footguns +### Footguns Some constructs in C are almost always the wrong thing. @@ -30,7 +28,7 @@ Some constructs in C exhibit implicit behavior that should instead be made expli - The conditional operator `?:` - Preprocessor macros (but constants are fine) -## Needless Complexity +### Needless Complexity Some type modifiers in C exist solely for the purpose of enabling optimizations which most compilers can do already. @@ -43,7 +41,7 @@ Some type modifiers in C only apply in very specific circumstances and so aren't - `volatile` - `_Imaginary` -# Adjustments +## Adjustments Some C features are footguns by default, so Crowbar ensures that they are only used correctly. @@ -60,15 +58,15 @@ However, sometimes it just sucks, and in those cases Crowbar makes changes. - All string literals, char literals, etc are UTF-8 - Octal literals have a `0o` prefix (never `0O` because that looks nasty) -# Additions +## Additions -## Anti-Footguns +### Anti-Footguns - C is generous with memory in ways that are unreliable by default. Crowbar adds [memory safety conventions](safety.md) to make correctness the default behavior. - C's conventions for error handling are unreliable by default. Crowbar adds [error propagation](errors.md) to make correctness the default behavior. -## Trivial Room For Improvement +### Trivial Room For Improvement - Binary literals, prefixed with `0b`/`0B` -- cgit v1.2.3