Commit Graph

18 Commits

Author SHA1 Message Date
CPunch fe136f84b5 removed CERROR 2023-08-30 20:14:03 -05:00
CPunch 2b3825d258 implemented jump table dispatch
- currently only enabled on supported platforms (GNU C Compiler + Clang)
- when enabled, sped up examples/fibtest.cosmo by about 20% (avg of 11.179s prior and 8.799 after)

NOTE: malicious dumps can trivially cause crashes now by having junk function chunks
2023-06-03 01:17:28 -05:00
CPunch 49a7f68239 cdump.c: major refactoring; various fixes 2023-05-27 23:15:58 -05:00
CPunch b902ac90de removed CObjStream 2023-02-09 12:42:09 -06:00
CPunch 6056f8eb5b added clang-format 2023-02-09 12:32:48 -06:00
CPunch 7b5825668d Added boilerplate for CObjStream 2021-03-20 01:44:03 -05:00
cpunch 35466f691f Added C99 support, refactored headers 2021-02-15 16:20:04 -06:00
CPunch 8d37f1f243 Renamed cosmoV_readObj to cosmoV_readRef to reduce ambiguity
also fixed several typos
2021-02-07 14:00:00 -06:00
CPunch cff26574bb Fixed table iteration bug, added vm.globals to debug lib 2021-01-25 16:14:51 -06:00
CPunch eb2f50e456 Added CObjError, cosmoV_throw(), pcall(), and cosmoV_printError()
Errors are now handled very differently, parser errors and VM errors are now treated the same.
When cosmoV_error is called, cosmoV_throw is also called, which formats the error object and sets the panic state.
state->error now points to the latest CObjError when state->panic is true. To get a nice formatted Objection message, use
cosmoV_printError() and pass the state->error. pcall() was added to the standard base library. When called, the first argument
passed is called with the subsequent arguments given. If the call completed successfully, `true`,`nil` is returned. However
when an error occurs during the call, `false`,`<error>` is returned. Simply print the `<error>` to retrieve the error string.
2021-01-05 22:27:59 -06:00
CPunch ec3552a155 organized flags 2021-01-04 16:20:05 -06:00
CPunch 7e9b61e018 minor refactor, fixed many warnings 2021-01-01 23:06:24 -06:00
CPunch 9012f9231b Added assert() to base library
also fixed regression in call()
2020-12-27 13:36:17 -06:00
CPunch e0d51c191f renamed cosmoV_makeObject 2020-12-05 17:55:09 -06:00
CPunch b936827cc6 added support for NaN boxing (8 byte CValues!) 2020-12-04 00:04:14 -06:00
CPunch 204bec3d0a added IStrings, added __index functionality 2020-11-16 19:58:16 -06:00
CPunch c42a72dfad Major refactoring, added classes, many bug fixes 2020-11-09 19:44:12 -06:00
CPunch 2e1b745624 Initial commit 2020-10-28 00:16:30 -05:00