#Kuroko

1 messages · Page 1 of 1 (latest)

swift turtle
#

Kuroko is my bytecode-compiled interpreted programming language. It is the NIH'd replacement for Python in ToaruOS. As a language, Kuroko is a dialect of Python - the vast majority of syntax is compatible between the two, but Kuroko has some differences, particularly around variable scoping and declaration. Kuroko was originally built to provide my code editor with a scripting language, but it's expanded beyond that to be a general-purpose language and I've started writing graphical applications for ToaruOS with it. Kuroko's implementation is very similar in design to CPython, and performance is about on par with CPython 3.10, sometimes a bit better.

While Kuroko comes from ToaruOS, it can be built for other environments - I regularly use it under Linux and macOS. It has a pretty slim libc surface, so it can be a simple port to a new OS - definitely easier to host than CPython.

Kuroko can be compiled to wasm and I have a few web interfaces available, as well as a port of Pyodide's Hiwire to interface with JS, so Kuroko can be used as a web scripting language.

Kuroko has also been built as an EFI application, running on the standard console interface, so you can run it in an EFI shell. This was intended to be the foundation for a new scriptable bootloader, but I got bored with it.

Since this is the start of a Progress Report thread, the most recent work in Kuroko has been improving the implementation of class creation to more closely match Python's data model. There's also been a lot of work within ToaruOS to create Kuroko bindings to Toaru's graphics libraries, with full support for the path rasterization methods that were previously restricted to the TrueType text renderer.

https://github.com/kuroko-lang/kuroko

GitHub

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

raw shore
#

woah 😳

#

bros reputation definitely precedes them

swift turtle
ripe saddle
#

its the real klange
very cool langugeaee 👍

ruby trout
#

klanguage

kind scaffold
#

the official python dialect of KDE

swift turtle
#

Been quite a while since I posted here, so how about a Kuroko update?

I did AOC2023 in Kuroko, naturally - and placed on the leaderboard for several problems. I'm not a particularly good speedcoder, and Kuroko isn't really designed for the task any more than any other language is, so that's impressive to me at least!

There were a few AOC-inspired changes this year: A new pairing heap module to support a simple, fast minheap, which proved useful on at least one problem. There was also a fix to a name binding issue when a local recursive function is wrapped in a decorator, which helped with implementing a quick @memoize decorator. The maximum recursion depth can now also be set from a script, under certain circumstances, obviating the need to pass the -R option the interpreter to run certain solutions.

There were also several non-AOC related changes in December, and a handful of other things since my last update. 1.4.0 was released with only a few minor updates from the beta posted above. After that, a number of edge cases and oddities with exceptions were fixed. A major change in the ongoing 1.5 branch is the extraction of several builtin modules to shared-object modules, including os, fileio, gc, dis, and time - this will help with embedding Kuroko in environments where these modules are unnecessary or undesirable.

Kuroko also got a new trick inspired by Python 3.11: Expression underlining in tracebacks. In addition to line number mappings, the compiler stores expression column mappings for relevant opcodes and can use this to highlight the actual expression that resulted in an error.

What I'm working on now is a bunch of API cleanup to make Kuroko better for embedding. I wrote bindings to integrate Kuroko into TIC-80, and as part of that I've also made efforts to get Kuroko building under MSVC. There's also been lots of little performance optimizations.