Interview with Zig language creator Andrew Kelley [video]
41–50 of 210 posts
Re: Interview with Zig language creator Andrew Kelley [video]
#42I think that Zig's simplicity hides how revolutionary it is, both in design and in potential. It reminded me of my impression of Scheme when I first learned it over twenty years ago. You can learn the language in a day, but it takes a while to realize how exceptionally powerful it is. But it's not just its radical design that's interesting from an academic perspective; I also think that its practical goals align with…
Re: Interview with Zig language creator Andrew Kelley [video]
#43Some of Zig's ideas fascinate me, both the great low-level concepts (e.g. arbitrary-sized ints), but much more than that, the high level concepts. Particularly great is Zig's handling of both macros and generic types, the answer to both of which seems to be: just evaluate them at compile-time with regular functions, no special DSL or extra syntax. Andrew mentions in the video a big drawback of this system - implicati…
Zig gives you memory safety (or, rather, will ultimately do that), but it does so in a way that's different from both languages with garbage collection (whether tracing or reference-counting) or with sound type-system guarantees a-la Rust. It does so with runtime checks that are turned on in development and testing and turned off -- either globally or per code unit -- in production. You lose soundness, but we don't h…
https://github.com/ziglang/zig/pull/5998
edit: For more details, see
Re: Interview with Zig language creator Andrew Kelley [video]
#44Zig is appealing to me, but I wonder whether time spent mastering Zig would be better spent mastering C.
The good thing is that mastering one of these languages gives you conceptual tools which help with becoming at least competent in the others, if not mastering them as well.
Re: Interview with Zig language creator Andrew Kelley [video]
#45Zig is appealing to me, but I wonder whether time spent mastering Zig would be better spent mastering C.
Why not both? Zig and C are both very simple languages, and there's not much to "master" TBH (at least not many language-specific things, so what you learn mostly transfers to other programming languages as well).
But in general I have gone for for generalist not specialist in my career.
Re: Interview with Zig language creator Andrew Kelley [video]
#46I think that Zig's simplicity hides how revolutionary it is, both in design and in potential. It reminded me of my impression of Scheme when I first learned it over twenty years ago. You can learn the language in a day, but it takes a while to realize how exceptionally powerful it is. But it's not just its radical design that's interesting from an academic perspective; I also think that its practical goals align with…
Do you have any example code? It's plain to see that Zig's comptime is powerful enough for typeclasses, but it's not at all obvious that it'd be as ergonomic as Haskell's typeclasses.
Re: Interview with Zig language creator Andrew Kelley [video]
#47Earlier quoted context omitted.
That is the same approach used in many C++ projects
But to do that you can only use a subset of C++ (e.g. you can't use arrays nor pointer arithmetic). This works for all of Zig, except for some very specific, clearly marked, "unsafe" operations.
It also works with iterators-generally by sticking some extra data in the iterator in dev builds, so it can check for out of bounds access.
If I do have some code that uses C pointers + size, I'll insert some dev build assertions.
Re: Interview with Zig language creator Andrew Kelley [video]
#48Earlier quoted context omitted.
But to do that you can only use a subset of C++ (e.g. you can't use arrays nor pointer arithmetic). This works for all of Zig, except for some very specific, clearly marked, "unsafe" operations.
It works with arrays if you stick with std::array & std::span like constructs. It also works with iterators-generally by sticking some extra data in the iterator in dev builds, so it can check for out of bounds access. If I do have some code that uses C pointers + size, I'll insert some dev build assertions.
Re: Interview with Zig language creator Andrew Kelley [video]
#49Earlier quoted context omitted.
how often does it happen that your interns work on the hot path of your trading systems, which is where I assume you care the most about avoid syscalls like malloc?
Nit pick: On modern systems malloc isn't a syscall, it's implemented in userspace. (Sorry, I couldn't help it) That's not to say you're safe to call other syscalls, many of them either require memory allocations in-kernel (see ENOMEM) or can block indefinitely.
Re: Interview with Zig language creator Andrew Kelley [video]
#50Earlier quoted context omitted.
That is the same approach used in many C++ projects
Then I guess the obvious question is: has it worked well for those projects?
For memory related issues I find it sufficient.
One aspect where it is probably not as good as Rust is for threading related issues, as it relies on inserting runtime checks which may or may not trigger depending on the number of threads attempting access.