LIVE - Exploring Effect, maybe game dev

English
MMaximilian Schwarzmüller
Computing/SoftwareVideo & Computer GamesInternet Technology

Transcript

00:00:00Thank you.
00:00:30Hello, hello, everybody.
00:00:48Welcome.
00:00:49Let me fix the camera.
00:00:54Welcome to another stream.
00:00:57No, I'm not pivoting to game dev, by the way.
00:01:00It's just something I enjoy.
00:01:02Basically, you could say for relaxing or to mix things up a little bit.
00:01:09And I did a stream two weeks ago where we also did, where I dabbled a bit with game development,
00:01:17a lot of vibe coding based game development.
00:01:22And I found that quite nice to be, I found it to be a nice side activity during a stream.
00:01:30But today is not primarily about game development, actually.
00:01:34But instead, I want to dive into the effect library.
00:01:38And I figured, why not bring you along for the ride?
00:01:44Now, I will say I actually have already played around with the fact a bit.
00:01:50It's not all brand new, but I'm definitely not an expert in it.
00:01:54So that's kind of the plan.
00:01:56And as always, just hang out, answer questions, have a good time, hopefully.
00:02:01That's the plan.
00:02:02So hi, everybody who joined.
00:02:05Got more people joining every minute.
00:02:06That's great.
00:02:09Welcome to the stream.
00:02:10It's been two weeks since the last stream, I think.
00:02:14So good to be back.
00:02:16And yeah, as I mentioned, today, I first want to dive a bit into effect, see what it is, why you may want to use it.
00:02:27And then maybe thereafter, a bit more game development.
00:02:33So we've got a question here.
00:02:35I want to get back into coding, but I'm just scared of making mistakes and overthink it a lot on starting.
00:02:40What advice can you give me to just look on the positive side of it?
00:02:45Yeah, I mean, always a boring excite, but just a boring advice.
00:02:51But yeah, just do it.
00:02:54Especially now with AI, I would say you have a great companion that can help, that can also get things wrong.
00:03:03Don't get me wrong.
00:03:04But I think if you want to get back into coding now with AI, you have someone to ask a lot of questions.
00:03:14So I think that may be easier than it was in the past.
00:03:18But yeah, I really would just jump into it.
00:03:20And hey, we all make mistakes every day.
00:03:23There is no perfect code, no perfect software.
00:03:26So don't let that pressure get you.
00:03:29Yeah, in fact, it's a good opportunity to dive in, I think, because in fact, recently got a new version, version 4.0.
00:03:39Or that version is now available in release candidate phase.
00:03:44And I think that's a good timing to check it out.
00:03:49Now, what exactly is a fact?
00:03:51And why would you want to use it?
00:03:56Excuse me, I just got something in my throat.
00:03:59That's the question.
00:04:01I think effect has, for me, three main advantages.
00:04:07So I'm not an expert in effect, as I mentioned, but I've been using it.
00:04:13I read quite a bit about it.
00:04:14I had a look at the doc.
00:04:16So for me, I see three main advantages with effect.
00:04:23The first one is better typing, especially for errors.
00:04:31So if you use or if you write TypeScript, if you're writing TypeScript code, right, you, of course, do we have some type good snippets?
00:04:42You, of course, know that you have return types and so on.
00:04:48So you can type your parameters and the return type can be inferred.
00:04:52So we know what goes into a function.
00:04:54We know what comes out of a function.
00:04:56What we don't know is what could go wrong, which errors we expect from a function.
00:05:02And why do we expect errors from a function?
00:05:05Well, because we do stuff like interacting with the file system.
00:05:08If you interact with the file system, there's a bunch of stuff that can go wrong, missing files, locked files.
00:05:16So there are expected errors for certain operations.
00:05:21If you were sending HTTP requests, there also are expected errors.
00:05:26And for those expected errors, that's the important part here.
00:05:31For those expected errors, you get better typing.
00:05:34Now, why would that matter?
00:05:37Especially now with AI, my experience, and I think the experience of many developers is that you want to give AI a lot of rules and guidelines.
00:05:49You want to use linting, automated tests, of course, manual testing, but you want to give it stuff that it can do on its own to ensure that its code is correct.
00:05:59So again, automated tests, linting, but also types can help a lot, type checking.
00:06:06So it's great if we know what goes into a function.
00:06:09It's great if we know what comes out of a function, but it also helps if we know which errors may happen, the expected errors.
00:06:17So that's one advantage, and we'll see that in action in just a second, but that's one advantage, the better typing we get for expected errors.
00:06:25The second advantage I see when using a fact is dependency injection.
00:06:33It has a rich, powerful dependency injection system, and that is something you don't have to like, and obviously you don't have to use a fact,
00:06:41but it is something that can, in my opinion, help with writing cleaner code, have a nice flow of your program, if you want to call it like this.
00:06:50And again, I'm coming heavily from the AI coding perspective here because, and I don't want to open that entire discussion again,
00:06:59but this clearly for me and I guess for many others is the future AI assisted coding and AI writing more and more code.
00:07:07And in order to ensure that the code AI does right is as good as possible, you, as I just said, want to give it many rules and not just about the types,
00:07:22but also about how code is connected, how different parts of your application are connected.
00:07:29And in fact, it's like a little framework that comes with a lot of expectations on how data is passed around, how things talk to each other and dependency injection is one key building block here.
00:07:41So that's another advantage I see here.
00:07:43By the way, this is coming from someone, me, who also liked Angular quite a bit, and Angular also had a very rich, powerful dependency injection system.
00:07:53Now, the third advantage I see with effect is it comes with a lot of stuff, a lot of helpers, a lot of things built in, and we'll see that.
00:08:05But if you take a look at the documentation, the V4 documentation, if you take a look at that, and we'll do that in just a second, you'll see it comes with error management and with requirements management.
00:08:17These are the two things I just talked about, errors and dependency injection, that is requirements management.
00:08:23But it also comes with logging stuff, with configuration stuff, helping you load and ensure a certain configuration, with scheduling,
00:08:34so that if you build an application that needs scheduling, you can use things from there, state management, caching, I mean, you can read yourself, right?
00:08:42There's so much stuff you can use, you don't have to use, but you can use.
00:08:46It's its own framework.
00:08:48And I found that, again, especially when working with AI, but I guess it would have been also been true if you worked the old school way.
00:08:58So this gives you a nice rule set, which can minimize the amount of mistakes that can be made, which does not mean no mistakes, but fewer mistakes.
00:09:08That is my opinion.
00:09:10So that was a lot of talking, but I think for me, these are the three main reasons for why effect can be useful.
00:09:17And with that, I just want to dive in and explore how effect code looks like and how you can use these features.
00:09:27And yeah, by the way, you're welcome regarding the advice.
00:09:32I think if skills come from learning through AI, you'll be replaced by AI pretty quickly.
00:09:36To stay ahead, you need to think beyond what AI can do.
00:09:39Otherwise, a basic AI agent will outpace you faster.
00:09:41Well, I think what you should do is use AI for learning in the sense of as an assistant, as a tutor, or as someone you can ask who's infinitely patient.
00:09:53That does not mean that you should accept everything blindly, AI tells you.
00:09:58That is, by the way, true for all aspects in life and even not just for AI.
00:10:02You should always think critically.
00:10:04You should try to understand the code if we stick to coding, AI suggests.
00:10:10You should critically question AI, but then it can be a powerful tool.
00:10:14Of course, it's not a powerful tool.
00:10:16If you just ask it for something, it gives you a solution.
00:10:18You take the solution, move on, and you don't question it.
00:10:20You don't understand it.
00:10:21That leads nowhere.
00:10:23Okay, so introduction.
00:10:26So let's say what they say about effect.
00:10:29Some of the main effect features include concurrency.
00:10:34Achieve highly scalable, ultra-low latency applications through effects, fiber-based concurrency.
00:10:40Concurrency model.
00:10:40Now, I did not touch on concurrency here.
00:10:44I guess we'll get to that as we go through the docs.
00:10:48Composability.
00:10:49Construct highly maintainable, readable, and flexible software through the use of small, reusable building blocks.
00:10:54That is something we'll see.
00:10:56And that is also basically, or to some degree, what I touched on here.
00:11:00It comes with a lot of stuff.
00:11:02And it gives you a nice flow, as I mentioned, or some rules on how that stuff should fit together.
00:11:08So that definitely makes it very powerful.
00:11:11Resource safety.
00:11:13Safely manage acquisition and release of resources even when your program fails.
00:11:18Not entirely sure what they mean with that, if they mean the error handling, but we'll see.
00:11:23Type safety and error handling.
00:11:24That is what I touched on.
00:11:28Asynchronous.
00:11:29Oh, that's a difficult word.
00:11:31Asynchronicity.
00:11:33You get what I mean.
00:11:34Write code that looks the same, whether it's synchronous or asynchronous.
00:11:37Yep, that's also a nice touch.
00:11:39Now, I will say, there are aspects here, like this one, which I think would have mattered more, a couple of months or a good year or so ago, because the amount of code that I guess many developers write has decreased a lot.
00:12:02So, code aesthetics or how, yeah, developer experience or how easy it is to write correct code or certain code may not be as important anymore as it was, I think.
00:12:22But, yeah, these are some advantages.
00:12:25It's weird.
00:12:26Oh, I mean, I think resource safety means probably the dependency injection stuff.
00:12:31Because it otherwise would be weird that it's not mentioned here.
00:12:36Okay, so that is that.
00:12:37So, why effect?
00:12:39And no worries, I will not read word for word through that.
00:12:43But here we can see basically what I meant before.
00:12:48We know what goes into a function.
00:12:50We know the return type.
00:12:51But then here they constructed an example, of course, a divide function, which, of course, can't work if the divisor.
00:13:01Is that the word?
00:13:02If that is zero.
00:13:03So, in that case, it would throw an error.
00:13:05And TypeScript on its own does not reflect that.
00:13:08There is no error type here.
00:13:10I mean, of course, error has a type.
00:13:12But the function signature does not tell us anything about which errors we may expect from it.
00:13:20So, when we call this function, when we use it, you will, yeah, I mean, you've all used TypeScript, or most of you have, I guess.
00:13:29You would know that, of course, you get type assistance regarding the inputs.
00:13:34And TypeScript would understand what divide returns.
00:13:36You could store that in a variable and move on.
00:13:39By the way, what's that?
00:13:39Is that clipboard?
00:13:43Oh, yeah, great.
00:13:44We have a playground.
00:13:45That's good.
00:13:45So, we have a playground.
00:13:46We can dive in.
00:13:47So, what we see here in the playground is, of course, that TypeScript understands these types, but it knows nothing about the fact that this could fail and with which error it would fail.
00:13:58And that is exactly what the fact fixes.
00:14:01You can import the effect class, I guess, or namespace from effect.
00:14:11And then from it, or the object, I should say, and then from it, you can import the effect type.
00:14:22Now, this looks a bit weird, effect.effect, but in the end, that's just a type.
00:14:27So, if we open that in the playground, we can see here that is a type, effect.effect is a type.
00:14:35And that type is a generic type, which takes three type parameters.
00:14:40So, in TypeScript, you can have generic types.
00:14:43And there, you have those type parameters to basically add more information to the thing this type is added to.
00:14:50So, this type here is, in the end, added to our function here.
00:14:56It's a new return type for the function, right?
00:14:59It replaced the old return type.
00:15:02So, we're saying now, this function is returning an effect, a value of type effect.
00:15:08And a value of type effect is a generic value.
00:15:12It is a value that has, in the end, three important pieces of information.
00:15:17It has a success case.
00:15:18So, that is the value we return if everything goes well.
00:15:23And that is the only information we have without effect, right?
00:15:27So, that success case, that is, in the end, the first type parameter.
00:15:32The second one, then, is the expected error.
00:15:36And that could be a union type if you have multiple expected errors.
00:15:40And the third one, that is the requirement.
00:15:42So, that is basically what should be injected.
00:15:44And that's the dependency injection system I was talking about.
00:15:49So, we have these types here.
00:15:52And then, in the function, of course, we have to make sure that we return a value of type effect.
00:15:57And therefore, the code in there changed, as you can see.
00:16:00It changed to basically check if B is equal to zero.
00:16:04Not sure why they rewrote it, but it's just a ternary here.
00:16:07But if it's zero, then we know that we want to fail.
00:16:11And since we always need to return a value of type effect, right?
00:16:15We say that we're always returning a value of type effect.
00:16:18We can't magically change the way TypeScript works.
00:16:20We can just change what we return.
00:16:23So, we return a value of type effect, but we return a value of type effect where that error parameter will be used or populated, so to say, by using the fail method on this effect object.
00:16:36So, fail is then just a method that returns a value of type effect, which we need to do, but it returns a value of type effect where the error is set, so where we have an error.
00:16:51And we just pass our normal error to fail.
00:16:54So, you can think of that effect value that is returned simply as an object, simply as an object, but an object which now has an error stored in it.
00:17:04So, if we know that we were successful, we instead can call succeed and pass our success value to it.
00:17:12And that success value has to be of that type here, right?
00:17:15So, it has to be a number.
00:17:16And for the error, it has to be of that type here.
00:17:22So, that then is a function that returns an effect.
00:17:27Now, when you use that effect type, you can't just call that function.
00:17:33So, if you try to call divide like this, I mean, you can call it, but that gives you an effect.
00:17:44But if you want to get the actual number, so, if you want to unwrap the success value, so to say, you need to call it with runSync.
00:17:53So, if you do that, runSync actually kind of looks into the object that is returned here and handles the error case and so on, but also gives you the success case by default.
00:18:07So, here, VL would be of type number because runSync unwraps that, gets us the success value.
00:18:16That's kind of the idea.
00:18:20Yeah, so, I'm also happy to be back.
00:18:23Thanks for the nice message.
00:18:25And again, I try to make it every Thursday, but yeah, unfortunately, there are some Thursdays where it just doesn't work out.
00:18:33And is this game going to be developed in TypeScript?
00:18:35Yeah, right now, it's not about the game.
00:18:36It's just about the fact.
00:18:37We'll see.
00:18:39This seems literally the port of the Scios Scala library for TypeScript.
00:18:43Yeah, I don't know that one, unfortunately.
00:18:44But I think it's very likely that we have similar libraries or even built-in mechanisms in other programming languages.
00:18:54I mean, in Rust, for example, we have the result type.
00:18:59And if I'm not totally mistaken, yeah, that is a type that also has kind of the same logic,
00:19:04that you have a success value and an error value, and you therefore have expected errors.
00:19:12Okay, so that is one of the key things where I think initially when the fact was introduced, that was the main thing, if I'm not totally mistaken.
00:19:21But again, nowadays, it has grown into so much more.
00:19:25But that alone, it may look weird, it may look redundant, but that alone can actually help write better code, better programs,
00:19:33because you have more information in your code, in your types about the things that can go wrong.
00:19:40And again, especially for AI, that can be super useful.
00:19:44So that is one thing.
00:19:48Now, we'll skip installation and dev tools.
00:19:50I don't plan on doing that here.
00:19:51Obviously, pretty straightforward.
00:19:55Importing, we saw that.
00:19:58I think it's more interesting to see what else we can do with the effect.
00:20:02Yeah, so again, here you see what I explained.
00:20:05So we know that creating effects, that is what is happening here.
00:20:11So we are creating effects here in these two lines, and both lines are creating effects.
00:20:18Just one effect that has an error and one effect that has a success value.
00:20:25So again, here we see succeed creates an effect.
00:20:29Fail creates an effect.
00:20:31So in both cases, we create an effect, but we create an effect that represents an error here.
00:20:40Error tracking.
00:20:41With fact succeed and effect fail, you can explicitly handle success and failure cases.
00:20:48Here's how you can rewrite.
00:20:49Yeah, we saw all that.
00:21:04Yeah, we'll take a look at error management soon.
00:21:08Yeah, and I think this is now interesting.
00:21:10The synchronous and the asynchronous effects, which we also have.
00:21:16So in JavaScript, you can delay the execution of a synchronous computations using thunks.
00:21:23And a thunk is a function that takes no arguments and may return some value.
00:21:27And that is near the pattern which effect uses here.
00:21:31So what you can do in effect is you can create effects with succeed and with fail.
00:21:41But if you want to put more complex logic into your effect creation thing, then you can use effect sync.
00:21:51So as an alternative to effect success or effect fail for now.
00:22:02Or, excuse me, effect success if you are sure that the operation will not fail.
00:22:09And then, again, you can, for example, perform a side effect in there and console log and still get an effect.
00:22:18So if you do that, you then have a function that returns an effect.
00:22:23It's an error function, so this value here gets returned, it returns an effect, and the returned effect in turn holds a function that will console log to the message.
00:22:32And it could, of course, do other things, too.
00:22:34It doesn't have to log to the message.
00:22:35It's just an example.
00:22:37Now, this example is here to show you that you can construct your own effects, and you don't have to use just succeed and fail, and that you can put more complex, or this is not complex logic, but you could put more complex logic in there.
00:22:52But what you get back, and that's the key takeaway, is you get back a program here, which on its own does nothing.
00:23:00So if what you get back here, interesting that it says any, it should not say any, I guess.
00:23:09It's not finding effect.
00:23:11Ah, it's still installing.
00:23:13Let's wait for it.
00:23:17Yeah.
00:23:18So what you get back here is, again, an effect.
00:23:21And just as before, with a succeed and fail, you have to run that.
00:23:25And that's really the key takeaway.
00:23:26Whenever you're using the effect library, no matter how you're constructing your effects, if it succeed, fail, sync, there are other ways, too.
00:23:34You need to then run your effect, to get hold of what's inside there, or, like in this case, to make sure that this code here actually executes.
00:23:45Because this code, this message code here, will not execute when this line here is reached.
00:23:51If I comment out this last line here, you will see this compiles, and there is no message down here in the terminal.
00:23:59That message only becomes visible once I comment this back in.
00:24:04Yeah.
00:24:05So now we see hello world.
00:24:07So an effect is also not executed until you run it.
00:24:13That is another core thing about it.
00:24:17Is this some kind of Redux sagas?
00:24:19It's a bit of that, I guess.
00:24:23As I mentioned earlier, there is so much stuff.
00:24:26And in fact, right now, or at this point, I would say it's a bit of everything.
00:24:31And I, again, I'm not an effect expert.
00:24:37So I've played around a bit with it, and I'm trying to understand it.
00:24:41And there are pieces which I do understand, but I'm not a deep expert here.
00:24:46So that's why I also want to dive into effect here today, together with you.
00:24:54And I totally see the point here, by the way, about what Chakra wrote.
00:25:00I've been meaning to get into effect for a while now, but it looks too much work and mental gymnastics.
00:25:05And I totally get that.
00:25:07And to be very honest, I think effect is so popular, or it's still a niche.
00:25:15But in that niche, I think there is some hype around effect because of AI.
00:25:21Because it's a tool, which I said, as I said earlier, which can help get better results out of AI because of all the rules, the strict rules it defines.
00:25:34We're just getting started here.
00:25:36These are just the basics.
00:25:37But as you build more complex programs, and as you potentially use all these features here, these rules kind of add up.
00:25:46And if you violate them, you get an error because it's all based on types.
00:25:51And that, of course, is great for AI because if AI gets an error, it has to fix it.
00:25:55Now, it can sometimes cheat and work around it, but it can also actually fix the code.
00:26:01And especially if you, like, give it the documentation, point it at documentation, stuff like that.
00:26:07And I think that's one of the reasons why effect is quite popular these days in a certain niche.
00:26:16I think if we would all have to write this code by hand, it may be less popular.
00:26:23And it sometimes reminds me of RxJS.
00:26:25Maybe some of you still remember RxJS.
00:26:31I don't know if there is a dark mode here.
00:26:34RxJS, of course, was heavily embraced by Angular back then in the old days, 2016.
00:26:45And for quite some time, it's only been in the recent years with the more recent versions of Angular that RxJS became more and more optional.
00:26:54But initially with Angular, you had to learn RxJS.
00:26:57And a lot of people hated that because the RxJS code was sometimes so difficult to wrap your head around and write.
00:27:08And there were foot guns.
00:27:11And, yeah, it was really a bit clunky and difficult at times.
00:27:15And I think it would be the very same for effect, to be honest, also because there are some similarities between the two, if it weren't for AI.
00:27:24That's my personal opinion here.
00:27:28But the key thing is that, of course, with AI, it can be a useful tool, I think.
00:27:32But, again, I'm still also experimenting with it.
00:27:35Is full-stack development still relevant to learn or is it outdated?
00:27:38No, it's not outdated.
00:27:39Full-stack apps still matter.
00:27:42And I would argue most applications, almost all web applications out there, need some kind of back-end.
00:27:49So they are, by definition, full-stack.
00:27:55Can I incrementally adopt or have I have to buy into the whole of effect ecosystem?
00:28:04So that's a good question.
00:28:07And I'm not experienced enough with effect.
00:28:11I've only been using it on greenfield projects.
00:28:16I believe buying into it everywhere is more powerful.
00:28:23But, therefore, obviously also not a solution for all projects.
00:28:27But that is my uneducated guess.
00:28:30And, yeah, I'm kind of programming old school here.
00:28:32I'm not really writing code.
00:28:34But we're taking a look at the code here.
00:28:36And, by the way, I mean, there is this entire discussion about should you read the code or not?
00:28:41And I'm pretty confident that we will read less and less code.
00:28:49But right now, for me, it's pretty clear that you still need to look at the code.
00:28:56Not all the code, not every single line.
00:28:58But you should still, or my belief at least, is you should still understand what's going on in the code base.
00:29:04And that's why I'm taking a look at the fact here and why I want to understand what the general idea is.
00:29:09I don't need to memorize all the syntax and stuff like that.
00:29:14But I want to understand what the idea is.
00:29:16That's something which is really important to me.
00:29:23I tried it yesterday with Gemini.
00:29:25It felt uncomfortable.
00:29:26That said, they said, effects makes error handling easier and more predictable.
00:29:30But the mental shift takes time.
00:29:33Is this a functional programming pattern?
00:29:38Functional programming.
00:29:40I'm not a functional programming expert, to be honest.
00:29:43So I would say, to me, it looks like it's heavily inspired by functional programming.
00:29:48But it's absolutely possible that I would get yelled at for that by functional programming experts.
00:29:54So I don't know.
00:29:58Now, again, this is not a deep dive effect course.
00:30:03But what is worth noting, of course, is that obviously things can fail when you use a fact.
00:30:08They can always fail.
00:30:09And the entire idea behind the fact is that you have better typing for these situations.
00:30:14And that is where effect try comes into play.
00:30:18Effect try allows you to wrap some code that could fail.
00:30:21For example, if you're accessing a file system, it's basically the alternative to sync, right?
00:30:27Sync is used if you have code you know won't fail to then produce an effect.
00:30:32Try is there to wrap code that may fail.
00:30:36And then you can pass an object to try, for example, to have the code that may fail.
00:30:43And then define your catch block, so to say.
00:30:46So it's an alternative to try catch in the effect world where you can handle that error that may occur to, for example, generate your own error, which then is part of that effect, which is returned.
00:30:58Because, again, effects are about clearly typing and managing errors.
00:31:04And then ultimately, of course, you can run your effect here with run promise because json parse returns a promise, doesn't it?
00:31:19I'm actually not sure.
00:31:31Oh, let's see.
00:31:38Let's wait for that to load.
00:31:47No, it's not.
00:31:49Why is that run promise here?
00:31:55Or is it simply because we want a promise, but why would that be?
00:32:03Oh, do they say that here?
00:32:09Why is it run promise?
00:32:13Because we used run sync, but does it have to be run promise for try?
00:32:16So that's the part where I'm also not sure because, as mentioned, I am not an expert here.
00:32:24Maybe we will learn below.
00:32:27What I do know is that with a fact, you can also, of course, handle asynchronous code with promise instead of sync.
00:32:38So sync is essentially for, as name suggests, synchronous code.
00:32:42And if you want to do something asynchronous and you know it will succeed, that's guaranteed to succeed.
00:32:48You can use promise like this, or, and then this will, so here, promise wrapped around the promise, returns a promise, can't fail, and try promise if it can fail.
00:33:06Now, I'm not sure why we had to use run promise there.
00:33:10Do run sync.
00:33:12Yeah.
00:33:12Let's try that.
00:33:16Was it here?
00:33:17No.
00:33:19This one.
00:33:25Where would I put code readability with effect?
00:33:32So I think readability in the sense of the structure of the program.
00:33:40I think, is quite readable with effect, once you got the hang of it.
00:33:45Now, the details of how you, I think for effect, for me right now, if I had to write all that code, that would be tricky.
00:33:55Because again, I'm far from an expert here, obviously, but I understand what the code does pretty easily.
00:34:03Obviously, because this is not difficult code, but even for more program, complex programs, I think the readability.
00:34:09The readability is actually not bad.
00:34:11The readability may be worse, which again, is why it may be interesting with AI.
00:34:17So let's try run sync here.
00:34:25Without a wait, then.
00:34:37Yeah, that just works.
00:34:40So I don't know why they had run promise here.
00:34:43Sync seems to be correct.
00:34:46I don't know.
00:34:50Yeah.
00:34:50Got another question.
00:34:59What do you think is worth to learn?
00:35:01Is it worth to learn web development with all this crazy AI evolution?
00:35:06Yeah.
00:35:06So I think the question simply is what learning web development means.
00:35:13Learning to code in general is changing drastically.
00:35:17And web development for me is still as interesting as it was in the past in the sense of being able to build web applications opens a huge world.
00:35:33Because the browser is the best place or one of the best place for building applications or as a target for applications because you can essentially share them with the entire world without any gatekeeping work.
00:35:50That's not true.
00:35:50There is Google and so on, but you don't have to go through some review process.
00:35:55Your potential customers can simply visit your website.
00:35:59They don't have to download anything.
00:36:01That is still amazing.
00:36:03Now, of course, what has changed is that it's, of course, easier for non-technical people to build software and websites to a certain extent.
00:36:15There still is a huge difference between building a little to-do app for your own, for yourself that runs on your system and building something that you plan on selling to customers, having to worry about database backups, having to worry about authentication and different ways your customers could exploit your service.
00:36:36So, there are levels here, and I think learning about how to build good software, not just web development, not just websites, that still matters.
00:36:49That's still important.
00:36:51But, of course, it's changing.
00:36:52But, of course, it's changing a lot.
00:36:55And I think as developers, clearly, we are writing less code.
00:37:01As I said a couple of minutes ago, probably at some point we'll also be reading far less code.
00:37:08I mean, it's already happening.
00:37:11It's more about architecting, about knowing where to steer the AI.
00:37:18And I have no idea how long that will stick around and if that will go away.
00:37:23Loved your Angular course years ago.
00:37:25It got me my current software, DevShop, back in 2020.
00:37:29I've been working there ever since.
00:37:31That's amazing.
00:37:32Congratulations.
00:37:33And thank you so, so much for the nice shout-out.
00:37:35I'm really happy that my course could help with that.
00:37:38And messages like this, honestly, they mean a lot to me because I started creating these courses to help other people to share the knowledge.
00:37:45And hearing that the course was at least a part of your journey to get this job, that makes me very, very happy.
00:37:55So, thank you so much for sharing.
00:37:58So, what is the effect thingy?
00:38:02Yeah, it's a library that can help with writing better programs, is my feeling.
00:38:12Oh, that's also, by the way, a good point.
00:38:14When programming with a framework like Laravel, I find almost no need to steer the architecture either.
00:38:20Yeah, I think that's a very good point.
00:38:21And I think effect is kind of the same.
00:38:27You use effect for kind of the same reason, though, of course, effect is absolutely not the same as Laravel.
00:38:34But I'm a huge fan of Laravel.
00:38:37Laravel, of course, is an amazing PHP framework.
00:38:40And one huge advantage of Laravel always has been that it's a framework.
00:38:48It has clear rules, it has a clear folder structure, and clear rules on how different building blocks are combined.
00:38:58And it has a lot of building blocks for essentially everything.
00:39:03Database setup or connecting different databases, queries, database queries through its ORM.
00:39:10It has mail support built in, queues, jobs.
00:39:16Laravel is amazing and always has been because everything is built in.
00:39:21By the way, just as for JavaScript, we would have Adonis.js.
00:39:24And I did a live stream on that, too, a couple of weeks ago.
00:39:27I'm not sure why that never got popular.
00:39:29But I think frameworks that have a lot of stuff built in are clearly better suited for AI than the default JavaScript ecosystem where everything is possible.
00:39:43And I think that's also the reason why all these AI models have been fine-tuned to have such strong opinions on using React, using Next.js and so on as default.
00:39:58Of course, you can use other technologies, but I think that's one reason why they have certain opinions, which clearly have been fine-tuned into them, I think.
00:40:09And it's also the reason why you need to do a lot of steering, especially if you want to deviate from that default stack, because there are no clear rules.
00:40:16And again, that is exactly one thing where I think effect can help to some extent.
00:40:20It's not a Laravel replacement.
00:40:23It's tackling probably a subset of what Laravel does.
00:40:28It's just so strange because what happens when the AI gets great at architecture.
00:40:37Also, why do people think this is just applicable to web dev?
00:40:40This will be the same elsewhere.
00:40:43Yeah, so I 100% agree with both points, especially the second one.
00:40:49I mean, as a developer, we are the first to feel the effects of AI, which is not great to some extent.
00:41:00It can be a great opportunity, too.
00:41:02And I find it quite exciting what's possible, but obviously it's changing our work, and we don't know where this leads.
00:41:12And what you wrote about the architecture is true, too.
00:41:14We don't know if AI in a couple of years will be good enough to just build everything perfectly.
00:41:20Now, there still are certain things which come to my mind where right now I would feel like I had a hard time trusting just the AI.
00:41:31It would feel really weird if an AI would entirely manage the application.
00:41:37I would hope that it got the database backup stuff right and so on.
00:41:42But I don't know where we'll end with that.
00:41:46I also feel like the architecture decisions are important, not primarily because AI can't do it, but because AI doesn't know which architecture we need.
00:41:58Because the architecture you choose for your software, of course, also depends a lot on the constraints you're dealing with.
00:42:09So, for example, cost constraints.
00:42:13I can build a queue on my own.
00:42:16I can use a queue service, for example.
00:42:19Now, that's not just a software architecture question.
00:42:22It's a system design question.
00:42:23But there are decisions where there is no wrong or right, but where it depends on the constraints.
00:42:29Now, obviously, AI could ask you for the constraints and then make the right decisions.
00:42:34But, again, I have a hard time imagining that I'm trusting AI entirely on that.
00:42:39Still, I probably also had a hard time a couple of years ago imagining that we would be where we are right now.
00:42:44So, I don't know.
00:42:45But if you decide that you leave programming because AI is taking our jobs, if that's your conviction,
00:42:56the question is which jobs will be better, because, as mentioned, accounting and so on, I'm not sure.
00:43:05AI is transforming all the jobs.
00:43:07I'm a strong believer that new jobs will emerge, but it's definitely transforming all the jobs.
00:43:15If you want to add guards with effect, it makes sense using IA.
00:43:21I may be stupid here, but what is IA?
00:43:26Or you mean AI?
00:43:29AI with effect is good, yeah.
00:43:31Angular MCP and skills is most important with Angular or else the AI generates a pile of garbage and bad practice.
00:43:36Yeah, that may very well be the case.
00:43:41Nowadays, with AI, is it normal for people to demand an app be developed in a day or two?
00:43:46I fear it is for many people.
00:43:50And actually, for some apps, I think it may be reasonable, depending on what developed means.
00:43:56Like, a very solid prototype or MVP, I think, depends on the app, obviously, but would be possible for many apps.
00:44:07But, yeah, I think the problem is that many people still have unrealistic expectations because they just believe what they read about 10 axing, 100 axing, and so on.
00:44:21Took a few Laravel courses, and to be honest, without AI, I'm not able to do anything except installing and configuring the settings.
00:44:27But with Agentic AI, I can build a complete full-stack app.
00:44:30Yeah, I think, so I personally found Laravel not that hard, but you had to spend a lot of time or quite some time at least to learn it, I agree.
00:44:42And I think, again, that's also the effect thing here.
00:44:46Writing that code, I'm not so sure, because you can end up with quite complex constructs.
00:44:54Because, I mean, you have stuff like this, where you deal with generators, and where you have to follow so many rules, and you're using some syntax, some features you may not be super used to, like generators.
00:45:13And I think writing that code could feel overwhelming, and to be honest, I'm not sure if I would build my apps with effect without AI.
00:45:23Because you definitely have to spend quite a lot of time getting into it to really build well-structured best practice effect applications.
00:45:35But understanding effect and its features, and then using that with AI, looks to me to be a good pattern.
00:45:45But again, I'm still in the early stages here.
00:45:50What architectures for back and front do you usually use?
00:45:54You mean tech stack?
00:45:55I use a lot of 10 stack start.
00:45:58I use BUN, I use, obviously, TypeScript.
00:46:06Nothing fancy there, to be honest.
00:46:08I try to use the same tech stack for most of the applications.
00:46:12And nowadays, I try to use effect to see how it works and to understand it better.
00:46:21How do I feel about inflated GitHub stars repositories?
00:46:24Yeah, I mean, to be honest, I never really cared a lot about that.
00:46:30The internet has changed in such a, I don't know, in such a weird way in so many areas.
00:46:39It's all hyped up, and it's all just hype.
00:46:43I'm a bit too old for that, I feel like that.
00:46:47Yeah.
00:46:48Never trust AI unless at least three frontier models say the same thing.
00:46:54And then verify with a senior dev before you trust it completely.
00:46:57Yeah.
00:46:58And I mean, with AI, it's also like, if you ask AI if the code is good,
00:47:05or if there is something that could be improved,
00:47:09it will always find something that can be improved.
00:47:11So, I don't know where we'll be in two or three years.
00:47:16And I mean it.
00:47:17But right now, it helps a lot if you're able to understand your code, your architecture,
00:47:30if you can steer AI.
00:47:34Yeah, I'm learning effect.
00:47:35So, I've been learning effect already a bit.
00:47:38But, yeah, I figured why not use a live stream to dive in a bit deeper.
00:47:44And, yeah, I guess at this point, so, we understand we can create effects in different ways.
00:47:49We can use effect succeed, exact fail, effect fail.
00:47:52So, we can use sync and try and promise to have our own little programs,
00:48:01our own functions wrapped in effect.
00:48:03And thank you so much for the subscription, Timoteo.
00:48:06So, we have all that.
00:48:09And then, I also mentioned or we saw that you need to run your program.
00:48:13So, if you create an effect like this, it doesn't do anything actually.
00:48:17You need to run it with run sync or run promise if you were using promise
00:48:21for it to actually have an effect.
00:48:24No fun intended.
00:48:28Now, what you also see a lot with effect is that you can use generators there.
00:48:37Now, as I say here, it's an optional feature.
00:48:40But, I'll be honest, in most of the code I have, right, I use that feature.
00:48:49The alternative would be pipelines.
00:48:52And, maybe I'll start with that because that makes it clearer why I use generators.
00:48:58The idea behind pipelines is that you can, that that's the functional programming part we had before,
00:49:05that you can chain effects together and have your values flow through multiple effects.
00:49:15So, let's see.
00:49:22So, for example, where do they have a good example?
00:49:36Yeah, I'm not sure if it's good.
00:49:38But, here, they simulate that they have an effect wrapped around some async value.
00:49:44So, here, it's just a promise always resolving to 100.
00:49:47But, of course, this could be an HTTP request, which then may yield a number or whatever.
00:49:53And then, let's say you want to transform that number and you have a helper function for that.
00:49:58Then, effect gives you a pipe function to pipe that together.
00:50:06So, you have your effect program here, the fetch transaction amount function, which then is the first argument because that gets piped left to right.
00:50:16And then, that value, that return value, or the value stored in that effect, I should say, so the number 100 in this case,
00:50:23will automatically be passed into the second effect here with effect map.
00:50:30So, this function here, which is not an effect, but which is, in the end, turned into one, you could say, with effect map,
00:50:37that is applied to the return value here.
00:50:40And that can be a bit, I think, confusing to read.
00:50:45And that is also what I mentioned earlier with RxJS.
00:50:49There, we also had that.
00:50:54Let's see.
00:50:56With RxJS, it was quite common that you also had to build pipelines.
00:51:05Nowhere is it.
00:51:06It's been a long time since I've been here.
00:51:08Yeah, with operators.
00:51:11So, that you also pipe stuff together.
00:51:13That was a typical RxJS pattern, which you needed quite a bit for a more complex operation.
00:51:18So, there, too, you got your HTTP request result, and then you had follow-up steps that would transform the data, that would maybe handle errors, run side effects, stuff like that.
00:51:33And it's the same here.
00:51:38And you can use this pattern, but I think it, yeah, it can be a bit annoying.
00:51:46But there is nothing wrong with it.
00:51:47But generators, whilst being kind of a niche feature, which I think not a lot of people use day-to-day, myself included, even before AI, I've not been using generators every day,
00:52:00can be used as an alternative to pipelines because generators are, in the end, you could say, functions that can pause execution, return a value, and then continue and return another value.
00:52:14So, they don't just return one value, but they can return multiple values, you could say.
00:52:18That's a generator in JavaScript.
00:52:20So, this is how you would write one, if you would want to write one, and each yield here is one value, and you would call next on your generator to get those values after each other.
00:52:41So, execution is paused after each next call, and you have to call next again to get the next value, so value one, oops, value one, value two, value three.
00:52:51And this is a pattern used by effect to kind of allow you to write nicer code.
00:52:57So, what you could do with effect is you can use effect gen for generator, pass a generator function, as you can tell by this star here, that is how you create a generator function JavaScript, pass that to effect gen.
00:53:12And then, in there, you can have your effect programs, like fetch transaction amount, which is this here, which returns an effect, what we saw before, you have that, you call yield like this, and you get that value, and then you can have your next step, your next step, your next step, and in the end, effect gen will make sure to call that next function to walk through that pipeline, so to say.
00:53:37Okay, and that simply is a more readable way, if you ignore the generator stuff, it's basically like async await, you could say, yield is like await, and this star here is like async.
00:53:50It's very close to what you may know from async await, and therefore, that is what I find more readable, and what I have AI right in my programs, if I'm using effect.
00:54:03So that's, that's the idea here.
00:54:06Yeah, but as you can tell, again, what I said before, I think writing effect programs can feel like a lot of unnecessary boilerplate, and I'm not sure if I would use it without AI, but with AI boilerplate is not that bad.
00:54:27It is extra tokens you're paying for, but it's not bad, it's not annoying for you, and the extra safety, the extra rules you get can be worth it, I guess.
00:54:41Before the AI hype, there were new frameworks every then and now, but it's been a long time since we last saw one.
00:54:47And why the new frameworks are not coming, any idea?
00:54:50So actually, there recently was a new framework, OctaneJS, which is a better React, that is kind of their pitch, I guess.
00:55:00And we'll see if that becomes more of a thing.
00:55:02Recently, there also was SolidJS 2 being released or in beta, I think.
00:55:09So there is, there are things happening here.
00:55:15But I mean, clearly, back in 2019, and so that we were still trying to figure out how to make our life as a developer easier when it comes to building applications or harder, depending on how you look at it.
00:55:34But that is why there was a lot of innovation regarding libraries and frameworks.
00:55:39The goal always was to give us better tools to build better applications that ideally have better performance, maybe are smaller and so on.
00:55:49Nowadays, where all the focus is on AI and where less code is being written, of course, it's less interesting to build frameworks because a lot of things you tried to improve, mostly the developer experience, just doesn't matter as much anymore.
00:56:11Now, you could still build frameworks to help with the rules, basically what a fact is doing.
00:56:17But of course, it's also harder to gain traction.
00:56:21Back in 2019, if you released a cool framework, you had people like me, obviously, but also many others, make videos about it, talk about it, and maybe people found it interesting.
00:56:34Maybe developers found it interesting, carried it into their companies, and therefore frameworks could get adoption.
00:56:42It was still difficult back then.
00:56:44I mean, React was still winning and so on.
00:56:46But nowadays, there is almost no visibility.
00:56:50If I create a video about a new framework, it will, yeah, it will not be super interesting to a lot of people.
00:56:58And I'll be honest, to me, a lot of frameworks or libraries also are not super interesting anymore.
00:57:05So I guess that's the long answer to this question.
00:57:09Can we have a link to the site?
00:57:11This is effect.website.
00:57:15Is that a library with utility functions like Lodash?
00:57:19It has a lot of utility built in, but I really see it as a framework that gives you clear rules on how to build your overall application.
00:57:28It's not just utilities you sprinkle into your code.
00:57:36Effect is not a software.
00:57:38It's a library or a framework for how you write your code.
00:57:42Or, yeah, as I just said, that may help you or that may help AI write better code.
00:57:49Do I have a plan on making a new course on Udemy?
00:57:52Maybe machine learning as you made Python course.
00:57:55I will still create courses on Udemy.
00:57:59I do have plans, but it will not be a machine learning course because I'm absolutely not a machine learning person or expert.
00:58:07So that's not the plan.
00:58:09But yeah, there will be new courses.
00:58:14Okay, but this is a good example for how you could build more complex, still simple, obviously, still dummy examples, but how you could build more complex programs.
00:58:23And if you've joined when I started the stream, if you've been around since then, you may remember that I said that effect is all about having clear rules about how your program is structured, how data flows through the program.
00:58:38And this is how we have clear structures on how we can pass data from one step to the other that we need to run our effects in order to run the code wrapped by them that they don't run on their own.
00:58:56There are there are a lot of rules here and that's that's really the entire idea behind the fact for me rules rules rules rules.
00:59:05Yeah, which can help AI.
00:59:07Again, the expected error stuff also super important.
00:59:11So as I said initially for me, a fact is about these expected errors and the better typing in general, but also about about the rules actually didn't say that here.
00:59:24It's all about the rules.
00:59:27That's also important, but also that it comes with a lot of stuff in the dependency injection.
00:59:31Now the expected errors, I mentioned that already.
00:59:33We saw that it is worth noting, of course, that you can still have unexpected errors in an effect program because you over looked something.
00:59:43Maybe maybe there is some potential error you didn't anticipate because of course, if you're reading a file and you just don't expect an error.
00:59:55That's a mistake by you or your AI.
00:59:57So that would be an error you could expect.
01:00:00But there may be situations where you don't expect an error.
01:00:06But to be honest, in most cases, all cases, I'm not sure that that would simply be bugs, because in theory, for any program you write, you can expect you can know all errors that could occur.
01:00:23But some errors may of course be so rare or simply happen due to some bug in your program that you don't expect them.
01:00:32So it is possible that your effect code declares something as success that still fails.
01:00:44In this example, that's actually not the case.
01:00:47Because instead they're using effect die, which is a built in method to have the program crash kind of.
01:00:53And that is then a so called defect.
01:00:56If code that you marked as will succeed fails, for example, that's a defect.
01:01:05It's an error that you didn't expect.
01:01:08And that can happen too.
01:01:17Now, let's see.
01:01:20Yeah, this one, you can wrap your code.
01:01:28Or you can use in your code in your pipeline here, they're using that catch defect, which essentially is like an old school try catch around your code, basically as insurance to catch any errors you didn't anticipate.
01:01:41But of course, one problem you'll have with that is that defects by definition are unknown.
01:01:50So the entire idea behind expected errors is that you have proper typing, that you know the types of the errors that may occur.
01:01:59And therefore you can continue in your program.
01:02:01You can write code that properly handles these errors because you know the types.
01:02:05For unexpected errors, you don't know them.
01:02:07So it may not be clear how you can continue if you don't know exactly what happened.
01:02:12And therefore you can still catch them to prevent your program, your website, whatever from crashing.
01:02:21But you may not have a clear path forward.
01:02:24So long story short, you of course, want to try to predict and expect as many errors as possible.
01:02:34But there is code you can add to also handle the unexpected errors, but you can, of course, not handle them as cleanly as the expected ones, which I guess should make sense.
01:02:50Now, the requirements management part is another interesting part.
01:02:53That's the dependency injection part, where the idea is.
01:02:58So the effect type has these three type parameters.
01:03:02And the third one is this requirements parameter.
01:03:04And the idea is that effect cannot just help you with typing and all these rules, but also with, as I mentioned before, the flow of data.
01:03:14And for example, by injecting values or objects and so on into your effects.
01:03:22So let's see, where do we have an example?
01:03:26So here they are declaring the service.
01:03:32Yeah, I mean, here we can, here it is in the end.
01:03:44Let's run this so that we have the types.
01:03:47What courses can we expect in Udemy?
01:03:53I don't know yet, to be honest.
01:03:54I'm not working on one right now.
01:03:57Is it a good idea to learn C++?
01:04:00Or I may soon be working on one, but I don't want to share it yet because I'm not sure if I, if I'll release it, if I'm happy with it.
01:04:10Is it a good idea to learn C++?
01:04:12I mean, in general, I would say you should learn what you personally find interesting or where you have concrete jobs that you want to apply for.
01:04:28But learning to code, of course, in general changes.
01:04:32So yeah, I would still say learn C++ 100%.
01:04:34It's one of the most important languages out there.
01:04:36But learn it such that you understand it, that you can read it, that you understand important concepts.
01:04:49And I think that is more important than being able to, to write, to write it, which does not mean that you don't.
01:04:58So it's really hard to phrase this because you should understand it and understand it means really understand the best practices, the patterns, the pitfalls.
01:05:06And that was always the difficult part, but I think that has to be the focus now that you can identify bad C++ code that you can, that you know what to ask for when talking to AI regarding which code it should write, which pattern it should use.
01:05:26But then still, yeah, C++, C++, I think still is a good idea.
01:05:31And yeah, you're welcome regarding the answers and thank you so, so much for the very nice feedback.
01:05:38It means a lot to me.
01:05:40So here now, we have a class which extends context service, which is coming from effect.
01:05:48That is how a service is defined and a service is simply an injectable thing.
01:05:54Now, this is just a dummy class, doesn't do anything here.
01:06:01It has, so it says that it should have a next method, which returns an effect, but that's actually not implemented here.
01:06:17And I hope I'm, I hope I'm still online, got a connection warning, but I hope it's still working.
01:06:28I'm not sure why this code has an error here.
01:06:34I think that is correct, actually.
01:06:37But anyways, what's happening here is that yield random, of course,
01:06:43is, is pointing at that class here, but it's not instantiating it.
01:06:57It's not, it's not, it's not new random.
01:07:06So what this expects to happen is that behind the scenes effect instantiates it and provides it.
01:07:16So that random gets this, this instance of the class, which has this next method.
01:07:22And that is indeed what happens here.
01:07:23And that is dependency injection in the end in action here.
01:07:29Now, why would you do that?
01:07:35Well, again, to have a, to have a certain way of writing your code.
01:07:43And let, let, let effect, for example, deal with the instantiation of your values and of providing them.
01:07:54And it's a bit difficult to explain, to be honest, in, in a made up example like this, because the true power really only becomes visible in more complex programs.
01:08:07So for example, there is this project or library called Alchemy, which is a infrastructure as code project.
01:08:19which also uses effect effect for defining infrastructure and program logic in code.
01:08:28So you can create Cloudflare or AWS resources here with code, with effect code.
01:08:34And I'm saying that because this is interesting, because in here, let's see, do I find a more complex example?
01:08:55Give me a second.
01:08:56Give me a second.
01:08:56I want to find an example where we can see dependency injection really well.
01:09:02I want to find a more complex example.
01:09:03I want to find a more complex example.
01:09:03I want to find a more complex example.
01:09:04I want to find a more complex example.
01:09:05I want to find a more complex example.
01:09:06I want to find a more complex example.
01:09:07I want to find a more complex example.
01:09:08I want to find a more complex example.
01:09:09I want to find a more complex example.
01:09:10I want to find a more complex example.
01:09:11I want to find a more complex example.
01:09:12I want to find a more complex example.
01:09:13I want to find a more complex example.
01:09:14I want to find a more complex example.
01:09:15I want to find a more complex example.
01:09:16I want to find a more complex example.
01:09:17I want to find a more complex example.
01:09:18I want to find a more complex example.
01:09:19I want to find a more complex example.
01:09:21I want to find a more complex example.
01:09:32I guess that's it's really abstract.
01:09:42It's really abstract.
01:09:43I'm not happy with that.
01:09:45I mean, yeah, what one thing we can see here in this example is.
01:09:55Here we're expecting some job service.
01:09:57So something that helps us manage jobs in an application.
01:10:01And these jobs, so tasks in the end, are typically stored in some database.
01:10:11They have to be stored in some data storage.
01:10:13So for example, here using KV, which is a Cloudflare service, a key value service.
01:10:18And that looks super horrible, that code here.
01:10:20But in the end, what's happening here is this is just using stuff built into the
01:10:26Alchemy package here to, in the end, say, hey, I want to use that Cloudflare key value service for managing my jobs.
01:10:36And the great thing about dependency injection is that we can leave this code here as is and just swap that code here.
01:10:45Whoops, that code here, that defines the storage mechanism, so to say, we can swap that for something else, like here for Dynamo, for DynamoDB from AWS.
01:10:57And that code here will just continue to work if it's a compatible service because it's injected.
01:11:06So the idea behind dependency injection or one of the ideas is that your program code can stay the same, even if you switch implementation details.
01:11:19Because you just have to switch the service in the place where it's defined or where effect is made aware of it.
01:11:28So that you say, hey, effect, instead of using service A, please use service B.
01:11:33And as long as they are compatible, your program will continue to work.
01:11:37That is one advantage here.
01:11:39It's a bit abstract, maybe.
01:11:42But that is really one of the ideas behind dependency injection that you basically separate the place where you use something and the place where you provide it so that you can easily change what you provide without having to touch your main code.
01:12:02And that is also something effect has built in.
01:12:05Again, code can be a look can look a bit clunky, in my opinion, as you can clearly tell.
01:12:12So, yeah, this is how you can provide services.
01:12:14There also is another concept called layers, which is what we saw in the LKB example, which basically allows you to define dependencies in one place.
01:12:28And then it will it will be available downstream in your effect code.
01:12:36So across multiple layers of your effect code.
01:12:39But again, that would require us to quiet to dive quite a bit deeper.
01:12:43And I would not feel comfortable doing that because I'm not an effect expert here and I have not written super complex effect programs.
01:12:51I have seen quite a bit more complex effect code, but that does not make me an expert here.
01:12:57But the idea is that you can define your services or provide your services in one place and consume them in another.
01:13:04That's always the idea behind dependency injection after all.
01:13:08Will I make a Cloudflare course?
01:13:11Yeah, that is a course I would find interesting.
01:13:13Yeah, because I'm using Cloudflare a lot and I think it's a really great cloud provider.
01:13:18has a lot of nice building blocks for building applications, especially nowadays with AI, I would say.
01:13:30Okay, but yeah, so dependency injection can be a very nice feature for building more complex applications, probably to put it like that.
01:13:45I wonder if we take a look at that.
01:14:00The Go language, by the way, is a really good programming language, in my opinion.
01:14:10I know that a lot of people don't seem to like it, but it also seems to be doing really well with AI, which may be a big advantage.
01:14:23And I've always liked Go.
01:14:24I always found it's a great programming language, to be honest.
01:14:29So yeah, I can recommend working with Go, absolutely.
01:14:33But I've never been a hardcore language fan or hater.
01:14:38I have my core languages, which is obviously mostly TypeScript, and then it is also, for example, Go, or it used to be Go.
01:14:46Yeah, it's a good language.
01:14:48Do you have any knowledge why the Adonis.js JavaScript framework is not so popular?
01:14:54I have no idea.
01:14:55I always found it weird.
01:14:56I always found it weird that Adonis.js is not more popular, because in the end it is, it is Laravel for JavaScript.
01:15:06And Laravel is pretty amazing and pretty popular.
01:15:10And I can only imagine that for Adonis, it's a timing thing or anything like that.
01:15:17Maybe it was too early, too late.
01:15:19I don't know.
01:15:20But for some reason, React one.
01:15:25Maybe it is because it all moved into that single page application area.
01:15:30And whilst you still can build that with Adonis 2, it maybe was never, it was never just about that.
01:15:37So I don't know why Adonis.js isn't more popular.
01:15:40But yeah, here we are.
01:15:42Here we are.
01:15:45So some of these playgrounds here are a bit broken.
01:15:51Oh, reset does not reset the example.
01:15:56Yeah, that makes it quite a bit less helpful, unfortunately.
01:16:16Yeah.
01:16:17Yeah.
01:16:18Yeah, that's not too useful, I guess.
01:16:33And what we can see here, though, is that in the end, we got a service definition.
01:16:49And then we got our service provided here.
01:16:53And the provisioning takes the concrete implementation of a service.
01:16:58So which is based on that service class here in the end, with help of this layer thing.
01:17:05And here we build our logger then with the log method.
01:17:09But yeah, it's too bad that these examples seem to be a bit broken.
01:17:13So yeah, but dependency injection is also nice.
01:17:19If you want it or if you need it, it's a different question.
01:17:23It's just a pattern, a pattern embraced by effect.
01:17:26Now, what I do think is also quite valuable about effect, especially effect v4.
01:17:35I think, oh no, effect v3 also had it, is all that other stuff we're getting.
01:17:41So as I also said earlier, so that you can and maybe should build your entire application with, by heavily embracing effect, to put it like this.
01:17:55And that, of course, I don't know how well effect works.
01:18:00If you, if you instead take an existing application and try to add effect to it, that may lead to weird results.
01:18:08If you have the luxury of building a brand new application from scratch, then effect, I think can provide a lot of good guidance and rules.
01:18:20And then it has a lot of building blocks that you can leverage, like the configuration building block, which helps with the finding and parsing a config so that you can clearly define what configuration you need.
01:18:32So which environment variables you could say you're expecting.
01:18:35And you can then inject that into your application provided through the dependency injection mechanism, parse it with the built in method, use it again through dependency injection in your application.
01:18:51And then again, you have the nice flow.
01:18:53You have a, a clearly defined way of parsing or of loading your configuration.
01:18:59And you then have a nice way of accessing it in your effect program.
01:19:04So that you don't have to build your own helper file, which loads environment variables or you're accessing the same environment variable in five different files.
01:19:14And if you change the name or if you remove it, you have to touch five different files.
01:19:18Now with AI that all of course has shifted a bit, but still it's a nice pattern to have a clearly defined flow here.
01:19:25That's kind of the, one of the philosophies of effect.
01:19:31I would say as a built in logger in general, it has built in observability stuff so that it can help you.
01:19:40Guess what? Observe your program and so on.
01:19:45And then also more advanced features like it can help with, with scheduling.
01:19:50So if you are building a program where something needs to happen every day or whatever, there are of course dozens of ways of making that work.
01:19:59You could be using an external service, you could be using cron on the VPS where your program may be running, but you could also use, for example, the cron implementation of effect to have your timer, so to say your schedule in your effect program.
01:20:17Obviously that program that needs to be running to have that schedule be alive, but that would then also be a way of doing that.
01:20:26It has state management built in, can help with caching.
01:20:32I think concurrency is also something which they advertise as one of the main advantages, but that is something I totally have not looked into yet, to be honest.
01:20:46But they seem to also do useful things to hear.
01:20:51But again, that's not really something I have used too much because again, I'm still in early days here.
01:21:01But it looks like the kind of effect, for example, also helps you with creating a queue.
01:21:06If that's something your application needs.
01:21:09And again, there are always more options here, always options to do that without effect.
01:21:15The idea, I guess, is just to give you so many building blocks, so much stuff in there.
01:21:22You can also replace SOT with effect, by the way.
01:21:25They have their own schema implementation where you can define your schema so that you don't need a lot of other dependencies other than effect.
01:21:34That, I guess, is one of the ideas here.
01:21:37And I will say, besides all the rules and AI stuff, there is one other advantage of this approach.
01:21:42And that is that supply chain attacks are, of course, quite frequent these days.
01:21:50And also because of that, I'm a big fan of having fewer, not more, dependencies.
01:21:58So using something like effect, which can replace a lot of dependencies, also has that benefit.
01:22:05So, yeah, there is also that.
01:22:08Where can we use the effects library?
01:22:10I know the library is not a full framework, but it would be nice to know where we can use it ideally.
01:22:15You can really build it and use it in any especially non-client side application you're building with effect, with TypeScript.
01:22:27So not in the browser.
01:22:31I think it also works in the browser.
01:22:35It just might add quite a bit to your bundle.
01:22:37And I'm not sure if all the things work in the browser.
01:22:41The file system, for example, won't.
01:22:45But especially on the server side.
01:22:47And there, no matter which framework you may be using, you can use it with 10 stick start with Next.js.
01:22:54If you're building a CLI, if you're building a desktop app with Electron, you can use a fact there.
01:23:00For your main application logic, so to say.
01:23:05And there also is.
01:23:08What's the name?
01:23:09FoldKit.
01:23:10There also is a framework, a frontend framework built on top of effect, on top of the parts that do work on the frontend, of course, which would allow you to build single page applications with effect.
01:23:24But one problem I have with that is that at least the last time I checked, they clearly market this as a client side only framework.
01:23:36So essentially like just react.
01:23:37And I personally prefer using frameworks that are full stack that makes server side rendering easy because I don't want to have to wire up a lot of stuff there.
01:23:53I want things to just work.
01:23:55But there is this frontend framework and effect itself can be used with any backend framework, I guess, with any and with any full stack framework like like Next.js and so on.
01:24:08But yeah.
01:24:09There is so much more you could dive into, but I think we have we had enough effect for now.
01:24:24It's a weird.
01:24:25It's a weird.
01:24:26It's a weird.
01:24:27It's a weird framework to some extent.
01:24:28It's a weird framework to some extent.
01:24:31And I'm still experimenting with.
01:24:36With how good it is, really.
01:24:41My feeling or the first results I saw, it's a bit difficult to tell though, is that it seems to lead to better code written by AI.
01:24:56And I'm looking for anything that can guide AI into a clear direction.
01:25:04Earlier, Laravel was mentioned.
01:25:07It's a great alternative too.
01:25:09It's not JavaScript or TypeScript.
01:25:12But of course, you may argue that this doesn't matter as much anymore because maybe you're not writing too much of your code.
01:25:22So Laravel is a great solution too.
01:25:26And just to be clear, Laravel is not an alternative to effect.
01:25:30Laravel is just an amazing full stack web app framework in general.
01:25:36But just like Laravel is great because it has all these building blocks and all these rules.
01:25:43Effect, I think, can be great because it has a lot of building blocks and a lot of rules.
01:25:49And yeah, I think in the applications where I'm using it, AI is doing better than in the applications where I'm not using it.
01:25:59But again, I'm still in early testing here.
01:26:02And yeah, another frontend framework.
01:26:04But let's be honest, we had fewer of those than we used to.
01:26:08I heard effect has error as values like Go.
01:26:12Is that true?
01:26:12Yeah, that is true.
01:26:14It basically turns errors into return values.
01:26:20That is one of the key things.
01:26:22I think that is actually with what effect started a couple of years ago.
01:26:27I think that was its main thing back then.
01:26:30And nowadays I would say the main thing is more this entire, the clear set of rules about how your programs are structured and how data flows through those programs and so on.
01:26:45But yeah, that is effect here.
01:26:50So now I'm just wondering, I have around half an hour left.
01:26:57I could dive back into that game I was building, if you are interested.
01:27:12It is a vibe coded game or partially vibe coded.
01:27:17And I will have to figure out how it works again.
01:27:22Because it's been some time.
01:27:28Give me a second.
01:27:33Okay, so yeah, let's see.
01:27:44How can I play this?
01:27:45Was it dev?
01:27:48Localhost 5.1.
01:27:52Yeah.
01:27:53Yep, yep, yep, yep.
01:27:54So.
01:28:01By the way, I will not be building with effect here.
01:28:06And I had indeed enough effect for now.
01:28:08I'll instead continue working on that game here for the last half hour here.
01:28:20So what I was building here, and I just have to get back into it, was like a Brotato-like game.
01:28:26Where it attacks on its own.
01:28:28We have all these enemies, clearly.
01:28:30And it's browser-based.
01:28:31And clearly there are issues like, for example, that we're always facing the same direction.
01:28:36And that the counter up there is a bit blurry.
01:28:38And that I died.
01:28:39And that this texture is blurry.
01:28:41But yeah, these are things we can fix now.
01:28:46Just briefly before I dive into that.
01:28:49I feel like Angular view have been left behind.
01:28:51Do you think they will ever catch up?
01:28:54Yeah, so.
01:29:01Clearly React, I would say, has won to some extent.
01:29:07But then again, now with AI, I think those choices matter less than they used to.
01:29:15But yeah.
01:29:16I don't think they will catch up in the sense of they will have more downloads than React.
01:29:21Or yeah.
01:29:22That will not happen, I think.
01:29:24Okay.
01:29:25So, back to this game here.
01:29:28And I will be using AI again.
01:29:32Was I using Pi in here?
01:29:34We're building a game.
01:29:35Okay.
01:29:37Yeah.
01:29:38Okay.
01:29:39Let's add a new session.
01:29:45Yeah, we can give Grok a try here.
01:29:48How well it does, I guess.
01:29:50We're building a game.
01:29:52A couple of obvious issues to fix.
01:29:57Text in menu and counter.
01:30:01Is blurry.
01:30:03And.
01:30:06Enemies and player are not facing the direction.
01:30:11They're moving towards.
01:30:15Please analyze the code.
01:30:18In depth.
01:30:19And share your thoughts on.
01:30:21Where these issues are coming from.
01:30:25So yeah.
01:30:26Let's send this off.
01:30:28Max try Blender.
01:30:29It has a built in IDE, I guess.
01:30:31And you can create your game assets within the same app.
01:30:33I actually have used Blender quite a bit over the last years.
01:30:37To be honest, this year is just a little fun side project.
01:30:47And I deliberately want to see how far I can get here with just AI.
01:30:55And just vibing.
01:30:57And I will never release that game.
01:30:58It's just.
01:30:59It's just a little fun side project.
01:31:02For relaxing.
01:31:04And.
01:31:05It's especially nice also for streams.
01:31:07Gives me a chance to catch up with the chat.
01:31:10And yeah.
01:31:12That's just.
01:31:14The main motivation behind this game.
01:31:17I will say that Blender is.
01:31:22A pretty fun tool though.
01:31:24And I sometimes wonder.
01:31:27I mean with programming we can see.
01:31:31How AI is having an impact and what it's changing.
01:31:35But I feel like.
01:31:37I've played around with using AI with Blender.
01:31:42And it's really good there too.
01:31:44And I have no doubt that if you are a pro.
01:31:48You can do way more.
01:31:50Way better.
01:31:51With Blender.
01:31:52With AI.
01:31:53Than it can.
01:31:54But.
01:31:56I don't know.
01:31:57That may change in a couple of years.
01:31:59Just as it does for coding.
01:32:02And it definitely gives more people.
01:32:05An opportunity.
01:32:06To.
01:32:07For example.
01:32:08Produce game assets.
01:32:09So that's really fascinating.
01:32:10How far it has come there.
01:32:14Am I using compaction context summarization?
01:32:16I read somewhere that.
01:32:18If we output that as an image.
01:32:19It's more token efficient than text.
01:32:21Have you tried anything like that?
01:32:23I have it to be honest.
01:32:24I know there are a bunch of hacks.
01:32:25About which I read.
01:32:27That should be more token efficient.
01:32:30I'll be honest.
01:32:31I never know which of these hacks.
01:32:33Actually work.
01:32:34And what's just BS.
01:32:35I try to avoid compaction.
01:32:39Sometimes there is no way around it.
01:32:40But typically I try to keep my sessions short.
01:32:43And focused.
01:32:44And operate on an empty context window.
01:32:47Or on a fresh context window.
01:32:48As much as possible.
01:32:51Also because.
01:32:53I think it's.
01:32:54I'm not sure if it's been proven.
01:32:55But.
01:32:56I think many people feel like.
01:32:59Models.
01:33:00Don't get better.
01:33:01If.
01:33:02The context is like.
01:33:0450% occupied.
01:33:05Instead.
01:33:06They get worse.
01:33:07Obviously.
01:33:08I think.
01:33:09So.
01:33:09So.
01:33:10That is another motivation.
01:33:11For getting.
01:33:11Nowhere clear.
01:33:12And.
01:33:13Nowhere near.
01:33:14To compaction.
01:33:15You wanna.
01:33:17Yeah.
01:33:18You wanna stay in the zone.
01:33:19Where you have a fresh.
01:33:21Um.
01:33:22Uh.
01:33:23Context window.
01:33:28Uh.
01:33:29Just stopping by.
01:33:30To tell you.
01:33:31That I've done your flutter.
01:33:32Course.
01:33:33And in the middle of your react course.
01:33:34I think they're great.
01:33:35Enjoy your teaching.
01:33:36And then also enjoy your YouTube videos.
01:33:37And take some AI.
01:33:38Thank you so much.
01:33:39Means a lot to me.
01:33:40I'm happy that the courses are helpful.
01:33:42And yeah.
01:33:43That you like the videos too.
01:33:44I'm.
01:33:45Trying my best to hopefully.
01:33:46Um.
01:33:47Share helpful content.
01:33:49So.
01:33:50So much.
01:33:51And no.
01:33:51I'm not using.
01:33:52Grok sexy mode.
01:33:53Okay.
01:33:54So let's see.
01:33:55What are the issues?
01:33:56Um.
01:33:59Uh.
01:34:00Both issues are real.
01:34:01And come from missing render.
01:34:02Facing setup.
01:34:03Blah blah blah.
01:34:04Blurry text is probably.
01:34:05I would.
01:34:06I would guess.
01:34:07Blurry text is.
01:34:08Related to scaling.
01:34:09Let's see.
01:34:10This is.
01:34:11The text is a baked canvas texture.
01:34:13Your.
01:34:14Hot canvas.
01:34:15Are created at logical sizes.
01:34:17And never get a higher.
01:34:19Turner resolution.
01:34:20Uh.
01:34:21Assumes.
01:34:22The camera.
01:34:23Yeah.
01:34:24Okay.
01:34:25So we are scaling.
01:34:26And that makes the text blurry.
01:34:29Fixed direction.
01:34:30After assume is known.
01:34:31Call set resolution.
01:34:32On the timer and the overlay labels.
01:34:33Don't just bump font size.
01:34:34That changes layout.
01:34:35Okay.
01:34:36Character not facing.
01:34:37There is no facing code anywhere.
01:34:38Search for flip X.
01:34:39Yields empty.
01:34:40Uh.
01:34:41Okay.
01:34:42Yeah.
01:34:43And of course we.
01:34:43So the sprite sheet.
01:34:44I have.
01:34:45Of course.
01:34:46Um.
01:34:47Um.
01:34:48We just have one direction here.
01:34:49So.
01:34:50We can.
01:34:51Of course.
01:34:51Kind of flip that.
01:34:52But.
01:34:53That will just look weird.
01:34:54Um.
01:34:55Um.
01:34:56Um.
01:34:57We just have one direction here.
01:34:57So.
01:34:58We can.
01:34:59Of course.
01:35:00Kind of flip that.
01:35:01But.
01:35:01That will just look weird.
01:35:02Um.
01:35:03So we don't have proper sprites.
01:35:04For moving into different directions.
01:35:05But I have a skill that should.
01:35:06Allow.
01:35:07Grock.
01:35:08To generate images.
01:35:09Or any AI model.
01:35:10In the end.
01:35:11And.
01:35:12So.
01:35:13I have a skill.
01:35:14That should.
01:35:15Allow.
01:35:16Grock.
01:35:17To generate images.
01:35:18Or any AI model.
01:35:19In the end.
01:35:20I have a skill that should.
01:35:22I have a skill that should.
01:35:23Allow.
01:35:24Grock.
01:35:25To generate images.
01:35:26Or any AI model.
01:35:27In the end.
01:35:28But I have a skill that should.
01:35:29Allow.
01:35:30Grock.
01:35:31To generate images.
01:35:32Or any AI model.
01:35:33Through.
01:35:34Fall.
01:35:35So.
01:35:36Through.
01:35:37The fall.
01:35:38A.
01:35:39API.
01:35:40Which.
01:35:43Yeah.
01:35:44Does work.
01:35:45So this exposes.
01:35:46Various image models.
01:35:47So I could ask it.
01:35:48Can you create.
01:35:50Proper.
01:35:51Sprites.
01:35:52For.
01:35:53The other.
01:35:54Directions.
01:35:55Can you.
01:35:56Generate those.
01:35:57Images.
01:35:58I'm including those words.
01:35:59To make.
01:36:00To trigger that.
01:36:01Image generation.
01:36:02Skill.
01:36:02Which I have.
01:36:03Because I have.
01:36:04That skill here.
01:36:05Which in the end.
01:36:06Um.
01:36:07Contains.
01:36:08A script.
01:36:09That can be used.
01:36:10To use.
01:36:11To follow.
01:36:12AI.
01:36:13API.
01:36:14And we'll see.
01:36:15If Grock.
01:36:16Is able to.
01:36:17Properly.
01:36:18Request.
01:36:19Those updated.
01:36:20Sprites.
01:36:21It may fail.
01:36:22Because I'm not sure.
01:36:23If my.
01:36:24Image generation.
01:36:25Script.
01:36:26Allows for.
01:36:27Images as input.
01:36:28May offer.
01:36:29It may be hard.
01:36:30To generate images.
01:36:31Based on the existing images.
01:36:32But we'll see.
01:36:33Um.
01:36:34Yeah.
01:36:35Yeah.
01:36:36Exactly.
01:36:37With the.
01:36:38With the.
01:36:39Context window.
01:36:40Uh.
01:36:41You don't want to.
01:36:43Have too much stuff.
01:36:44In there.
01:36:45I fed some skills.
01:36:46To my.
01:36:47AI agent.
01:36:48Now it uses.
01:36:49Almost twice.
01:36:50The tokens amount.
01:36:51It was using before.
01:36:52Is there any way.
01:36:53I can balance this.
01:36:54So personally.
01:36:55I try to use.
01:36:56Only.
01:36:57A very.
01:36:58Small.
01:36:59Amount of skills.
01:37:00And I really.
01:37:01Really.
01:37:02Adjust my skills.
01:37:03To be concise.
01:37:04And actionable.
01:37:05And I think.
01:37:06That is important.
01:37:07I think.
01:37:08It's far too easy.
01:37:09To just install.
01:37:10A bunch of skills.
01:37:11Because somebody.
01:37:12Tells you.
01:37:13A skill is good.
01:37:14Let it.
01:37:15Write them.
01:37:16And never.
01:37:17Look at them.
01:37:18But I do.
01:37:19Look at my skills.
01:37:20And I really.
01:37:21Try to optimize.
01:37:22Them.
01:37:23So.
01:37:24Yeah.
01:37:25That I.
01:37:26Have a limited.
01:37:27Amount of.
01:37:28Very short.
01:37:29As short.
01:37:30As possible.
01:37:31Skills.
01:37:32Which harness.
01:37:33Am I using.
01:37:34This is pie.
01:37:35I'm using.
01:37:36The pie.
01:37:37Coding.
01:37:38Agent here.
01:37:39Potentially.
01:37:40Employers.
01:37:41Sent me.
01:37:42Your angular.
01:37:43And I declined.
01:37:44The offer.
01:37:45Cause angular.
01:37:46Sucks.
01:37:47But your tutorial.
01:37:48Was great.
01:37:49I'm happy.
01:37:50To hear that.
01:37:51It's better.
01:37:52That the job.
01:37:53Sucked.
01:37:54Than.
01:37:55That my tutorial.
01:37:56Sucked.
01:37:57Is there.
01:37:58Reason you.
01:37:59Whilst I'm.
01:38:00Vibing.
01:38:01The game.
01:38:02I do.
01:38:02Like to look.
01:38:03At some of the code.
01:38:04To understand.
01:38:05What happened.
01:38:06And.
01:38:07I'll be honest.
01:38:08I'm.
01:38:09I just like.
01:38:10Using.
01:38:11VS Code.
01:38:12For looking.
01:38:13At the code.
01:38:14I'm not really.
01:38:15Using it.
01:38:16To write.
01:38:17A lot of code.
01:38:18There.
01:38:19It's just really.
01:38:20Convenience.
01:38:21Herder.
01:38:22If I have.
01:38:23Multiple agents.
01:38:24Running.
01:38:25But for the stream.
01:38:26I mostly.
01:38:27Just work.
01:38:28With one agent.
01:38:29So.
01:38:30I can use.
01:38:31The terminal.
01:38:32Built into.
01:38:33VS Code.
01:38:34But even.
01:38:35If I'm using.
01:38:36Herder.
01:38:36And I have.
01:38:37Like four.
01:38:38Agents.
01:38:39To write.
01:38:40New.
01:38:41Vim.
01:38:42And everything.
01:38:43But.
01:38:44I'm just.
01:38:45So used.
01:38:46To VS Code.
01:38:47To the shortcuts.
01:38:48And stuff.
01:38:49I don't know.
01:38:50Just.
01:38:51Just really.
01:38:52What I'm used to.
01:38:53I've been your student.
01:38:54For eight years.
01:38:55Starting with your.
01:38:56React course.
01:38:57Wow.
01:38:58That's such a long time.
01:38:59That's really.
01:39:00Amazing.
01:39:01So cool.
01:39:02To have you here.
01:39:03Thank you so.
01:39:04So much.
01:39:05For stopping by.
01:39:06And saying hi.
01:39:07Do I think.
01:39:08Model capabilities.
01:39:09At the end.
01:39:10Of last year.
01:39:11And I will say.
01:39:12No.
01:39:13I don't think.
01:39:14I was right there.
01:39:15I think.
01:39:16Models.
01:39:17Are getting better.
01:39:18They make.
01:39:20Fewer mistakes.
01:39:21They are mostly.
01:39:22Also better.
01:39:23At following.
01:39:24Instructions.
01:39:25I mean.
01:39:26They do it.
01:39:27Really.
01:39:28Well.
01:39:28Now.
01:39:29To some extent.
01:39:30And.
01:39:31Now.
01:39:32I think.
01:39:33The next step.
01:39:34Is to.
01:39:35Get them to.
01:39:36To follow instructions.
01:39:37Even better.
01:39:38To.
01:39:39Introduce features.
01:39:40You don't want.
01:39:41To make them.
01:39:42A little bit.
01:39:43Less defensive.
01:39:44In certain situations.
01:39:45Make them a bit.
01:39:46Less verbose.
01:39:47In certain situations.
01:39:48But I think.
01:39:49Models.
01:39:50Are getting better.
01:39:51And the pure.
01:39:52Intelligence.
01:39:53Of the models.
01:39:54The creativity.
01:39:55Of the models.
01:39:56If you want.
01:39:57To put it like this.
01:39:58Are getting better.
01:39:59That.
01:40:00I have.
01:40:01Mostly.
01:40:02Global skills.
01:40:03Agent skills.
01:40:04But.
01:40:05I.
01:40:06Depending on.
01:40:07The project.
01:40:08I do.
01:40:09Also.
01:40:10Add project.
01:40:11Specific skills.
01:40:12I don't think.
01:40:13I have.
01:40:14Project specific skills.
01:40:15Here.
01:40:16No.
01:40:17I don't.
01:40:18I use.
01:40:19Effect.
01:40:20I typically.
01:40:21Use an effect.
01:40:22Skill.
01:40:23And since.
01:40:24I'm using.
01:40:25Effect.
01:40:26Version 4.
01:40:27And that was.
01:40:28Still changing.
01:40:29Quite a bit.
01:40:30Typically.
01:40:31To build.
01:40:32The skill.
01:40:33Analyze.
01:40:34The docs.
01:40:35And then.
01:40:36Improve.
01:40:37The skill.
01:40:38Before.
01:40:39I.
01:40:40I start.
01:40:41Working with it.
01:40:42So to say.
01:40:43Have I seen.
01:40:44VS code.
01:40:45Agent view.
01:40:46Yeah.
01:40:47I have.
01:40:48But I'm not really.
01:40:49Interested in here.
01:40:50Because here.
01:40:51I really only need.
01:40:52One terminal.
01:40:53For the live stream.
01:40:54I'm not.
01:40:55Doing this here.
01:40:56To be super efficient.
01:40:57But just to.
01:40:58Just to.
01:40:59Vibe code a bit.
01:41:00And at the same time.
01:41:00And then.
01:41:01I occasionally.
01:41:02Want to look.
01:41:03At some code.
01:41:04So.
01:41:05I'm happy.
01:41:06With the default.
01:41:07View for that.
01:41:08So.
01:41:09I don't use.
01:41:10VS code.
01:41:11In general.
01:41:12For running.
01:41:13My agents.
01:41:14Or anything.
01:41:15Like that.
01:41:16I'm really.
01:41:17Just using it.
01:41:18As a code viewer.
01:41:19It's the main thing.
01:41:20I do these days.
01:41:21With it.
01:41:22And if I need.
01:41:23To tweak.
01:41:24Something in code.
01:41:25Here.
01:41:26And there.
01:41:27I do that.
01:41:28With it too.
01:41:29So.
01:41:30Yeah.
01:41:31Do we already have.
01:41:46Some images.
01:41:47To look at.
01:41:48Maybe.
01:41:49Nope.
01:41:50It's generating images.
01:41:51Okay.
01:41:52So.
01:41:53Here is.
01:41:53One thing.
01:41:54It generated.
01:41:55I assume.
01:41:56It.
01:41:57Gave it.
01:41:57This background.
01:41:58So.
01:41:58That it can.
01:41:59Then.
01:42:00programmatically.
01:42:01Remove it.
01:42:02Um.
01:42:03I hope.
01:42:04It's not generating.
01:42:05Like.
01:42:06Dozens of images.
01:42:07I mean.
01:42:08I'm paying for that.
01:42:09So.
01:42:10Please stop it.
01:42:11Um.
01:42:12Um.
01:42:13But we'll see.
01:42:14Using.
01:42:15When.
01:42:16Image three.
01:42:17Here.
01:42:18As it seems.
01:42:19Uh.
01:42:20I find that.
01:42:21Always interesting.
01:42:22By the way.
01:42:23Um.
01:42:24If you let.
01:42:25an AI.
01:42:26Do something like this.
01:42:27To see.
01:42:28The results.
01:42:29Then.
01:42:30And see.
01:42:31What.
01:42:32It considers.
01:42:33Good.
01:42:34Um.
01:42:35The last time.
01:42:36When we streamed.
01:42:37It generated these.
01:42:38Sprites.
01:42:39And they are.
01:42:40Decent.
01:42:41Um.
01:42:42The last time.
01:42:43When we streamed.
01:42:44It generated these.
01:42:45Sprites.
01:42:46And they are.
01:42:47Decent.
01:42:48Um.
01:42:49The last time.
01:42:50When we streamed.
01:42:51It generated these.
01:42:52Sprites.
01:42:53And they are.
01:42:54Decent.
01:42:55definitely.
01:42:56Okay.
01:42:57Um.
01:42:58And so.
01:42:59I'm.
01:43:00I'm really interested.
01:43:01In seeing.
01:43:02What it generates.
01:43:03This time.
01:43:04I've been using.
01:43:05Set editor.
01:43:06For a few months.
01:43:07Now.
01:43:08And it's really fast.
01:43:09And happy with it.
01:43:10Yeah.
01:43:10So.
01:43:11Set is a.
01:43:12Is a really great.
01:43:13Editor too.
01:43:14The.
01:43:15The only problem.
01:43:16I have with it.
01:43:17Is I've.
01:43:18I've been back and forth.
01:43:19With it.
01:43:20Quite a bit.
01:43:21I've installed it.
01:43:22I tried it.
01:43:23I liked it.
01:43:24And then there was.
01:43:25Always something.
01:43:26Which.
01:43:27Uh.
01:43:28Didn't work.
01:43:29And I.
01:43:30I don't even know.
01:43:31What it was.
01:43:32I think.
01:43:33It's sometimes.
01:43:34It were.
01:43:35Certain.
01:43:36I think.
01:43:37It was like.
01:43:38A buggy.
01:43:39Shortcut.
01:43:40Here.
01:43:41Here.
01:43:42And there.
01:43:43That.
01:43:44That made me.
01:43:45Less productive.
01:43:46With it.
01:43:47Than with.
01:43:48VS code.
01:43:49Though.
01:43:50That being said.
01:43:51That was still.
01:43:52In a time.
01:43:53Where I wrote.
01:43:54More code.
01:43:55So.
01:43:55Maybe it's.
01:43:56Time to give it.
01:43:57Another try.
01:43:58Said.
01:43:59Really a lot.
01:44:00By the way.
01:44:01One thing.
01:44:02If I understand correctly.
01:44:03That said.
01:44:04Also did.
01:44:05Which is really amazing.
01:44:07Is.
01:44:08They created.
01:44:09The gpu.
01:44:10UI.
01:44:11Rust.
01:44:12Crate.
01:44:13Which is a.
01:44:14UI.
01:44:15Framework.
01:44:16For rust.
01:44:17By the creators of set.
01:44:19And I'm not a big rust.
01:44:20Developer.
01:44:21But my understanding.
01:44:22Is that it's one of.
01:44:23The most important.
01:44:25Or.
01:44:26Most production ready.
01:44:27UI.
01:44:28Frameworks.
01:44:29For rust.
01:44:30But.
01:44:31You can correct me there.
01:44:32But that's really cool.
01:44:34Because it.
01:44:35If you're building.
01:44:37A desktop application.
01:44:39With rust.
01:44:40You can use.
01:44:42This framework.
01:44:43On which.
01:44:44Set.
01:44:45Is basically built.
01:44:46And that's pretty cool.
01:44:48That you have that.
01:44:49As an open source framework.
01:44:53So I don't know.
01:44:54What we're doing here.
01:44:55If we're getting somewhere.
01:45:00Okay.
01:45:01That doesn't look too bad.
01:45:02Generate.
01:45:04To the side view here.
01:45:08I mean.
01:45:09You can still see.
01:45:10The.
01:45:11The outlines.
01:45:12Right.
01:45:13From the background.
01:45:14Which.
01:45:15It didn't remove.
01:45:16Cleanly enough.
01:45:17But.
01:45:18It's.
01:45:19Okay.
01:45:26The enemy.
01:45:27King looks.
01:45:28Too aggressive.
01:45:29But.
01:45:30To me.
01:45:31It didn't look.
01:45:32Aggressive enough.
01:45:33Now.
01:45:34For the player.
01:45:35That looks quite good.
01:45:36So it did really.
01:45:37I have to say.
01:45:38Given those input images.
01:45:39It did a decent job.
01:45:40Or the image model.
01:45:41Did a decent job.
01:45:42Or the image model.
01:45:43Did a decent job.
01:45:44So that.
01:45:45That could yield.
01:45:46Quite nice results.
01:45:47Would an app.
01:45:47Like.
01:45:48Dreamweather.
01:45:49With drag and drop.
01:45:50Make a comeback.
01:45:51With AI.
01:45:52No.
01:45:53I don't think.
01:45:54I don't think so.
01:45:55Would an app like Dreamweaver with drag and drop make a comeback with AI?
01:46:03No, I don't think so.
01:46:06I also think that no code sites like Wix will have issues
01:46:12because I don't think you want to prompt everything.
01:46:17So chat is not the perfect input for everything.
01:46:21But I'm also not sure if people want to drag and drop a lot
01:46:30and have that combination of chatting and dragging and dropping.
01:46:35I may be wrong here and I see why to some extent it could be helpful,
01:46:41but I really don't think that this will have a big comeback, to be honest.
01:46:50What I do see is that you have interfaces where you can select parts, click on them,
01:46:55and then maybe add notes on them, like make this bigger and so on.
01:46:59Then that can be sent to AI as an annotation.
01:47:06If model capabilities are not slowing down, do you think there's a chance they will reach senior engineer level in five to ten years?
01:47:13Depending on how you define it, I think to some extent they have reached it already,
01:47:19and to some extent they very much have not.
01:47:22But it's the big question, which I also touched on earlier.
01:47:27I don't know, in theory, AI knows everything about building software, and in practice, it still messes up too many things,
01:47:39and it may make decisions that are not in line with your expectations or constraints or wishes.
01:47:47And I'm not sure if that is something that will just work in a few years.
01:47:56I have a hard time imagining that that will be the case, that AI will be able to produce the perfect architecture for a given problem in your codebase, I mean.
01:48:13But then again, we may just not care too much about it anymore in a couple of years.
01:48:19And that's the heart that's difficult for me to predict, because I don't know how much our behaviors may change here, or our expectations.
01:48:28There are parts that I would say are hard to replace about humans, but I'm not sure if they will still matter in that future.
01:48:39So that's, that's the difficult part I have.
01:48:44So let me restart this looks like the agent is in the testing phase, so we can test as well.
01:48:52And yeah, it's quite nice.
01:48:55These sprites are definitely now adjusting now we only have four directions.
01:49:00So it's, we don't have diagonal sprites, but yeah, it's not too bad.
01:49:09And I will say, on first look, these sprites look all right.
01:49:18I don't see like obvious differences between the different sides.
01:49:23There may be some, but it, I would say did a decent job.
01:49:28Now the counter is still blurry.
01:49:30I'm not sure maybe it hasn't tackled this yet, but the sprites I think are, are all right.
01:49:39But now it's still, it's, it's playing the game with the agent browser and analyzing it.
01:49:46So here we can see what it's looking at.
01:49:49So maybe it sees that this is still blurry.
01:49:52Oh, don't know.
01:49:54But yeah, the sprites are good.
01:50:04Uh, yeah, I have looked at the Godot engine.
01:50:07I've, uh, played around with that quite a bit.
01:50:10And if I ever want to build a real game and actually publish it, it would be with Godot.
01:50:16Um, I like the engine a lot, uh, obviously not an expert, but, um, I like that it's open source.
01:50:24I felt the logic, uh, of it with all the, the nodes and essentially like this component system, and it may be the same in unreal engine and unity.
01:50:35I don't know, but I've only played around with Godot, but I liked, um, I felt that very intuitive and it made a lot of sense.
01:50:43So yeah, I do actually like it, um, and if I ever find more time or want to dedicate more time to game development, I would do that in Godot.
01:51:00So now here, the agent seems to be a bit stuck in the testing cycles.
01:51:07Um, and I'm not sure if it realized that the text is still blurry.
01:51:25I'll tell it because I'm not sure if it'll, uh, figure out on its own because I actually just want to finish this up now, uh, because I have to go soon anyways.
01:51:46And I would like to see if it can fix that too, and not just the sprites.
01:51:53Um, just to double check.
01:51:54Yeah.
01:51:55The counter is still blurry.
01:52:04Um, let's see.
01:52:14My, I mean, that's a prime example also for, uh, wipe coding, which of course is deliberately done here.
01:52:22But since I know nothing about this, this game engine phaser, and I do understand the code if I look at it, but I haven't written it.
01:52:31So I have no idea where I would have to go to manually tweak this.
01:52:36This blurry text is very likely a problem, which would be easy to fix or avoid by a developer who has a bit more experience with that engine.
01:52:46But I have known, but I have known, I have never used it.
01:52:49So that's the perfect example for what problems you can face with vibe coding.
01:52:56You have to hope that the AI can figure it out because you have no chance of doing it.
01:53:04And therefore I think that's really nice that we see that here.
01:53:07Um, because vibe coding can be really useful for little utility tools.
01:53:12Now it's fixed for little utility tools you're building, but if it's something serious you're building, I really wouldn't feel too good.
01:53:20If I would not understand the code, if I had no chance of understanding the code, or if it would take me quite a long time, at least to understand it, because yeah, you, I don't want to be in the hands of the AI only.
01:53:38Um, but that is also kind of what I meant before.
01:53:40I don't know how things will change for one AI will get better, but we humans also may, we may just adapt to, to work with a system that is a bit less reliable and that makes more decision for us.
01:53:56And we may just accept that to a greater extent, but I don't know, um, still feels a bit, a bit weird, uh, to be honest.
01:54:06But yeah, let's see if the menu text is also crisp.
01:54:11Looks good.
01:54:13So that was fixed.
01:54:14And the, uh, and the, the sprites also were quite nice.
01:54:20It's a million dollar game if it was released 2010 ish.
01:54:23Yeah, that is possible.
01:54:25Um, this one definitely is not.
01:54:28Um, I think the bun rewrite is the biggest thing made with AI yet, and I haven't heard its progress after that.
01:54:37I think bun is doing quite all right.
01:54:39Uh, I see them post about new versions.
01:54:41They're releasing or they're planning to release and, uh, bugs they fixed and more node JS compatibility achieved.
01:54:48And I think the bun rewrite seemingly worked out quite well from the outside.
01:54:55It's, of course, worth noting that they had essentially infinite tokens to throw at it though.
01:55:01So that helps.
01:55:03Anyways, I will stop that here, uh, because I gotta go in five minutes anyways, and I'm not sure if I want to watch my agent test the game for more and more, um, for, for, for a longer time.
01:55:18So I would like to stop that now.
01:55:23Um, and yeah, thank you all for joining me today and I'll try to be back next Thursday.
01:55:32As I mentioned, every Thursday is the plan.
01:55:34I don't make it every Thursday, but I'll try my best.
01:55:37So thank you all so, so much.
01:55:39And I wish you a great day, evening, morning, whatever it is for you.
01:55:43And hopefully see you in future streams.
01:55:46So bye-bye.

