Ian Patrick Badtrousers

Logos standard discourse

Standard discourse is a universal set of propositions fundamental to all logos dialects. It can be translated, as-in internationalized, but can never be overridden.

So far, it only covers what’s certain about the language.

// 1. Void manifests itself.
void.

// 2. Iota is an intangible particle, a form distinguished from void.
//
// Whilst void is the infinitely large, which is the totality of all
// possible propositions, iota is the infinitely small. And that is
// a single definition, correspondingly.
//
// Iota signifies meaning, void a lack thereof.
//
iota := not void.

// 3. Boolean is a iota of truthfulness.
//
boolean := iota.

// 4. True and false are the two boolean possibilities.
//
true, false := boolean.

// 5. From this, normal boolean logic arises.
//
not p :=
	p := boolean.

	-> p ?
		true  -> false.
		false -> true.

p and q :=
	p, q := boolean.

	-> p ?
		true  -> q.
		false -> false.

p or q :=
	p, q := boolean.

	-> p ?
		true  -> true.
		false -> q.

p xor q :=
	p, q := boolean.

	-> (p or q) and not (p and q).

// 6. Text is a non-empty sequence of propositions.
//
// This definition introduces spelling punctuation.
// To put ... is to read the text, as-in spell it out.
//
text := iota...

// 7. Panic is a proposition that renders discourse meaningless.
//
// It's defined via an assertion of syntaxically correct form,
// which can be shown to be contradictory.
//
// When such contradiction arise during a reading,
// present discourse is rendered meaningless.
//
panic! :=
	iota = void!

// 8. Herein is an intiutive if-then-else construction.
//
// 	if <condition is true>, then
// 		<clause>
// 	else
//		<alternative clause>
//
if condition, then clause :=
	condition := boolean.
	clause := text.

	condition -> clause...
	-> condition.

condition else alternative clause :=
	condition := boolean.
	alternative clause := text.

	not condition -> alternative clause...

// 9. For any sign, we can say of its value
Some sign is defined :=
	Some sign := iota.

	-> Some sign is iota.

// 11. Whole number, maximum absolute value is 9223372036854775807.
//
// |max| (either max, or -max) is the largest possible value
// int can maintain until it overflows.
//
int ::
	int + int -> int.
	int - int -> int.
	int * int -> int.
	int / int -> int.
	int ^ int -> int.

	int >  int -> bool.
	int <  int -> bool.
	int >= int -> bool.
	int <= int -> bool.

	int mod int -> int.
	|int| -> int.

// 12. Rune is a Unicode character.
//
// Any text encoding must assume a finite set of characters.
// You can hardly imagine an encoding with the word capacity
// of more than 2^63-1 (the practical limit of int.)
//
// It is safe to say any rune can be expressed by an integer.
//
rune := int

// 13. List is used to express a finite series of numbered elements.
//
item list ::
	(list)
	(index := int)

	// Get item by its index in the list.
	list[index] -> item.
	// True if item(s) is/are in the list.
	item... in list -> boolean.
	// True if item(s) is/are not in the list.
        item not in list -> boolean.
	// Total number of items in the list.
	list length -> int.
	// First occurrence of item.
	find item in list -> index.
	// Count occurrences of item.
	count item in list -> int.
	// Imperatives.
	add item to list!
	remove item from list!
	put item before list[index]!
	delete list[index]!

// 14. String is a list of runes.
//
string := rune list.

// 15. Actor is a iota of the people.
//
actor := iota.

// 16. This is the currently speaking actor.
//
this := actor.

// 17. Dictionary allows to go from keys to values.
//
from key to value ::
	(dictionary)
	(key, value := iota)

	dictionary[key] -> value.

	// True if key is in the mapping.
	keys in dictionary -> boolean.
	// True if key is not in the mapping.
	keys not in dictionary -> boolean.
	// Get the value by key.
	key dictionary -> value.
	dictionary of key -> value.

	// Imperatives.
	key dictionary = value!
	dictionary of key = value!
	delete dictionary[key]!

// TBA.