DEV Community

JoeStrout
JoeStrout

Posted on

MiniScript Roadmap Update (March 2026)

At the end of 2025, I posted a MiniScript Road Map for 2026 (and beyond). We're now almost one quarter into 2026. Let's see how it's going!

MiniScript chinchilla logo

MiniScript 2.0

The biggest work planned for this year is MiniScript 2, a complete rewrite of the MiniScript language, focused on performance. I'm pleased to report that MiniScript 2 is ahead of schedule.

The goal for the first quarter was "MS2 compiles & runs a subset of MiniScript", while the Q2 (end of June) goal was "MS2 feature complete (whole language implemented)". We've pretty much achieved the Q2 goal already! MS2 has an extensive test suite that exercise every part of the language, and longer test programs and benchmarks that put it to work in more realistic ways. We don't yet have import, but technically that's not part of the language; that's added by host apps (like Mini Micro. We have a short list of new language features and minor changes, all of which are tested and working except for one (doc strings on functions — we're still thinking about whether and how we want that to work).

But what about performance, you ask?

Yesterday I ran three benchmarks -- two using iteration and one using recursion (a particularly challenging benchmark for MiniScript 1.x). I ran them in MiniScript 1 (C++ version), MiniScript 2 (both C# and C++ version), and for comparison's sake, also ran equivalent code in Python and Lua. Here's the result, with the Y axis representing speed relative to Python.

Bar chart showing benchmarks by language

There are a couple important things to note here. First, the C++ version of MS2 is significantly faster (like 15X faster) than the C# version. That's how it should be, since C# is managed code run by a bytecode interpreter, but in MS1, those times were about the same. (I didn't include a MS1 C# benchmark but trust me, it's always been roughly the same as the C++ version.)

But this doesn't mean the C# version is slow. Compare the blue bars (MS2 C#) to the teeny gray bars (MS1 C++). Even the C# version of MiniScript 2 is much faster than the C++ version of MS1, by a factor of 10.

Now compare the green bar (the C++ version of MS2) to Python (orange bar). We are much faster on 2 of 3 tests, and about the same on the third. Recursion still costs a little more than we'd like, but it now merely drags us down to "about the same speed as Python," which is pretty fast.

Of course there's Lua over there (red bars), feeling pretty good about itself. Yes, Lua is fast, especially on recursion tests. On the iterative benchmarks, we're faster on one, a bit slower on the other. But we're not done yet!

I also ran some tests where, instead of starting with MiniScript source code, I used hand-written assembly code. This tests how fast the VM can go, separate from how good the compiler is at emitting optimized bytecode. Here are the results for that:

Bar chart showing asm vs. src

Here the bright bars are hand-written assembly, and the darker bars are MiniScript source. You can see that the hand-written assembly runs faster, by a factor of 2-3. This reflects the opportunity for improvement we could get just by improving the compiler, entirely separate from the VM. We've barely begun to do compiler optimizations yet. So I think we'll be able to capture much of that potential improvement.

To summarize: MiniScript 2 is already fast (comparable or better than Python; nearly as fast or faster than Lua). And I expect it to get faster before 2.0 ships.

Raylib-MiniScript

Another goal for the year was a full set of bindings for MiniScript, and not just for the web, but for desktop (and maybe other) platforms too. Here I am pleased to report that we are even more ahead of schedule. This was a goal for the 4th quarter (end of the year), but, well, some of us got excited and it's nearly done!

Animated gif of raylib-miniscript demo menu

With the aid of helpful community members (especially Dcrawl), essentially the entire Raylib library has now been wrapped -- all 736 functions. These include support for shaders and even 3D graphics:

Animated gif of 3D graphics demo

Like MSRLWeb, on which it is based, the new raylib-miniscript library performs shockingly well. This despite it being currently built on MiniScript 1. As soon as possible, we'll shift it over to MiniScript 2, for a substantial boost in performance.

The raylib-miniscript library is currently available only in source form, and has only seen substantial testing on MacOS and Linux. Nonetheless, several users are not waiting, but are already writing or porting projects to use it.

Soda

I'm among those porting projects to raylib-miniscript; in my case, it's Inversion Institute, a logic/puzzle game that's been on the back burner since 2023. To port this Mini Micro game to Raylib, I am writing classes (in MiniScript) that mimic the Mini Micro APIs... in other words, I am (re)writing Soda on the way to updating my game.

You can find the files for that currently in the Inversion Institute repo, for example PixelDisplay.ms and SpriteDisplay.ms. So, while I originally had no actual intention of starting on the Soda rewrite until MiniScript 2 is done, in fact I'm already writing and testing the code that will end up becoming Soda.

So what's next?

The broad 50,000-foot ambitions outlined a couple months ago have largely been reduced to a laundry list of smaller, more specific remaining to-do items:

MiniScript 2:

  • Further optimize the MiniScript 2 compiler
  • Write moar tests and benchmarks to ensure it works properly
  • Modify or wrap the internal APIs so that people embedding MiniScript in their C#/C++ apps can easily update to MS2

Raylib-MiniScript:

  • update to a MiniScript 2 backend
  • set up build scripts/procedures for Mac/Win/Linux/Web
  • publish prebuilt binaries, so users don't have to build it themselves
  • improve documentation/examples
  • retire MSRLWeb (now superceded by this project)

Soda:

  • retire existing SDL code, replace with raylib-miniscript foundation
  • get API coverage at or beyond Soda's current status (enabling trivial porting of current Soda apps)
  • continue to API parity (or beyond) with Mini Micro
  • publish prebuilt binaries

Mini Micro 2:

  • continue the rewrite once MiniScript 2 is done (and Raylib-MiniScript is using it)
  • release for current platforms
  • release for new platforms (Raspberry Pi, phones, tablets)

Summoner Game Platform:
This one is still at the 50,000-foot level. It will be built on the technologies above, so... it has to wait. But while previously I didn't expect to even start on this until 2027, now I think we might see it sooner than that.

So that's where we are. I'm really quite excited about how far we've come so far in 2026, and what is now on the near horizon. What about you? Which of this stuff are you most looking forward to? Please leave your comments below!

Top comments (1)

Collapse
 
treytomes profile image
Trey Tomes

That's pretty exciting! I love those graphs. Did I hear you mention elsewhere that Mini Micro v2 will be written in C++? The graphs would help explain why.