1
0
forked from Mirror/wren

97 Commits

Author SHA1 Message Date
f3b0200c39 Merge pull request #541 from kext/amalgamation
Repaired amalgamation script
2019-09-18 00:11:22 -07:00
2a1499b04b Fix horrendously bad bit hashing function.
hashBits() is used to generate a hash code from the same 64 bits used
to represent a Wren number as a double. When building a map containing
a large number of integer keys, it's important for this to do a good
job scattering the bits across the 32-bit key space.

Alas, it does not. Worse, the benchmark to test this happens to stop
just before the performance falls off a cliff, so this was easy to
overlook.

This replaces it with the hash function V8 uses, which has much better
performance across the numeric range.
2019-07-27 13:34:07 -07:00
ccb9ba3441 Disable 32 bit macOS Build
With the latest XCode it looks like 32 bit builds are deprecated. This
causes build warnings which fail the libuv build. This commit remvoves
the 32 bit arch from the macOS libuv build, and stops building the 32
build on Travis.
2019-02-12 06:56:38 +00:00
a5147aa2d9 Add a limited form of re-entrant calls.
This doesn't let you arbitrarily call back into the VM from within
foreign methods. I'm still not sure if that's even a good idea since
God knows what that would mean if you switch fibers while doing that.

But this does allow the very important use case of being able to call
a foreign method from within a call to wrenCall(). In other words,
foreign methods need to always be leaf calls on the call stack, but the
root of that stack can now come from runInterpreter() or wrenCall().

Fix #510.
2019-02-08 17:09:39 -08:00
29cef0bd53 docs; update generator
- copies files in doc/site/static/ to output
- update output formatting to include potential differences in markdown generator (local generate had >, so cover both to remain consistent)
- copy rss xml (could be in static too, but for now...)
2019-02-05 18:14:34 -08:00
091d2c4313 Fix call to markdown.markdown 2018-10-30 15:06:50 -04:00
f23c82071a Don't allow calling the root fiber.
The VM used to not detect this case. It meant you could get into a
situation where another fiber's caller had completed. Then, when it
tried to resume that fiber, the VM would crash because there was nothing
to resume to.

This is part of thinking through all the cases around re-entrancy. Added
some notes for that too.
2018-07-21 10:02:29 -07:00
ed64a13778 Add new files to api_test target in XCode project. 2018-07-18 07:30:18 -07:00
1a37d2228d Merge branch 'smarter-imports' 2018-07-16 07:00:08 -07:00
7a42a20b98 Merge branch 'master' into smarter-imports
# Conflicts:
#	src/module/io.c
#	src/vm/wren_vm.c
2018-07-15 21:01:14 -07:00
c367fc3bfc Get logical imports in "wren_modules" working.
There's a lot of changes here and surely some rough edges to iron out.
Also, I need to update the docs. But I want to get closer to landing
this so I can build on it.
2018-07-15 20:09:41 -07:00
e486c56ae9 Merge pull request #546 from mathewmariani/master
Fixed PreBuildEvents on vs2017
2018-07-15 11:08:21 -07:00
ef5f38b48f Turn on auto-deploying docs.
Looks like it's working now. <crosses fingers>
2018-07-14 21:35:33 -07:00
c7c69d1291 Check in shared Xcode file. 2018-07-14 12:12:37 -07:00
52f08aec05 Install the custom pygments lexer using python3. 2018-07-14 11:44:53 -07:00
d13cafed71 Fix command. I am an idiot. 2018-07-14 11:17:36 -07:00
db77a9dce4 Disable container-based build so we can use sudo. 2018-07-14 11:05:41 -07:00
5fff693530 Testing fix to doc deploy script. 2018-07-14 10:35:45 -07:00
08b5492362 Turn off doc deploying for now. 2018-07-13 09:15:26 -07:00
c120769977 Make some tweaks to doc deploy script.
- Rename file to match other naming conventions.
- Simplify condition a little.
2018-07-13 08:02:37 -07:00
91b4f53ee5 Merge branch 'auto-deploy-docs-from-travis' of https://github.com/CodogoFreddie/wren into CodogoFreddie-auto-deploy-docs-from-travis 2018-07-13 07:46:46 -07:00
1f93e16fb2 Provide actual soname when building shared lib on Linux.
Fix #572.
2018-07-13 07:19:06 -07:00
9934d17019 Update PreBuildEvent scripts for more conditions 2018-05-21 11:14:23 -04:00
85b2c9a99d added explicity vs2017 argument
To build with VS2017 you need to explicitly add a vs2017 argument
2018-05-21 01:57:50 -04:00
4957fff584 Fixed PreBuildEvents on vs2017 2018-05-21 01:25:38 -04:00
c40bb93d60 Changed shebang to python3 2018-05-16 23:10:44 +02:00
abd1cf37c4 Repaired amalgamation script
The amalgamation script now searches for files in the different
directories of src.

Also the full paths in the amalgamation were replaced by the basename
to produce the same content on all machines.

The makefile now creates the build directory for the amalgamation
if it does not exist.
2018-05-12 09:24:23 +02:00
492763205b introduced docs auto publish step to travisci 2018-04-04 20:37:05 +01:00
8210452970 Relative imports!
This is a breaking change because existing imports in user Wren code
that assume the path is relative to the entrypoint file will now likely
fail.

