My first attempt to embed VM in project ended with crash. Fortunately I'm not so easly scared and managed to found out that despite comment in "wren.h" no check for null is performed. I took the liberty of fixing that.
Btw. nice project, keep up the good work!
This is simpler than having special opcodes for them. It's also a bit
faster, and gets some non-critical code out of the interpreter loop.
Also, this is good prep work for being able to write some of the module
loading process in Wren to make things more flexible for embedders and
the CLI.
This is not implemented on Sequence because, at least for lists and
strings, I think users expect an eager result. Multiplying a string
should give you back a string, not a lazy sequence of repeated
characters.
This also mirrors "+" on strings and lists, which is eager. I like the
idea of having a general guideline that operators are eager.
Repetition is useful for arbitrary sequences, but for that maybe we
should add a "repeat()" method.
Instead of copying the uv_fs_stat struct to a list of Wren numbers, we
store it directly in the Stat object. This is important because we'll
need to implement later methods like isDirectory() in C so we can use
S_ISDIR(). For that, we need to have access to the original stat data.
Gets rid of the slightly ugly loadInstruction output parameter that
gets passed around. Now a reference to a variable is a first-class
concept in the compiler.
- Add process module with Process class.
- Add "arguments" and "allArguments" methods.
- Docs for same.
- Support passing additional arguments to command line.
- Add "--help" support to command line.
It's failing when building with clang on Travis. The underlying problem
seems to be something broken with how LLVM is looking for the gold
linker, and working around that is outside of my skillset.
To learn more, Google: "LLVMgold.so: error loading plugin" lto