I was lucky to work with one or two people like Tsoding in the past who learned super quick by just jumping in and trying stuff. That's what I used to do as a kid when I learned Basic and assembly on 8 and 16 bit computers, but somehow lost my way after going to college and becoming a professional dev. Watching people learn like this is helping me to recover that healthy and practical mindset.
yeah i think the tendency is for it to get HARDER for us to see simple direct solutions the more time we spend looking at and reasoning about the 'professional' (pathologically indirect) versions. Abstractions in your head, preventing you from accessing less abstract pictures of the system at hand.
@@homelessrobot exactly! It doesn't help that a lot of people we meet on the job tend to obsessively add extra layers of abstraction and indirection, to the point where it can be hard to get promoted if you don't go along with it. I left my last job because I was tired of simple PRs taking weeks to get merged because one or two "architecture astronauts" would keep asking for more interfaces and factories etc.
We knew it all along, but the fact that you received a $300 donation and donated it to Ukraine given the current situation with payments and donations to Russia just highlights what a genuinely great guy you are. I appreciate the effort you put into streaming and learn a lot watching you code. I hope the situation over there is okay for you.
The compiler errors are one of my biggest complaints with Zig. They are often time very obtuse and not pointing at the right thing. Makes learning the language harder I agree. Thankfully it's on the roadmap and will be improved.
true but one good thing is that error propagate and you get a precise stack trace of where it went wrong. Which is better than "program aborted with error code ##"
i think at some point he kinda checked out and stopped reading error messages, there was couple where he just ignored output) that line from "paint.zig" was totally usable, he just needed to change target file for compilation. but yeah, onboarding could be a little better. thing with arbitrary error names i believe is good, errors in zig are just values, and declaring them at the same place where you use them eliminates a lot of boilerplate (for people who want to be explicit with errors there is a mechanism too)
I really appreciate the way you approach things. It's especially helpful when you show yourself figuring things out live on stream, because I feel it gives us a more thorough understanding of the tools you try out and the problems you aim to solve. Thank you! Edit: I like that Zig lets you include a C file effortlessly without polluting the global namespace. Very cool
Haven't watched in months, coming back it seems you're much more comfortable on stream and have generally become more entertaining. Keep up the good work! subbing.
Same, being a system administrator python and bash scripting have become a thing I used once a month then once a week and now daily, I'm not a programmer but I get caught in docs for hours I need to be more like tscoding... Just go for it haha
Same! Tho he should have read a little bit more documentation in the case. A lot of the things we struggled to do during the video were literally explained on the screen ate various points and he simply skimmed over them. Writing as you read is absoluely one thing, but he sometimes goes a little "Writing before you read" lol
it's a loooooot more efficient on the longer term, if you spend time on reading documentation. and by longer term, i mean already on the 1-2 day time scale, if you spend 1-2 hours on reading documentation (in 1-10 minutes chunks), you are likely to have already saved yourself more than 1-2 hours. but i understand how hard is it to achieve, if you have ADHD, which i do have and Mr Tsoding has an even stronger case of ADHD for sure.
I think the simplest solution to the bar collision problem is to just set the dy of the projectile to -1 when they collide to make the projectile always go up.
The reason it took 2 seconds to start up is most likely the llvm JIT engine waking up. Especially if you're already using the CPU for encoding 1+ seconds is pretty normal.
Cosplaying as Tom Scott lol. Keep up the good work man, you inspire me to be better and learn more. Always fascinating to watch your process in action.
@@bradywb98 it's predictable, he burned out, it got boring now he wants to work on a new and more exciting projects. He probably achieved the main goal, the reason of making porth and now .. well it just lays in the back. Probably until the better times
@@monsieuralexandergulbu3678 has he actually decided to just leave Porth entirely now? Last thing I had heard he had stopped streaming, but wanted to work on it offline. Wouldn't surprise me if he did drop the project though.
@@monsieuralexandergulbu3678 it ended on such a cliffhanger, with the typed pointers/variables/structures-trilogy. in my personal lore/delusion tsoding s still going strong and drops a big update in a couple of months.
I just smile when the info you seek is in second half of the first sentence you started to read but didn't finish. I try my hardest to at least read the part before the code snippet, because for some reason people don't put the important info in the snippet but above where it won't be copied over into your code... But I can totally see why you'd want to jump every 2 seconds, it's hard not to!
Actually I think the problem is not reading the document first. Since this language is still growing, there's no very friendly compile message like Rust. IMO, however, this language is strong. You can do many things at compiletime with `comptime`, which is more powerful than Rust's `const fn` and macros, and more readable than C++'s metaprogramming skills. It also has strict type system like Rust. Maybe I'll use it if Zig was not longer beta.
My thoughts exactly..it has great potential. But it needs to leave beta for me to use it. Do you know what's the timeframe for Zig to reach a stable release?
@@pietraderdetective8953 I think now is already a good time to start tinkering with the language, even just learning build.zig for your C/C++ projects can be a cool start. But the language won't be ready before end of 2024 and even that I'm not sure yet, I'd say 2025 the language will really start to be "production grade". Right now they are focusing on stuff that not a lot of people immediately care about but in the long run it will be of great benefit for the developer experience. Currently they are working on a set of different custom backend to become the default in order to improve the compilation time. They are also working on solving bugs. They are also integrating a Zig based C compiler for the traduction of C code to Zig, They are also replacing the Async implementation but I'm not sure if it's already there or not. Loads of good stuff happening, Zls is also improving a lot, and they have plan to improve it a lot more, Right now Zls doesn't play well with comptime evaluation but they have plan for this, But those plans also depends on the custom backends to arrive, because otherwise the features will be too slow to be usable. I'd say if you want to start when it's in a better place, you should keep a tab on when ZLS add's comptime evaluation this will probably improve the learning experience quite a lot in my opinion.
@@pietraderdetective8953 I think 1.0 is projected to arrive in 2025-2026. If you end up experimenting with it, `zig fmt` can be used to automatically fix some breaking syntax changes that are added.
I'm glad I'm not the only one to: 1. learn by trying; 2. complaining about how unintuitive things are; 3. feeling dumb that I can't do it as intuitively as I thought; 4. feeling dumber with everybody expecting me to read thousands of pages or millions of lines of code to get past "hello world"
@@etodemerzel2627 exactly, for example I really prefer the semantics of |type | identifier | assignment operator | value | semicolon | but there is objectively no intuitiveness to it one could argue that | identifier | type | assignment operator | value | no semicolon | is more intuitive and that would be equally correct.
Just out of curiosity, why the hate for Rust? Or was it a joke? I was thinking of giving it more attention after I played with it for a couple of weeks a year ago. Should I waste my time?
Great fun! BTW - I tried to use your code with the latest version of Zig (0.11.0) but found a few breaking changes - presume this is what one would expect for a language which is evolving or maybe a language for maintaining software causes one to maintain software?
ZIg syntax is still in flux because it has not hit 1.0. `zig fmt` can be used to automatically fix some small syntax changes that have been made. It is a good reason to put off using it, though I hope you'll come back to check it out once they pin that 1.0 release. No breaking changes will be allowed in minor releases or revisions after that.
Hi Tsoding. As I Saw, you have implemented a Lot of interesting stuff in your Channel. I am creating a simple database (based on sqlite) in my own, as a personal project. That Said, I think that would be a great idea If you make a serie of making a serie of "implementing a database from scratch" in your Channel.
57:59 wouldn't a function that returns an array with those values work? I'm pretty sure there's also some way to make Zig execute the function at compile time.
You found the solutions in less than 30 minutes (which I couldn't for a week) and you call yourself stupid. Man, you're one of the most efficient programmer I've seen. Don't underestimate yourself
I love languages where they really insist variables must be initialized at literally the very line they are declared in but then they provide "undefined" to initialize them to. This is what happens to your brain when you think if only we wrote more keystrokes then we wouldn't have any null pointer dereferences.
Brilliant job as always! Might I ask you, I see you use emacs instead of vim, any reason behind? Also I really like your desktop environment setup, minimal and highly efficient, what kind of distro is that and which desktop environment? Thanks a lot! Keep the good stuff happening :)
I like compiler for ricv and does the thing you said. If you make a mistake like parameters it gives you suggestion which one to use. Compiler can know best and could be neat if it would give such suggestions. I think they added that for people who use arm so if you try to use arm registers and instruction it suggest you riscv ones.
The more normal hello world would be const std = @import("std"); pub fn main() !void { std.debug.print("Hello, World! ", .{}); } I think the version you saw was intentionally noisy just to illustrate more language features.
some parts aren't really intuitive I'll give you that one, but the project seems to be on track to be a potential real C replacement. But in the long run I think it's going to be a very solid language.
@@chrboesch I use zig, it's amazing, but it's isn't as simple and intuitive as C, not that it's a big deal once you get past it, but that's still a real issue of the language, It's on the roadmap to improve, but the compiler is still very much unhelpful, the compilation speed is ok, but the llvm backend is super slow (not really a zig thing tho) So no it's not an unqualified comment, I've used it enough to understand it's state, and It's not production ready, nor does it claim to be. There is still a lot to be done, but if the project maintains it's objective of replacing C while not becoming as bloated and horrendous as Cpp than It's surely going to be the next C, and that's why I'm using it already.
At current state it's unfortunately unstable, last night I spent hours trying to get Zig to accept input from user, only to find out the method from available tutorials have been deprecated. Maybe i'll revisit Zig next year when it has become much more stable.
Just finished the video, very interesting how Tsoding's experience with Zig is similar to mine! It would be interesting when Zig has reached a stable release.
Look ma, somebody have no switch flipped. No test take is hilarious. Good luck driving a car with testless code. Modern gamedev seems taking booking's approach seriously and what a kind of a mess we have.
dislike. Compiler doesn't know what crap is in your head. Tests are important for testing what you did. Programming is not only about one-liners and simple one-file games. Maybe you're good videoblogger, but you're newbie at programming. You lost me at 18:52
I don't understand why people cannot have reasonable opinions. It's either "cover everything with tests! 100% coverage!" or "you don't need to have tests at all!". Where's the damn middle ground?
@@etodemerzel2627 well the reason behind those two opposite sides of the same scale is the dumb managers. First are those who want to reduce cost while developing something new (go-go-go, we need to release MVP next friday or we're dead!), second are those who want to reduce dependency on developers (I want to fire that ugly guy and replace him with this new cheap guy, we have no risks here, we have 100% test coverage, right?). As a developer I use tests for mainly two cases, out from the tip of my head. One, if I don't know how to do it yet, but I know what the system should look like, the API, the behavior, maybe known values for the given parameters - I can create a bunch of tests before actual coding, and then it's usual TDD, test-driven development. Other, when I don't want to visit THAT part of the code often, I can cover it with tests and forget THAT part. If something goes wrong, the tests will tell you that it's time to look into that part again. Or tweak your new shiny changes..
1:14:13 The inference goes from the right side to the left side on assignment. ex: `const i = @floatToInt(i32, 1.0)`. In later versions it's fixed as suggested such that `const i: i32 = @intFromFloat(1.0)` now works.
think of it as "explicit" rather than "verbose". the idea is that as a programming language, Zig can be useful in contexts where you don't even have stdout, or certainly don't want to have it by default.