Commit Graph
100 Commits
Author SHA1 Message Date
Bob Nystrom 5aaaa33552 Revise benchmarks:
- Ditch JS since it's in a different league.
- Make binary_trees and fib run faster.
- Compare using best time instead of mean.
2013-12-12 16:59:57 -08:00
Bob Nystrom 8e71660ce6 Reorder the method types.
Seems to slightly improve perf.
2013-12-12 07:39:27 -08:00
Bob Nystrom 4ba5c38bbf Generate default constructors at compile time.
Also re-ordered a few of the cases in the interpret loop. 
Removing a bit of code from CODE_CLASS and CODE_CALL triggered
some branch alignment issues which had a negative perf impact.
The new ordering seems to cancel that out.
2013-12-12 07:34:16 -08:00
Bob Nystrom e191424a70 Make "super" a reserved word. 2013-12-11 08:02:17 -08:00
Bob Nystrom 6e16df08f0 Add note about default constructor. 2013-12-11 08:00:25 -08:00
Bob Nystrom 71c26c6d89 Add support for just control which language benchmarks are run. 2013-12-10 23:02:24 -08:00
Bob Nystrom 510e3fc383 Add test for default constructor. 2013-12-10 21:58:02 -08:00
Bob Nystrom 03c7b01b0f Start writing performance doc. 2013-12-10 21:51:58 -08:00
Bob Nystrom c1cfe1b9f6 Handle inherited fields correctly. 2013-12-10 16:13:25 -08:00
Bob Nystrom 1e2449893e Add baseline comparison to benchmark script.
This way, I can track performance improvements and regressions.
2013-12-07 22:15:25 -08:00
Bob Nystrom 42b04c6c90 Fix bug in loops.
It was still popping the stack for the body even though loop
bodies are statements now.
2013-12-07 18:47:40 -08:00
Bob Nystrom eb1e5b48d6 Fix up benchmarks and add method call one. 2013-12-07 18:43:39 -08:00
Bob Nystrom 3f24515496 Don't allow method names to overflow. 2013-12-06 20:09:43 -08:00
Bob Nystrom 6a0d550562 Bitwise ~ operator. 2013-12-04 22:09:31 -08:00
Bob Nystrom 7355dd3dc7 Fill in some more basic syntax docs. 2013-12-04 21:51:23 -08:00
Bob Nystrom c91fcd12cc Treat ";" like newlines. 2013-12-04 19:12:21 -08:00
Bob Nystrom 8521d5ad79 Bunch more work on docs. 2013-12-04 07:46:41 -08:00
Bob Nystrom 047cfacede Include "include" directory in source code metrics. 2013-12-04 07:46:23 -08:00
Bob Nystrom 157944aa27 Get closures working!
In the process, I had to change the grammar. There is now a strong
separation between statements and expressions. The code was just wrong
before when it popped locals at the end of a block scope because there
could be temporaries on the stack if the block was in expression
position. This fixes that.

Still need to implement closing over `this`.
2013-12-04 07:43:50 -08:00
Bob Nystrom c14b115c02 Use char* instead of offsets for tokens.
Simplifies a bunch of code that works with token strings.
2013-12-01 15:22:24 -08:00
Bob Nystrom e4043d69b4 Unify code for ending compiler.
There's now a single code path for the end of a chunk of bytecode, so
we can eventually put code there for capturing closures.
2013-12-01 14:59:56 -08:00
Bob Nystrom 19811143a0 Always use provided allocator for allocation. 2013-12-01 10:22:32 -08:00
Bob Nystrom 9188c00bc0 Start adding navigation to the docs. 2013-12-01 09:54:51 -08:00
Bob Nystrom d2e82d8967 Clean up parsing a bit. 2013-12-01 00:04:46 -08:00
Bob Nystrom 60c97b5c2f Make sure we don't go over the maximum number of locals. 2013-11-30 18:51:27 -08:00
Bob Nystrom 88852960ca Handle local variable shadowing. 2013-11-30 18:28:01 -08:00
Bob Nystrom 74c414937c Add JS version of binary tree benchmark. 2013-11-29 20:25:00 -08:00
Bob Nystrom f6c9848706 Ignore scratch script. 2013-11-29 16:20:44 -08:00
Bob Nystrom edb9032052 Get binary_trees benchmark working.
Wren is actually doing well in it:

