RAMBLING 2019-10-20 08:47 PM Just some rambling. To define a programming language, you define the mapping: Your language feature -> The target language feature But to define a programming language syntax, is entirely up to you. This gives birth to many paradigms: * Declarative * Procedural * Functional * Object-oriented The ultimate purpose of a program is to automate. Automation must be able to mimic what humans can do. This means: * Problem segregation * Arithmetic * Working with text * Logical deduction * Input/Output These 3 things allow for easy communication and reasoning. Without one or the other, there's no point in existing. This means all programming languages should implement arithmetic,boolean algebra, pi calculus, string processing, and a way to accept input and output from the world *in a conveyor belt-like fashion*. ## Drafting .... say hello to: your friend, age { !["hey how are you ", your friend, "you're ", age, " years old, right?"] } get my best friend's name: { "bill" } random age in seconds: { (60.00 * 60.00 * 24.00 * 365.00 * 100.00) } say hello to(someone, someone's age) | someone: get my best friend's name() | someone's age: random age in seconds() .... Types are what you actually type - "string", 100.00, 0x12, 0x3223 This means the language is type strict. SHA256 .... h0: { 0x12345678 } // type can be inferred as u32 // define the rest k0-63: { [0x12345678, ...] } //begin with the original message of length L bits message: { (arg[0] % "") $ from_char_to_u8 } //append a single '1' bit message_with_bit: { !(message()) * 0x80 } // recombine into a chunk of memory // append K '0' bits, where K is the minimum number >= 0 such that L + 1 + K + 64 is a multiple of 512 K_bits: { ((|message| * 8) + 1 + 64) % 512 } // TODO figure out lengthy repetition append_K_bits: { message_with_bit() * (K_bits()) } // append L as a 64-bit big-endian integer, making the total post-processed length a multiple of 512 bits // infers u64 for "8". append_L_length: { append_K_bits() * (|message()| * 0x00000000000000008) } prepared_message: { append_L_length() } // TODO: syntax for breaking up into chunks chunks: { (prepared_message() _ 512) } // for each process_chunk: chunk, index, array { // create 64 elements, each 32-bits // can be skipped? [,,,,,,,,,,,,,,,,,,,,...] // copy chunk into 16 elements // (512 / 32 = 16 elements) c: { (chunk ! 32) } // recombine into 32-bit words (16 elements) d: { c() * [, , ,,,,,...] } // extend to 64 elements e: { d() $ extend_chunk } a: { h0() } // can infer a is a number of certain bit-width e() $ (: chunk, index, array { ... a: { ... } }) h0: { h0() + a() } } chunks() $ process_chunk digest: { ![h0(), h1(), h2(), h3(), h4(), ...] } to_hex(digest()) extend_chunk: chunk, index, array { if index >= 16 { chunk + s0(index, array) + (array ?1 index-7) + s1(index, array) } } s0: index, array { (array[index-15] >> 7) ^ (array[index-15] >> 18) ^ (array[index-15] >> 3) } s1: index, array { (array[index-2] >> 17) ^ (array[index-2] >> 19) ^ (array[index-2] >> 10) } ....