Commit Graph

48 Commits

Author SHA1 Message Date
678051c5e1 Tweak makefile formatting. 2016-03-16 07:22:18 -07:00
8c79501738 Fix windows build 2016-03-16 00:37:23 +09:00
485e91ab05 Redo metrics script. 2016-03-07 07:56:44 -08:00
84bcb5801c Add a test for creating a VM without a config. 2016-03-03 14:31:47 -08:00
fa2598c601 Upgrade to libuv 1.8.0. 2016-02-27 09:19:56 -08:00
bec5181bdb Add separate targets for building just the shared or static library.
make static
make shared

Running "make vm" will build both, as usual.

Fixes #322.
2016-02-19 07:22:10 -08:00
5b7cd12e76 Don't run the skynet example from the tests.
It's too slow on the Travis bots and times out.
2016-02-14 22:28:14 -08:00
b8e85c83a8 Fix test and add skynet example. 2016-02-14 22:21:50 -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
860220869a Oops. Completely disable lto. 2016-01-22 07:01:56 -08:00
7e8bc2a89a Disable link-time-optimization for now.
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
2016-01-22 06:42:01 -08:00
39b29ee07a Enable link time optimization in the CLI.
One little compiler flag makes a surprisingly large difference:

api_call - wren            0.05s 0.0017 130.52% relative to baseline
api_foreign_method - wren  0.24s 0.0017 144.54% relative to baseline
binary_trees - wren        0.21s 0.0032 112.27% relative to baseline
binary_trees_gc - wren     0.75s 0.0288 115.02% relative to baseline
delta_blue - wren          0.13s 0.0031 103.24% relative to baseline
fib - wren                 0.20s 0.0036 120.56% relative to baseline
fibers - wren              0.04s 0.0007 108.52% relative to baseline
for - wren                 0.07s 0.0009 124.45% relative to baseline
method_call - wren         0.12s 0.0010  95.58% relative to baseline
map_numeric - wren         0.30s 0.0031 110.11% relative to baseline
map_string - wren          0.11s 0.0098 111.38% relative to baseline
string_equals - wren       0.19s 0.0064 115.49% relative to baseline
2016-01-20 07:47:00 -08:00
9512ce74c3 Merge branch 'master' into api
# Conflicts:
#	src/module/io.c
2015-12-26 20:42:53 -08:00
8ab329ff91 Make wren.mk log wren_to_c_string.
Thanks, Michel!
2015-12-26 20:11:48 -08:00
8203baf7bd Initialize match in the test script.
Thanks, Michel!
2015-12-26 20:08:20 -08:00
1d16e85a85 Add an API to load a top-level variable into a slot. 2015-12-26 10:53:14 -08:00
15043b897f Add a benchmark for wrenCall(). 2015-12-23 17:29:53 -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
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