Skip to content

Releases: cyxigo/wi

Wi 9.8.0-beta

Choose a tag to compare

@cyxigo cyxigo released this 10 Oct 22:56
wi-9 8 0

Added

  • wi_abi_version and wi_check_version/WI_CHECK_VERSION (API)
  • std::call
  • io::stdin, io::stdout, and io::stderr
  • find to array, map and string

Changed

  • The main script path is now included as the first item in os::args
  • std::real now rejects blank strings and skips trailing spaces
  • std::isfunction now returns true for foreign (C) functions too
  • Overflowing hex/octal/binary literals are now an error
  • std::assert now validates the message before checking the condition
  • io::writebytes now appends a NUL byte
  • Libraries now live as long as the state does
  • Speed up new a, b merging and array->insertat

Fixed

  • Import crashes with foreign libraries (NULL module, missing exe path)
  • C stack overflow not being detected through foreign calls
  • Off-by-one in the global and constant limits
  • Missing write barriers in variable definition
  • Function fields recursing into themselves
  • Implicit returns not getting TCO
  • Switch not requiring its closing brace
  • wi_pcall leaving the callee's upvalues open on failure
  • REPL returning EXIT_SUCCESS instead of the real exit code
  • std::equals missing the C stack overflow check
  • io::writebytes error messages
  • array->slice with an empty slice
  • Off-by-one in stack accounting in returns
  • Interrupts being ignored after foreign calls
  • string->select/where leaking on error
  • string->each not returning the string
  • Lexer errors pointing at the wrong character
  • std::try hanging forever on stack overflow
  • std::real ignoring the sign in hex/octal/binary strings

Full Changelog: v9.7.1-beta...v9.8.0-beta

Wi 9.7.1-beta

Choose a tag to compare

@cyxigo cyxigo released this 03 Oct 19:46

General

  • Mark _flag_parse_error as WI_NORETURN (wi.c) (61fe5e6)
  • Store globals as slots instead of a name -> value table (a8d4ecb)
  • Remove special-case error messages for foreign variables (88b6b50)
  • Revert wi_##name##_buf_reserve mirroring wi_table_reserve (a3d123d)
  • Determine new capacity from table->live_count in wi_table_set (988b82a)
  • Fix compiler->var_name leaking into subexprs (46e8793)
  • refactor(compiler): add wi_parser_error_limit helper and use it for limit errors (53ec5bb)
  • refactor(state/stm): add wi_state_check_mod_count helper for "modified during iteration" errors (38704c7)
  • refactor(compiler): use wi_parser_error_limit in _compiler_make_constant/_compiler_add_upvalue (5602846)
  • chore: bump version to v9.7.1-beta (b7cf6e5)

STD

  • Return checked value instead of true in std::assert (_base_assert) (df37599)
  • Simplify arity check in std::input (_base_input) (a4bd0a5)
  • Cleanup STD to use wi_push_arg (2813479)

STM

  • Bump array->items.mod_count in _array_sort (d89abed)
  • Change _array/map_clear return type to the caller (32ea7db)
  • Change _array_add/insertat return value to the caller (78c76ed)
  • Cleanup STM to use wi_push_arg (0643411)

Full Changelog: v9.7.0-beta...v9.7.1-beta

Wi 9.7.0-beta

Choose a tag to compare

@cyxigo cyxigo released this 30 Sep 22:41

API

  • Add wi_push_lstring/arg to API (0648cd0)
  • Bump array->items.mod_count in wi_array_set (a9be286)

General

  • Print warnings to state->error instead of state->out (wi_parser_warning_at) (1527b6c)
  • Report OOM in wi_state_add_lib (a5e985f)
  • Fix already imported library nodes not pushing modules (2875cbb)
  • Refactor the import expression implementation (b59fc14, 384aba4)
  • Delete foreign libraries modules from state->imported when closing the handle (c100f79)
  • Fix _state_capture_overflow_ctx corrupting frame stack when there are any recoveries (2c4402c)
  • Fix PUSH_MAP calling wi_state_error instead of _ERROR (9446fd8)
  • Check if we are at the start of the file instead of line 1 when checking shebang (c0ff0f3)
  • Mirror wi_table_reserve behavior in WI_DECL_BUF wi_name_buf_reserve (aa8b535)
  • Check if character after 0base is_alnum in wi_string_to_real (a7cf42a)
  • Move _state_close_upvalues to the top in _state_reset (e6408a7)
  • Check state->frame_count == 0 in _parser_error_va when checking for an EOF error (862b4cf)
  • Refactor stack growing/reserving/overflow checking (1df82f6, 3299cb0)
  • Capture and restore gc->temp_root_count instead of zeroing it in the compiler (1352351)
  • Check if we're actually in a console on Windows in wi_read_line; fallback to fgets if not (7171480)
  • Fix memory leaks in escape sequences and import attempts (wi_compiler.c) (b4edb1b)
  • Use _flag_parse_error for multiple script files instead of raw fprintf (wi.c) (dcd098e)
  • Fix _os_sleep/_string_repeat error wording (must be positive -> must not be negative) (4171854)
  • Add ./file/init.wi and lib/file/init.wi search paths to _compiler_import_expr (d7620c5)
  • Move state->main_module initialization to the bottom of wi_new_state (1538b85)
  • Measure/read relative to the current position in wi_read_stream (a3c94e8)
  • Root name in _compiler_export_stmt (like in _compiler_def_var) (e611d87)
  • Add WI_TABLE_SET_FOREIGN_ALL (wi_table.h, not public API); use it in all of STM (9d79f0c)
  • Bump version to v9.7.0 (7bc1ca3)

