mastodontech.de ist einer von vielen unabhängigen Mastodon-Servern, mit dem du dich im Fediverse beteiligen kannst.
Offen für alle (über 16) und bereitgestellt von Markus'Blog

Serverstatistik:

1,4 Tsd.
aktive Profile

#ZigLang

4 Beiträge3 Beteiligte0 Beiträge heute

Yesterday I released new versions of thi.ng/wasm-api (and its add-on packages), a modular and extensible bridge API & toolchain for hybrid JS/TS/Zig/WebAssembly apps, now updated to be compatible with the latest Zig version 0.15.1...

The update addresses some of Zig's breaking syntax & build system changes only, nothing on the JS/TS side has changed. As a result thi.ng/wasm-api-dom has a slightly revised internal structure (also a breaking change, but nothing major & unavoidable). All bundled Zig examples[1] in the repo have been updated too, take a look for reference (if needed).

FYI More details about the Zig language changes here:
ziglang.org/download/0.15.1/re

Specifically, the removal of `usingnamespace` has had a major impact on the existing handling of generated types in these wasm-api support packages (or your own) and now forces an additional level of hierarchy in terms of namespacing. This is because `usingnamespace` enabled a form of namespace merging, which allowed the generated WASM⭤TS interop types (written to their own sourcefile) to be merged/hoisted into the main library module.

For example, previously after importing `const dom = @import("wasm-api-dom");` we could refer to a type via `dom.WindowInfo`. Now with namespace merging removed, we have to use `dom.types.WindowInfo`. As I said, it's not a major departure, but a breaking change nonetheless[2]...

The `build.zig` file bundled with thi.ng/wasm-api is now also only compatible with Zig 0.15.1 (for now). Build files for older Zig versions are still included too (in the same directory)[3].

Lastly, once more for the record: The wasm-api bridge itself is NOT tied to Zig (or a particular version), however it's the main use case/language for my own WebAssembly use cases...

[1] github.com/thi-ng/umbrella/tre (all examples starting with `zig-*`)

[2] The existing design of these modules helped to keep these breaking changes to a minimum in userland code and these updates are all following the same uniform pattern (i.e. exposing interop types via `modulename.types.TypeName`...)

[3] github.com/thi-ng/umbrella/tre

thi.ng/wasm-apiGeneric, modular, extensible API bridge and infrastructure for hybrid JS & WebAssembly projects
#ThingUmbrella#Zig#Ziglang

#Zig, what are you doing (credits to Bernard Kolobara)!?😱

const std = @import("std");

const FileError = error{
AccessDenied,
};

fn doSomethingThatFails() FileError!void {
return FileError.AccessDenied;
}

pub fn main() !void {
doSomethingThatFails() catch |err| {
if (err == error.AccessDenid) {
std.debug.print("Access was denied!\n", .{});
} else {
std.debug.print("Unexpected error!\n", .{});
}
};
}

1/2

I’m at a demoparty (Xenium) and there’s a guy coding a synth from scratch for a microcontroller (STM something) using #ziglang. Didn’t expect seeing Zig here but this makes sense - way better than using C here, also way easier than coding it in assembly.

#vkuroko has full #Linux support now!

vkuroko is a project programmed in #Zig that brings the #Kuroko scripting language (dialect of #Python) to #SourceEngine #Games.

Originally only ran on Windows but now works on Linux!

github.com/evanlin96069/vkuroko

The creator is a great guy. You should check out his other projects like his #ika language. Go show him some support!

github.com/evanlin96069/ika

github.com/evanlin96069

GitHubGitHub - evanlin96069/vkuroko: Integrating Kuroko with SourceIntegrating Kuroko with Source. Contribute to evanlin96069/vkuroko development by creating an account on GitHub.
#Game#GameEngine#Gaming

Various thi.ng updates, bug fixes, additions and new version of github.com/thi-ng/zig-thing/ — now fully compatible with current Zig v0.14.1

On a more diary/devlog note: I also updated several of my Zig based work-in-progress art pieces to the latest version (some of them not touched in 2+ years) and it's so good to see how the thi.ng/wasm-api toolchain has been holding up with various breaking Zig changes and also how this setup simplifies creating hybrid Zig/TypeScript projects (e.g. for using DOM/WebGL from Zig). Related, I also want to mention once more the #GenArtAPI Zig WebAssembly bindings[1] (updated a few weeks ago), which add another layer of flexibility & boilerplate reduction for generative/procedural/algorithmic art projects...

I will be attempting yet another few takes creating a video overview & mini-workshop/tutorial about thi.ng/genart-api, hopefully also touching on these aspects...

[1] github.com/thi-ng/genart-api/t

#ThingUmbrella#Zig#Ziglang

PSA for people using #Ziglang via the #ASDF version manager: The "official" Zig plugin seems to be unmaintained and doesn't support the new URL format of recent Zig releases, but there's a new fork of the plugin which does. You can switch to it via:

```
asdf plugin remove zig
asdf plugin add zig github.com/thaolt/asdf-zig
asdf install zig 0.14.1
```

GitHubGitHub - thaolt/asdf-zig: zig plugin for asdf version manager https://github.com/asdf-vm/asdfzig plugin for asdf version manager https://github.com/asdf-vm/asdf - thaolt/asdf-zig