backyard/ciel
Connor Olding a9b57de145 add ciel 2022-06-13 07:18:08 +02:00
..
README.md add ciel 2022-06-13 07:18:08 +02:00
charsqueeze.py add ciel 2022-06-13 07:18:08 +02:00
ciel.c add ciel 2022-06-13 07:18:08 +02:00
enfer.c add ciel 2022-06-13 07:18:08 +02:00

README.md

it's a C Integer Expression Language…? 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:

/* 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.