STD

  • Guard std::ismain (_base_ismain) against running it outside of a running script (80e7480)

STM

  • Validate callbacks in _string_each/select/where (4a9f3e2)

Repo

  • Normalize path slashes in the test runner (util/test.py) (b900007)
  • Add Clang to build.yml workflow (9b252d4)
  • Rename build workflow to just "Build Wi" (4538a47)
  • Cleanup .clangd a bit (0c03184)

Full Changelog: v9.6.0-beta...v9.7.0-beta

Wi 9.6.0-beta

Choose a tag to compare

@cyxigo cyxigo released this 27 Sep 16:11

API

  • Fix wi_find not checking state->foreign (7b65643)

General

  • Bump array->items.mod_count in _state_subscript_set (201b639)
  • Add more escape sequences (690b84a)
  • Add scientific notation support (d030dda)
  • Add support for trailing commas in array/map expression + export statement (af6edf0)
  • Fix extremely rare memory leak in _state_concat (75b31ad)
  • Bump version to v9.6.0 (5190231)

STD

  • Refactor io::writebytes (_io_writebytes) (625fd40)

STM

  • Fix char buf leaking in _string_select/_string_where (8d2fc47)
  • Add _string_isdigit/isalpha/isalnum (e0bf8ae)
  • Add _array_insertat (619d476)

Full Changelog: v9.5.0-beta...v9.6.0-beta

Wi 9.5.0-beta

Choose a tag to compare

@cyxigo cyxigo released this 27 Sep 07:40

API

