1
0
forked from Mirror/wren
Commit Graph

81 Commits

Author SHA1 Message Date
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
2df5362ab2 Handle compile errors in imported modules. 2015-12-08 07:49:37 -08:00
10ece995f7 Add some Dart benchmarks running on fletch. 2015-12-05 11:09:30 -08:00
a38753d1d6 Add an animals guessing game example. 2015-11-29 09:43:47 -08:00
c46507d937 Fix .gitignore (and add incorrectly ignored file!) 2015-11-27 11:22:09 -08:00
2125471132 Addressing feedback
* Always include fcntl.h in io.c
* FileReqData -> FileRequestData
* Don't combine allocations
* Make output paths more consistent with the docs
2015-11-25 19:47:13 -05:00
2d3a7ece40 Remove reference to timer.h, add reference to wren.h 2015-11-25 12:43:49 -05:00
f09e75c6e8 Update Visual Studio projects so we can build again 2015-11-25 12:43:19 -05:00
71575d9179 Switch to O3 for release builds.
It now seems to be fairly consistently faster on my machine:

binary_trees - wren     0.22s 0.0023 100.10% relative to baseline
binary_trees_gc - wren  0.85s 0.0160 112.63% relative to baseline
delta_blue - wren       0.12s 0.0044 102.91% relative to baseline
fib - wren              0.21s 0.0021 103.34% relative to baseline
fibers - wren           0.26s 0.0083 102.46% relative to baseline
for - wren              0.08s 0.0024 111.82% relative to baseline
method_call - wren      0.11s 0.0087  94.56% relative to baseline
map_numeric - wren      0.32s 0.0042 109.83% relative to baseline
map_string - wren       0.11s 0.0096 105.69% relative to baseline
string_equals - wren    0.19s 0.0028 110.00% relative to baseline
2015-11-10 07:33:15 -08:00
82706b74fc Reorganize site to make room for documenting the other built-in modules. 2015-11-08 13:31:22 -08:00
8c0dae1320 Move precedence table to syntax page. 2015-11-08 10:59:23 -08:00
931d9ca4d3 Reorganize the language guide.
- Rename "Expressions" -> "Method Calls".
- Organize "Types" and "Language" into a single linear narrative.
- Mobile-specific navigation to handle the longer guide.
- Rename "Fibers" -> "Concurrency".
- Get rid of duplicate stuff about signatures in "Classes".
- Add next/prev links to each page in the guide.
- Move "Contributing" and "Community" up to the top level.
- Move the precendence table to a separate "Grammar" page.
- Lots of other little stuff.
2015-11-07 11:09:04 -08:00
b365c07d7a Add a benchmark that explicitly invokes the GC. 2015-10-24 11:00:17 -07:00
0f7d4dd4d0 Add a timeout to the test runner.
This ensures that when you run the tests while stress testing the GC,
that a pathological test won't hang forever.
2015-10-24 10:58:21 -07:00
f145662158 "Auxiliary" -> "optional".
Fixes #309.
2015-10-24 09:23:25 -07:00
545a4cbf7e Style example output and errors in the docs. 2015-10-18 15:56:52 -07:00
30e7d9e508 Move core.wren to be next to wren_core.wren.inc. 2015-10-17 22:17:10 -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
a3f3e3ce03 Don't try to run the guess_number example from the test script. 2015-10-17 13:29:50 -07:00
8436ce1934 Add a random module. 2015-10-17 11:03:15 -07:00
29eebe4928 Tweak libuv.py a bit. 2015-10-16 21:33:22 -07:00
82d6453a7e Merge branch 'master' of https://github.com/ppearson/wren into ppearson-master 2015-10-16 21:24:22 -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
52b1b7698f Modified libuv.py file to be able to work with Python 2.6 2015-09-24 21:05:08 +12:00
a944ead5b4 Give the docs some love. 2015-09-22 21:19:38 -07:00
505b48fdac Add a real Pygments lexer for Wren (finally!). 2015-09-22 07:59:54 -07:00
36f7d74183 Unify "script" and "project" under "util". 2015-09-22 07:45:58 -07:00