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- Lightweight Runtime (Only ~110kb)
- Cross Platform (Windows, Linux, and Mac support).
- Foreign Function Interface to native DLLs (Example: https://github.com/joshuadahlunr/MizuRunner/blob/master/examples/hello_world_dumper.cpp).
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
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.