Commit graph

20 commits

Author SHA1 Message Date
daniel
d5b24138d3
add go module v2 (#244) 2019-12-29 13:38:51 -08:00
daniel
a9a233a750
fix internal package issue (#241)
* fix internal package issue

* ExampleSimple -> Example
2019-12-24 07:42:30 -08:00
daniel
c88a5f506e
some code clean up (#237) 2019-12-20 11:40:38 -08:00
Daniel
61890b15cb
module refactor (#148)
* wip

* move print and JSON functions to modules

* builtin functions are not replacable now

* builtin functions are added for default nil symbol table

* importables: builtin modules and source modules

* refactoring runtime tests

* fix tests

* update documentation

* cleanup

* clean up cli

* fix REPL prints
2019-03-18 08:15:26 -07:00
earncef
5d8457a8f6 Removed double indirection for massive performance gains (#140)
* Removed double indirection for performance gains

* Added missing file

* Cleanup

* Remove pointers patch.

* Cleanup

* Removed redundant parenthesis

* FreeVar changed to ObjectPtr and removed OpSetLocalPtr

* Removed truePtr, falsePtr and undefinedPtr

* Cleanup
2019-03-14 01:07:19 -07:00
Daniel
e93f6f6325
limit max object allocations (#129)
- add object.NumObjects()
- add object allocation limit in VM
- delete objects.Break, objects.Continue, objects.ReturnValue
- add Script.SetMaxAllocs()
- update sandbox documentation
- add some tests
- remove duplicate values in compiled constants (fixes #96)
- option to limit the maximum number of objects in compiled bytecode constants
2019-03-06 17:20:05 -08:00
earncef
7cc683e867 SetBuiltinFunctions and SetBuiltinModules (#120)
* `SetBuiltinFunctions` and `SetBuiltinModules`

* nil implies no built in functions.

* Additional tests.

* Cleanup

* Updated SetBuiltinFunctions

* Docs updated.
2019-02-28 08:26:25 -08:00
earncef
5816186821 parser.ParseFile removed (#117)
* parser.ParseFile removed

* return values
2019-02-25 22:52:08 -08:00
Daniel
3500c686b3
Improvements on compiler/VM error reporting (filename:line:col)
- add type infos to VM error messages
- add 'Name' to UserFunction objects 
- add 'expectErrorString' to VM tests
- replace vm.expectError() with vm.expectErrorString() to make it more explicit
- add source map info to VM error messages
- optimization in function calls
- add file/line/col info to compiler errors
- change stdlib module to be loaded from VM (instead of compiler) so they can be properly loaded after the source is compiled into binary
- VM can take builtin modules optionally
2019-02-20 16:26:11 -08:00
Daniel
9c67444678
Fixes a REPL bug (Issue #91) (#92) 2019-02-10 00:32:37 -08:00
Daniel Kang
a8d838ad3e Compile can take custom stdlibs 2019-01-18 09:19:45 -08:00
Daniel Kang
4b370e8623 minor change in bench code 2019-01-13 11:10:55 -08:00
Daniel Kang
5383c899dc add another version of fibonacci to bench 2019-01-13 02:30:46 -08:00
Daniel Kang
27438eea6f update directory package structure 2019-01-11 02:27:28 -08:00
Daniel Kang
d954348e75 update bench fibonacci tail call code 2019-01-11 01:56:19 -08:00
Daniel Kang
581aa5773d minor update in bench output 2019-01-11 01:22:21 -08:00
Daniel Kang
53af0d6328 move file and fileset to source package 2019-01-11 01:16:34 -08:00
Daniel Kang
d870ebf72e variable definition (operator ":=") is now required not optional 2019-01-10 22:34:28 -08:00
Daniel Kang
54bea46d19 bench outputs expected result 2019-01-10 14:51:20 -08:00
Daniel Kang
2c3282da21 initial commit 2019-01-08 23:17:42 -08:00