TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Zig Goals

90 pointsby whatever311 months ago

14 comments

LAC-Tech11 months ago
I like Zig the language. Probably more than rust - Zigs singular focus on making systems programming ergonomic really appeals to me.<p>Rust tooling however makes it an easy choice. Unit testing with pretty printing, proptest crate for property based testing, Cargo.toml is just an easier life choice than build.zig, etc etc.<p>Not sure if Zig will improve in this regard. I suspect what I consider an improvement Zig folks would not. Still easier to wrangle than C.
ForLoveOfCats11 months ago
What I find remarkable is how closely aligned these goals are with the Zig we see today. Andrew is an incredible engineer and, while I don&#x27;t prefer all of Zig&#x27;s design decisions, he clearly had a very complete vision for the language from the beginning.
tiffanyh11 months ago
In more recent news, today Zig launched 0.13.0<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=40605828">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=40605828</a>
fallingsquirrel11 months ago
You probably want (2015) in the title.
评论 #40612263 未加载
lenkite11 months ago
I wish I could pray and convince language author to please give us RAII in Zig. That is the only thing I want presently - I truly detest writing `defers` after my experience in Golang. If Zig wants trash cleanup absolutely explicit, then please at-least give us a C# like `using` or Python `with` statement. I will move to using Zig tomorrow and praise it to the heavens.
评论 #40616461 未加载
boricj11 months ago
Linking to the README.md file directly instead of the source code tree would make the intent of this submission more obvious.
评论 #40612506 未加载
sekao11 months ago
The ability to export a zig project to a single C header file would be really nice. Is that still a planned feature?
评论 #40612751 未加载
durandal111 months ago
How they basically could not improve on tagged union enum types as you express them in C is to me one of the misses. Modeling data through effortless sum types is a requirement for me when picking up a modern language.
评论 #40612488 未加载
评论 #40612502 未加载
评论 #40613969 未加载
评论 #40612602 未加载
评论 #40612471 未加载
0x020311 months ago
&gt; Opinionated when it makes life easier. &gt; Tab character in source code is a compile error.<p>I don&#x27;t think I will ever understand this. I get that different people have different preferences and reasons for those preferences, but why deliberately alienate such a large set of potential users? Especially after a statement asserting it&#x27;s to make life easier? Who&#x27;s life? The developers who will be using the language? I&#x27;m not convinced forcing all users to either type more white space or figure out how to configure their editor to auto convert (some of which may not be able to) is really making life easier. Or is it for the language developers themselves? In which case I&#x27;d argue that&#x27;s probably the wrong thing to be optimizing for, and that it isn&#x27;t that difficult to support both anyway.<p>And to be clear, I&#x27;m not interested in litigating the tabs vs spaces debate here, or even white space as part of code&#x2F;syntax. It&#x27;s this attitude that I&#x27;m seeing a lot more in recent years of &#x27;I know better than you how you should do&#x2F;use _X_ so I&#x27;m not going to give you the option&#x27;. Obviously not every project out there can be tailorable to every user&#x27;s every preference, but I wish that when deciding what to accommodate and what not to, it would be done not on one&#x27;s own myopic perception of the problem space, but on actual limitations and priorities and user needs. And when making a choice that may not be widely popular, be up front about why and how that decision was made. I&#x27;m much happier accepting &#x27;not enough dev resources to support the added complexity in the parser&#x27; than I am &#x27;tabs are stupid and you&#x27;re dumb for wanting to use them&#x27;.
评论 #40612665 未加载
评论 #40613365 未加载
评论 #40654698 未加载
评论 #40612656 未加载
评论 #40612738 未加载
评论 #40619559 未加载
fithisux11 months ago
Maybe we need a version of Dlang based on Zig rather than C.
unclad596811 months ago
&gt; Whitespace at the end of line is a compile error<p>How does this &quot;make life easier&quot;?
评论 #40612675 未加载
评论 #40612707 未加载
评论 #40612714 未加载
heavyset_go11 months ago
Off topic, but how stable is Zig&#x27;s syntax these days?
评论 #40612543 未加载
zzo38computer11 months ago
Some of these look like good ideas. Some look like bad ideas:<p>&gt; Tab character in source code is a compile error. Whitespace at the end of line is a compile error.<p>Both of these seem like bad ideas, except perhaps tab characters in string literals (or anywhere else that replacing it with an arbitrary number of spaces changes the meaning of the program) should be errors. Whitespace at the end of the line, also should not be an error unless deleting them would not change the meaning of the program. (Another reason to disallow tabs would be if indentation-sensitive syntax is used (like Python), although I dislike the indentation-sensitive syntax anyways.)<p>(Also, I often have spaces at the end of a line in incomplete programs I write in C; usually this will be eliminated if that part of the program is complete, though.)<p>&gt; Source code is UTF-8.<p>Also bad. It is an unnecessary restriction, unless you want to use a &quot;secure character set&quot; (which should probably be an option and not mandatory, anyways), in which case it is an insufficient restriction (ASCII only (without most controls) would be better). If you do want the &quot;secure character set&quot;, then the alternate restrictions for tabs and trailing spaces that I mentioned above, would help.<p>However, since you can run code at compile-time, if that allows reading other files in the same directory then you can put any non-ASCII text that you need, in other files, and then load them at compile-time. (This is much cleaner than the messy ways of having to deal with mixed text directions (and other stuff) in Unicode.)<p>&gt; Ability to declare dependencies as Git URLS with commit locking (can provide a tag or sha1).<p>Providing a hash is helpful for security, although keeping a copy of the dependencies would also help, and you can access any copy of it; this way you do not need an internet connection (or even if you do, in case the connection is down, etc). Having multiple sources to find the dependencies is helpful, and if hashes are available for the files that it depends on then you can verify that it is the correct file.<p>&gt; C style comments.<p>Depending on the syntax of what tokens would make sense together, it might not be the best idea (although this depends on what the syntax of Zig otherwise is; it might not be a problem). In C, a slash followed by an asterisk denotes the beginning of a block comment, but a slash also means division, and an asterisk as a unary operator denotes dereferencing; this is a sensible combination, so a space or parentheses or [0] or something else like that would be required in order to not be treated as a comment. This is a bad idea in C; I don&#x27;t know enough about Zig to know how well it works in Zig, though.<p>&gt; Shebang line OK so language can be used for &quot;scripting&quot; as well.<p>This is also something to be considered depending how the rest of the syntax works. It is probably a good idea though, if it does not interfere with other syntax like the comments in C interferes with the syntax of the operators in C.
refulgentis11 months ago
Flagged, per observations confirming other comments noting old, unclear link, people noting they&#x27;re not sure if they&#x27;re on-topic, and multiple people downvoted below 0 when they use the link as a source for their comment.<p>Even with charity and steel-manning, this is a one-off, broad, short, personal todo list from 9 years ago.<p>That leads me to believe it is unclear what the topic is, and it is clear it is a minefield if you comments.
评论 #40612659 未加载