- fixed-width (4 byte) stack-based bytecode, put long jumps
- no keyword args
- fibers model similar to wren (but call them virtual threads)
- whitespace sensitivity, but not indentation-delimited blocks
- nanboxing
improve:
- diagnostics (unified Error type across the entire language, with support for reporting spans)
- no keywords means no need for macros for bindings
Handle
with get
/get_mut
methods which are unsafe for outside use.
if you want panics, use RefCell
. if you want locks, use Mutex
. control is handed to the user. values given to the VM need to be 'static
.
Deref
/DerefMut
for internal use
public API could be simpler (and unsafe), with sugar using extractors on top. that way users could choose to use the unsafe API to do more interesting (and zero-cost) stuff, or use the convenient sugar to write safe code.
- unify all the crates into one (except derive, but derive should not be used internally)
- remove variable-width encoding, use a simple enum+match dispatch
- remove delegate_to_handle and use deref/deref_mut instead
- replace the public interface with an unsafe one
- remove keyword args
- change the calling convention so that the top of the stack in the previous call frame becomes the bottom of the stack in the next call frame. get_field + call for method calls should still be next to each other so they can be peepholed to invoke (maybe this can even be done as part of the initial emit pass)
- code should be executable at any point, which means all the state that's required to execute code should be cleanly split into "local state" and "global state". global state should be stored in a thread-local variable while the VM is executing, and popped off and pushed into this variable when call recursion happens
https://github.com/TechTheAwesome/code-yew-server/blob/main/client/src/embeddedHTML.ts