Skip to content

doir-lang/MizuRunner

Repository files navigation

Mizu's Mascot

MizuRunner

Unlicensed Latest Release

A simple executable wrapper around the Mizu assembly interpreter library. It takes as input a binary in Mizu's Portable Format and executes it.

# On linux this looks like:
mizu hello.mizu

# Or like this to see a printed trace of the instructions as they are executed
mizu-trace hello.mizu

# A binary's "source code" can be examined by running
mizu hello.mizu --generate-header

Features

Creating Mizu Binaries

Unfortunately Mizu doesn't have an assembler, thus to create a Mizu binary you need to write a simple C++ executable with code for the Mizu program embedded. You then need to call Mizu's to_portable function and save the resulting binary blob to a file:

fp::raii::dynarray<std::byte> portable = mizu::portable::to_portable(program_view, mizu_stack);
std::ofstream fout("program.mizu", std::ios::binary | std::ios::out);
fout.write((char*)portable.data(), portable.size());

A full example program dumper can be found in: https://github.com/joshuadahlunr/MizuRunner/blob/master/examples/bubble_sort_dumper.cpp

License

The code in this repository is unlicensed, feel free to do whatever you want with it. However Mizu, Argparse, and Mio are all MIT Licensed.

About

A runner for Mizu's Portable Format.

Resources

License

Stars

Watchers

Forks

Packages

No packages published