Key Takeaway

Effect version 4.0 provides a structured TypeScript framework centered on strict error typing, dependency injection, and application rules designed to improve AI-assisted coding reliability.

Highlights

  • Effect version 4.0 is currently in its release candidate phase, introducing improvements for TypeScript error typing, dependency injection, and application rules.

  • Effect enables developers to define expected errors in function signatures, allowing type-checking systems to track what can go wrong alongside inputs and outputs.

  • Effect provides a generator-based syntax using effect gen that acts similarly to async/await for composing functional pipelines.

  • Effect replaces numerous third-party libraries by bundling built-in utilities for configuration parsing, scheduling, state management, caching, and schema validation.

  • Browser-based canvas rendering scaled incorrectly in the game project, resulting in blurry text and numbers until resolution adjustments were applied.

  • AI-generated image models produced functional four-directional character and enemy sprites when supplied with baseline visual assets.

Timeline

Introduction to Effect Version 4.0 and Core Advantages

  • The stream introduces Effect version 4.0 which is currently in release candidate phase.
  • Effect offers three main advantages: strict error typing, dependency injection, and built-in application helpers.
  • AI coding assistants benefit from strict framework rules and type definitions to minimize code generation errors.

The discussion opens with casual community greetings before shifting focus to the Effect library. Although the creator is not an expert, familiarity with the documentation highlights Effect's value in managing expected errors and program structure. The integration with AI coding tools serves as a primary motivator for exploring stricter type systems.

