Devlog

Short update feed for projects.

About

This is the Devlog for moonshine-zig where I post short updates on development so you can stay in the loop and we can both avoid twitter.


Complete restructuring: build vs bindings split

This work encapsulates the tagged release: v0.1.5. This matches the upstream tagged release v0.1.5.

The Split

Previously these bindings would build moonshine from source whenever the project needed to compile, and the entire project was in one repository: moonshine C/C++ and Zig build system and bindings. This was bad for downstream projects that had to have all of moonshine’s dependencies installed to build, and moonshine takes a long time to build from source.

Now, there are two repositories: moonshine-zig-build and moonshine-zig.

The build repository is responsible for building moonshine from source, and it has tagged releases which contain prebuilt moonshine headers and static library. It also vendors the build dependencies! If your target platform is not currently supported, you can build from source like always (except now the build dependencies are mostly vendored).

The main repository is responsible for analyzing the target platform and selecting the proper prebuild artifact or invoking the build for moonshine-zig-build. This repository contains the Zig bindings, and it is what you should fetch into your project.


Migrated to Zig 0.17.0

I have officially moved the codebase to Zig 0.17.0. All tests passed.

Additionally, there were some typos and corrections for the README, but those were minor.


Minimum tests

I have restructured the tests. Previously there was a single test inside the root module that simply checked if the Moonshine library returned the same version as the header’s version.

This was suboptimal for one primary reason: Zig’s compilation is lazy, so code that is not used is not compiled. For bindings, this means that anything that I do not test could have compilation errors that I ship to end users. I resolved this by adding an extra test to pull in all declarations and that means that they are compiled when I run zig build test.

I will write more traditional tests that actually check the behavior of the functions in question, but for bindings of a ASR transcription library there is little to test. The core functionality should be tested upstream.

Note: I could provide more robust tests eventually and that could be useful to upstream.


First entry: State of moonshine-zig

I’ve finally gotten around to publishing a site for my work! This will be a brief introduction to the state of moonshine-zig.

TL;DR: It is usable for Zig 0.16.0 but it still needs work!

Primarily, the transcriber stream API is implemented with idiomatic Zig. Other features are available using @import("moonshine").c where the raw C API, publicly. So, it is ready to use if you’re using Zig 0.16.0 and the latest release of Moonshine as of writing 0.1.5. Soon, I will port the bindings to Zig 0.17.0 now that it is released, and will not bother maintaining Zig 0.16.0, most likely.