github wren-lang/wren 0.4.0

3 years ago

0.4.0 contains 145 commits from 28 contributors!

About Wren

Release blog post (highlights only).

Documentation

This release includes many documentation revisions, fixes, additions and gaps closed!

Language

  • Add continue keyword for loops - #822
  • Add as keyword: import "..." for Name as OtherName - #775
  • Add Support positive sign in scientific notation - #706
  • Add Fiber.try(value) to complement Fiber.call(value) - #835
  • Allow . to be on a different line (for fluent/builder APIs) - 4c496c5
  • Allow newlines in empty parameter lists - #925
  • Add raw strings using triple quotes """ - 981ea4a
  • Add \e escape character for strings - #963
  • Add Attributes to classes and methods - #962

Modules

  • Random: Random.sample optimizations - #716
  • List:
    • Add list.sort() and list.sort {|a, b| ... } (quicksort) - #802
    • Add list.swap(index0, index1) for swapping elements within a list - 38f50fe
    • Add list.indexOf(value) for finding values in a list - 6200987
    • Add list.remove(value), removing by value not index - ecce1f6
  • Num:
    • Add Num.tau - 89c5e22
    • Add Num.nan, Num.infinity - #781
    • Add Num.minSafeInteger and Num.maxSafeInteger - #874
    • Add min(other), max(other), clamp(min, max) - 8361217
    • Add cbrt for cube root - #905
    • Add exp, log2 - 433fbc4

Fixes

  • Fix stack corruption related to Fn calls - #807
  • Fix a byte offset bug in CODE_IMPORT_VARIABLE - 28ad8aa
  • Fix some stack corruptions related to multiple wrenInterpret calls - #730
  • Fixed crash when GC collects module during import 2ce421e
  • Fix Bool, Num and Null allowing subclassing, which is invalid - #831
  • Fix config reallocateFn being required, it can now be left out as intended - 33ab8be
  • Fix returns in a constructor returning null, and disallow returning a value - #845

API

  • BREAKING: Add userData to wrenReallocateFn - #788
  • BREAKING: Add WrenLoadModuleResult which has a onComplete callback, allowing freeing module strings - #778
  • Add wrenGetVersionNumber for external access via the API - #958
  • Add WREN_API prefix for correct dll exports for some compilers - a501fba
  • Add wrenHasVariable and wrenHasModule queries, for use with wrenGetVariable - 182ca90
  • Add wrenSetListElement to complement wrenGetListElement, and allow negative index for both - 97ebcc7
  • Add Map functions to API - #725
    • wrenSetSlotNewMap
    • wrenGetMapCount
    • wrenGetMapContainsKey
    • wrenGetMapValue
    • wrenSetMapValue
    • wrenRemoveMapValue

Other

  • build; add util/generate_projects.py for regenerating project files
  • vm; Allow computed goto when using clang on Windows
  • vm; WREN_MAX_TEMP_ROOTS default is 8 (instead of 5)
  • vm; GC debug times are printed in milliseconds, not seconds

Commits since 0.3.0

Don't miss a new wren release

NewReleases is sending notifications on new releases.