Meetup in Bologna (Italy) about how to use Zig in JS projects - 18 October 2023

Wednesday October 18th I will give a talk at Bologna JS, a Meetup focused on backend JavaScript.

I will first introduce Zig to a JavaScript / TypeScript audience, and then I will show how to create a Node.js native addon using the Node-API and zig, and a WebAssembly module that can be consumed by the Node.js wasi module.

The talk will be in Italian. Slides and other material will be in English.

Here is the link for the event:

I will post any relevant link in this thread.

5 Likes

Could you share the slides here after the talk ?

Sure. Slides and all other relevant material :wink:

1 Like

Here is the link for the slides (the title is in Italian, but all other slides are in English).

https://zig-bolognajs.vercel.app/

2 Likes

Wow, this is pretty good, nice work! I’ve only skimmed through it, noticed one detail which I don’t think is correct, namely, the two error handling tips contradict each other.

I believe that omitting the error set is exactly the same as specifying anyerror global error set in the error union. We’ve discussed a few points about anyerror here. I’ll link it just for context.

Thanks! My understanding regarding that aspect of error handling in zig is this one:

  1. by omitting the error set, zig infers the minimal error set at compile time;
  2. anyerror basically coerces any error set to the global one (which cannot be the minimal one).

Is the actual behavior different?

1 Like

Yeah, Zig definitely infers the error set, but I guess I’m not entirely sure even from reading the langref whether the inferred error set is minimal or global. I wish you were right and I got it wrong! It actually now kind of seems to me that you are. Hopefully, someone with more knowledge can settle this.

1 Like