General

  • Guard against file_size > INT_MAX in wi_read_stream (98b3e2e)
  • Change comment syntax to %% for line comments and %* ... *% for block comments (2ab49d3) <----- ULTRA SUPER BREAKING
  • Add integer division (INT_DIVIDE, //) (f786d94)
  • Bump version to v9.5.0 (aff3b27)

STD

  • Add os::isdir (_os_isdir) (0313805)
  • Add math::atan2 (_math_atan2) (e44d797)

STM

  • Guard against NaN keys in _map_select (0f61301)

Full Changelog: v9.4.0-beta...v9.5.0-beta

Wi 9.4.0-beta

Choose a tag to compare

@cyxigo cyxigo released this 26 Sep 09:33

API

  • Add extra pointer API (2ac35b8, 2688472)
  • Add wi_is_function to the API (3baf77e)
  • Add wi_arg_type to the API (8ab29b0)
  • Add ref API (eb81bdb)
  • Add state parameter to wi_print_fn (a7a1f80)
  • Add wi_type() to API (ea70b79)
  • Add wi_map_next/wi_object_next/wi_module_next to the API (f50399f)
  • Cleanup doxygen comments in wi.h (4c5391f)
  • Add wi_state_memory_used/wi_state_collect_garbage to API; refactor STD/STM error messages (fb8ee9c)
  • Update wi_call comment (796926c)
  • Add wi_arg_check_function to API (4dd933b)

General

  • Add raw string literals (syntax `string` instead of "string") (eed4921)
  • Canonicalize NaNs that can come from ADD, SUBTRACT, MULTIPLY, DIVIDE, POWER, and MODULO (2097ea9)
  • Replace libc rand() with xoshiro256** PRNG (ca3beb3)
  • Add optional exit_code parameter to std::exit (_base_exit); add wi_state_exit_code to the API (ded4b53)
  • Guard against NaN as a key in maps (9181eaf)
  • Bump version to v9.4.0 (15bdb50)

STD

  • Add os::listdir (_os_listdir) (92785a2)
  • Fix dead formatting argument in _io_writebytes (63f11b8)
  • Add optional N parameter to math::round (_math_round) (5a3cb79)
  • Check for empty strings in std::real (_base_real) (2b7aac5)
  • Cleanup io reading (4a83b3c)
  • Add io::flush (_io_flush) (52220ef)
  • Add io::seek (_io_seek) and io::SEEK_SET/SEEK_CUR/SEEK_END (ae71b71)
  • Add os::monotonic (_os_monotonic) (d3235d0)
  • Refactor math::min (_math_min)/math::max (_math_max) (5a13bcd)

STM

  • Use wi_arg_check_function in array/map STM (6ccf1ef)

Full Changelog: v9.3.0-beta...v9.4.0-beta

Wi 9.3.0-beta

Choose a tag to compare

@cyxigo cyxigo released this 23 Sep 12:11

General

  • Rename wi_compiler_local -> wi_local; wi_compiler_upvalue -> wi_cupvalue (b33264f)
  • Add nesting to block comments (48f9b5a)
  • Refactor old STD/STM functions to use "new" API (09cc5fc)
  • Remove dead macro in wi_state_error (3467ede)
  • Cleanup wi_compiler.c a tiny bit (570c550)
  • Add mod_count to buffers/arrays; update STM accordingly (6165ee6)
  • Update table->mod_count in wi_table_set/wi_table_delete too (93c4528)
  • Rename remaining STD/STM functions to flatcase (b3c6104)
  • Use signed integers in _bit_shift (1f56e48)
  • Use strtoull instead of strtoll for hex/oct/bin literals (73bb80c)
  • Update invalid utf-8 error messages (e37b4ea)
  • Bump dest->mod_count in wi_table_copy (b3d3f77)
  • Default globals to null at compile time (d9a8de2)
  • Check state->import_load result for NULL (_state_import) (cec8cc7)
  • Bump version to v9.3.0 (ee4d449)

STD

  • Add math::seed (_math_seed); add optional [min, max] to math::random (_math_random) (81f03b6)
  • Fix naming in io (wi_file -> _file) (f6bfccd)
  • Add os::system (_os_system) (2c7683d, edea630)
  • Add os::remove/os::rename (_os_remove/_os_rename) (07dd8b7)
  • Add os::sleep (_os_sleep) (7c37d04, 7384e7f)
  • Add std::char (_base_char) (9957d58)
  • Rename std::to_X -> std::X (bc754d2)
  • Rename _os_get_env -> _os_getenv (os::getenv) (ea3143a)
  • Add os::setenv (_os_setenv) (f78d141)
  • Use reals in math::random (_math_random) (1049b5c)
  • Add os::date (_os_date) (29cca57, 54b6e30, 4f823e4)
  • Rename std::is_x -> std::isx; std::has_field -> std::hasfield (b53986b)
  • Add io::exists (_io_exists) (751011d)
  • Add WI_PATH_MAX (wi_util.h); add os::cwd (_os_cwd) (f270df2)
  • Add os::mkdir (_os_mkdir) (f033dc1)
  • Add io::writebytes (_io_writebytes); add io::readbytes (_io_readbytes) (1093d8c)
  • Add std::gc (_base_gc); add std::memoryused (_base_memoryused) (bdf4535)

STM

  • Add array->join (_array_join) (b7ad105)
  • Add string->repeat (_string_repeat) (b6bf480, 5d7252c, f565897)
  • Add string->bytes (_string_bytes) (7b90078, f5c4ea9)
  • Root value in _map_select (1abf18f)
  • Root pivot in _aqsort_partition (fa9d842)
  • Add write barriers to _aqsort_swap (156055e)
  • Bump mod_count in _array_clear/_map_clear (1918caa)
  • Bump array->items.mod_count in _array_reverse (f91dfd9)

Repository

Full Changelog: v9.2.1-beta...v9.3.0-beta

Wi 9.2.1-beta

Choose a tag to compare

@cyxigo cyxigo released this 19 Sep 16:22

General

  • Fix designated initializers (MSVC compliance) (61ad816)
  • Fix void* to type* conversion (MSVC compliance) (f983111)
  • Bump version to v9.2.1 (e479720)

STD

  • Add C stack overflow check to _equals (std::equals) (5fb21a6)

STM

  • Correct write barriers in _string_replace (50bc9ca)
  • Add write barriers to _map_keys/_map_values (6e2632f)

Repository

  • Refactor xmake.lua to support MSVC better (1a3305d)
  • Fix kind of sort_clear.wi (3054dbb)
  • Remove matrix from codeql.yml; add MinGW/EMCC to build.yml (731fd51)

Full Changelog: v9.2.0-beta...v9.2.1-beta

Wi 9.2.0-beta

Choose a tag to compare

@cyxigo cyxigo released this 17 Sep 00:04

General

  • Add switch statement (31555a1)
  • Support multiple values per switch case (case x, y, z:) (06e1daa)
  • Move local bounds check to _compiler_add_local (27bbec4)
  • Fix a tiny miscount in _compiler_import_foreign (Windows) (4519d02)
  • Move C stack depth check to the top in wi_state_call (1f2a117)
  • Bump version to v9.2.0 (ae49ce4)

Full Changelog: v9.1.2-beta...v9.2.0-beta

Wi 9.1.2-beta

Choose a tag to compare

@cyxigo cyxigo released this 15 Sep 16:50

General

  • Add missing write barriers across STD/STM (e9baa7b)
  • Add integer (64-bit) validation (be8c4aa + d73e336)
  • Update STM to use wi_state_real_to_int (e897cd3)
  • Fix int64_t printing formats (649ef0a)
  • Bump version to v9.1.2 and fix implicit conversion in _array_slice (f3b5aca)

Full Changelog: v9.1.1-beta...v9.1.2-beta