Skip to content
0:00 / 0:00

#zig#andrewkelley#cinterop

Zig: A programming language designed for robustness, optimality, and clarity –  Andrew Kelley

Recurse Center

11K subscribers • 2 videos on Hallway

YouTube
  • Recommended by 7 people: 6 on Hacker News and 1 in engineering communities.
  • Presented by Andrew Kelley, creator of Zig

Intermediate. Assumes working knowledge.

75K views8 years ago7 recommendations

Programming languagesSystems programmingZigLanguage design and type systemsPerformance and optimization

Andrew Kelley introduces Zig, explaining its design goals of robustness, optimality, and clarity, along with its C interoperability and explicit memory allocation.

Zig – a programming language designed for robustness, optimality, and clarity – Andrew Kelley, March 20th, 2018 Localhost is a series of monthly technical talks in NYC, open to the public, and given by members of the Recurse Center community. Go to recurse.com/localhost for more info. Abstract: Zig is an LLVM frontend, taking advantage of libclang to automatically import .h files (including macros and inline functions). Zig uses its own linker (LLD) combined with lazily building compiler-rt to provide out-of-the-box cross-compiling for all supported targets. Zig is intended to replace C. It provides high level features such as generics, compile time function execution, and partial evaluation, yet exposes low level LLVM IR features such as aliases. The Zig project believes that software can and should be perfect. Let the Zig Zen guide your spirit down the most optimal path. Bio: Andrew is an open source programmer, interested in electronic music production and video game development. In the Fall 2013 batch he worked on a music player server and a 3D spaceship flight simulator. Andrew is a backend engineer at OkCupid, and working on open source software nights and weekends. About RC: The Recurse Center runs educational programming retreats in New York City. The retreats are free, self-directed, project based, and for anyone who wants to get dramatically better at programming. Learn more at recurse.com.

Why it's here

7 people recommend this

What people say. Highly recommended as an excellent introduction to the Zig programming language and its core design philosophy by its creator.

Moments people linked to

komuWon Hacker News • Recommends

On “Ask HN: What are some of the best technical talks you've heard?”

…s Seife, Eve Silverstein. Moderator: Neil deGrasse Tyson link 5. 2016 Isaac Asimov Memorial Debate: Is the Universe a Simulation? - Panelists: David Chalmers, Zohreh Davoudi, James Gates, Lisa Randall, Max Tegmark Moderator: Neil deGrasse Tyson link 6. Zig: A programming language designed for robustness, optimality, and clarity – Andrew Kelley link to this video 7. Concurrency Is Not Parallelism - Rob Pike link…

cellularmitosison Hacker News • Recommends

On “Zig Is Great”

(and one continuous paragraph harms readability) edit: here's a great talk on zig from the recurse center: link to this video

lshon Hacker News • Recommends

On “Game Boy Advance “Hello World” Using Zig”

This is the introduction to Zig from the language author that I watched when it was first posted here a while ago: link to this video (good watch)

u/leonadavin r/haskell • Recommends

In 11:27 of the following video the Zig creator says that Haskell is among the languages that cannot write perfect software because of hidden memory allocation

Boulthon Hacker News • Recommends

On “Big Integers in Zig”

Zig is really interesting, and the explicit allocators is a feature I miss in many other system languages (like Rust). Presentation by the Zig author is a good introduction to the concept link to this video

wlkron Hacker News • Recommends

On “I Quit My Job to Live on Donations to Zig”

Looking for more on Zig I found a talk 0 (~1 hour) on the language by Andrew Kelley from just a few months ago. Edit: I see there already questions about Rust in this thread. There's an audience question on Rust in the talk 1 and the creator states that Rust is Zig's biggest competitor. 0 link to this video 1 link to this video

MaxBarracloughon Hacker News • Recommends

On “Zig 0.3.0 Released”

I don't know of an 'objective' thorough evaluation of Zig as it stands, but I hope these are of interest: Previous HackerNews discussion on Zig: link Also, perhaps not as objective as you'd like but still good resources: Whirlwind tour of the basic thinking behind Zig: link A ~50 minute talk on Zig, by its creator: link to this video

