Alek Ratzloff b9429d7c19 Add __call__, __init__, and fix a few stack bugs
* __call__ on a type will construct a new value for a couple of types,
  based on the arguments passed to that constructor. For example,
  `Str(foo)` just ends up calling `foo.to_str`. However, this opens up
  the door for more complex constructors.
*  __init__ is available, but for all objects that currently have it, it
   just does a no-op because they are copy-on-write, and are
   instantiated on creation.
* Builtin functions sometimes call other functions. However, when a VM
  would handle an `Op::Return`, it was expecting the callee function to
  be on top of the stack after discarding the stack items. A lot of the
  .call()s were not pushing the function to the stack beforehand, so
  this was causing stack misalignment when it really mattered. It went
  undetected until now because every function that was using .call() had
  stack items that were safe to discard.

Hopefully we should be in a good place to implement the rest of the
builtins that have not been implemented, and then we can start working
on implementing containers.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-09-30 12:13:25 -07:00
2024-09-26 10:03:54 -07:00
2024-09-25 11:42:51 -07:00
2024-09-25 11:42:51 -07:00
Description
No description provided
804 KiB
Languages
Rust 95.5%
Python 4.2%
Shell 0.3%