Skip to content

Kuroko 1.4.0

Latest
Compare
Choose a tag to compare
@klange klange released this 28 Aug 00:58
· 145 commits to master since this release

This is Kuroko, a dynamic, bytecode-compiled, interpreted language with significant whitespace and familiar syntax.

For a complete tutorial and sample code, please visit kuroko-lang.github.io.

If you believe you have discovered a bug in this release, please file an issue report here on Github or join #toaruos on Libera.chat to discuss the problem.

What's new in 1.4.0

This release features major changes to object construction and more compatibility with Python.

Object Construction

  • The object construction process has been rewritten to conform more closely with the Python object model.
  • __new__ is now supported.
  • New opcodes have been added to support running class bodies in a custom environment.
  • Metaclasses are now supported.
  • __init__ is now expected to return None.
  • __init_subclass__ is now supported.
  • __class__ can be reassigned in some cases.

Syntax Improvements

  • Function signatures now support / (end of positional-only arguments) and * (start of keyword-only arguments)
  • * and ** expansions are now supported in list, set, and tuple, and dict expressions, respectively.

Standard Library Updates

  • set.update
  • range.__contains__
  • ceil, floor, trunc functions from the math module can now return long values where appropriate.
  • function objects now expose their Cell-typed upvalue cells.
  • staticmethod and classmethod can be applied to native (C) function objects.
  • __bool__ is now supported.

C API

  • API changes to support __new__ will necessitate downstream changes in C extensions.
  • krk_isSubClass is now exposed and may be used to check a single subclass relationship.
  • krk_parseArgs now supports ? to determine if an argument as provided, : to override the function name displayed in exceptions, float conversion for f and d
  • Kuroko can now be built with float support disabled, using KRK_NO_FLOAT.
  • The STATIC_ONLY define has been renamed to KRK_STATIC_ONLY.
  • Kuroko can now be built with a fixed memory tagging value to support ARM MTE on Android. Specify KRK_HEAP_TAG_BYTE=0xb4 when building for this functionality.

Bug Fixes

  • Various issues were fixed in this release and backported to 1.3.1. Please see the release notes for 1.3.1 for a complete list.

Fixed from b1

  • import raising the wrong exception when trying to import a non-existent member
  • No exception was raised when passing extraneous keyword arguments to __new__ when using the default __init__
  • Fixed formatting of bools to return True and False instead of 1 and 0

Added from b1

  • The socket module has experimental support for UNIX and INET6.
  • kuroko.members() has been added, providing similar functionality to __dict__, though read-only.

Fixed from b2

  • An issue which prevented C modules that were part of packages from being loaded due to an incorrect onload function name has been resolved.