backyard/ciel/README.md

37 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

2022-06-12 22:18:08 -07:00
it's a **C** **I**nteger **E**xpression **L**anguage…? maybe?
ciel doesn't actually do anything useful,
and it's more of an exercise in masochism.
read some notes from the C file itself:
```c
/* this code uses no #includes, because i've lost my mind. */
/* it also makes it easier to compile with hobbyists' compilers. */
/* this code is somewhat optimized for LOC after preprocessing with noccom. */
/* ( noccom: https://github.com/notwa/rc/blob/master/sh/noccom ) */
/* this code makes extensive use of the comma operator. */
/* i tried to avoid using the preprocessor for any side-effects. */
```
at the time of writing, ciel fits into 643 LOC,
under my arbitrary measure of lines-of-code.
you can find the mangled source code in `enfer.c`.
i avoid having multiple semicolons in one line, with these exceptions:
"for" loops, switch-case-breaks, and alongside closing braces.
also, most lines fit into 80 columns. there's a couple that don't (yet).
perhaps of note is the relatively compact robin-hood hash table implementation.
it supports looking (peeking), pushing, pulling (popping),
and expansion/growth (but not shrinkage).
there's also some utilization of perfect hashes
found by an external program through brute force.
these efficiently map operator strings to their respective numeric enumerations.
*aside:* ciel already has its own git repo with a ton of history,
but it's not for the public (i.e. it's an absolute clusterfuck).
*aside:* i wrote ciel before i really knew what Forth was, and now
i kinda want to make my own Forth instead of whatever the heck this is.