Zigar 0.14.2 released, with major new features

Zigar is a toolkit that let you use Zig code in JavaScript environments.

The main addition in 0.14.2 is the virtual file system. It lets you handle file operations in JavaScript. When an fopen() occurs, for instance, you can choose to return a string or a Uint8Array as a file substitute. The main purpose of the system is to facilitate the use of older C libraries in web applications, where the file system is generally not the source of data or its destination.

This demo app running SQLite in the browser shows one usage scenario.

Thread handling has been enhanced in 0.14.2. Creating async functions is a lot easier now with the addition of promisify() to WorkQueue. I’ve also add a command for quickly patching std for WebAssembly threads.

Importing package and C file is also easier now.

The meta-type system has been overhauled and expanded. You can now flag particular fields as string, typed array, or normal object, making them easier to use on the JavaScript side.

Development for 0.14.2 took longer than expected, that’s why the project is still stuck at Zig 0.14. The upgrade to 0.15 hopefully can happen within a month. I’ll start as soon as I’m done writing this message :slight_smile:

Anyway, check it out!

GitHub: GitHub - chung-leong/zigar: Toolkit enabling the use of Zig code in JavaScript projects

6 Likes