首页

25 条评论

SoraNoTenshi23 天前
I am not entirely sure what the Author is criticizing? It looks like a comparison to Odin rather than any critic.<p>And also: I don&#x27;t quite understand most of the Arguments. UB is often a way to ensure that certain optimizations can be made (if i remember correctly.) Also there just are certain facts that when you have full control over memory, some things can just not be predictable. (Accessing invalid pointers as an example)<p>Verbosity is mostly subjective. Most of Author&#x27;s concerns were path lengths, which can easily be &quot;fixed&quot; by redefining the path into a constant. `const debug = std.debug;` I also think the Argument towards &quot;it looks like java&#x27;s println&quot; full on is a <i>bad</i> argument. Especially because `std.debug.print` does something completely different.<p>The whole &quot;critic&quot; towards `build.zig` also seems like it&#x27;s done with without good faith. Yes it&#x27;s daunting at first. Yes it requires to learn about the build system in the beginning. Sure those are all very real Arguments, author just doesn&#x27;t want to mention the benefits of it.<p>Then half of the arguments about comptime i also don&#x27;t quite understand. It seems like it is building up the main point of the argument, but then you just get hit by a statement. So no explanation no nothing. Talking about lazy evaluation and a little bit of how SoA makes things worse (which i have no clue how that matters in this context) and then saying it&#x27;s violation &quot;no hidden control flow&quot; is not really getting the point i feel like.
评论 #43953862 未加载
评论 #43954608 未加载
评论 #43953713 未加载
90s_dev23 天前
&gt; Of course, if you don’t use pos, the compiler will say that this is an error and refuse to compile as well. And if you discard that error (typically using _ = pos;), the compiler will complain that it should be a const.<p>This was one of the main things that bothered me about Zig when I last tried it. This actively works against me when writing prototypes, exploratory code, and <i>especially</i> when writing code <i>to learn the language</i>. I get the rationale, that it&#x27;s trying to protect me from shipping poorly designed code. But <i>helicopter mom features do not belong in a programming language.</i> They are just as hindering to progress as a literal one would be to a grown man, and for the exact same reasons. I know Andrew has made up his mind, but minds can be changed. So please, Andrew, please take away this helicopter mom feature.
评论 #43953882 未加载
评论 #43954007 未加载
评论 #43953661 未加载
stephc_int1322 天前
I&#x27;ve been closely following and evaluating the train of C replacement languages that was (I believe) started by Jonathan Blow and Jai.<p>Zig is one of the strong contenders, but Odin is IMO following a saner path, Carbon and D should be mentioned and I think there are a few others.<p>My initial reaction to new programming languages is naturally skeptical, but I really liked the way the designers behind those efforts approached it, trying to solve frequent C&#x2F;C++ pain points and adding a few fresh ideas.<p>But overall, after a few years, I am sticking with C and orthodox C++, the cost&#x2F;benefit ratio is simply not worth the effort, none of them are really mature and the problems they try to solve are not painful enough.<p>My current take on this is to view Jai&#x2F;Zig&#x2F;Odin&#x2F;etc. as attempted C forks, quite often motivated by hubris and coming with the usual inconvenience of forks, a lot of wasteful&#x2F;redundant efforts put into small islands, each ruled by their own &quot;benevolent&quot; kings.<p>An other analogy that can be made is the many attempts at replacing keyboards layouts. Dvorak etc. They probably have their merits, but the adoption was limited to a few enthusiasts for the same reasons that C is unlikely to get replaced by any of those forks.
评论 #43953759 未加载
评论 #43953989 未加载
评论 #43954068 未加载
评论 #43954102 未加载
评论 #43953838 未加载
评论 #44000517 未加载
hmac128211 天前
The full list of articles:<p>Jai: <a href="https:&#x2F;&#x2F;bitshifters.cc&#x2F;2025&#x2F;04&#x2F;28&#x2F;jai.html" rel="nofollow">https:&#x2F;&#x2F;bitshifters.cc&#x2F;2025&#x2F;04&#x2F;28&#x2F;jai.html</a><p>Odin: <a href="https:&#x2F;&#x2F;bitshifters.cc&#x2F;2025&#x2F;05&#x2F;04&#x2F;odin.html" rel="nofollow">https:&#x2F;&#x2F;bitshifters.cc&#x2F;2025&#x2F;05&#x2F;04&#x2F;odin.html</a><p>Zig: <a href="https:&#x2F;&#x2F;bitshifters.cc&#x2F;2025&#x2F;05&#x2F;04&#x2F;zig.html" rel="nofollow">https:&#x2F;&#x2F;bitshifters.cc&#x2F;2025&#x2F;05&#x2F;04&#x2F;zig.html</a><p>V: <a href="https:&#x2F;&#x2F;bitshifters.cc&#x2F;2025&#x2F;05&#x2F;17&#x2F;vlang.html" rel="nofollow">https:&#x2F;&#x2F;bitshifters.cc&#x2F;2025&#x2F;05&#x2F;17&#x2F;vlang.html</a><p>C3: <a href="https:&#x2F;&#x2F;bitshifters.cc&#x2F;2025&#x2F;05&#x2F;22&#x2F;c3-c-tradition.html" rel="nofollow">https:&#x2F;&#x2F;bitshifters.cc&#x2F;2025&#x2F;05&#x2F;22&#x2F;c3-c-tradition.html</a>
macintux22 天前
Discussion yesterday of Odin, that touched on Zig and D.<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=43939520">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=43939520</a>
评论 #43956292 未加载
jbritton24 天前
Instinctually I’m bothered by passing an allocator to everything. LISP’s dynamic variables spring to mind. One could set an arena allocator at the top of a loop in a dynamic variable and then everything inside the loop would use that allocator. The bottom of the loop could free everything. Although I do really like knowing if something might call an allocator, perhaps a function specifier to indicate it allocates.<p>Although I’m intrigued by another idea I haven’t thought through. Haskell requires all function side effects to essentially propagate a description of the side effect up to main() where Haskell executes the side effect. There is also the idea of imperative shell, functional core that I don’t fully grasp. In any case perhaps all side effects should execute at the top level or maybe in a parallel environment and here passing an allocator would not be so onerous.
评论 #44000531 未加载
bonzini23 天前
Back when it still had async support, I looked at using Zig in QEMU.<p>My main qualm with it is that it doesn&#x27;t try to integrate with existing C programs. The ideal C replacement for me would be a two-way per-file C transpiler, in the same way as the Vala language was. Cython also works the same way even though it&#x27;s not a C replacement.<p>Having to know the full set of Zig sources in advance due to error types, and the strong accent on Zig as a build system, are both a non starter for integration in existing large C programs, for example.
评论 #43953829 未加载
评论 #43953757 未加载
behnamoh22 天前
C is not going anywhere. Neither are C++, Java, and JS (less sure about TS).<p>One reason is that we&#x27;ve built most of the foundations of modern software already in these languages. New apps pop up all the time but they all rely on ffmpeg, etc.<p>The only way for a new language like Zig to cement itself is to build foundational software that other programs depend on. I don&#x27;t think even Rust is moving in that direction (lots of Rust apps, but not so many libs I&#x27;ve had to use in my programs that were written in Rust).
评论 #43953949 未加载
评论 #43954103 未加载
评论 #43954224 未加载
com2kid24 天前
I disagree on many points the article makes, but it is well written and lays out its arguments well.<p>One example - I prefer the named fields of Zig over Odin&#x27;s use of positional fields. Zig&#x27;s syntax is the more popular one as of late, heck even C has named struct member initialization.<p>IMHO Positional is just asking for trouble. Yes it works fine for game programming, and not having to specify x and y thousands of times in a code base is nice, but for general purpose languages where a struct can have a dozen+ fields to init, positional assignment is how bugs are made.
评论 #43944010 未加载
评论 #43950410 未加载
评论 #43945857 未加载
fithisux24 天前
I like the try&#x2F;catch of Zig. It is innovative.<p>Moreover Zig is a research playground. Ideas will find their way to D&#x2F;Nim.<p>Zig CC is another innovation.<p>The compile time is also a great experiment.<p>It brings a lot to the table.<p>May not be a total C replacement, but it is an improvement and lots of C code, can be written in Zig. Lots of people can be introduced to Systems Programming with Zig. For Low Level coding, have you heard of FASM? Better than C in my opinion.
评论 #43950432 未加载
dustbunny22 天前
Some fair criticisms of differing importance, but the tone of the article feels pretty off putting. Almost like the author has some personal gripe against someone affiliated with Zig something.
GianFabien24 天前
I stumbled across Zig by a reference to it as part of the Bun (JS engine) documentation.<p>I didn&#x27;t find the Zig language benefits sufficiently compelling to learn yet another opinionated language.<p>Since much of my work is with embedded and bespoke systems, I did find the <i>Zig cc</i> front-end to LLVM convenient. Maybe it&#x27;s because I haven&#x27;t sufficiently mastered Clang for cross-compilation.
评论 #43954938 未加载
EPWN3D22 天前
I think the author&#x27;s criticism of the named initializer requirement is emblematic of a big problem I have with most new languages. The author says that it makes things like vectors more verbose and awkward, which is true.<p>My counter to this is: who gives a shit? I&#x27;m not writing a vector library or a game engine; I&#x27;m writing systems code, and unnamed initializers are harder to read and expose code to subtle bugs. And for what? So that vectors look prettier?<p>A lot of programming language design seems to prioritize making its own standard library math functions more elegant to implement, which I find to be very irritating, and Zig is a breath of fresh air in this regard.
jmull22 天前
The author hand waves away ReleaseSafe, but does not really seem to understand its usage.<p>I don&#x27;t think zig best-practices are written in stone yet, but I would expect ReleaseSafe to be the default in production. Since zig allows turning off&#x2F;on safety checks on a per-block basis, you only need to pay as much of a performance cost as you want for this.<p>Actually, this doesn&#x27;t really come across as a sincere critique of zig. It&#x27;s more like how a sport fan talks about a rival team (I guess the author must be team Odin). The &quot;first impressions&quot; section is silly.. of course you don&#x27;t understand how it all works before you&#x27;ve learned anything about it. It might be a bit confusing and have some new patterns. And yes, all the options of the advanced build system is complex, but... you can use the simple build mechanism, or just go with the template for that matter.<p>Myself, I think there are certainly valid criticisms of zig to make and I don&#x27;t know if it&#x27;s ultimately going to amount to something, but you&#x27;ve got to have some knowledge of the subject and not come at it with a predetermined conclusion.
评论 #43954319 未加载
charlie-8322 天前
Its always interesting to me that other people have such an issue with languages being verbose. I have never really understood why people feel this way. It&#x27;s just a bit of extra typing. I also think it generally increases code readability. Anyone who dislikes verbose languages care to explain their perspective to me?
lerno24 天前
The ease of using Odin over Zig for Raylib was an interesting contrast that I hadn’t reflected on myself. I tried to do things well with C3, but it might be hard to beat Odin on that particular point.<p>I just wonder how well it will work long term with update cycles and such. Zig and C3’s decentralized model seems easier for handling frequently updating libraries.
评论 #43961588 未加载
weiwenhao23 天前
zig ld should be the only cross-linker out there, and I&#x27;m considering migrating to zig, for zig ld&#x27;s sake .<p>All programming languages that claim to be alternatives to C eventually become themselves, zig is good enough and different enough to not care about being an alternative to C!
GardenLetter2723 天前
The worst part IMO is no decent LSP like rust-analyzer.
评论 #43953563 未加载
pjmlp22 天前
That would have been Modula-2 already in 1978, but sadly Acorn, yes the one from ARM, was the only OS vendor adopting it.
pepa6521 天前
For the Bitshifters author: could you do a review of the V language as well?
评论 #44059654 未加载
评论 #43978415 未加载
ur-whale22 天前
&gt; the language motto is “No hidden control flow”.<p>Oh man, I wish the Haskell crowd gave at the very least lip service to that type of idea.
评论 #43964744 未加载
pron22 天前
Because we rarely have objective measures by which to compare programming languages, there is no such thing as &quot;ideal.&quot; Some objective measures can include code size, and it is undoubtedly true that switching from Assembly to Python often results in a super-linear reduction in code size, but we rarely see such differences anymore. When we do get some objective comparisons through empirical research -- always many years later -- we also find that <i>usually</i> differences between languages are smaller than many would expect [1]. This isn&#x27;t surprising and, in fact, it was predicted by Fred Brooks in the 80s. This is because much of the difficulty in constructing algorithms is essential. This is not just due to results in computational complexity about the fundamental difficulty in constructing and analysing programs, but also part of computers&#x27; utility. As I once heard a NASA developer say, &quot;computers were built to surprise us; if we knew their output we wouldn&#x27;t need to build them.&quot;<p>That&#x27;s a long-winded way of saying that programming language preference is mostly a matter of personal taste as well as more objective but non-intrinsic, &quot;environmental&quot; or social factors. But that doesn&#x27;t mean that preferences are evenly distributed. Even within a specific domain there may be big disagreements among programmers over which language is &quot;better,&quot; but some languages may appeal to significantly more people than others. Programming language designers, at least those who target their language for wide audiences, effectively try to pick tradeoffs that they guess would appeal to many.<p>This is what makes statements like &quot;but as we all know, it’s not always the best alternative that wins&quot; meaningless. Winning means appealing to more people, i.e. having a good &quot;market fit&quot;, whereas &quot;best&quot; has no agreed-upon definition. Like in the famous story about Betamax vs VHS, one had a better picture quality at the expense of recording time, and it turned out that a longer recording time was more important to them than better picture quality. In various debates over programming languages, I often see people frustrated when confronted with the reality that other people prefer different tradeoffs to their own preferred ones.<p>What the author find surprising or confusing in Zig are things others find desirable (for reasons such as making the language more expressive, simpler, more easily portable, or faster to compile). If you prefer Odin or Rust or Jai -- use them; that different people prefer different languages is very much to be expected. But one of the things I, subjectively, find appealing in Zig has to do with the point made in the post about &quot;high level conveniences&quot; and &quot;abtractions.&quot; Over the past several decades, high-level languages have become so fast that in most software it makes little sense to use low-level languages regardless of the &quot;high level conveniences&quot; they may offer. But low-level languages still have a very important role to play when full control over resource usage (especially memory) is needed, such as in constrained environments. That is why I, as someone who does both high and low-level programming, prefer a separation between the two. I probably won&#x27;t write a large, complex application in any low-level language, and when I do write low-level code, what&#x27;s important to me is to clearly see what&#x27;s going on. Anything that hides that from me isn&#x27;t a convenience but an inconvenience when doing this kind of programming. To me, subjectively, it seems that making low-level languages appear more high level is a mistake -- it hinders low-level programming without offering a truly compelling alternative to a high-level language. Whether my preferences or the author&#x27;s are more common is something we&#x27;ll find out in another decade or so.<p>[1]: One of the things I find annoying -- not only in programming language debates but in science and technology discourse in general -- is invalid extrapolation of valid empirical results. For example, we do have some valid empirical comparisons of TypeScript vs JavaScript or Rust vs. C, but extrapolating from those to conclusions about, say, TypeScript vs. Clojure or Rust vs. Zig requires making unfounded (as yet) assumptions (such as that all untyped languages are alike or that all languages that don&#x27;t soundly prevent <i>all</i> undefined behaviour are alike).
评论 #44000568 未加载
评论 #43955169 未加载
dvh22 天前
Does it run on Arduino?
trealira23 天前
The message I got upon connecting to this site:<p>&gt; Website Access Prohibited<p>&gt; Malware Website Warning<p>&gt; The website you are trying to access is known to host malware and poses a security risk to your computer and network. Please contact your IT help desk to review if you are impacted. If you think you are receiving this message in error, please contact your IT help desk.<p>I guess you should know your website is seen as a malware vector.
评论 #43953481 未加载
cranberryturkey23 天前
<a href="https:&#x2F;&#x2F;smashlang.com" rel="nofollow">https:&#x2F;&#x2F;smashlang.com</a>
评论 #43953399 未加载