Take a normal forth-like
25 4 * 100 = // true
Add parenthesis as a re-write rule, and move one symbol from the left to the right
write(2 4 *) becomes 2 4 * write
Take a normal forth-like
25 4 * 100 = // true
Add parenthesis as a re-write rule, and move one symbol from the left to the right
write(2 4 *) becomes 2 4 * write
| public static uint DataHash(byte[] data, uint len) | |
| { | |
| var hash = len; | |
| for (uint i = 0; i < len; i++) | |
| { | |
| hash += data[i]; | |
| hash ^= hash >> 16; | |
| hash *= 0x7feb352d; | |
| hash ^= hash >> 15; | |
| hash *= 0x846ca68b; |
| [Test] | |
| public void tiny_crypto() | |
| { | |
| var key = new byte[] { 55, 167, 44, 86, 217 }; | |
| var secretMessage = "This is the input text"; | |
| var input = Encoding.UTF8.GetBytes(secretMessage); | |
| var encrypted = Encode(input, key); |
maybe the wavefunction oscilates through time, taking alternate paths, until it gets stuck somewhere. Maybe this getting stuck loses information locally. That would seem to give a mechanism for collapse and directionality of time.
Forth and List based on a 'fundamental container type'. Forth -> stack, Lisp -> linked-list.
We take as the fundamental container type a list/stack hybrid.
Anything in a list is data. Anything outside is a function call.
Motivational example
(4) (1 2) + * # 12
(4 1 2) + * # same
"pipes" cover stream (read+write)
"cursor" over pipe to push & pull data (byte-wise, bit-wise, and broader types all mixed)
all types serialisable.
base is name(param) like lisp (similar to MECS)
special math mode
types are numeric (incl arbitrary), hash-map, vector, matrix. Everything on top of that
storage is scope, or mem-db
gc is at end of scope, special 'lift' if something survives scope.
| // No keywords? | |
| my.thing { // a namespace | |
| // proc head | |
| procname => | |
| inParam1 <- (u8) // a byte list | |
| inParam2 <- "" // a string | |
| { | |
| // proc body |
| static int[] cColors = { 0x000000, 0x000080, 0x008000, 0x008080, 0x800000, 0x800080, 0x808000, 0xC0C0C0, 0x808080, 0x0000FF, 0x00FF00, 0x00FFFF, 0xFF0000, 0xFF00FF, 0xFFFF00, 0xFFFFFF }; | |
| /// <summary> | |
| /// By Antonín Lejsek https://stackoverflow.com/a/33715138/423033 | |
| /// </summary> | |
| /// <param name="cValue"></param> | |
| public static void ConsoleWritePixel(Color cValue) | |
| { | |
| Color[] cTable = cColors.Select(Color.FromArgb).ToArray(); | |
| char[] rList = { (char)9617, (char)9618, (char)9619, (char)9608 }; // 0, 1/4, 2/4, 3/4, 4/4 |
| version, errorCorrectionLevel, totalDataCodewords, eccPerBlock, blocksInGroup1, codewordsInGroup1, blocksInGroup2, codewordsInGroup2, | |
| 1, L, 19, 7, 1, 19, 0, 0, | |
| 1, M, 16, 10, 1, 16, 0, 0, | |
| 1, Q, 13, 13, 1, 13, 0, 0, | |
| 1, H, 9, 17, 1, 9, 0, 0, | |
| 2, L, 34, 10, 1, 34, 0, 0, | |
| 2, M, 28, 16, 1, 28, 0, 0, | |
| 2, Q, 22, 22, 1, 22, |