wren      mean: 1.9441 median: 1.9428 std_dev: 0.0260
lua       mean: 3.5992 median: 3.6033 std_dev: 0.0156
python    mean: 3.6667 median: 3.7097 std_dev: 0.1340
ruby      mean: 1.3941 median: 1.3914 std_dev: 0.0091
2013-11-29 16:19:13 -08:00
Bob Nystrom ce89dd9c2f Fix compiling constructors. 2013-11-29 16:17:43 -08:00
Bob Nystrom 8c9ce024ee Move debug code into separate module. 2013-11-29 16:17:33 -08:00
Bob Nystrom b390bdf604 Clean up constructor tests. 2013-11-29 15:21:36 -08:00
Bob Nystrom 325bb281a5 Allow 16 arguments, and handle going over that correctly. 2013-11-29 15:08:27 -08:00
Bob Nystrom 5f1d5cfa85 Do not allow fields outside of classes. 2013-11-29 10:53:56 -08:00
Bob Nystrom 1b353e9380 Make pinned list a linked list instead of hardcoded array. 2013-11-29 09:18:13 -08:00
Bob Nystrom 715fecdc7c Rename files and add some docs. 2013-11-28 08:11:50 -08:00
Bob Nystrom 9d9f9c11ca Clean up "primitive" code. 2013-11-28 08:00:55 -08:00
Bob Nystrom 1fc9fe131d Clean up value code. 2013-11-27 20:00:03 -08:00
Bob Nystrom c2f4345af4 Remove stale TODO. 2013-11-27 11:34:35 -08:00
Bob Nystrom 1bfa252a70 List.removeAt(). 2013-11-27 10:20:32 -08:00
Bob Nystrom f8ded27376 List.clear and List.insert(). 2013-11-26 23:11:11 -08:00
Bob Nystrom 56449cdbef Reorganize tests. 2013-11-26 22:52:00 -08:00
Bob Nystrom 897a396599 List.add() method. 2013-11-26 18:02:10 -08:00
Bob Nystrom eaeec01dc6 Get inheritance and core classes more correctly wired up. 2013-11-26 07:52:37 -08:00
Bob Nystrom af694053a5 Add JavaScript to benchmark runner. 2013-11-26 07:50:12 -08:00
Bob Nystrom af6b73208c Start defining actual API for embedding Wren. 2013-11-25 07:47:02 -08:00
Bob Nystrom f9b2aed4dd Unify to a single reallocation function. 2013-11-25 07:14:51 -08:00
Bob Nystrom ece3f3b83b Add optional support for computed gotos.
In my benchmark, this gives like a 5% speed boost. But I'm not sure
it's taking full advantage of it. The XCode project is using LLVM,
which has support for it, but may not optimize it as much as GCC.

