More Zig Learning
HTML-код
- Опубликовано: 4 сен 2024
- LIVE ON TWITCH: / theprimeagen
Become a backend engineer. Its my favorite site
boot.dev/?prom...
This is also the best way to support me is to support yourself becoming a better backend engineer.
Get in on Discord: / discord
Get in on Twitter: / theprimeagen
Got Something For Me to Read or Watch??:
/ theprimeagenreact
Static reflection (the way you can iterate other the fields of structs) is useful for generic programming. For example if you want to print/serialize nested structs, you could just create a function in zig that would print/serialize any struct. This is very powerfull and very usefull. You can check the json functions in zig std library, in which you can read a json file into a struct containing all the fiel expected.
Try writing annotations in any language that support them. Reflection becomes a must
"I feel like I havent run into needing reflection ye" write a serializer/deserializer *cough* type safe json operations instead of dictionary and then manually moving things in/out of it *cough*
Make sure zls is same version as zig if you're seeing language server issues.
zvm is useful on this front.
Everything is more an object or array.
What is the file that is being worked on and can be learned zig ?
Ziglings. It’s on github
search for ziglings
It’s a set of exercises called ziglings
@@henryangeles2413thank you!
An error occurred. Please try again later. (Playback ID: sIXz23skee-sKSLa)
It's later, can I try again now?
@@i-am-linjano
@@re_detach :(
One minute and 0 views
bro fell off
We are so back
same unoriginal comment as all the other bots
bro fell off
@@FlanPoirot same unoriginal comment as all the other bots
bro fell off
7 hours and 5 likes
bro fell off
Forcing things that don't change to be const is awful because constness is a contract. Nothing should be incidentally const because it encourages people to rely on constness that may be incidental.
- I don't know how exactly you're thinking of pointers, but it's wrong. `*` and `[N]` are _independent_ type modifiers: (pointer to) (N contiguous) whatever. Auto-dereference lets you treat them like a unit, but that's a fiction. (I'm with you in not liking `*` == `*[1]`. I think that was a mistake.)
- ZLS is a third-party project, with no official support from the ZSF. Given that, and that due to comptime it may have to execute arbitrary code to satisfy queries, it's actually remarkable how good it is.
- Please never try to think about the bit representation of values again. That was painful to watch.
- I will grant you, Ziglings does a poor job communicating what it is you're meant to do. I'm surprised at that.
Brother there’s a chill pill somewhere that you’ve forgotten to take
@@vvarhand3985 I am...confused. I wrote that comment with no emotion at all.
@@i-am-linja if so, then my bad. I mostly thought the comment about bit representation is unwarranted, he is learning after all
@@vvarhand3985 Ok, yes, I will concede that bit has an electrostatic charge. I do have a tendency to get frustrated at mistakes/misunderstandings in things I wouldn't even think to elaborate in an explanation. They set off from the wrong place following the wrong map, and I'm trying to pinpoint the exact coordinates where they diverged from the path.