Error Typing and Explicit Effect Creation

  • Standard TypeScript functions only type inputs and return values without indicating expected operational errors.
  • Effect uses generic types containing success cases, expected error unions, and dependency requirements.
  • Programs constructed with effect succeed, effect fail, or effect sync do not execute until explicitly run using runSync or runPromise.

A division example demonstrates how traditional TypeScript fails to expose potential division-by-zero errors in function signatures. Effect wraps return values into an explicit structure where expected errors are typed alongside success values. Code snippets inside the online playground illustrate how effect execution requires explicit invocation runners.

Asynchronous Handling, Pipelines, and Generators

  • Effect try and tryPromise handle asynchronous code and operations that might fail.
  • Pipelines chain multiple effects together using functional operators similar to RxJS.
  • Generators combined with effect gen provide an async/await-style syntax to make complex execution flows more readable.

Error handling mechanisms expand to cover asynchronous code through promise wrappers and try blocks. The comparison between functional piping and generator functions highlights readability trade-offs. Generators allow developers to write sequential-looking code while retaining Effect's underlying safety guarantees.

Requirements Management and Built-in Framework Utilities

  • Effect features a dependency injection system that manages service instantiation and decoupling.
  • Configuration parsing, logging, cron scheduling, and schema validation come built into the library ecosystem.
  • Fewer external dependencies reduce vulnerability to supply chain security attacks.

Dependency injection allows application logic to remain decoupled from underlying infrastructure services, such as swapping key-value stores. By bundling configuration management, logging, and schema tools, Effect functions as a comprehensive framework that minimizes reliance on fragmented third-party packages.

Browser-Based Game Development and AI Sprite Generation

  • A side project browser game built using Phaser features Brotato-style automated combat mechanics.
  • Blurry UI text issues stem from logical canvas scaling that lacked proper resolution adjustments.
  • AI image models successfully generated four-directional character and enemy sprites from initial reference assets.

The second half of the stream transitions into vibe-coding a browser-based game. An AI agent analyzes codebase issues, fixes blurry canvas text scaling, and generates directional sprite sheets using external image generation tools. The session concludes with reflections on AI reliability and upcoming streams.

Community Posts

No posts yet. Be the first to write about this video!

Write about this video