There are also some GCC flags I may need to set (-fno-gcse?) to get the
best perf on GCC. Needs more investigation.
2013-11-24 21:48:47 -08:00
Bob Nystrom c99f4d7834 Subscript operator for lists. 2013-11-24 19:08:46 -08:00
Bob Nystrom 7a343f2ecf List literals. 2013-11-24 13:38:31 -08:00
Bob Nystrom f9b008e283 Subscript operators! 2013-11-24 10:45:07 -08:00
Bob Nystrom e3e1f7f3d4 Start working on string escapes. 2013-11-23 21:00:47 -08:00
Bob Nystrom acf9cc024f Remove some unneeded casts. 2013-11-23 17:35:11 -08:00
Bob Nystrom a5bbe81280 Start to get instance fields working. 2013-11-23 14:55:05 -08:00
Bob Nystrom ba676f1231 Work on docs a little bit. 2013-11-23 14:52:50 -08:00
Bob Nystrom e4b5613780 ASCII art graph of benchmark results! 2013-11-22 09:17:45 -08:00
Bob Nystrom b30c30e1e3 Get a basic benchmark runner going. 2013-11-22 08:55:22 -08:00
Bob Nystrom d19f9f1b9b Add a license. 2013-11-21 21:41:44 -08:00
Bob Nystrom d332eed048 Start hacking on web site. 2013-11-21 21:38:36 -08:00
Bob Nystrom 359481f260 More thinking about calls. 2013-11-21 21:38:21 -08:00
Bob Nystrom 3b0e962a05 Named, user-defined constructors. 2013-11-20 07:20:16 -08:00
Bob Nystrom 32144dae20 Clean up compiler a bunch. 2013-11-19 20:54:47 -08:00
Bob Nystrom 32d41e2d54 Simplify lexer a bit. 2013-11-19 20:19:02 -08:00
Bob Nystrom fe48113054 Logical "||" operator. 2013-11-19 18:24:58 -08:00
Bob Nystrom 4266facfda Add IS_FALSE for non-NaN-tag values. 2013-11-19 07:36:59 -08:00
Bob Nystrom 6b87a8400f "&&" operator. 2013-11-19 07:35:25 -08:00
Bob Nystrom e614e092ed Start getting block scope working. 2013-11-18 09:19:03 -08:00
Bob Nystrom 4d23d58bf1 While statements. 2013-11-17 22:38:59 -08:00
Bob Nystrom 64509a4f61 NaN tagging!
This plus moving some variables into locals in the interpreter loop
gets the fib benchmark within 25% of Lua!
2013-11-17 14:20:15 -08:00
Bob Nystrom 0c1ce91e80 Make String#contains return a bool. 2013-11-17 10:04:02 -08:00
Bob Nystrom 0181f69dfb Get rid of special handling for call methods. 2013-11-17 09:02:57 -08:00
Bob Nystrom ee504435f7 Real hello world example. 2013-11-17 08:55:04 -08:00
Bob Nystrom bc5415e486 Move value/object stuff to separate files. 2013-11-16 17:51:30 -08:00
Bob Nystrom 37fdf88bbe Clean up a bunch of stuff. 2013-11-16 17:41:09 -08:00
Bob Nystrom 2af4cb6169 Get rid of "no value" value type. 2013-11-16 11:54:42 -08:00
Bob Nystrom 8f6f546ab3 Bump default heap size. 2013-11-16 11:43:40 -08:00
Bob Nystrom 462ea3903a Unboxed numbers. 2013-11-16 11:41:29 -08:00
Bob Nystrom e6f085b7c4 Get rid of boxed null and bools. 2013-11-16 11:35:59 -08:00
Bob Nystrom 01b61c83d7 First phase of changing object representation.
This code is full of hacks and isn't the right representation, but
it gets it so that Value is no longer just a raw Obj*.
2013-11-16 11:26:32 -08:00
Bob Nystrom 1266578a4e Add trivial fib benchmark. 2013-11-14 20:57:56 -08:00
Bob Nystrom cfb5193ce8 Function parameters. 2013-11-14 18:25:28 -08:00
Bob Nystrom 167e174480 User-defined operators. 2013-11-14 10:59:28 -08:00
Bob Nystrom f6eadbe3f4 Get rid of mixfix methods (for now at least). 2013-11-14 09:21:58 -08:00
Bob Nystrom a24f29002d Better parsing error messages. 2013-11-13 23:06:53 -08:00
Bob Nystrom 5ac4087d0c Some design notes. 2013-11-13 17:09:55 -08:00
Bob Nystrom 85d9bffa08 Block comments. 2013-11-13 17:09:47 -08:00
Bob Nystrom 27a652e565 Start sketching out inheritance. 2013-11-13 11:05:03 -08:00
Bob Nystrom 509f62fdad Ditch man file. 2013-11-13 07:15:10 -08:00
Bob Nystrom 9d4599f6e6 Unary operators and variable assignment. 2013-11-13 07:10:52 -08:00
Bob Nystrom 7e2c200e0d Garbage collection! 2013-11-12 08:32:35 -08:00
Bob Nystrom 0339bcdeca Use object conversion macros consistently. 2013-11-10 14:21:14 -08:00
Bob Nystrom 915ecb4e58 Static methods. 2013-11-10 11:46:13 -08:00
Bob Nystrom 2f241e2225 Metrics for tests. 2013-11-10 11:12:38 -08:00
Bob Nystrom f19dd64f8b Floating point number literals. 2013-11-09 21:32:57 -08:00
Bob Nystrom 3cdabcb8c7 "%" operator for numbers. 2013-11-09 21:01:18 -08:00
Bob Nystrom a1f10786ef "this" expressions. 2013-11-09 15:42:23 -08:00
Bob Nystrom 0cc5524249 Generate correct code for locals. 2013-11-09 11:38:01 -08:00
Bob Nystrom a2f0e41bcb Method parameters. 2013-11-09 11:18:27 -08:00
Bob Nystrom 166d74930f "is" operator. 2013-11-07 17:07:32 -08:00
Bob Nystrom 55e433f980 Reorganize the compiler to be bottom-up.
Gets rid of a bunch of forward declarations and shortens the code.
Also makes points of recursion more explicit.
2013-11-07 07:04:25 -08:00