diff options
| author | the lemons <citrons@mondecitronne.com> | 2022-02-18 01:14:07 -0600 |
|---|---|---|
| committer | the lemons <citrons@mondecitronne.com> | 2022-02-18 01:14:07 -0600 |
| commit | beeb46c4795125eb95078ecaffd8dec415c9251d (patch) | |
| tree | 97f818187a8d82b3d73d519ccd05c4a8fb40a36f /lang.md | |
language existence
Diffstat (limited to 'lang.md')
| -rw-r--r-- | lang.md | 131 |
1 files changed, 131 insertions, 0 deletions
@@ -0,0 +1,131 @@ +# compact representation +compact representation is a hopefully compact representation for ideas. this document serves as its official specification. + +a CR "document" is a sequence of ASCII characters. characters outside of the range 0x20-0x7E are forbidden, except for `\n` (0x0A) and `\t` (0x09). when presenting CR to a human person, the exact encoding details are irrelevant, as humans read text with their eyes (or other sense organs). however, the characters in a CR document must be reasonably legible as their ASCII equivalents. it does not matter if the human reader is not able to discern the exact whitespace characters used in a document as long as they are able to discern their presence and location. + +## syntax +a CR document consists of any number of sentences. a sentence in CR consists of a single expression. each expression in CR evaluates to a noun. + +an expression consists of a literal noun (expressed as a sequence of alphebetic characters or if it is a number, numerical characters), a binary operation, or a unary operation. unary operators prefix the expression they operate upon. binary operators appear between the expressions they operate upon and are right-associative. parenthesis can be used to explicitly group expressions. + +"quotations" are a special type of literal noun which refer to statements or sequences of text themselves. there are two types of quotations. a bracket quotation is surrounded in square brackets, and must contain within it a syntactically valid CR document. a normal quotation is enclosed in double quotes and may contain anything of any syntactic validity or language. however, a normal quotation must be properly escaped. the only escape sequences available in a normal quotation are `\\` and `\"`. + +### described in EBNF +``` +alpha = ? [a-z][A-Z] ? ; +num = ? [0-9] ? ; +ws = { ? whitespace characters ? } ; + +literal = alpha , { alpha } | num , { num } | quote ; + +binop = ? binary operator, see § binary operators ? ; +unop = ? unary operator, see § unary operators ? ; + +operation = unop , ws , expr + | ( literal | "(" , ws, expr , ")", ws ) , binop , ws , expr ; + +expr = literal | operation | "(" , ws , expr , ")" , ws + +document = ws , { expr } + +quote char = "\\" , ? any character ? | ? any character except double quotes ? +normal quote = "\"" , { quote char } , "\"" + +bracket quote = "[" , document , "]" + +quote = normal quote | bracket quote +``` + +## the meaning of a noun +the meaning of literal nouns (which are not quotations or numbers) is determined thusly (in this exact order): + +1. if the meaning of the literal noun, is defined in this standard's noun list, then the meaning of the noun is according to the list. +2. if the meaning of the literal noun has been defined previously via the `::=` operator, then the meaning of the noun is according to that definition. +3. the meaning of the literal noun must be determined from context, e.g. it is the name of a person. + +it is recommended that nonstandard nouns (nouns defined via step #2 or #3) are initially capitalized to distinguish them from standard nouns, which will never be capitalized. however, this is just proposed convention and is not required to conform to the standard. + +## the meaning of a sentence +a sentence consists of a single expression. each expression evaluates to a noun, and so to find the meaning of a sentence, the expression is evaluated. if the expression's meaning is X, then the meaning of the sentence is "there exists X". + +CR makes no distinction between statements such as "the/a person who is thinking exists" and "the/a person is thinking". both would be: +``` +g>:f +``` +## operator side-effects +some operators have **side-effects** which means that + +## binary operators +the binary operators, when used, evaluate to their definitions below. + +the two operands are denoted as `x` and `y` in these definitions. they are the first and second operands respectively. `*_x` or `*_y` are to be intepreted as "(an) instance(s) of `x`" or "(an) instance(s) of `y`". +### `=` +`x` which is the same thing as `y` + +### `>` +`x` which causes `*_y` + +### `>:` +`x` which manifests `*_y` + +### `&` +`x` and `y` + +### `^` +`x` xor `y` + +### `|` +`x` or `y` + +### `?` +`y` which exists if `x` exists + +### `?_` +a hypothetical `y` which exists according to/in the perspective of `*_x` + +### `/` +`y` which is located in/on/at `*_x` + +### `%` +`y` which concerns/pertains to/is about `x` + +### `~` +`y` which is similar to/like/as `x` + +### `$` +`y` which is the conduit of/embodies `x` + +### `#_` +`x` number of `y` + +## unary operators +the unary operators, when used, evaluate to their definitions below. + +the operand to the unary operator is denoted as `x` in these defintions. `*_x` is to be interpred as "(an) instance(s) of `x`". + +### `*_` +some specific instance(s) of `x` + +### `&_` +all instances of `y` where `x` is an instance of `y`; *such that* `&_*_x` *is equivalent to* `x` + +### `!` +nothing that is `x` or `*_x` + +### `!!:` +`x`; *this operator has the* **side-effect** *of emphasizing* `x` in the sentence + +### `?:` +a hypothetical/possible `x` + +### `?/` +the truth value of the statetment "there exists `x`" + +### `#` +the amount of `x` which exist + +## clarification: the meaning of `*_x` +the difference between `*_x` and `x` can be thought of like this: if `x` is "dog"/"dogs", then `*_x` is "some dogs" or "a dog". the difference becomes quite relevant when one performs definitions. + +if one makes the definition `X::=a`, then `X` is exactly the same thing as `a`. any usage of `X` would be identical to using `a`, which means that this definition wouldn't be very useful. instead, you can define `X` as an instance of `a` and then makes tatemetns about it, for instance `X::=*_a i>:X` would mean that `X` is a specific something, and that something is something you did. + |
