TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Zig is becoming more production-worthy

126 点作者 Shoop将近 3 年前

7 条评论

verdagon将近 3 年前
I love how Zig is pushing the state of the art forward. I have some expertise in the area, and I think the future is in languages that prioritize simplicity and developer velocity like Zig is doing.<p>&gt; The core team will then be able to begin thinking about: ... Exploring hot-code-swapping<p>Hot code swapping, plus Zig&#x27;s ability to cross-compile, plus release-safe&#x27;s memory assistance without mental overhead, all seem to come from one underlying drive: support and empower the programmer without getting in their way.<p>When designing a language, it&#x27;s important to keep the user&#x27;s ultimate goal in mind: making useful software. For some domains that might mean adding restrictions, but for other domains it means getting out of the programmer&#x27;s way and making language mechanisms and tooling so they can iterate, experiment, and build faster.<p>I&#x27;m particularly excited about Zig&#x27;s future in webassembly, where many safety concerns are already handled by sandboxing. It&#x27;s amazing to read that someone ported an entire game to webassembly with Zig.
评论 #31984352 未加载
评论 #31984291 未加载
评论 #31990516 未加载
评论 #31984747 未加载
suby将近 3 年前
Zig looks very promising, but there are a few nitpicks I have which keep me from deep diving into it. The most annoying thing I&#x27;ve found so far is treating unused variables as compiler errors. I understand this is something more and more languages are doing, but I can&#x27;t get over it. It makes writing and prototyping code annoying and tedious, especially during the initial learning phase. Zig trusts the programmer to do things like manually manage their memory, but unused variables is a bridge too far I guess. I don&#x27;t understand why this isn&#x27;t a compiler option.<p>I don&#x27;t want to leave a purely negative comment so I&#x27;ll add that the only reason I&#x27;m posting in the first place is because, my own personal annoyances aside, the language does look very nice. Especially comptime, I wish every language had a similar construct built in as seamlessly as it is in zig.
评论 #31986639 未加载
评论 #31988016 未加载
评论 #31986845 未加载
japhib将近 3 年前
I used Zig for a couple of Advent of Code problems last year. I decided that Zig is not a language I’m going to be using. Here’s why:<p>- If you ever want to allocate memory, you have to pass in an allocator to the function doing the allocating. You also have to explicitly allocate and deallocate.<p>- Zig has no concept of a string - it’s just a slice of bytes. This also means Zig has no support for string concatenation, UTF-8, regex, or any of the other many niceties we’ve come to expect as standard.<p>Zig is not the next Rust or the next C++ - it’s very much the next C.<p>Zig may be fine for people programming an OS or very highly performance sensitive application. But it’s too low level, and too obtuse about being low-level, for me to ever want to actually use it.
评论 #31991323 未加载
评论 #31991443 未加载
评论 #31992427 未加载
elromulous将近 3 年前
It&#x27;s been really great watching zig progress. I&#x27;m on the fence on some of its design choices, but I think there&#x27;s room in this world for zig as a truly modern c.
SV_BubbleTime将近 3 年前
My benchmark for how serious a C replacement is, is when it successfully moves to not embedded and people actually use it.<p>So far Rust has the smallest of inroads to embedded.<p>I hope Zig makes it, but I’ve been down this road before.
评论 #31985056 未加载
评论 #31984702 未加载
评论 #31984665 未加载
xupybd将近 3 年前
Wow 40-60 hours at work then 40 on a project at home. I&#x27;m lucky to get an hour a week for hobbies.
评论 #31985045 未加载
fulafel将近 3 年前
Zig seems like a reasonable fit for WebAssembly for some cases if the memory safety story can be made good enough. (Even though wasm is sandboxed you don&#x27;t want your in-sandbox app pwned after all)