HackerTrans
TopNewTrendsCommentsPastAskShowJobs

ifreund

no profile record

Submissions

How Austral’s Linear Type Checker Works

borretti.me
2 points·by ifreund·3 jaar geleden·0 comments

The First Zig Website Redesign

kristoff.it
2 points·by ifreund·6 jaar geleden·0 comments

comments

ifreund
·3 jaar geleden·discuss
(plz read the article, pkgconf is discussed)
ifreund
·4 jaar geleden·discuss
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.
ifreund
·4 jaar geleden·discuss
comptime is absolutely the biggest difference, in Zig you'll find high quality, performant generic hash map implementations in the standard library. In hare there are no generics and you are encouraged to write your own hash maps as needed: https://harelang.org/blog/2021-03-26-high-level-data-structu...
ifreund
·4 jaar geleden·discuss
For example:

zig cc -target x86_64-linux-gnu.2.28
ifreund
·5 jaar geleden·discuss
> 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.
ifreund
·5 jaar geleden·discuss
From that spamhaus link .xyz has a lower bad percentage (4.4%) than .com (5.1%) and .net (10.5%).
ifreund
·5 jaar geleden·discuss
> 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?
ifreund
·5 jaar geleden·discuss
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.
ifreund
·5 jaar geleden·discuss
This person has been for many months now: https://www.youtube.com/watch?v=124wdTckHNY

We hope to be using TigerBeetle which is written in zig in production in 2022: https://github.com/coilhq/tigerbeetle
ifreund
·5 jaar geleden·discuss
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.
ifreund
·5 jaar geleden·discuss
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.
ifreund
·5 jaar geleden·discuss
This is due to zig enabling clangs UBSAN by default in unoptimized builds. This can be disabled with `-fno-sanitize=undefined` or by enabling optimizations with `-O2` or `-O3`.

https://github.com/ziglang/zig/issues/4830#issuecomment-6054...
ifreund
·5 jaar geleden·discuss
The zig standard library also has a ComptimeStringMap type for this use case which is used by the self hosted tokenizer for example.

https://github.com/ziglang/zig/blob/master/lib/std/comptime_...
ifreund
·5 jaar geleden·discuss
The implementation of the pinned keyword proposed here should fix most if not all @fieldParentPtr() footguns https://github.com/ziglang/zig/issues/7769