diff options
author | Melody Horn <melody@boringcactus.com> | 2020-10-28 17:01:55 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2020-10-28 17:01:55 -0600 |
commit | edf87f09045e8f56576b37078b4a0d220d6ddf55 (patch) | |
tree | 4503afb80ee7ea068db257c6381541a5fe1f716b /vs-c.md | |
parent | 72e8cabe8e3c8ae272fb4771f0d1dabb306dc2ae (diff) | |
download | spec-edf87f09045e8f56576b37078b4a0d220d6ddf55.tar.gz spec-edf87f09045e8f56576b37078b4a0d220d6ddf55.zip |
start using Sphinx for doc generation
Diffstat (limited to 'vs-c.md')
-rw-r--r-- | vs-c.md | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -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` |