veganism.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Veganism Social is a welcoming space on the internet for vegans to connect and engage with the broader decentralized social media community.

Administered by:

Server stats:

271
active users

#zig

11 posts11 participants0 posts today

⚡ Odin, A Pragmatic C Alternative with a Go Flavour | Bitshifters

「 Rather than introducing complex features, Odin focuses on code that is simple and clean to read and reason about. This is the polar opposite of Zig’s embracing of metaprogramming for as much as possible 」

bitshifters.cc/2025/05/04/odin

Bitshifters · Odin, A Pragmatic C Alternative with a Go FlavourOdin is a general-purpose systems programming language authored by Bill “gingerBill” Hall. Designed as a modern alternative to C, Odin emphasizes simplicity, performance, and readability without sacrificing control over low-level details.

🌘 Zig 語言的記憶體安全特性
➤ Zig 語言如何打造更安全的記憶體管理
gencmurat.com/en/posts/memory-
本文深入探討了 Zig 程式語言的記憶體安全特性。Zig 在提供手動記憶體管理效能的同時,透過消除隱藏控制流程、健全的錯誤處理機制、嚴格的編譯時檢查、以及強大的執行時界線檢查等方式,有效預防常見的記憶體相關錯誤。此外,Zig 的 `defer` 語句確保資源能被妥善釋放,而可選類型則避免了空指標解參問題。Zig 也提供了多種構建模式,允許開發者在安全性與效能之間取得平衡。
+ 這篇文章很清楚地說明瞭 Zig 語言在記憶體安全方面的設計理念,讓我對這個語言產生了興趣。
+ Zig 的錯誤處理機制看起來非常健全,避免了許多其他語言常見的潛在問題。
#程式語言 #記憶體安全 #Zig

Murat Genc · Memory Safety Features in ZigMemory safety is a cornerstone of Zig’s design philosophy. While maintaining the performance benefits of manual memory management, Zig incorporates sophis
([Very] slowly) starting to write my WM for the upcoming river-window-manager-v1 protocol. Don't really have any clue what I'm even doing but I've at least registered a couple of interfaces lol.

First goal is to display a window (anywhere). Second will probably be some basic keybindings. Third, window management?

#river #Wayland #zig

How did I not know of sr-speedbar? I used imenu-list for this use-case previously, but this is so much nicer.

Required a tiny configuration to work with #zig but now works flawlessly.

Wrote a minimal Linux shell in C and Zig (no dynamic mem allocation). The aim is to see how small can we get the binary size to.
C version uses no stdlib, just syscalls using inline assembly.
Zig already does a pretty good job exposing the syscall wrappers, so using std.os.linux.syscallN wrappers.
Learned a lot about the "newer" syscalls e.g
- clone3 instead of fork/clone for spawning new child process
- getdents64 instead of the libc readdir
- newfstatat for checking file info
- Need to try openat2 vs openat

zig toolchain is very good at building minimal binaries. Even compiling the C code using `zig cc` gives smaller binary sizes. Currently, both C and Zig are at 5kb each.

Code: gist.github.com/rrampage/5046b

Minimal Linux shell (C, Zig and ASM). GitHub Gist: instantly share code, notes, and snippets.
GistMinimal Linux shell (C, Zig and ASM)Minimal Linux shell (C, Zig and ASM). GitHub Gist: instantly share code, notes, and snippets.

pretty stoked having pushed a huge update to github.com/stef/klutshnik

it is now all based on liboprf.

rewrote the server in #zig, the python client has also been completely rewritten. threw out the macaroons and the opaque-storage back-end, this simplified and made the whole thing a bit more secure also.

still some work left before this can go into production, but this is a big leap already. pheeew.

this work is funded by #nlnet / #ngi0

GitHubGitHub - stef/klutshnik: data-at-rest encryption KMS server and clientdata-at-rest encryption KMS server and client. Contribute to stef/klutshnik development by creating an account on GitHub.

Damn! I have this #zig 0.11 program and I need to update the build.zig file...

It was a pain to write and now I have to rewrite the whole thing... and everything changed...

EDIT: ok i think i made it to compile but I think many things are repeated for no reason. I need to review the file.