1
0
forked from Mirror/wren
Commit Graph

16 Commits

Author SHA1 Message Date
59e9eb127e Add wrenAbortFiber().
Thanks, @underscorediscovery!
2016-06-09 19:14:21 -07:00
06731f66d4 Add a Platform class.
- Rename the "process" module to "os".
- Add Platform to it.
- Static "name" method.
- Static "isPosix" method.
- Docs and tests!
2016-05-21 12:44:17 -07:00
0a060a9678 WrenValue -> WrenHandle. 2016-05-20 20:55:28 -07:00
84bcb5801c Add a test for creating a VM without a config. 2016-03-03 14:31:47 -08:00
71e2458a6c Add API for accessing command-line arguments.
- 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.
2016-01-22 07:57:26 -08:00
1d16e85a85 Add an API to load a top-level variable into a slot. 2015-12-26 10:53:14 -08:00
6f37d379f4 Add C API functions for working with lists:
- wrenEnsureSlots()
  Lets you go the foreign slot stack to make room for a temporary work
  area.

- wrenSetSlotNewList()
  Creates a new empty list and stores it in a slot.

- wrenInsertInList()
  Takes a value from one slot and inserts it into the list in another.

Still need more functions like getting elements from a list, removing,
etc. but this at least lets you create, populate, and return lists from
foreign methods.
2015-12-16 16:28:26 -08:00
7fcdcf2f1a wrenReturn___() -> wrenSlotSet___().
This turns those functions into general-purpose functions for writing
raw C values into slots on the foreign call stack.

Writing a return just means writing a value to slot 0.
2015-12-16 13:00:13 -08:00
01e8f9053e Add a benchmark to test the Wren C API.
I've got some ideas on how to tweak the embedding API, but I want to
see what performance impact they have first, so this adds a little
benchmark that just calls a foreign method a ton of times.
2015-12-15 16:02:13 -08:00
f145662158 "Auxiliary" -> "optional".
Fixes #309.
2015-10-24 09:23:25 -07:00
e5176607d9 Move meta and random to "aux" modules.
Wren now has three classes of modules:

- The one magic "core" module that's built in and always needed.
- Auxiliary libraries like "meta" and "random". These do not have any
  dependencies, so can be used even when you embed Wren inside an
  application. But they're also optional and can be disabled if you
  don't need them.
- CLI modules. These ones need libuv and are tied to the CLI wrapper
  around the VM.
2015-10-17 22:09:48 -07:00
8436ce1934 Add a random module. 2015-10-17 11:03:15 -07:00
d431c2eaa8 Start sketching in support for reading from stdin. 2015-10-16 21:05:24 -07:00
79354f5a97 Do some work on wrenCall().
- Add an explicit va_list version. That lets variadic functions
  forward to it.
- Fix a GC bug in wrenCall() with return values.
- Make the call API test not re-enter the VM.
2015-09-29 19:29:10 -07:00
f757c9efac Better embedding API support (and tests!) for strings with null bytes.
- Test that a foreign method can return strings.
- Test that a foreign method can return a string with null bytes.
- Test wrenCall().
- Allow passing NULL for "v" to wrenCall().
- Allow "a" for passing an explicit length byte array to wrenCall().
2015-09-24 08:02:31 -07:00
36f7d74183 Unify "script" and "project" under "util". 2015-09-22 07:45:58 -07:00