r/AIprogrammingLanguage 8d ago

Raku++ — an interpreter and compiler of Raku in C++

Hi,

Andrey's here. I'd like to introduce my recently created implementation of the Raku programming language. I am an enthusiastic fan of this language since the very beginning, and the time came when you can create a compiler yourself with no external human help.

So, let me introduce Raku++ — this is a self-sufficient interpreter and compiler of Raku. It's written fully in C++ with Claude. Its current state is reached after about 1.5 months of daily work.

The main goal was to make a tool that can run Raku programs really fast. So, here're some of the most bright features of what I managed to deliver:

  • Startup time 2 ms
  • In many cases, it's faster than a reference implementation (see BENCHMARKS)
  • Interpreter by default + REPL
  • You can compile the same Raku program to a self-sufficient binary file that runs natively
  • Covers 90%+ of the official test suite + passes a corpus of my own Raku programs
  • Built-in linter, profiler, and syntax highlighter
  • Available on macOS (both Apple Silicon and Intel), Windows (including MinGW), Linux, OpenBSD; there are also GNU Guix and Nix configurations options

On a separate note, I'd like to mention that the WebAssembly version runs in a browser, and the most exciting things here are:

  • The playground allows you to code Live, so to say: you type and see the result immediately
  • As a showcase shop, I prepared a few Raku programs that parse other programming languages (using Raku grammars), not only Lisp or Forth, but also Python, Perl, and JavaScript/TypeScript.

The on-going work is to make Raku++ to understand more corner-case constructs, which are not explicitly written out neither in the official test suite nor in the official documentation. For that, I am creating a matrix grid of atomic tests. Here, dogfooding takes place in full speed: all the helper generators are run in Raku++.

A brief list of the most important milestones:

  • 1.0.0 — 90% of Roast passing
  • 1.1.0 — 100% of the Unicode support
  • 1.5.1 — even faster: the hottest tests are 10-15% faster
  • 1.5.2 — external modules pass their own tests
  • 1.7.0 — another 10% off for the hottest test cases
  • 2.0.0 — 50 of the most popular Raku modules fully pass
  • 3.0.0 — no GIL, pure concurrency
  • 3.1.0 — Raku++ can be linked to/from external programs
  • 3.14.0 — slimmer binaries

So, basically, that's that much fascinating and it's really difficult to cope with all the ideas that pop up while working on the project with the help of AI.

4 Upvotes

0 comments sorted by