# Zigar 0.14.0: A major step forward in Zig-JavaScript interoperability

**URL:** <https://ziggit.dev/t/zigar-0-14-0-a-major-step-forward-in-zig-javascript-interoperability/9183>\
**Category:** Showcase\
**Tags:** language\
**Created:** [March 20, 2025, 11:49am UTC](https://ziggit.dev/t/zigar-0-14-0-a-major-step-forward-in-zig-javascript-interoperability/9183 "2025-03-20T11:49:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chung-leong](https://ziggit.dev/user_avatar/ziggit.dev/chung-leong/32/999_2.png) [@chung-leong](https://ziggit.dev/u/chung-leong)\
**Post date:** [March 20, 2025, 11:49am UTC](https://ziggit.dev/t/zigar-0-14-0-a-major-step-forward-in-zig-javascript-interoperability/9183/1 "2025-03-20T11:49:02Z")

</div>

The biggest improvement in the latest version is the support for function pointers. Call marshalling is now two-way: JavaScript code can call Zig functions and Zig code can call JavaScript functions. This opens up a lot of new possibilities. Zig can now operate independently in its own thread, initiating communication with JavaScript only when the need arises. Imagine something like an in-process HTTP server.

Version 0.14.0 also brings support for promise and async generator, allowing you to perform time consuming tasks in separate threads.

Support for WebAssembly thread has been added. You can now spawn Web Workers directly from Zig using std.Thread.

Handling of allocators has improved greatly courtesy of function pointer support.

The JavaScript runtime was largely rewritten. Dead code removal is much better. Code for particular features isn’t included anymore when they aren’t actually in use.

Overall, you can do a lot more than before. I’ve added a couple new tutorials: one involving accessing a MySQL database, and the other on how to use zzz. I’m planning to add a couple more in the near future.

The project’s Github page is [here](https://github.com/chung-leong/zigar). At the project website you’ll find a number of demos that run in the web browser. Have a look!

---

<div class="post-metadata">

**Author:** ![awesomo4000](https://ziggit.dev/user_avatar/ziggit.dev/awesomo4000/32/543_2.png) [@awesomo4000](https://ziggit.dev/u/awesomo4000)\
**Post date:** [March 21, 2025, 3:21am UTC](https://ziggit.dev/t/zigar-0-14-0-a-major-step-forward-in-zig-javascript-interoperability/9183/2 "2025-03-21T03:21:08Z")

</div>

This is remarkable!

Which is the best example to study if I want a vanilla JavaScript application in the browser that doesn’t use any frameworks but can still marshall calls back and forth to zig code?

Cheers

---

<div class="post-metadata">

**Author:** ![chung-leong](https://ziggit.dev/user_avatar/ziggit.dev/chung-leong/32/999_2.png) [@chung-leong](https://ziggit.dev/u/chung-leong)\
**Post date:** [March 21, 2025, 7:32am UTC](https://ziggit.dev/t/zigar-0-14-0-a-major-step-forward-in-zig-javascript-interoperability/9183/3 "2025-03-21T07:32:16Z")

</div>

Look at the tutorial for Rollup. If you use the UMD format, the resulting JS file can be loaded using just a `<script>` tag.

---

<div class="post-metadata">

**Author:** ![gonzo](https://ziggit.dev/user_avatar/ziggit.dev/gonzo/32/54_2.png) [@gonzo](https://ziggit.dev/u/gonzo)\
**Post date:** [March 21, 2025, 8:34am UTC](https://ziggit.dev/t/zigar-0-14-0-a-major-step-forward-in-zig-javascript-interoperability/9183/4 "2025-03-21T08:34:14Z")

</div>

What would be a good example of running zig code in the backend, with node / deno / bun?

---

<div class="post-metadata">

**Author:** ![chung-leong](https://ziggit.dev/user_avatar/ziggit.dev/chung-leong/32/999_2.png) [@chung-leong](https://ziggit.dev/u/chung-leong)\
**Post date:** [March 21, 2025, 8:59am UTC](https://ziggit.dev/t/zigar-0-14-0-a-major-step-forward-in-zig-javascript-interoperability/9183/5 "2025-03-21T08:59:33Z")

</div>

The “Getting started” tutorial have separate tracks for Node.js and Bun.js. The MySQL example also runs a server. The zzz example can also be of interest.

I haven’t looked into supporting Deno. I’ll add that to the TODO list.
