ifreund
ifreund on Hacker News
Posted by
ifreund on Sunday January 29, 2023 @05:22AM
from the borretti.me dept.
(plz read the article, pkgconf is discussed)
Maybe try opening the PDF instead of the PNG, the PNG images of text look off to me as well but the font rendering in the PDF looks fine.
For example:
zig cc -target x86_64-linux-gnu.2.28
> it actually builds a stub program and runs it in qemu for your target arch
That's not at all how the implementation works, the zig compiler does not depend on qemu. The comptime evaluation works much more like evaluating an interpreted language such as python.
From that spamhaus link .xyz has a lower bad percentage (4.4%) than .com (5.1%) and .net (10.5%).
> Andrew: In release fast mode, which is unsafe, you will get actual undefined behavior. So, you might crash or you might get overflow. You might go down to zero or you might run an unrelated function.
Are you perhaps confusing this with statements made about the debug and release safe build modes?
This comment is a perfect example of what Andrew was talking about here:
> Andrew: It’s funny how it just kind of changes course as the language gets taken more and more seriously. And now, all the comments are even starting to shift to kind of like the philosophy of memory safety and whether Zig is immoral.
I'd suggest you go listen to the podcast or at least read the "Zig Is Immoral and Unsafe" section of the transcript as well as the following one.
The fact that the author was able to find success with Zig so quickly speaks not only to the author's abilities but to the simplicity of Zig. Learning enough C++ or Rust to be productive in the same amount of time would be a much greater challenge.
zig's standard library `std.fmt` functions support named arguments as well:
var tuple_params = html.create("{[foo]} ... {[bar]} ... {[observable]}", .{
.foo = a,
.bar = b+c,
.observable = observable,
});
It's verbose and explicit to be sure, but quite readable IMO.
Posted by
ifreund on Wednesday January 13, 2021 @08:07AM
from the kristoff.it dept.
Compile times of the stage1 zig compiler may seem fast compared to e.g. rust or C++ but they are slow compared to what the WIP stage2 compiler can do :)
You're totally right that at least 90% of the infrastructure is there. Andrew's been threatening to implement hot code swapping in a live stream but has been busy with other tasks it seems.
It already does, dynamic linking is orthogonal to @import() semantics.
Incremental debug builds will of course not be reproducible. Release builds will be.
Why nest them? Wayland already has multi-seat.
No, this is to make the transition from a one-man show into a sustainable organization.
That's true, though systems programming is in practice dominated by the C ABI (great post on that here by the way
https://drewdevault.com/2020/03/03/Abiopause.html). Zig does something quite special that puts it ahead of the crowd in this space; It can import and use C libraries as easily as C does (no bindings required), and it can itself be built into a C library, auto-generating the required C headers.
Afaik the only drawback is that this functionality is very new and still has some open issues (linked at the end of the post). As stated there are no dependencies for Zig and it is shipped in relatively small tarballs which can be downloaded from the Zig website:
https://ziglang.org/download/
Aye, and it lives up to that claim as well in my opinion, despite being still relatively young and pre-1.0. My favorite thing about Zig is that it has managed to stay simple and solve many of the problems of C without resorting to greatly increased complexity like Rust (which is much more of a C++ replacement than a C replacement in my opinion).