Zig in 100 Seconds

preview_player
Показать описание
Zig is general-purpose systems programming language often used as an alternative to C, C++, and Rust. Learn the basics of Zig in this quick tutorial.

#programming #code #100secondsofcode

💬 Chat with Me on Discord

🔗 Resources

🔥 Get More Content - Upgrade to PRO

Use code YT25 for 25% off PRO access

🎨 My Editor Settings

- Atom One Dark
- vscode-icons
- Fira Code Font

🔖 Topics Covered

- What is Zig?
- Is Zig fast?
- Zig quickstart tutorial
- Zig vs C
- Zig vs Rust
- Memory management in Zig explained
- How do Zig allocators work?
Рекомендации по теме
Комментарии
Автор

You should do a "Fireship 100 seconds video in 100 seconds" to explain what goes into you making these - for example, how much time do you spend with the language, researching, doing graphics, etc.

Aphova
Автор

Another programming language I can add to my resume because I completed 32% of a Udemy tutorial series about it. Perfect.

graememorgan
Автор

Zig is awesome, but be aware it’s pre-1.0. Async and even a package manager are still in the works (well, re-implementation in case of async). But yeah, the language is small, and it really does integrate with C better than anything else, so it’s incredibly powerful. Oh, and it natively compiles to wasm, with the Zig compiler, so no more wasm tooling. It’s the bee’s knees.

UliTroyo
Автор

It also includes an allocator that tells if you if you have leaked memory and it tells you exactly where in the code you allocated the memory. It comes with safety options, such as automatic bound checks for array (slices) and integer overflow. You basically have none of the C issues with zig.

notuxnobux
Автор

Yesterday I was looking to see if you ever did a "Zig in 100 Seconds, " and today it comes out. Amazing!

francescoscassillo
Автор

Another neat thing with the allocator features is since you have to pass the allocator you can use the std library on bare metal. No need to implement arrays and hashmaps into your own code.

emptydata-xfps
Автор

1:06 Clarification: Zig can still cross compile with LLVM, the issue was just about not including those libraries by default in the Zig package, but you could still choose to depend on them if you want.

magne
Автор

The whole point of comptime is to be used in combination with Zig's best feature: types are a first-class type. The `std.ArrayList` example code is _a comptime function_ that returns what is the equivalent of a template instantiation.

fennewald
Автор

Honestly I think what's the coolest about zig is the explicit control over pointers. One of the inconsistencies with c is that when you pass a int or float to a function it makes a copy. But if you want to pass an array you are just passing a pointer. In zig it's explicit if you pass an array [8]u8 that works the same as passing an int or a float you pass a copy of all 8 u8s. Same with custom types. And if you want to pass a pointer you can. This makes working with pointers most of the time effortless. Because your not pointlessly allocating something on to the heap just to keep reference to it. It helps keep things neat on the stack and in control

mycollegeshirt
Автор

Thanks to bun for popularizing zig!
All it takes is a really good open source project to get some attention on a language

brianevans
Автор

As a C and Rust developer, I appreciate the fact that Zig is stupid simple, yet powerful. It seems the perfect alternative to C for applications that don't require extensive memory safety.

nicholas_obert
Автор

I've been waiting for this in a while! Thank you Fireship for making high-quality content

Gkcrafting
Автор

Yes! I remember seeing a comment where a guy asked you to review Zig, and you replied with "working on it". I've been waiting on this ever since.

rakaboy
Автор

Having built in testing is something i would definitely like to see in other languages

RabidFlaminChipmunks
Автор

I really hope this lang takes over C in newer projects, extremely promising. :)

knineromhak
Автор

Can you do Odin next? Like Zig it‘s trying to be a C successor, but it’s quite different

zytrx
Автор

The more I see Zig, the more I like it. Looks great!

AceofSpades
Автор

I was waiting for it <3
I dont know why, but out of all of them (Rust, Zig, Carbon, etc etc) I want to learn zig

foji-video
Автор

Thank you so much for this video :)
You made me definitely interested. Really looking forward going deeper into it!

gerritweiermann
Автор

Yesss, I have been waiting for this video and got excited when I saw the notification
I don't know why actually because I already know how to use the language, but I still wanted to see the video

CookiLover