Kuroko Versions Save

Dialect of Python with explicit variable declaration and block scoping, with a lightweight and easy-to-embed bytecode compiler and interpreter.

v1.4.0

8 months ago

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.

v1.4.0b2

10 months ago

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.

This is a beta release.

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.

v1.4.0b1

11 months ago

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.

This is a beta release.

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.

v1.3.1

1 year ago

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.3.1

This release brings a few minor feature improvements and some bug fixes.

Feature Additions

  • Support for / and * in function definitions to mark positional-only and required keyword-only parameters.
  • Support for memory tagging extensions (MTE) on Android.

Minor Changes

  • The compiler now builds comprehensions similarly to lambdas, resulting in smaller bytecode.
  • Various C style issues with function signatures have been fixed.
  • Some changes have been made to documentation generation to work around upstream changes in Doxygen 1.9.

Bug Fixes

  • An issue where some operations on longs could result in uninitialized data being exposed leading to incorrect results has been resolved.
  • An issue where adding a long with its negation resulted in incorrect results has been resolved.
  • An issue where passing argument expansions to zip incorrectly raised an exception about keyword arguments has been resolved.
  • An issue where it was possible to cause a NULL pointer object reference to be created through the docstrings of property objects has been resolved.
  • An issue where va_args were used in an undefined manner resulting in incorrect results in krk_parseArgs has been resolved.

v1.3.0

1 year ago

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.3.0

Over 200 commits have been made since 1.2.5, including several major feature additions, bug fixes, and C API improvements.

Major Features

  • Optimized method invocations reduce object allocation pressure when calling bound methods.
  • Cached method operators eliminate hash lookup costs when using built-in operators.
  • More operator overloads including in-place ops (+=, etc.), unary +, infix @ (__matmul__)
  • Support for else branches in for, while, try for branches to execute upon successful completion.
  • Relative imports and improved package module support, with a new import resolution strategy.
  • Arbitrary precision integers with a new long type, using an integrated bigint implementation and with seamless switchover from small ints.
  • Exception contexts and causes when raising within an except block or with raise ... from ....
  • Format specs and = in f-strings with the addition of __format__.
  • __setattr__ and __set_name__ methods
  • Updated codecs module

Other Improvements and Bug Fixes

  • Added comparator methods for lists and tuples.
  • Some loops and iterator operations have been optimized.
  • Implemented Python name mangling for private identifiers in classes.
  • The compiler now supports concatenating unalike string tokens (f-strings, r-strings, and regular strings).
  • Issues with memory allocation tracking that resulted in over-eager garbage collection have been resolved.
  • Reallocation of value stacks used in C native functions is now deferred until the function returns.
  • Global namespaces are now bound to functions, not codeobjects, and functions objects can be built at runtime from codeobjects combined with appropriate upvalue sources and global tables (either through an instance or dict).
  • The compiler now builds expressions directly and the repl will only print the results of expression statements, rather than peeking beyond the top of the stack to find statement values.
  • The dis module can now be used with -m to compile and print a disassembly of source inputs, recursively, without running them.
  • Type hints can now be added to local declarations, and are computed and stored when functions are created in a manner similar to arguments. The keys for these type hints are indexes into the local names table, where the actual names and valid lifetimes on the variables can be found.
  • The binding for ** has been corrected to match Python, binding to the right, so 2 ** 3 ** 4 is equivalent to 2 ** (3 ** 4) instead of (2 ** 3) ** 4.
  • All global state has been consolidated to the VM state and threadstate objects in the interpreter.
  • The scanner and compiler are now reentrant.
  • Upvalue capture in generators has been improved.
  • When breaking or continueing from within a with or try, __exit__ handlers and finally: blocks are now executed correctly.
  • krk_runfile() now provides the exit frame guarantees krk_callfile provided, making krk_callfile redundant; it has been removed.
  • A new string formatter has been implemented for krk_runtimeError, supporting several common usecases such as printing the type name of an object, directly printing KrkString* objects, and calling repr on arguments.
  • __pow__ is now supported on ints by default. (float.__pow__ still requires import math to be bound to a libm implementation of pow())