Also, stack trace output and host API calls that take a module string
now need the resolved module string, not the short name that appears in
the import.
2018-03-24 11:10:36 -07:00
5539c59750 Add a minimal path manipulation C module.
This is just for the VM's own internal use, for resolving relative
imports.

Also added a tiny unit test framework for writing tests of low-level
C functionality that isn't exposed directly by the language or VM.
2018-03-24 10:58:07 -07:00
8a71735e0f Expose an API to let the host resolve relative import strings.
This is a breaking API change: wrenInterpret() now takes an additional
parameter for the module name to interpret the code in.
2018-03-23 07:54:09 -07:00
bd3897278c Use newer GYP. 2018-03-14 08:06:06 -07:00
a95077cd9f Don't build the libuv tests on Linux. 2018-03-14 07:27:29 -07:00
011e8fab96 Fix off-by-one error in arg checking. 2018-03-14 07:27:29 -07:00
f866ee7003 Vendor GYP and libuv into the repo.
Instead of dynamically downloading these as needed during a build, this
checks in those two dependencies directly into the Wren repo. That's a
little lame because users of Wren who aren't building the CLI don't
actually need them, but they aren't too big, so it's not a huge deal.

It makes builds (particularly on Travis) more reliable, because they
don't have to pull down additional content over the network.
2018-03-14 07:27:29 -07:00
97b2e1c818 Add web server to doc generator. 2017-10-12 06:38:34 -07:00
21b4032fae Remove Visual Studio 2013 solution 2017-03-28 22:06:03 +03:00
a32f54126b Add Visual Studio 2017 solution 2017-03-28 22:05:58 +03:00
02bcefcbe4 Add test for user data.
Also moved the VM parameter in the error callback to be first like it
is in other callbacks.
2017-03-22 07:26:19 -07:00
0cc00c41c0 Simplify test runner output a little. 2017-01-12 21:38:06 -08:00
e8dfb1bf10 Don't test bitwise operations on operands that don't fit in u32.
The current behavior is undefined in C when converting the double to a
u32, so the tests fail on some compilers. For now, I'm just removing
those parts of the tests because I'm not sure what I want the behavior
to be. Modulo? Truncate? Runtime error?
2017-01-12 21:32:50 -08:00
04a7c9b5c8 Improve Travis Build & Test Coverage
Build Wren for more targets, and run the test suite on both 32 and 64
bit builds.

 * Update the build config to test both with and without NAN_TAGGING
   defined.

 * Updatest `util/test.py` to take the executable suffix as a
   parameter. This allows the makefile to control which binaries will be
   tested.

   Adds a new target to the makefile to be run by travis, this runs the
   test suite against all of the configurations it builds.

 * Gcc on some 32 bit platforms was complaining about numeric overflows
   when -INFINITY was used. Update the logic for converting a double to
   a string to not explicitly check against the literal values.

 * Make CI builds run the tests on both 64 _and_ 32 bit builds.

 * If I limit the number of CPUs on my MBP I can get some of the tests
   to time out, I'm imagining that the specs of the Travis Macs means
   that the same is happening there too. Updated the test script to
   allow an extra few seconds for the test to complete successfully
   before killing it.

 * Due to slight differences in accuracy in some computations tests were
   failing on 32 bit builds. Stop comparing things quite as exactly in
   the cases where it is causing issues.

   For some reason 12.34 was refusing to compare equal to itself. Bad
   show 12.34 :-/. I've also updated the test so it doesn't leak handles
   even if the assertions fail.

 * Double-cast from `double` to `uint32_t` to prevent undefined
   behaviour on overflow of basic integers. This should hopefully
   prevent 32 bit test failures on Linux.

 * Move to a version of LibUV with a fix for the 32 bit build error on
   Travis.
2016-12-29 17:52:38 +00:00
b9f53f71fb Reset API stack a fiber is aborted from wrenCall(). 2016-11-01 08:40:16 -07:00
e7cabbb5e4 Reset the API stack after a foreign constructor returns. 2016-08-28 08:23:27 -07:00
b41a0f7c07 Allow builds to be verbose
It’s impossible to disable @s in Makefiles to get a verbose build.
Adding them conditionally using a variable lets users choose if they
want a verbose build by using the VERBOSE variable.

Normal build:

    make

Verbose build:

    make VERBOSE=1
2016-07-02 11:21:47 +02:00
689cd42269 Start writing the REPL in Wren.
It doesn't actually execute code yet, but it:

- Supports left and right arrow keys for moving the cursor.
- Ctrl-C, Ctrl-D, Ctrl-A, and Ctrl-E for navigating.
- Syntax highlights the line (!).

The next step is to do a rough parse so that we can tell if the line
is an expression, statement, or needs more input. That will tell us
whether we need to interpret it at the top level (statement) and not
worry about a result, evaluate it as an expression and print the result,
or read more lines.
2016-06-09 19:16:41 -07:00
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
678051c5e1 Tweak makefile formatting. 2016-03-16 07:22:18 -07:00