feat(content): Add post about rewriting zvm from Go to Zig#115
feat(content): Add post about rewriting zvm from Go to Zig#115jiacai2050 merged 3 commits intozigcc:mainfrom
Conversation
Add a new blog post sharing practical experience of rewriting the zvm version manager from Go to Zig. The post covers: - Core architecture and directory structure design (XDG Base Directory) - Windows junction vs symlink handling - Hand-written CLI parser using std.StaticStringMap - Network layer trade-offs (mirror speed test, proxy fallback) - Installation details (tar.xz/zip extraction, macOS 26 smoke test) - Configuration persistence and string lifetime management - Error handling and tagged union patterns in Zig - Binary size optimization and CI release matrix
Apply autocorrect fixes to the newly added zvm post for consistent formatting around operators and punctuation. Changes: - Add spaces around the plus operator in mirror speed test description - Remove extra space before "pragmatic" after a Chinese period
There was a problem hiding this comment.
Code Review
This pull request adds a blog post documenting the rewrite of the zvm version manager from Go to Zig, highlighting architectural changes, cross-platform challenges, and performance gains. Feedback points out a factual error concerning the macOS Sequoia version number and suggests enhancing the project link's formatting for better readability.
Update the zvm blog post for factual accuracy and cleaner formatting. Changes: - Remove incorrect "Sequoia" codename from macOS 26 reference, since Sequoia is actually macOS 15 - Convert the project repository link from a blockquote to an inline Markdown link for better readability
There was a problem hiding this comment.
Pull request overview
Adds a new blog post documenting practical lessons learned while rewriting the zvm version manager from Go to Zig, focusing on real-world tooling concerns (filesystem quirks, networking, packaging, memory/error handling, and release engineering).
Changes:
- Add a long-form post covering architecture decisions (XDG layout, Windows junction handling, CLI parsing).
- Describe implementation trade-offs for networking, extraction/installation, and post-install verification.
- Document Zig-specific patterns for config persistence, string lifetimes, error handling, and release optimization.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Zig 官方发布的 tar 包解压后是 `zig-macos-x86_64-0.16.0/` 这种长名字,但用户只想看 `0.16.0/`。解压后要重命名。 | ||
|
|
||
| 坑在于:如果用户指定了 `--force` 强制重装,老目录要先删掉。但 deleteTree 是危险操作,万一路径拼接错了把家目录删了就完了。这里加了双重校验: | ||
| 1. 只删版本号格式的目录(正则匹配 `\\d+\\.\\d+\\.\\d+`) |
There was a problem hiding this comment.
Inline regex example appears double-escaped (\\d+\\.\\d+\\.\\d+). In inline code (not a string literal), this will render with extra backslashes and may confuse readers; consider showing the regex as \d+\.\d+\.\d+ (single escaping) or explicitly stating it’s a string-literal form.
| 1. 只删版本号格式的目录(正则匹配 `\\d+\\.\\d+\\.\\d+`) | |
| 1. 只删版本号格式的目录(正则匹配 `\d+\.\d+\.\d+`) |
Add a new blog post sharing practical experience of rewriting the zvm version manager from Go to Zig.
The post covers: