I Tried ZIG, Can It Replace C?

  Рет қаралды 20,179

Cakez

Cakez

Күн бұрын

Zig is a general-purpose programming language and toolchain for maintaining robust, optimal and reusable software.
····················································································
Twitch ➤ / cakez77
Twitter ➤ / cakez77
Patreon ➤ / cakez77
Discord ➤ / discord
TokTok ➤ / cakez_77
Coding ► / @cakezdev
Gaming ► / @cakeztv
····················································································
My Game Tangy Defense
store.steampow...
····················································································
About Me *
Hey! And welcome. I'm an indie game developer, currently working on a Tower Defense Game written entirely in C/C++, I tried using Unity or Unreal Engine in the past, but never really found much success. I'm mostly posting devlog / devblog videos where I show off the progress I make on the game.
····················································································
Check out some of my other videos!
• I Tried JAI, Can It Re...
• First Time Using Godot...
• Tired Of Unity? Let's ...
• This Made My Game So M...
• I Made Vampire Survivo...
• A Day In The Life Of A...
• My life changing year ...
····················································································
#reaction #gamedev #coding

Пікірлер: 355
@Cakez77
@Cakez77 7 ай бұрын
Well hello there, hope you still like the video despite my angry takes
@MrPoselsky
@MrPoselsky 7 ай бұрын
We're here mainly because of angry takes. Kappa
@DarkerCry
@DarkerCry 7 ай бұрын
Same line curly is superior.
@scottwalker4619
@scottwalker4619 7 ай бұрын
Honestly, I've only ever watched some of your random videos. After this, I'm going to be following the streams 😀
@churraskindequeijo8418
@churraskindequeijo8418 6 ай бұрын
I love it 😂
@OkOkOkIMightKnowYou
@OkOkOkIMightKnowYou 7 ай бұрын
"Can zig replace c?", proceeds to compare zig with c++
@amorpilo9666
@amorpilo9666 7 ай бұрын
Ok, let's compare it to C then... Still dog shit.
@Cakez77
@Cakez77 7 ай бұрын
lol actually true yeah
@iatheman
@iatheman 7 ай бұрын
🤣
@jhonmarcosaraujo6943
@jhonmarcosaraujo6943 5 ай бұрын
Xd
@NoX-512
@NoX-512 5 ай бұрын
Classic noob mistake 😂
@lucy-pero
@lucy-pero 7 ай бұрын
when you just refuse to RTFM
@familyshare3724
@familyshare3724 7 ай бұрын
I figured out the problem: Windows
@Cakez77
@Cakez77 7 ай бұрын
lol
@VictorRodriguez-zp2do
@VictorRodriguez-zp2do 7 ай бұрын
Thank goodness I don't use visual studio nor windows, so I don't have to cry while setting the PATH
@koool56
@koool56 7 ай бұрын
@@VictorRodriguez-zp2do json is objectively worse, in zig you write build logic using zig, no need to mix json into it or anything else
@VictorRodriguez-zp2do
@VictorRodriguez-zp2do 7 ай бұрын
@@koool56 But then like in the video you have to worry that your file follows the syntax of the language. I do agree that sometimes you need a bit more complex logic in your builds but usually you can separate that into stages. For example usually you just specify your dependencies (paths to them, versions, etc) linker flags, compiler flags, etc.,. All that stuff you can easily declare in a JSON/ini or text file with maybe some environment variables in between, it doesn't require logic. Usually the complex stuff comes as pre and post build conditions of the build and that's the exception. So to me the logical thing is to have a build.json with compiler linker flag all the declarative stuff you can do in a JSON file and then IF needed have a file like "post-build: "run post-build.zig" or a python script or whatever your build requires. JSON is just easier to look at, and easier to debug, and easy to integrate with. Not to mention, most IDEs and language servers will have an easier time parsing a JSON file to search for requirements than a .zig file.
@5374seth
@5374seth 4 ай бұрын
I'm getting flashbacks, stop it
@RenderingUser
@RenderingUser 2 ай бұрын
@@VictorRodriguez-zp2do toml > yaml > json
@AnzenKodo
@AnzenKodo 7 ай бұрын
This man is too honest, and I love it
@Cakez77
@Cakez77 7 ай бұрын
Appreciate it bro
@VictorRodriguez-zp2do
@VictorRodriguez-zp2do 7 ай бұрын
17:30 - It's normal for a language to not have abstractions for opening windows. C, C++, Lua, haskell don't have those. Usually the idea is you install a library for that. It's not weird this programming languages are not made specifically for making games so it makes sense they don't have such abstractions implemented. Jai has it more than anything because it's creator is into game dev.
@Cakez77
@Cakez77 7 ай бұрын
Yeah you are right, I suppose that I thought that because people recommended that to me after I tried JAI and said it was similar.
@FlanPoirot
@FlanPoirot 6 ай бұрын
@@Cakez77if you want to try a Jai like language try Odin, very similar syntax wise and has builtin bindings for raylib, sdl, opengl, stuff like that (game programming stuff)
@andrewdunbar828
@andrewdunbar828 5 ай бұрын
Exactly. Do you want an OS window for the current OS? An OS window for cross platform use? A graphics/game/GL window?
@KatzRool
@KatzRool 7 ай бұрын
I love how the first 10 minutes is spent wrangling vscode and Windows lmao
@MrPoselsky
@MrPoselsky 7 ай бұрын
For switch case statement, if you have want to have two same cases, you can just write "," between them. switch(color){ red,green,blue => base_color(), white,black => contrast() else => mix() }
@Cakez77
@Cakez77 7 ай бұрын
Ahh okay thanks for pointing this out. Couldn't find anything on stream.
@kevathiel1913
@kevathiel1913 7 ай бұрын
​@@Cakez77 Where did you look? Is your attention span so low that you tried to look for some KZbin video instead of the docs?? It is literally the first example in the switch docs..
@m4rt_
@m4rt_ 7 ай бұрын
technically in Jai, you have the syntax u8.[1,2,3,4,5]; but the compiler is able to figure out the data type at compile time, so you can omit the u8, though the default type for a number is s64 so you would have to hint to the compiler that it's u8 and not s64 by assigning the array to a variable that has the type of []u8, return it where the return type is []u8, or cast one of the values to u8.
@kevathiel1913
@kevathiel1913 7 ай бұрын
Kinda weird seeing you not even actually learning the language, but just trying to apply your C++ism. What is the point of learning a new language when you just stick with the C++ subset, instead of actually learning the features, idioms and reasons behind the decisions in another language? For example, you moving the defer to the end of the function defeats the entire point of it and makes it clear that you didn't even try to understand it. You didn't even look at the things that make Zig actually interesting, like its comptime stuff. Might as well stick with C++ if you don't want to broaden your horizon. Your complaints seem superficial, too. I don't use VS Code, so I can't talk about the LSP., but switches are not exactly like their C pedant, you can just use a "'," to combine them, which is mentioned in the actual docs.. I guess you didn't even read them at all? Same as the getting started guide, which would have told you about the reason for using the master branch(stable is tied to the LLVM release schedule, which is 6 months). The issue with some random third party lib has nothing to do with the language, but the build issue is actually fixed in one of the 2 open issues(which you didn't seem to read either). Looks like you spent an afternoon with the language, then got triggered when you noticed that you had to actually invest time into learning it, and got an attention span that is too short for reading any docs.
@theuglytruth5556
@theuglytruth5556 7 ай бұрын
You can learn literally anything by "investing time" to it. The point is how easy they make it for new users to learn.
@kevathiel1913
@kevathiel1913 7 ай бұрын
@@theuglytruth5556New users should read the docs, it is as easy as it gets.. You can't expect learning an entire systems programming language in 4 hours, where 2 were wasted on the setup with some third party library, while not reading any docs. The switch thing is literally the first example!
@Cakez77
@Cakez77 7 ай бұрын
Okay, you probably mean the `defer clearcolor?` why is it there and not at the top?
@leonss2356
@leonss2356 7 ай бұрын
@@theuglytruth5556 > I want to learn a new language, let's try Zig > Huh? It's not just C with extensions and a different name? I hate it
@diadetediotedio6918
@diadetediotedio6918 7 ай бұрын
@@leonss2356 Clearly you have your own biased views on it as well, to say that all he did was saying "It's not just C with extensions and a different name". I have tried it myself, and it is just not ergonomic or practical at all. The compiler is good tho.
@fpalmac
@fpalmac 7 ай бұрын
It’d be incredibly fun to see you struggling with Rust’s borrow checker lmao. Keep doing this, you’re genuinely entertaining man
@Cakez77
@Cakez77 7 ай бұрын
That's what I'm worried about lol. My dear equipment is gonna break. Thanks for the kind comment bro
@nikkehtine
@nikkehtine 6 ай бұрын
those first 10 minutes filled with rage are prime example of the experience of coding on windows
@Cakez77
@Cakez77 6 ай бұрын
lol
@darkfllame
@darkfllame 5 ай бұрын
yes.
@aaronwinter7911
@aaronwinter7911 7 ай бұрын
Jai uses the semicolon for member fields instead of the comma to make refactoring easier. Imagine you have a bunch of global variables that you want to put in a struct, you can literally just move or cut paste them into the struct, without having to change the semicolon into a comma. It makes refactoring easier.
@Cakez77
@Cakez77 7 ай бұрын
Ohhhhhhhhhhhh, that is actually 5Head. Damn that's smart
@Mario-vt2ss
@Mario-vt2ss 6 ай бұрын
It applys to zig too, just put ',' after the last element
@thebutlah
@thebutlah 6 ай бұрын
Just use vim or your IDE multiline cursor?
@androth1502
@androth1502 7 ай бұрын
no operator overloading is a feature.
@Presenter2
@Presenter2 Ай бұрын
I would not call it a feature, it is rather an aspect of Zig's language philosophy.
@cyanmargh
@cyanmargh 7 ай бұрын
0:50 "zig file" sounds even more sus than "zip file" 💀💀💀
@spicynoodle7419
@spicynoodle7419 7 ай бұрын
VSCode skill issue. It works on my Neovim
@Cakez77
@Cakez77 7 ай бұрын
Typical Microsoft yeah
@chrboesch
@chrboesch 6 ай бұрын
Too bad you didn't understand the basic principle of Zig: Control. This sometimes means that you have to write a little more, but you know with 100% certainty which values are assigned to which variables and how many parameters a function has in total. There are also editors (e.g. Neovim) that do a lot of the typing for you. Just as a tip. 😉
@spaceowl5957
@spaceowl5957 Ай бұрын
Knowing how many parameters a function has is a problem?
@chrboesch
@chrboesch Ай бұрын
@@spaceowl5957 No, but not knowing can be a big problem.
@whywhatwherein
@whywhatwherein 6 ай бұрын
a lot of comments are commenting against Cakez showing frustration from trying to use zig on Windows. His comments are absolutely fair. At the moment, Zig is a half-baked mess. Even the creator admitted in his 2024 video.
@soggy_dev
@soggy_dev 7 ай бұрын
Braces on their own line are for psychopaths
@Cakez77
@Cakez77 7 ай бұрын
Truest Statement ever!
@andrewdunbar828
@andrewdunbar828 5 ай бұрын
True. Next they'll want to add an extra blank line before and after the brace line.
@Grigore-Daniel
@Grigore-Daniel 7 ай бұрын
This all felt like the angry german kid meme Love it! :D
@Cakez77
@Cakez77 7 ай бұрын
lol
@danikvitek6845
@danikvitek6845 4 ай бұрын
Breaking changes between pre-release versions is totally fine and pretty much expected. Developers are getting a feedback and polish things
@umar7812
@umar7812 7 ай бұрын
Can you try odin language in your next stream, it's kinda like public version of jai. btw i watched the stream live and the master branch part was hilarious😅
@Cakez77
@Cakez77 7 ай бұрын
Yeah sure bro, I'm just scared that I go into it with very high expectations like into ZIG. Odin sound really cool
@umar7812
@umar7812 7 ай бұрын
i am pretty sure it will cure your zig trauma.
@LinucNerd
@LinucNerd 7 ай бұрын
​@@Cakez77 The good thing about odin is that libraries are just folders with the library's source files. Meaning you can have a structure like this: cool_library_folder_name\ another_library\ your_project_source_file.odin your_other_source_file.odin To include the library, you just do: import "cool_library_folder_name" or import cool "cool_library_folder_name" and you're done. Better still, Odin comes with raylib out of the box, so you can just import it via: import rl "vendor:raylib"
@Ross96D
@Ross96D 7 ай бұрын
skill iiisues
@Cakez77
@Cakez77 7 ай бұрын
joe mommy
@Qohist
@Qohist 7 ай бұрын
bro u do: fn main() { } wtf? all my homies only do: fn main() { }
@Cakez77
@Cakez77 7 ай бұрын
Yeah bro, it's my preference to have more space vertically and see a bit better.
@TheTrienco
@TheTrienco 7 ай бұрын
From the places I worked at, both styles seem to be used about the same. I changed my preference at least 4 times, because of work (and I just don't care that much). What really drives me crazy is what I saw in tons of Java code: void function() { // code } If you want to leave space between signature and code (understandable for readability), why the f'iddity sh eff not just put the brace in the next line instead of leaving it blank. The main argument is easier visual mapping of opening and closing braces, so somehow Java devs love combining the WORST aspects of both styles. Almost as evil as 2-space indents...
@Qohist
@Qohist 7 ай бұрын
oohhhh i see i never though about that@@Cakez77
@jokinglimitreached1503
@jokinglimitreached1503 6 ай бұрын
30:00 BEST moment ever 😂😂 the realization is priceless
@ForeverZer0
@ForeverZer0 4 ай бұрын
Zig is a little bit overwhelming for the first couple hours, there is a lot of syntax and idioms not common to other languages, but it just keeps getting better once you they click in your brain. The more I get into it and actually building real-world applications with it, the more I love it. It is quickly becoming my new go-to language, there are just so many niceties to it that I never knew I wanted before. Unironically Zig is also my new favorite C toolchain. The LSP can be a bit sluggish, but to be fair, it is a 3rd party application, and not reflective of the language itself.
@captainfordo1
@captainfordo1 5 ай бұрын
This is the best video. I love your brutal honestly. It seems like people just cut Zig too much slack.
@Cakez77
@Cakez77 5 ай бұрын
@wat6549
@wat6549 7 ай бұрын
all the problems in the beginning are windows issues ☠
@Cakez77
@Cakez77 7 ай бұрын
Yeah true
@scottwilliams1902
@scottwilliams1902 7 ай бұрын
That was hilarious. As a mainly c/c++ programmer I'm always on the lookout for a language for utils and prototyping. Something that I can quickly write an app with without setup time etc. I tried Zig and had the same experience as you. Zig is just too verbose and quirky for me. I may be missing the point but I can't see why I would use it over plain old c. I have settled on Odin. Odin has so much built in and in mostly painless to get started with.
@Cakez77
@Cakez77 7 ай бұрын
Oh man another Odin enjoyer. Is it really that good? I wanna give it a try but I'm scared to be disappointed. Glad to hear that a fellow C++ dev had the same issues tho
@scottwilliams1902
@scottwilliams1902 7 ай бұрын
Odin really is that good. It has some quirks and is a little verbose in places but I can live with it.
@Cakez77
@Cakez77 7 ай бұрын
@@scottwilliams1902Okay, I will give it a shot soon then. Odin is gonna be next
@MadMatty72
@MadMatty72 5 ай бұрын
Love your complaining. Many logical comments you robot! (that's a compliment)
@jonasferencz8569
@jonasferencz8569 3 ай бұрын
This is why I use vim and the command line. Too many days of my life wasted fighting an IDE
@viniciusantonio2253
@viniciusantonio2253 3 ай бұрын
7:05 the most german rage I’ve ever seen lol
@soggy_dev
@soggy_dev 7 ай бұрын
Using zig on a dog shit OS with a dog shit editor results in a dog shit experience 👍 ...for real though, I get it. Jai is specifically built for games versus zig being a replacement for C, so for building a game Jai should win every time. Zig probably won't ever have windowing built in because it's not built specifically for graphics programming. Once the package management story is better this sort of stuff should be a bit easier. I actually love the build.zig file because I hate relying on an IDE (or Makefiles) to manage my builds, but I also agree it's a lot to take in all at once
@Cakez77
@Cakez77 7 ай бұрын
Yeah I suppose the build.zig file is just an equivalent of the typical build files that you see in programming. Like some people use .bat, others .sh, CMake, Makefiles. Actually a good point
@diadetediotedio6918
@diadetediotedio6918 7 ай бұрын
Imagine actually programming in one of the most widely used operating systems out there
@kuhluhOG
@kuhluhOG 5 ай бұрын
@@Cakez77 one thing you should try is to use Zig as a C++ compiler (Zig has clang builtin) and maybe even cross-compile with it (it's literally just a CLI option) for example last week I cross-compile a C++ program on my Linux x86_64 machine for Windows aarch64 and somebody else ran that binary on macOS via BootCamp it worked without hassle or generally, take a random C++ project and tell the buildsystem to use "zig c++" as C++ compiler and "zig cc" as C compiler
@kevinkkirimii
@kevinkkirimii 4 ай бұрын
well said
@ForeverZer0
@ForeverZer0 4 ай бұрын
Kinda have to agree. I literally did a "pacman -S zig zls", ran "zig init" in new directory, opened neovim, and started coding.
@MrElmida
@MrElmida 7 ай бұрын
I can't stop watching this video, it includes all the Cakez-Aspects I like: Rage, silly mistakes and genuine opinions. PS: Its my 3 watchthrough
@Cakez77
@Cakez77 7 ай бұрын
My man, I'm happy you like it bro.
@diadetediotedio6918
@diadetediotedio6918 7 ай бұрын
I tried zig, the ergonomics are terrible and the lack of smart type inference is a pits. But I like the comptime stuff (not so much the way they handle types as values tho), and the toolchain is pretty damn interesting. Not a language for me tho.
@Cakez77
@Cakez77 7 ай бұрын
Maybe it gets better in the future
@mycollegeshirt
@mycollegeshirt 5 ай бұрын
I mean what programmer doesn't know that windows isn't a programmer friendly experience? This was like watching someone review a video game controller using a Wal-Mart controller.
@kiwiladi
@kiwiladi 4 ай бұрын
I felt this comment to my core. The language looks excellent once I understood the philosophies.
@notuxnobux
@notuxnobux 5 ай бұрын
A lot of the arguments are "its bad because it's not c", " it's bad because I don't understand it". Once you look at how debug print is implemented it will make complete sense, the standard library can validate the format string against the arguments unlike in c and even rust requires compiler magic to do it, zig doesn't
@Z3r0XoL
@Z3r0XoL 6 ай бұрын
SDL
@casvanmarcel
@casvanmarcel Ай бұрын
This was maximum entertaining to watch =)))))) I subbed
@Cakez77
@Cakez77 Ай бұрын
Lol
@oglothenerd
@oglothenerd 2 ай бұрын
Zig outright makes Neovim crash.
@thebutlah
@thebutlah 6 ай бұрын
The rust compiler has very friendly error messages and an actual build system. But "the rust way" is to use a library for everything, have a standard project structure, and the language comes with almost nothing in the std lib. I like that, you may not.
@ForeverZer0
@ForeverZer0 4 ай бұрын
What is the benefit of having a near non-existence std lib? I can understand how one might not be bothered by that nor find it important, but it seems odd to "like" that or view it as beneficial.
@ThomazMartinez
@ThomazMartinez 5 ай бұрын
i think if and when zig will have its own package manger that problems you had with lib should go away
@Cakez77
@Cakez77 5 ай бұрын
Ehm, but I had more problems
@vei_bean
@vei_bean 7 ай бұрын
Would love to see u try rust. I saw ur comment about the compiler so i have to say rust has the best the best error messages ive seen, it tells u what u did wrong, where and potential solutions with a link to decent docs, u can learn a good amount from the compiler alone. Also the build times are fine, the first will take longer ofc but its not slow at least imo If nothing else im sure youd like rust dependencies after ur experience with zig
@lightpurple3147
@lightpurple3147 7 ай бұрын
i think he already hates rust it seems 😅 this might be skill issue or something but IMO borrow checker for gamedev is definitely a big blocker. i know you can use things like ecs, idiomatic rust approaches, but it's too much for simple 2d games.
@Cakez77
@Cakez77 7 ай бұрын
Yeah I will think about rust, maybe on a sunny day after 20hours of sleep and no stress for 2 weeks
@musdevfrog
@musdevfrog 7 ай бұрын
Waiting for that Odin Arc.
@Cakez77
@Cakez77 7 ай бұрын
Fine I'll do it, sooooooon
@troymaxwell383
@troymaxwell383 7 ай бұрын
@@Cakez77odin has raylib included so you can easily make a window with it haha, my only gripe with it was setting up language server was a little annoying. but I think youll enjoy odin way more then zig so far hahaha
@Rupour
@Rupour 7 ай бұрын
I've had similar experiences with Zig. It really is a language that you need to read the documentation, try out some examples, go through ziglings, and play around with the build system to really understand how to move around in it. Once it clicks, it has some wonderful additions and changes from C; but zig still is not for me yet. Fortunately, I found Odin a much easier experience to get into. It still requires a little bit of reading before you grok it (especially with 'packages' if you've never used Go), but it's a simpler language than Zig with a lot of nice consistency in its design. I think you'll have a much easier time with it. All that said, no language has a built windowing and graphics library with a single "create_window" procedure like Jai does. However, Odin does include bindings for Raylib/SDL2/opengl/direct3d/metal/etc officially built in as modules that you import and it just worked for me.
@Cakez77
@Cakez77 7 ай бұрын
I have heard about Odin many times now. I should really try it. About the create_window stuff, I knew I was asking a lot after coming from JAI. I guess I just hoped that adding Libs would be much easier than it turned out to be. Maybe raylib was the wrong choice
@androth1502
@androth1502 7 ай бұрын
@@Cakez77 you can go from download to having a raylib window open in about 5 mins in odin. no mucking around with build systems.
@ForeverZer0
@ForeverZer0 4 ай бұрын
I dedicated a few weeks getting the full Odin experience, making a basic voxel game/Minecraft clone. It is an interesting language, but somewhat niche. I would recommend it to people who really like Go and want to create a game, as it solves a lot of the problems Go has with such an endeavor. Compared to Go, you get much better C interop, which is far from a good experience in Go, SoA, SIMD, etc., though you do lose out on some features that make Go great, so it is a mixed bag. I am happy I learned it, and might go back to it someday for some other project, but it feels like there is always a better alternative language to use IMHO.
@tubeincompetence
@tubeincompetence 7 ай бұрын
Nice tower defense game and good banana stream!
@Cakez77
@Cakez77 7 ай бұрын
Thanks brother
@CwispyAirtune
@CwispyAirtune 7 ай бұрын
Zig is very verbose since nothing is supposed to be happening under the hood implicitly such as operator overloading. Having no operator overloading for multiplying a number with a vector also grinds my gears. You can either accept how verbose it is or explicitly use functions instead of operator overloading like this: const print = @import("std").debug.print; const Vec2 = @Vector(2, f32); pub fn mul_vec2(vec2: Vec2, x: f32) Vec2 { return vec2 * Vec2{ x, x }; } pub fn main() void { const v1 = Vec2{ 1, 1 }; const v2 = mul_vec2(v1, 0.5); print("v1 = {d} ", .{v1}); print("v1 * 0.5 = {d} ", .{v2}); }
@Cakez77
@Cakez77 7 ай бұрын
Well I can respect that, however, this feels like regression to me and not an advantage over C. But that's just me I guess lol
@salim444
@salim444 7 ай бұрын
yeah man, I successfully included raylib to my project and would like to consider it an achievement 😅. The docs are shit and the build system is great in concept but the realization is subbar or at least in great need to some docs for us non system programmers
@Cakez77
@Cakez77 7 ай бұрын
GJ bro, achievment unlocked. I think the docs are okay but the language just isn't there yet. I mean 0.11, still a lot to be changed I guess.
@VictorRodriguez-zp2do
@VictorRodriguez-zp2do 7 ай бұрын
If you are open for another programming language I recommend D. The sytanx is way closer to C and also comes with package manager and all to make things easier. For graphics it has a Raylib package
@Cakez77
@Cakez77 7 ай бұрын
Thanks for the suggestion bro, I will see if I try it after Odin.
@thechosenone729
@thechosenone729 Ай бұрын
Modern languages are meme. 🤣 Good old C++.
@Cakez77
@Cakez77 Ай бұрын
Lol
@pushqrdx
@pushqrdx 7 ай бұрын
I am a very sensitive person and I am ReallyMad right now, in fact I am seething.
@Cakez77
@Cakez77 7 ай бұрын
my man
@costelinha1867
@costelinha1867 7 ай бұрын
I wanna see a battle royale where Zig, Rust, Go, C, C++ and whatever are all in an arena beating the living shit out of each other.
@demolazer
@demolazer 4 ай бұрын
Who are we picking as the talisman for each language?
@akza0729
@akza0729 7 ай бұрын
You're like my inner monologue. But unlike me, You don't keep it in. So It's nice to watch you just letting it out.
@Cakez77
@Cakez77 7 ай бұрын
Yeah for better or worse lol
@progress2171
@progress2171 7 ай бұрын
7:06 i'm pretty sure you should have just clicked the "Use Zig in PATH" button
@_KondoIsami_
@_KondoIsami_ 7 ай бұрын
if that's the only option that works then don't give the other options.
@Cakez77
@Cakez77 7 ай бұрын
yeah true^^
@progress2171
@progress2171 7 ай бұрын
Thats what worked for me
@progress2171
@progress2171 7 ай бұрын
@@_KondoIsami_ I’m sure other buttons have their own purpose that makes it work some other way, but i did it the same way that cakez did it, when i got this pop up i used this option and it worked perfectly fine.
@utubekade
@utubekade 5 ай бұрын
I still can't get over the curly braces thing in that extension. So abusive.
@eni4ever
@eni4ever 7 ай бұрын
Death by banana
@diadetediotedio6918
@diadetediotedio6918 7 ай бұрын
I think the most bs people do about zig is how they try to lower the bar on it by saying it should be a "better C", when the language itself is trying to be MUCH more than that (and failing on it). Zig is clearly trying to sell itself as a simpler to languages including C/C++, D and even Rust, so we should at least expect a thing that is usable and ergonomic, opting for simplicity does not mean you should opt-out for usability (even if I find the "simplicity" slogan thing bs as well).
@Cakez77
@Cakez77 7 ай бұрын
Well I just see it as an objectorientification of C, that's all. Which is not bad, but it enforces a way of thinking, which I don't like
@AlexMax2742
@AlexMax2742 6 ай бұрын
Old programmer here. I think the most important thing to know about Zig is that it's designed to replace C. Not C++, not Java, not even Rust. It's a C replacement. In other words, It's designed for the niches that C is still good at in TYOOL 2024, and is also designed to make integrating with and replacing existing C code as easy as possible. If you want to write a portable library that speaks the C ABI so it can be easily called from other languages, Zig might be a good choice. If you want a language that you could eventually use on an embedded platform due to simplicity and small object file size, Zig might be a good choice. But most people don't need a better C.
@jan_harald
@jan_harald 4 ай бұрын
it's also kinda replacing c++ but the main point, is that zig makes all program flow obvious, what you see, is what happens, without stuff like operator overloading or fallthrough, where you have to be aware in which cases they happen, in what order, what types are compatible or not, etc etc
@spaceowl5957
@spaceowl5957 Ай бұрын
I feel like dogmatic “always do this” stuff in programming is usually at the cost of practicality. There’s probably a reason why other languages hide control flow sometimes, and if zig just says “we never hide control flow no matter what” I’d expect that to make code more annoying to write with question benefit in many instances. Like most decisions in programming, hiding control flow is probably a fuzzy trade off, with a sweet spot and just saying “it leads to problems sometimes so we’ll never ever allow it (even in cases where it doesn’t really lead to problems and has tangible benefits)” is probably not ideal. People tend to be drawn to that kinda stuff because it feels “intellectually pure” but I don’t think it’s usually very practical.
@Giga4ever
@Giga4ever 7 ай бұрын
Dude who never finished a project shares his opinion about a language he tried to learn in 3 hours.
@diadetediotedio6918
@diadetediotedio6918 7 ай бұрын
If you know more than 5 languages 3 hours is sufficient to grasp the language and see if it fits or not in a good place.
@Giga4ever
@Giga4ever 7 ай бұрын
@@diadetediotedio6918Hello Dunning Kruger
@lightpurple3147
@lightpurple3147 7 ай бұрын
​@@Giga4ever lmao why are you replying twice?
@diadetediotedio6918
@diadetediotedio6918 7 ай бұрын
@@Giga4ever There's nothing more dunning kruger than calling people dunning kruger.
@Byynx
@Byynx 16 күн бұрын
These new languages want so badly difer from C++ to pretend they have something that they end up broking simple syntax logic. They even added "fn" to define a function, what a joke.
@brandonphilander661
@brandonphilander661 3 ай бұрын
Try Odin instead.
@yaksher
@yaksher Ай бұрын
This is such an insane way to learn a language. Like, I recognize you're a content creator and "spend an hour or two reading the documentation to understand how the language works" isn't very interesting content, but also, Zig is both very elegant and very new. Its comptime system is entirely unique afaik and reading up on understanding that would likely making things far more painful. Also, @16:30, fwiw, I think the reason for the somewhat counterintuitive for-loop syntax is for uniformity with the other "value capturing" constructs. if (optional value) |capture| { ... } gives you access to the contents of an optional value if it exists, under the name capture, inside the braces. This "value capturing" construct appears in a bunch of places in Zig and so for uniformity it's also used for for-loops.
@robinkuster1127
@robinkuster1127 Ай бұрын
I don't know if you've yet tried Rust but I've done some Rust basically since pre 1.0 although not professional. Rust and Zig as well as Odin are fundamentally different things. Odin (and Zig) are taking C and think about what could make it better. The Zig Dude (Andrew Kelly) thought "the preprocessor is garbage" and then implemented comptime and changed some other things of C. The Odin Dude (Ginger...beard?) thought that C isn't really a pleasure to work with and picked features that he liked from other languages but put them into the vibe of C. Rust is "We create a lot of memory related bugs. How can we make introducing those bugs effectively impossible or really obvious". Odin, Jai and Zig are taking C into a modern era. Rust takes C++ into a professional league. Odin, ZIg and Jai give your car an automatic transmission, heated seats. Rust gives you car roll over bars, a short shift stick, racing seats and a giant handbrake lever so you can drift. But it doesn't help you with learning how to drift. It is just giving you the tools to do it properly. This makes Rust a frustrating experience but also makes Rust a good tool to learn to be a better programmer. The most important thing I took from Rust is the gut feeling for what the borrow checker will or won't let you do because those places where it won't do what you want are the places where you can introduce bugs and when you then write C++ you get that tickle in your willy that tells you that whatever you do is stupid. When you go into Rust and expect to have a good time, you will be disappointed. Rust will fight you but once you defeated it, your code will work. I think now after years of using Rust, it has become quite clear that Rust isn't the best tool for a lot of jobs. The Async story is annoying and leaks into every piece of code you write, lifetime annotations feel so pointless, libraries sometimes do weird things that make it hard to structure your code a certain way (like, I remember fighting Rust a lot when I tried to have a renderer in WGPU that just has a "start_frame", "draw_quad" and "end frame" function. Setting up a command buffer in "start_frame", filling it with "draw_quad" and flushing it in "end_frame" didn't really work well with lifetimes. But just getting used to the borrow checker actually made me a better programmer. I would just like to take the risk and tell it to f itself.
@goodoldwilliam
@goodoldwilliam 4 ай бұрын
31:25 come on man, just install 7-zip (which is free and open-source), it would unzip that file in
@zeroows
@zeroows 6 ай бұрын
Skill issues -
@ovi1326
@ovi1326 3 ай бұрын
In defense of the devil: zig is def for a different audience than jai, rust, or maybe even c/cpp. For starters zig is actually the most low level out of these. It's standard library doesn't have a standard allocator you just go and use, instead it has a bunch of them so you can _easly_ pick and choose for your use case. Simd instructions are _easly_ accessible from the language, the @Vector() thing isn't a linear algebra vector but a single simd vector (of arbitrary size so ie. you can use 256bit vectors and the compiler will splt operations on them, which is honestly soo good compared to immintrin.h). Finally zig has probably the nicest compile-time code execution (it simply just works, and I love it). I don't think zig is the best match for gamedev, but as someone dabbling in realtime audio it's literally the best thing since sliced bread.
@chopeda5822
@chopeda5822 7 ай бұрын
I don't understand what operating system your using? Seems to be some kind of deprecated office desktop. It looks like its giving you pain.
@Cakez77
@Cakez77 7 ай бұрын
Ehhh Windows 10
@chopeda5822
@chopeda5822 7 ай бұрын
@@Cakez77 someone should file a big report, the slashes in file paths seem to be printed in the wrong direction
@ovi1326
@ovi1326 3 ай бұрын
So about the raylib incident - zig's package manager is a relatively new invention (it's like less than a year old I think?), and the bindings you downloaded don't support it. If it did however you could just go zig fetch --save {tarball with it's source}, and then link it to the executable in like 2 lines in the build.zig. Not to say there's a better way to use raylib in zig this way currently (or at least I haven't seen it). The best feature of zig is arguably how you can just import a c header into zig, and that's the way I'd go about doing that (so like not exactly better than C in this regard, but hey - the zig build system has way less footguns than any build system for c or c++ so that's nicer).
@CwispyAirtune
@CwispyAirtune 7 ай бұрын
15:25 here you're making a type (struct) const GameState: type = struct { ... } Types are always defined as const. It is correct that a struct is reassignable and mutable with var: var current_game_state: GameState = .{ ... } and is not reassignable and not mutable with const: const start_game_state: GameState = .{ ... }
@AeroSW
@AeroSW 4 ай бұрын
Hey Cakez, when copying files on Windows 10/11, it is better to copy the folders while they are zipped/compressed. It will make your file transfers 100x faster. Unzip at the final destination 😎
@kevinkkirimii
@kevinkkirimii 4 ай бұрын
I am so confused. First I thought you are talking of Jlang but it is Jai that you are talking about. Jai = C++ Zig = C Whoever said Zig is comparable to Jai lied. And Yes Zig is better then Rust IMOHO
@anG_3L404
@anG_3L404 4 ай бұрын
22:34 yeah the early part of zig is a bit of a downside because windows is horrible to develop anything on. Microsoft made it so inaccessible that literally there are tools to just fuck windows over. Which is a morally good thing argueably because- most people back in the day made the worst decisions ever. With zig, you just use zig, and to build zig You use zig to make zig to write zig to build zig to see zig and translate c into zig because right now it is solely focused on being a better c. It has no macros, no unexpected behaviors, no preprocessors, nothing like that since when looking into c code, its hard to find the actual SOURCE, while in zig- it just is, and if you want "macro" like stuff, you do that with comptime. Also new line { is... Bad :) So abstractions of establishing a window.. is gonna be far from common especially as it is a language still in high end development, constantly you will run into the issue that the compiler for zig is not compatible with previous version code. Windows is open by not being open. They wanted to make a product that is free to the user by not being free to the user. Argueably one of the worst systems, that and also apple stuff too. I looked into the process myself and it is only a quarter fraction of a nightmare than it was in this video. The problem isnt zig, its windows. But im also not gonna say you should switch to linux. It is a nightmare right now and windows is going down the drain faster than it ever has before.
@eptic-c
@eptic-c 5 ай бұрын
Some of the issues could have been solved by reading the docs, but, even when you got it working and i look at the code I am dissapointed by zig, i would take C anytime over zig and use it only for the build tools which are better then make imo.
@yarden-zamir
@yarden-zamir 5 ай бұрын
windows lol. you just like pain?
@javierflores09
@javierflores09 5 ай бұрын
Love how people are coping so hard lol. Zig is cross-platform so why would it have to be a worse experience on one of the most used OSes in the world? Rust at least got this part down from the get-go, installing it through rustup and setting up projects with cargo is a 100 times easier (though, everthing else isn't but I digress)
@_tsu_
@_tsu_ 7 ай бұрын
try rust. It's the best build system of any language ever imho. The language itself is also pretty cool.
@Cakez77
@Cakez77 7 ай бұрын
But I heard the compiler is a caren
@boccobadz
@boccobadz 7 ай бұрын
If you think that compilation takes too long in zig, you will destroy the keyboard waiting for rust code to compile. Not to mention anything non-trival (so game dev as well) is a pain in the ass in rust. Don't get finessed into rust by its fanboys, 99% of use-cases don't need rust. It's just a frustrating language to write, and offers little to no upside if you're already good at cpp.
@_tsu_
@_tsu_ 7 ай бұрын
@@Cakez77 it's helpful tho. It will tell you exactly what you did wrong and how to fix it. So it's more "um akshually" guy than karen.
@Giga4ever
@Giga4ever 7 ай бұрын
@@boccobadzYou are wrong. My entire game compiles in less than one sec. There are also many upsides in Rust aside from the safety stuff, like better tools(Cargo >>>>> CMake), quality of life features especially useful for games(include bytes/str to embed shaders, textures into the binary), and there is nothing comparable to enum + pattern matching in C++. It is only frustrating when your code is crap, like a bunch of mutable global state or following OOP practices..
@_tsu_
@_tsu_ 7 ай бұрын
@@boccobadz compile times are not bad off late. And you neet to be tripping balls to think rust is more frustrating than cpp. There is a reason rust is in Linux and cpp is not. What even is that last point?? 99% of use cases can be done in python.
@pietraderdetective8953
@pietraderdetective8953 7 ай бұрын
the forced formatting where the ZLS forces us to use curly braces in the same line drove me nuts too! I still use K&R style though...only in Zig i let it go and let the ZLS do whatever it wants LOL. I watched this on livestream and yeah Zig is kinda rough around the edges, it cuts and bleeds you if you're not careful. I also experienced breaking changes caused by different versions which made me stop trying Zig for a week before returning back to it. Now I take the slow and steady route with Zig: reading docs, finished the Ziglings tutorials, rewriting small projects in Zig, etc...and I think the experience is much better this time.
@Cakez77
@Cakez77 7 ай бұрын
Good approach actually. I mean the same thing is possible in JAI, but the difference is that it's not out yet for that reason.
@simplegameplay1469
@simplegameplay1469 7 ай бұрын
Jajaja I almost die at 30:00 when he realices it's using a Master unstable version
@arsenbabaev1022
@arsenbabaev1022 7 ай бұрын
Average zig experience 7:05 btw i also failed to get lsp working when i tried it (skill issue)
@Cakez77
@Cakez77 7 ай бұрын
Bruhhhh, what a ride that was. Getting your hopes up with the path selector only to not work lol
@sbr27287
@sbr27287 2 күн бұрын
zig is just straight up weird man, odin is so much better
@andrewdunbar828
@andrewdunbar828 5 ай бұрын
What's J? Does he mean Jai maybe?
@Cakez77
@Cakez77 5 ай бұрын
Yup
@Little-bird-told-me
@Little-bird-told-me 5 ай бұрын
Instead of getting into this political debate, I would be keen to know which might be the best use case of zig? Per my little understanding it seems zig may be good for embedded systems and systems programming especially where teams are small, meanwhile Rust will be the enterprise version of zig.
@naranyala_dev
@naranyala_dev 7 ай бұрын
take it easy man, angry doesn't solve the problem
@Cakez77
@Cakez77 7 ай бұрын
But it helps me
@m4rt_
@m4rt_ 7 ай бұрын
7:05 ... reminds me of a famous angry guy in history. ... if only you screamed in german
@Cakez77
@Cakez77 7 ай бұрын
Who would that be? lol
@radosmirkovic8371
@radosmirkovic8371 3 ай бұрын
I guess zig lang was created to boost production and sales of bananas. These new languages (rust, go, zig...) are making c++ looking good.
@KoltPenny
@KoltPenny 4 ай бұрын
This was a very interesting approach at Zig actually. I never considered that it could get that cumbersome for someone
@_programming_
@_programming_ 2 ай бұрын
this guy uses soooo much Microsoft BS that cannot even understand anything outside Microsoft BS. Try to read some initial basic tutorial before
@asoulinsearch4267
@asoulinsearch4267 5 ай бұрын
Well, I just have to say here that I endured around 1 to 2 hours of Zig "experience" with the same setup, Zig + VSCode + ZLS, and the only language that caused me as much pain was Go. The syntax is unintuitive as all hell, the documentation is obviously non-existent, and I haven't found a single good thing about this language. Like, want speed, use C, want speed and safety, use Rust. This thing is just bad. The `.{10}` syntax on print is just rage-inducing, and it's the least of this language's problems. This thing has so much syntactic noise it's just painful to look at.
@Cakez77
@Cakez77 5 ай бұрын
True
@brivism
@brivism 5 ай бұрын
doing ziglings would make it a bit more painless - for example how to write fall through alternative etc
@Cakez77
@Cakez77 5 ай бұрын
What is Ziglings?
@brivism
@brivism 5 ай бұрын
bunch of exercises where you have to fix up broken code that guide you through the language. since zig wants to replace C but does the things different I though doing ziglings might help with going through those "different" bits
@weeb3277
@weeb3277 7 ай бұрын
37:53 can you please slowdown the rotation of the banana? it's a bit annoying.
@Cakez77
@Cakez77 7 ай бұрын
Hahaha lol I'm sorry
@NdxtremePro
@NdxtremePro 7 ай бұрын
The top one literally says it is master? What world is that not the unstable branch?
@Cakez77
@Cakez77 7 ай бұрын
Should be labeled better
@NdxtremePro
@NdxtremePro 7 ай бұрын
@@Cakez77 No, it shouldn't. The common theme through this whole video was not reading enough, just making assumptions. If Zig worked like every other language you use, then it serves no purpose.
@diadetediotedio6918
@diadetediotedio6918 7 ай бұрын
@@NdxtremePro ["If Zig worked like every other language you use, then it serves no purpose."] Lol, then no language should ever serve a purpose, you understand that virtually all languages works in the same way in the sense that you should be able to build functional stuff with them, right?
@NdxtremePro
@NdxtremePro 7 ай бұрын
@@diadetediotedio6918 You can build functional stuff with Zig. I don't understand what it is you are saying? Zig is a C/C++ replacement. It is aimed at improving that ecosystem, while being a drop in replacement. And it isn't even in Alpha at this time. They don't advertise to use it yet, they are still building the features. It is not at the level of Jai because Jai is at a later stage.
@zocker1600
@zocker1600 Ай бұрын
lol this dude is complaining about Windows being trash for 20 minutes straight and then blaming it on zig
@almighty1984
@almighty1984 7 ай бұрын
Swedish keyboard layout also requires two keys to make a semicolon. I prefer using the US layout and pressing Ctrl+Alt+Q/W/P for Swedish characters because I use them a lot less. Anyway, enjoyed the video.
@Cakez77
@Cakez77 7 ай бұрын
Thanks Bro
@BDainis
@BDainis 7 ай бұрын
Entertaining video Cakez. I would add time markers for easier jumping around, but otherwise very well done! 8/10
@AhmedSLilah
@AhmedSLilah 19 күн бұрын
Honestly it's partly his fault for using VS Code it's a piece of shit
@havocthehobbit
@havocthehobbit 7 ай бұрын
C AND C++ are the worst at library consumption and build commands . Zig appears to be better but is still a headache at times . Rust ,Go and Javascript won me over on those and made me feel like a genius in comparison when it comes to those aspects . Zig and C is easy to write code from scratch but bloat for getting started is a machine . Plus I always hate setting up C++ on a new system and starting new projects that need external libraries , even just buiding Boost one of its main libraries is a mission. I can write a whole Rust program in the time it take just to setup C++ new projects .
@Cakez77
@Cakez77 7 ай бұрын
Yeah, libs in C and C++ just suck, so many different build systems. That is why I enjoyed JAI so much
@AdamPoniatowski
@AdamPoniatowski 4 ай бұрын
10 min of OS/IDE skill issues... funny still. I had zero issues on linux and nvim.
@vercolit
@vercolit 3 ай бұрын
I felt the same way about the zig extension autoformatting by default. Who thought this was a good idea?
@Kapendev
@Kapendev 7 ай бұрын
We already have 'Better C'. It is called D and it rocks!
@Cakez77
@Cakez77 7 ай бұрын
Okay, sounds like something I should try too
@FlanPoirot
@FlanPoirot 6 ай бұрын
where is D a C alternative? it has a garbage collector in, most of the ecosystem depends on said garbage collector as well. for it to be a C alternative it has to be manually managed and to have a minimal runtime
@Kapendev
@Kapendev 6 ай бұрын
@@FlanPoirot My game does not use the garbage collector because it is optional. For me it works. It looks like C, it has slices (pointer + length), it has modules, it has good meta-programing, variables are zero initialized by default and other nice things like that.
@FlanPoirot
@FlanPoirot 6 ай бұрын
@@Kapendev yes I'm aware, but I'm saying it there's a reason why D failed to catch on, it made the grave mistake of defaulting to a garbage collector. if it did not I think it's likely that it would be big by now
@Mariuspersem
@Mariuspersem 2 ай бұрын
Dont worry, I think everyone who started with Zig has had all the same problems :D
@kuklama0706
@kuklama0706 3 ай бұрын
All hail zig
@Cakez77
@Cakez77 3 ай бұрын
Lol
I Tried JAI, Can It Replace C++?! (Programming Language)
21:05
Officer Rabbit is so bad. He made Luffy deaf. #funny #supersiblings #comedy
00:18
Funny superhero siblings
Рет қаралды 13 МЛН
Incredible: Teacher builds airplane to teach kids behavior! #shorts
00:32
Fabiosa Stories
Рет қаралды 11 МЛН
Офицер, я всё объясню
01:00
История одного вокалиста
Рет қаралды 5 МЛН
My Zig Experience | Prime Reacts
38:13
ThePrimeTime
Рет қаралды 151 М.
The Vlang Drama
43:35
ThePrimeTime
Рет қаралды 101 М.
I Made Terraria In JAI (Programming Language)
19:20
Cakez
Рет қаралды 11 М.
Odinlang Creator Ginger Bill Talks Odin!
51:05
ThePrimeTime
Рет қаралды 82 М.
Why I Write C++ Like it is C | Cakez Reacts
23:16
Cakez
Рет қаралды 3,6 М.
Will Ada Replace C/C++?
44:57
Tsoding
Рет қаралды 92 М.
P99 CONF - Zig vs Rust
55:01
ThePrimeTime
Рет қаралды 75 М.
Optimizing my Game so it Runs on a Potato
19:02
Blargis
Рет қаралды 599 М.
Blazingly Fast Greedy Mesher - Voxel Engine Optimizations
23:35
Проверил, как вам?
1:01
Коннор
Рет қаралды 1,2 МЛН
Смартфоны через 10 лет
0:12
История одного вокалиста
Рет қаралды 329 М.
Китайцы сделали телефон БАЯН
0:14
Собиратель новостей
Рет қаралды 1,5 МЛН
The BRIGHTEST Phone Flash In The World
0:46
Mrwhosetheboss
Рет қаралды 33 МЛН