lshon Hacker News • Recommends

On “Zig 0.4.0 Released”

The Zig language has a great premise, it's worth reading the above link or watching a bit of this video link to this video just to question our assumptions that certain language features need exist at all.

u/SalastroGin r/Zig • Mentions

Should I learn Zig first? Hello, Sorry for the annoying question. I've never really learned a low-level language before. I am only used to "hack" code in C (because suckless) to make it work with no knowledge of what is happening. I think Zig is a cool language and want to learn it, but it feels wrong to learn it with no deep C/C++ knowledge. I've watched the talk about it and didn't understand a lot, so maybe I won't be able to actually use the benefits of Zig practically. I would like to hear your thoughts! Thanks for the time.

u/memforgetin r/Zig • Mentions

Zig vs. Clang Optimization: Should Clang Use -Ofast for Fairness? Hi everyone, I'm new to Zig, so forgive me if this has been asked before or if it's an obvious question. I was watching some conference videos on YouTube, and in this video link, Andrew Kelley has a build file open, and for Clang, it's using `-O3` (not `-Ofast`), whereas for Zig, it's `--release-fast`. Shouldn't the Clang flag be `-Ofast` to make a fair comparison against Zig's `--release-fast`? I came into this conclusion after reviewing some documentation: * GCC Optimization Options * Zig News on Release * Clang Command Guide In another video, at this timestamp link, Andrew Kelley asks, "Where is the call to `sum_ar…
11View on Reddit

u/geonin r/compsci • Mentions

On “Modern day Metaprogramming?”

A couple of interesting languages are Nim and Zig. link to this video
3View on Reddit

u/cassepipein r/Zig • Mentions

On “What if Zig had a dual "typing" system?”

I think you need to try and learn C (which will be useful in you continue to be low-level) to fully appreciate what zig is bringing to the table. Actually one of the first talks of Andrew really brought the point home that the purpose was to be a better C, C without all the warts, not the kitchensink approaches of C++ and Rust. link to this video link to this video

MaxBarracloughon Hacker News • Mentions

On “Pointers Are More Abstract Than You Might Expect in C”

…cking", it's actually as fast as C. Its author values the minimalism of C, but wants to create a far better language for doing that sort of work. 0 They're doing surprisingly well. They even managed to make a faster-than-C (faster even than hand-tuned assembly) SHA-2 1 0 link , link 1 link , it's also mentioned somewhere in this talk link to this video…

MaxBarracloughon Hacker News • Mentions

On “Pointers Are More Abstract Than You Might Expect in C”

Obviously Zig's output (courtesy of its LLVM backend) can be expressed and distributed as assembly code, but it's not hand-tuned, it's compiler-generated. Whether the hand-tuned assembly code they used was the fastest out there, I'm not sure. I'd hope so, or they're being misleading. I might get time to re-watch the relevant part of the video - it's around the 21 minutes mark - link to this video

MaxBarracloughon Hacker News • Mentions

On “How Tail Call Optimization Works”

> So I assume you could make a standard compliant compiler that doesn't nothing but immediately overflows the stack. Interesting thought. I imagine just about every language spec (with the possible exception of assembly languages) states something like If memory is exhausted, a handler is executed or If memory is exhausted, the behaviour is undefined , and it's always going to be up to the compiler/interpreter to make reasonable use of the available memory on the specific target platform. Would a C compiler be non-compliant if it generated code that used 100x the memory that would be used by code generated by typical C compiler? How about 1,000,000,000x so that its generated programs always…

jorangreefon Hacker News • Mentions

On “Why Zig when there is already C++, D, and Rust?”

Zig does however go a long way towards memory safety, to be fair, and if you wanted to, you could also argue similarly that Rust does not guarantee 100% OOM safety whereas Zig does: link to this video I would also say that for "very large long lived projects", memory safety is not actually the most important issue, but rather correctness, followed by (in no particular order) safety, performance, explicitness, readability and exhaustive fine-grained error handling, the latter also not found in too many languages besides Zig.