Small embeddable scripting language (SESC)
- JSON compatible object notation
- Small
- Small executable footprint
- Small memory footprint
- Small-C compatible
- Small language set
- Consistency
- every thing should behave symmetrically
- ranges should act like lists
- Inspirations
- Javascript
- Duktape
- Lua
- Python
- Javascript
-
Needs Callable functionality
- ABI:
- Args are passed and returns as integer index in current scope
- Args are passed as list
argv
in current scope
- Parent Scope reference:
- integer index 0 in current scope (except root scope)
- called
parent
- Root Scope
- called
global
- called
root
- called
parent
- called
- Callable code bodies
- Looping
- Conditionals
- function definitions
- save as
- raw text
- define ctx and run with eval
- minified text
- runs as raw, but more efficient
- compiled byte code
- requires byte code parser
- moves toward full compilation
- executable parse tree
- just walk the tree to run the code
- similar to test approaches, but stored first half of eval already done.
- raw text
- ABI:
-
Needs Small-C compatible interpreter
-
Memory management
- Rely on reference counting
- Needs way to detect circular references
- Scan contents of htable for itself?
- Prevent an htable from containing itself as key or value?
-
Needs iterators
- Lists as:
- resizable array type
- Just a htable
- how to iterate through keys
- Lists as:
-
a better way to uniquely save strings
-
save memory
-
should hashs of htables hash contents?
-
operators
- just call into hash lookup function
- cfunc for each operator
- should unary be left associative? does it matter?
- Implicit Type conversions
- explicit type conversions
- function overloading through recursive context stack
- operator precedence
- want less levels than C, python, javascript or lua
- Pascal model makes some sense
- others
iff
logical equalityimplies
logicalxor
logical sum