-
Notifications
You must be signed in to change notification settings - Fork 0
Evaluation
Joakim edited this page Dec 19, 2021
·
8 revisions
kesh is line-oriented.
- Code is evaluated line-by-line, top to bottom
- Lines are separated by either newline or comma
,
- There are two types of lines:
- Declaration lines
- Expression lines
- A block
{}
consists of lines- Declaration lines
- Expression lines
- A block has its own (lexical) scope
- A block's value is the value of its last evaluated expression line
- A block is an expression
- A collection
[]
consists of lines- Declaration lines if object
- Expression lines if other type
- Collection is a reference type
- A tuple
()
consists of lines- Expression lines
- Tuple is a reference type, ideally it would have value semantics
- A function
->
consists of parameters and a body- Its parameters is the unpacking of its argument, as either a tuple or a collection
- The unpacked argument's values exist in the function scope
- Its body is an expression, typically a block
- Its parameters is the unpacking of its argument, as either a tuple or a collection
- Function is a reference type, being also a collection
- A function is a callable collection
This programming language only exists as a design. I'm unlikely to ever get the chance to write a compiler for it.
Feel free to steal any parts of it that you like. Ideas are better stolen than forgotten. (They're not my ideas anyway.)