Zig language: a WAY better C!
Channel: Beauté et musculation
Date: 2021-06-17

I introduce the Zig programming language and its best parts!

This is my first video ever, I hope you'll enjoy it! Timestamp later in the description!

If something is wrong, tell me in the comments.

EDIT: the follow-up is HERE: https://www.youtube.com/watch?v=GZyRHyuHvpk
ENJOY! ;)


References:

Why not compare to Rust or D, or C++
https://ziglang.org/learn/why_zig_rust_d_cpp/


Libc coord ML
https://www.openwall.com/lists/libc-coord/


Loris Cro: advanced hello world
https://www.youtube.com/watch?v=iZFXAN8kpPo

Loris Cro: Solving Common Pointer Conundrums
https://www.youtube.com/watch?v=VgjRyaRTH6E

Benjamin Feng: what's a memory allocator anyway?
https://www.youtube.com/watch?v=vHWiDx_l4V0


C defer from INRIA: publication
https://hal.inria.fr/hal-03090771/document

C defer from INRIA: library
https://gustedt.gitlabpages.inria.fr/defer/



LibCello
http://libcello.org/




Timestamps:
00:00 - Introduction - Zig in a few words
00:24 - Warning
01:15 - Presentation
01:28 - Comparing Zig to X
02:25 - C language
03:52 - libc-coord
04:17 - Zig overview 1/2 - nice features
05:25 - Zig overview 2/2 - game changers

C and Zig similarities
08:40 - Hello world
10:35 - Numbers
12:00 - Overflows
13:18 - Booleans
14:22 - Arrays
    16:33 - Looping over arrays
    17:19 - Accessing arrays' values
18:32 - Pointers
18:55 - Slices
19:13 - Strings

Structures
    20:14 - Structures 0
    20:54 - Structures 1
    21:25 - Structures 2

23:16 - Quick summary

23:46 - BREAK: C preprocessor
    24:04 - Macros
    24:32 - Calling macros
    25:36 - Insanity
    25:57 - LibCello

New features
    26:55 - Comptime
    30:56 - Optionals
    32:36 - Tests
    33:50 - Errors 1
    34:40 - Errors 2
    36:54 - Errors 3
    38:54 - Allocators
    46:08 - Defer

50:25 - Real life example: ArrayList

54:21 - Summary
56:26 - Comment on standard library
56:55 - Comment on cross-compilation
57:33 - New Linker!

58:05 - Conclusion