Wren v0.4.0 Release Notes

  • Language

    • ➕ Add continue keyword
    • ➕ Add as: import "..." for Name as OtherName
    • ➕ Add Support positive sign in scientific notation
    • ➕ Add Fiber.try(value) to complement Fiber.call(value)
    • 👍 Allow . to be on a different line (for fluent/builder APIs)

    Modules

    • Random: Random.sample optimizations
    • List:
      • add list.sort() and list.sort {|a, b| ... } (quicksort)
      • add list.swap(index0, index1) for swapping elements within a list
      • add list.indexOf(value) for finding values in a list
    • Num:
      • add Num.tau
      • add Num.nan
      • add Num.infinity
      • add min(other)
      • add max(other)
      • add clamp(min, max)
      • add exp
      • add log2

    🛠 Fixes

    • 🛠 Fix stack corruption related to Fn calls
    • Fix a byte offset bug in CODE_IMPORT_VARIABLE
    • 🛠 Fix some stack corruptions related to multiple wrenInterpret calls
    • 🛠 Fixed crash when GC collects module during import
    • 🛠 Fix Bool, Num and Null allowing subclassing, which is invalid

    API

    • 💥 BREAKING: Add userData to wrenReallocateFn
    • 💥 BREAKING: Add WrenLoadModuleResult which has a onComplete callback, allowing freeing module strings
    • ➕ Add wrenHasVariable and wrenHasModule queries, for use with wrenGetVariable
    • ➕ Add wrenSetListElement to complement wrenGetListElement, and allow negative index for both
    • ➕ Add Map functions to API
      • wrenSetSlotNewMap
      • wrenGetMapCount
      • wrenGetMapContainsKey
      • wrenGetMapValue
      • wrenSetMapValue
      • wrenRemoveMapValue

    Other

    • 🏗 build; add util/generate_docs.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