Changes from RC0

  • let is now a simple statement and can be chained with semicolons and used in a -c argument.
  • Linear-time base conversions for power-of-two string formatting and parsing of longs.
  • Some math functions have been changed.
  • New utility functions, krk_parseArgs, krk_pushStringBuilderFormat, have been added to the C API.
  • File, BinaryFile, Directory are now part of fileio.
  • DYNAMIC_PROPERTY has been removed from the C API.
  • The exception hierarchy has been reworked to more closely match Python.
  • More accurate conversions between float and log.

Changelog

  • 8043ca2 Pre-hash strings from str(),hex(),oct(),bin() conversions
  • 08aa30a Calculate hash while multiplying strings
  • b9b60ad Better power-of-two base conversions for parsing/printing longs
  • 564a4b3 Parse 'let' declarations as simple statements
  • a59b635 tgamma/lgamma should exist on all of these platforms
  • 90f6854 Just bind tgamma instead for now; can alias it later
  • 6cb3be2 Don't bind 'math.gamma' to libc gamma, we have no idea what that might actually calculate
  • d63ab70 Fix dangling pointer to VM value stack in krk_processComplexArguments
  • 81c5706 Saturate rather than failing on index bounds in list.insert()
  • ab0418f fix missing .0 when printing negative whole floats
  • 016e9e4 Use StringBuilders in compiler string parsing
  • 0b696fc StringBuilders should be cleared when finished or discarded
  • e4f96af Expand KRK_Method, KRK_Function in doxygen docs, instead of old _METHOD, _FUNC
  • 9732e01 Drop SCAN_TRACING
  • 13d0189 Add an __options__ import to disable implicit 'self'
  • e6e63ad Fixup backspace behavior in rline
  • 4e791e9 Fix bad return values from int.__eq__, float.__eq__
  • b9f8f4c Bump serial
  • 342ee04 Cleanup krk_disassembleInstruction
  • fb57355 Use krk_parseArgs in os module
  • 607ac88 Support several int conversions in krk_parseArgs
  • db3a628 Expose _protected in util.h, useful elsewhere
  • ca981fb Cleanup operators to use a common function
  • bdfb0e2 Make paste() a little bit smarter
  • de7e32b Cleanup input()
  • 7bd6cdf Implement proper float conversions for longs
  • 984dea5 ToaruOS has sigaction now
  • ad39476 Clean up function, method repring
  • 29199c9 And in base objects...
  • ca631e0 Use new formatted string builders in various places
  • 32c1dba Add krk_stringFromFormat
  • a632144 Fix handling of ^C when editing multi-line input
  • 6b8d7ee Move StringBuilder functions out of header, into obj_str; add pushStringBuilderFormat
  • 6029d50 Fix incorrect handling of tombstones in tableGet_Fast, tableFindString
  • f6a5f7f Cleanup exception hierarchy
  • 1129323 Trying to build an exception may itself raise an exception
  • 5d9d33e The builtins module really should be called 'builtins'
  • 879a26f Support rline in the simple-repl and update it to be more like the real one
  • 0df346f Don't keep rebuilding class object that tracks compiler state for gc...
  • 6d8d33c Move File, BinaryFile, Directory to fileio module
  • 0455137 Store fget, fset as direct object pointers if we can
  • 8236fb9 Rewrite attribute get/set to fix descriptors; drop DYNAMIC_PROPERTY
  • c519298 reorder opcodes since we added EXIT_LOOP
  • 71dd3ec Use krk_parseArgs in a few places
  • 15fa509 Add krk_parseArgs utility function
  • 2387ac6 bytes() can take iterators, int, encode strings (utf-8)
  • 0d23254 Replace all uses of PUSH_CHAR in obj_str with string builders
  • b0a35fb Attach mode strings to stdin, stdout, stderr objects so they repr correctly
  • 85d64e0 _macos_currentThread should always be inlined
  • efb73c8 Don't use PRIkrk_int in exception format strings, we can't trust it
  • 5190c0c Mark this as rc0
  • 2793090 Make deb package versions a bit smarter
  • bc413b6 Missing cast when shifting '1' by digit size in obj_long
  • b3fbb9c Cleanup old unpackArray things
  • 5c469dd clang seems to think this can be uninitialized
  • 9bd257e Exceptions raised in 'else' should run 'finally' before raising, not run 'except'
  • 2f18ecb Support 'else' block on 'try'
  • d6c9602 Properly run __exit__, finally on break or continue
  • d89b023 Support %.*s in exception formatter
  • 0a9eeca Cleanup sandbox
  • 473f0ba Fix Makefile oops with rpath=$ORIGIN
  • 3de86ab Break out 'kuroko' module, expose init functions, and let VM be initialized without modules
  • b862060 Minor cleanup of import errors
  • 8c387b5 Clean up some C API docs
  • 3b770aa Fixup krk_runfile and remove krk_callfile
  • 71ab25b Add more exposed API functions to headers
  • 74d3b5f Move exception generation into src/exceptions.c
  • b5ab2bd Support del on function attributes, since we support get and set
  • a0d66aa Serial to 7
  • 3b56331 Don't use 'char*' Attribute functions in get/set/delattr
  • 26a31b7 Use a custom formatter for krk_runtimeError
  • b9c8e36 Don't rely on %s to print messages attached to exceptions
  • 9075a58 Fix wrong size of specialMethodNames
  • 8fa4a62 serial to 6
  • fb014bf Fix up some feature disable flags
  • 786457c Fixup typedefs for KrkObj, KrkString
  • 7d568a2 Make the compiler reentrant
  • 39ed214 Remove global state from debugger
  • 73cdaee Get rid of several redundant globals
  • b7f81d9 KrkGenericAlias → krk_GenericAlias for symbol name consistency
  • dd621b9 Don't let an already-running generator execute
  • 4dc3f08 Fix upvalue capture in generators
  • 8213430 Close upvalues even if exception exits runtime
  • ee86a24 b5
  • a580a83 Codecs revisited (#28)
  • 79a4a02 Resolve long-standing left/right binding issue with '**'
  • b966db7 Bump serial to b4
  • 825dbe1 Support type hints on locals
  • c739180 Cleanup exported symbols in rline
  • eae29dd Avoid unnecesasry type checking in tableGet_fast
  • 6eda981 Be more clear on OPERANDS being unsigned
  • d027b86 Bump serial, 1.3.0b3
  • d73d7bd -m dis should recurse
  • e22410d Still need to advance into that string token...
  • 77c38ea Only print actual expressions in repl; fix dumb hacks
  • a20c89f Support -m dis with a dis.krk pseudomodule
  • f8acd8a Fix segfault in syntax error when previous token is synthetic
  • b7e1454 int in bytes
  • cf4683e tuple.__mul__
  • 56c1bbe Tab-complete builtin module names after 'import', 'from'
  • d332688 Bump serial number
  • 6e2ba5f Allow functions to be built from codeobjects, upvalues, dict/instance
  • 316d121 Bind globals to functions, not codeobjects
  • 7dc754a Update outdated comment about enum values for opcodes
  • 3472fcf Accept trailing comma in set literal
  • ed81bc9 Randomize the opcode table.
  • 212efab Consolidate opcode definitions and do not expose the macros in public headers
  • ff43e94 Cleanup common method invocation instructions
  • 431d347 OP_TEST_ARG
  • eeca53e Fix bad argument collection with optional positionals
  • 258527e Fill out missing tokens in parse table for debugging; remove TOKEN_ from string names
  • be3c8a9 Set release serial, shorten -beta to b
  • 15014df Add kuroko.hexversion
  • 7193115 Let MAKE_STRING handle the = prefix, after FORMAT_VALUE swaps it around
  • feebd6e Emit emit string not MAKE_STRING 0
  • a3b2722 Unicode character for fill in __format__
  • 0c10107 Support Unicode strings in argument to str.*strip
  • aa97b37 f'{foo=}' should default to !r if no = or !s
  • ec6a896 Display textual representation of FORMAT_VALUE type in dis like CPython does
  • 391a4d7 Fixup concatenating unalike string tokens in compiler
  • e5f4208 str.__format__
  • cb1bfa4 Cleanup, fix, break out common format string parsing
  • 7d409eb Format spec support in f-strings
  • 9230d4f int.__format__, long.__format__ with as close to Python semantics as I can be bothered
  • d8a1861 format() and object.__format__()
  • f1c0af7 Cache __format__ method
  • f24cb33 Fixup SET_GLOBAL to use IfExists, no need for delete
  • 9b5ce15 Implement Python's identifier mangling
  • d00bdda Strings, too...
  • 17a6aaf Fix parse error when 'if' ends on a class
  • 95c6f17 Remove accidentally committed test file
  • 6fa951a Subclass cleanup must use exact key match to not call VM during GC sweep
  • ff23dbb Update docs
  • c10a457 Rudimentary __setattr__ support
  • cf98b93 dict.__eq__
  • ae99ce1 set comparisons
  • ff19144 Even more correct sequence comparisons...
  • 6d59ddb 'inline' on krk_valuesEqual does nothing
  • c9b989c Add test for __set_name__
  • 2d8de13 More fixes to tuple comparisons; port to lists
  • d601800 list and tuple stuff should use SameOrEqual not just Equal
  • 92d8d0e Cleanup, simplify equality operation
  • 17772c7 unary + (__pos__)
  • ed52b72 operator @ (__matmul__)
  • 855d342 Support __set_name__
  • 388a649 Perform identity checking before equality checking for table keys
  • c49a12e Highlight krk sources as Python on gitlab mirror
  • af18b20 Better long printing
  • afc522a Replace KRK_METHOD, KRK_FUNC with nicer macros
  • 25d5f88 Clean up a bunch of potential type checking issues
  • 7ff7c26 Standardize =,is,~,- a bit more; ELF 'protected' on operator functions
  • e95cc5d Break out collection builder opcodes into inlinable function
  • 9237891 No reason for that callgrind stuff to be a big macro
  • ee1420c Use krk_unpackIterable (and a temporary tuple) in OP_UNPACK
  • eabe6f9 Cleanup some exposed string functions we don't need
  • 3cda8cf Replace macro unpackIterableFast with callback-driven function
  • ebe1b02 Remove tupleOf builtin
  • 19927ea Stop using tupleOf in codec tools
  • a429aa9 tuple.__init__ should not call tupleOf
  • 31509bc Remove setOf, listOf, dictOf builtins (all unused)
  • 87f6c31 tuple.__add__(tuple)
  • 8314e4c 'zip' as a class
  • 5d77dec Set rpath in tools
  • fe4fd1a Retool more things to use utility macros
  • 0ae051b Rewrite Exceptions using typechecking method macros
  • f86887b Elide : for zero-length Exception.__str__()
  • de0af11 KeyError should repr instead of print because Python does that
  • 8b6952d Include module name when printing exception name
  • f38a451 Attach and build upon partial tracebacks
  • 85ad910 Attach __cause__, __context__ to exceptions; support 'raise ... from ...'
  • 2d26917 Exceptions with no argument should not set it to 'None'
  • 3167888 Restore frame pointer correctly on exit due to inner exception
  • 1d828ad Bail early if _eq raises an exception
  • 33946d8 Break early from exceptions in more list functions
  • 9f2791f Describe 'END_FINALLY' handler sentinel in printValueSafe
  • 6512720 Revert accidental inclusion of debug prints when print() encounters an exception
  • e33a37a Cleanup complex argument parsing
  • abd90cc Fixup, complete tuple comparisons
  • 150a37f NotImplemented == NotImplemented
  • e39628b When returning with an uncaught exception in an inner call, set the stack appropriately
  • 2e15653 Add some tuple comparators
  • 0b7988c Ensure list.sort doesn't run more comparators with an active exception
  • ed9b522 Use absolute stack offset when exiting from a native call
  • 2000161 Trim trailing whitespace in string-to-int/long conversions
  • a354c4a Fixup int(str) which should default to base 10, and throw exceptions
  • 0d28885 Fix that one old test to not go through float()
  • e7ca71e Support more special methods in doc generation
  • d968a91 Cleanup missed setlice/delslice refs
  • 563a2b1 Update version suffix to -beta
  • fa452d6 Cleanup macros for BIND_TRIPLET
  • 4c5a584 highlight 'long' as a type in rline
  • fd7bc2a Internal long inspection methods
  • 8c6273c long.__abs__
  • c5fa5cf Fix __pow__ loop order, missing scratch reg
  • 5da2708 (-1) ** 0 is in fact 1
  • 468fb09 Implement __pow__ for integers using method described by HAC 14.79, as CPython does
  • 978f09a Add set.__xor__
  • edc86e2 Rudimentary float operations for longs; definitely more inaccurate than they could be
  • c670dd6 Addition long (and int) functions, as per Python
  • 1079190 Collect a bunch of digits into a uint64_t first...
  • 21cd0c8 typo'd condition for converting negatives
  • f61922d long type
  • 635dd44 Add method fallbacks for oct,hex,bin,abs,float; move int methods to class
  • 82292d0 Optimize 'while True' and 'while 1' at a parse level
  • 5e464b3 Upvalue closing only needs to happen once in CLOSE_MANY
  • 4b02118 Bind a few new dynamic properties for code objects
  • 2314a4e Rudimentary % formatter for strings
  • 0e51103 __call__ must be one of these, let's skip the extra jumps and switch...
  • 92c0d09 Implement dict.__ior__
  • 7d3df0d Cache binary operator methods, support inplace variants
  • ed31f1e Try some minor optimizations to function calls
  • 3721ebc shift-and-compare is probably better than mask & compare
  • 248f54a Pull out attributeUnpack to a separate function because I may want to just get rid of it
  • cdcfb63 New '__options__' psuedo-module with compile-time changes
  • b2846c1 (bench) python fasttimer should check for exceptions
  • cd25ada Less obtuse list.append() benchmark
  • 75e0ec9 Fix up some syntax errors
  • 3bfa32a Print ^s for the whole width of a faulting symbol in a syntax error, looks cooler
  • 4fd68ec Simplify rewinding infix operators
  • 5f3a2b4 Expose __args__ directly on codeobject
  • b434930 Add more keywords to the stdlib highlighter
  • 5a79f27 Fix incorrect OP_CLOSURE instruction size returned by dis.examine
  • 9c25e20 Take the line number from the previously parsed token when build synthetics
  • bce9943 (meta) upgrade github codeql workflow
  • 48f9d34 Tests for bound method edge cases
  • 2e7bf54 Bound methods can be bound to non-function callables
  • 55849aa Fix edgecases around expanded calls to bound callables when no stack space is available
  • 3bc8d72 Take best-of-ten in most benchmarks, add inner_loop benchmarks
  • 1ee63c1 Use a flag to mark classes not subclassable
  • 098b316 prevent functions, codeobjects from being initialized; methods can be
  • fa2b2c0 Merge flags
  • c785b25 kuroko.inspect_value() shows KrkValue byte representation
  • b3c693e Disallow subclassing of some core types that are not subclasses of Instance
  • 3f0522d Change getsizeof calculations; stack-only values have 0 size
  • 2437e73 Bad malloc size in putenv?
  • f16083a Pack object type/flags/hash better
  • bbfe948 Lambda should be able to accept *args and **kwargs
  • 65f7ae3 Simplify cached method things; don't expose the enum in headers
  • a41410d Stick 'subclasses' before method cache
  • bbf378e Reorder arguments to callNativeOnStack for better fallthrough to native call
  • d18b08e Native function args should be const
  • 8ade3af Support dir() with no arguments; returns globals only
  • ae10f81 Start calling this 1.3
  • 285f7cd Fix up path search ordering to be more like CPython; implement __main__.krk
  • a4e2b5c Relative imports
  • 3645047 Same for None
  • f14ca90 Avoid NotImplemented.__hash__ resolving to object.__hash__ and segfaulting
  • 81e3bb3 Defer freeing pre-grown stacks when using them in native calls
  • 1f6afa7 Add new CLOSE_MANY and POP_MANY instructions
  • 7dff49c Fix incorrect hashing of classes in fallback added for subclass tracking
  • aa67816 Fix bad encoding of large upvalue indexes
  • 32b3af5 Unset class bases when doing final free so we don't access potentially-freed subclass tables
  • 1ac8f29 Invalidate caches of subclass method pointers when they change in a superclass
  • 1c5fc95 Update copyright years, it's been 2022 for a while now
  • 3601411 Support step value in range()
  • 1acd024 Workaround horrible thread-local performance on macOS (aarch64)
  • 74e064c Test case for preceding fix
  • b9776ae Revert loop on 'for ... if ...'
  • 341fd87 New optimized loop and jump instructions
  • 657a02a Reduce recursion overhead when calling objects
  • c4b8339 More efficient bool, int comparisons, sometimes
  • c38e78e Fast-case listiterator.__call__ instanceof check
  • d0c2f8c Cleanup memory size debugger, no need for external hashmap
  • cb14875 Catch exceptions early in timeit.timeit
  • 4a05219 Support 'else' blocks on for and while loops
  • ece7da2 Support = to print f-string expression alongside value
  • 78e85ce Support an extensive memory debugging process, if you provide some extra files
  • 27278cf Fixup allocation size for bytes literals
  • 953e57f Fix two more instances of bad alloc/dealloc pairings
  • 73c82e0 Fixup display of gc debug info on 32-bit platforms
  • a50cfc6 Fix tracking of memory from instances of objects with allocSize != sizeof(Instance)
  • 9b1875d Fix incorrect memory usage tracking of taken strings
  • b6e5916 Fix incorrect memory usage tracking of code object line mappings
  • 81f78b9 fixup potential leaks when os.exec*() family fails
  • 7c4b129 Dict unpacking should only happen on dicts, or we're going to have a bad time
  • 396b8c0 Inline string equality check to save overhead of object.__eq__ call
  • 5df1469 Optimized method invoke
  • d947e1a Add bound method call test to benchmark suite
  • f8139f9 Add versions, local Kuroko to benchmark

v1.3.0rc0

1 year ago

This is a release candidate and not a final 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.3.0

Over 200 commits have been made since 1.2.5, including several major feature additions, bug fixes, and C API improvements.

Major Features

  • Optimized method invocations reduce object allocation pressure when calling bound methods.
  • Cached method operators eliminate hash lookup costs when using built-in operators.
  • More operator overloads including in-place ops (+=, etc.), unary +, infix @ (__matmul__)
  • Support for else branches in for, while, try for branches to execute upon successful completion.
  • Relative imports and improved package module support, with a new import resolution strategy.
  • Arbitrary precision integers with a new long type, using an integrated bigint implementation and with seamless switchover from small ints.
  • Exception contexts and causes when raising within an except block or with raise ... from ....
  • Format specs and = in f-strings with the addition of __format__.
  • __setattr__ and __set_name__ methods
  • Updated codecs module

Other Improvements and Bug Fixes

  • Added comparator methods for lists and tuples.
  • Some loops and iterator operations have been optimized.
  • Implemented Python name mangling for private identifiers in classes.
  • The compiler now supports concatenating unalike string tokens (f-strings, r-strings, and regular strings).
  • Issues with memory allocation tracking that resulted in over-eager garbage collection have been resolved.
  • Reallocation of value stacks used in C native functions is now deferred until the function returns.
  • Global namespaces are now bound to functions, not codeobjects, and functions objects can be built at runtime from codeobjects combined with appropriate upvalue sources and global tables (either through an instance or dict).
  • The compiler now builds expressions directly and the repl will only print the results of expression statements, rather than peeking beyond the top of the stack to find statement values.
  • The dis module can now be used with -m to compile and print a disassembly of source inputs, recursively, without running them.
  • Type hints can now be added to local declarations, and are computed and stored when functions are created in a manner similar to arguments. The keys for these type hints are indexes into the local names table, where the actual names and valid lifetimes on the variables can be found.
  • The binding for ** has been corrected to match Python, binding to the right, so 2 ** 3 ** 4 is equivalent to 2 ** (3 ** 4) instead of (2 ** 3) ** 4.
  • All global state has been consolidated to the VM state and threadstate objects in the interpreter.
  • The scanner and compiler are now reentrant.
  • Upvalue capture in generators has been improved.
  • When breaking or continueing from within a with or try, __exit__ handlers and finally: blocks are now executed correctly.
  • krk_runfile() now provides the exit frame guarantees krk_callfile provided, making krk_callfile redundant; it has been removed.
  • A new string formatter has been implemented for krk_runtimeError, supporting several common usecases such as printing the type name of an object, directly printing KrkString* objects, and calling repr on arguments.
  • __pow__ is now supported on ints by default. (float.__pow__ still requires import math to be bound to a libm implementation of pow())

v1.2.5

2 years ago

Kuroko 1.2.5

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.2.5

  • Various build fixes for Windows targets.
  • Parser fixes around blank lines and comments before else, except, etc.
  • KUROKOPATH environment variable can be set to specify module paths on startup, similar to PYTHONPATH
  • Fixed some lock ordering issues in lists.
  • Added random.seed(), os.get_terminal_size().
  • Fixed an issue with str.replace() when strings had \x00 bytes.
  • Significant improvements to the performance of str.__add__.
  • The main repl binary now assigns the last repl result to __builtins__._ (if it's non-None)
  • slice objects have been added
  • __getslice__, __setslice__, and __delslice__ have been removed; slice objects are passed to __getitem__, etc., as in Python 3.
  • Fixed some instances where nested exceptions were being incorrectly replaced, such as when indexing a non-hashable type in a dictionary.
  • Precedence ordering for tuple and slice sequences in [] expressions has been corrected to match Python 3 (eg., 1:2,3:4 is (slice(1,2),slice(3,4)), not slice(1,(2,3),4))

Changes from 1.2.3 to 1.2.4

  • Fixed an issue when print() is passed keyword arguments but no positional arguments.
  • Various changes and additions to the os module.
  • __setitem__ on list and dict should return the set value.
  • Added abs() as a built-in.
  • Added support for keyword argument initialization of dicts.
  • dicts are now iterable, aliasing dict.keys().
  • Added dict.values, and the dictvalues iterator class.
  • Fixed issues with comparing floats and ints.
  • Fixed an issue wherein using del on table entries did not correctly update table sizes.

Changes from 1.2.2 to 1.2.3

  • The tuple hash algorithm has been improved with some inspiration from CPython.
  • Added list.__eq__.

v1.2.2

2 years ago

Kuroko 1.2.2

With apologies, I have neglected to mark off releases despite bumping version numbers internally. -klange

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.2.2

  • Some issues related to maximum recursion depth have been resolved, and an exception should now be properly raised when maximum recursion depth is reached.
  • The maximum recursion depth can now be configured at runtime.
  • An issue where the terminal escape sequences printed by the REPL would be hard to read on some terminals has been resolved.
  • Various iterators have been improved with faster C implementations.
  • A random module has been added.
  • Two incorrectly implemented math functions (log1p, expm1) have been fixed, and some new constants have been added.
  • Two potential segmentation faults, one in string comparison and one in iterable unpacking, have been fixed.
  • The internal integer representation has been expanded to 48 bits. This change breaks ABI compatibility, please rebuild where necessary.
  • The codecs package has received some updates.
  • The wcwidth implementation provided for Windows has been updated with the latest data from the Unicode databases, and a wcwidth module has been added to expose the function. Note that the system libc wcwidth will be used where available.
  • Some issues with comparison of NaNs have been addressed.

v1.1.2

2 years ago

Kuroko 1.1.2

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.1.2

  • Keyword arguments are now supported in lambda functions.
  • rline has been updated with support for ^R history search.
  • Some methods have been added to the str type.
  • An issue in which Windows builds failed to load files with \r\n line endings has been fixed.
  • An issue in which lists passed to the exec* family of functions were not properly NULL terminated has been fixed.
  • An issue in which zero-length files were not correctly handled has been fixed.
  • An issue in which tracebacks were not properly printed on platforms with unsigned char types has been fixed.
  • An issue in which the main interpreter improperly examined the $PATH environment variable has been fixed.

v1.1.1

3 years ago

Kuroko 1.1.1

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 Freenode to discuss the problem.

What's new in 1.1.1

This is a bug fix release to address issues found in 1.1.0:

  • An issue where trailing commas were not accepted in function call argument lists has been fixed.
  • An issue where single complex assignment targets did not result in a one-value unpack has been fixed.
  • An issue with scrollback in rline has been fixed.
  • An issue where any and all corrupted the stack when passed iterators has been fixed.
  • An issue where dict.capacity expected an unused argument has been fixed.
  • An issue where set.__eq__ was not implemented has been fixed.
  • An issue where the timeit module was not included in the bundle list has been fixed.
  • Some minor changes to the source layout have been made: C extension modules are now in src/modules/.
  • tcmalloc is no longer used on Windows, as the issue it was added to solve was resolved previously. This change was quietly applied to the release archive for Windows provided for 1.1.0.
  • Some minor changes have been made to support building under tcc.