ZIO 2 dot Ohhhhh! with Bill Frasure

About this episode
Our co-author on Effect Oriented Programming, Bill Frasure, joins us to chat about his programming journey and his involvement in last week's ZIO 2.0 release.
Resources & links
Transcript
Generated automatically by Spotify, so expect the odd misheard word. Select a timestamp to play from there. Download (.srt)
Read the transcript
0:01 Welcome to happy path programming. I'm Brew cycle. I'm James Ward. All right. Well, today we have with us Bill, Frazier. Who I think I first met you is at a Java Posse Roundup or something as a fire breathing, fire dancer, this is something along those lines. Is that correct fire juggler fire juggler? Yeah, true true. I do remember you dancing with fire? And breathing? It, is that all true? I think that was later though. Okay, the first time he just feels old around up. He wasn't and that was weird because your administrative person whose name was Mary. Jane sent me a message that arrived at 4:20 p.m. I think it was on a Tuesday and that you, you and Garrett had figured out that this was happening somehow and you let this last-minute thing but I thought it must have been a joke.
1:02 Yeah, I was in town grabbing coffee and the barista. Asked what I did. I said software, she said, oh, you must be here for Bruce's conference. I said, I am not. I just live here. She's like, oh yeah. Brew cycle. Does this conference every year? Really, I was reading his book last week. I had no idea. We were all in the same little town, but yeah, I'll go check it out, right? Yeah. And as I showed up at the Java, Posse around up and both you and Garrett had these really long hillbilly beards. And I was like, I don't know who these guys are. Well, we thought we'd do all of the Nerds in Crested Butte. Well, that was the other guy. Yeah, there were more hidden nerds. So that was a real Don't transplant. At that point.
1:53 I had right here less than a year and didn't realize it was that soon and really integrated with. And you had pretty much only been doing Java that tono. You would also been working in C++. Yeah. So I guess stepping back a minute to my career background, I did a standard computer science degree and that was probably 90% C++. And with the occasional delving into other languages assembly, lisp python all the youth, my stuff. Yeah, it was a old school curriculum and plenty of stuff that I've never used sense, but not Java.
2:40 I know, I have not touched Java, all through school, but your first job was in job. My first job was in Java. I graduated from college, And started looking for jobs out in Utah. Just scanning postings everyone. That's because you like the environment there. Yeah, I had been snowboarding out there the my senior year of college and so STD snowboarding driven development. Yes, absolutely. That was, I wrote it on, you know, one of my goal list, you know, before graduation was just fine. Find a way to move to Utah and snowboard and also do software and yeah that ended up being Java. Was what I could get my hands on and my mom had luckily bought me, it was one of the early Amazon, tablets fire baby and she got it to me, just gave it to me as an e-reader just to you.
3:51 Like a normal person but it was the first Android device that I ever got my hands on and I was able to use that to just kind of get my feet wet with Java made some your building Android apps for the Fire tablet. You started by building Android apps. Yes. Okay. And that would end up being the only Android app I ever made, right? It was very basic, but but it was enough to get a feel for the language. And did you make the coast of you bus schedule in app? Was that the now that would come much later using wildly different technology.
4:36 And so, you worked for two companies that use Java for healthcare database. Kind of management stuff. Yeah, so it was all back-end. Jabba. The yeah. So my first job was Is at solution reach medical and dental company. And yeah, that was using almost exclusively Java. But there was one project where they gave us a little more freedom to explore. And we did ask Allah Play application, my friend co-worker, Tyler open. At the time we kind of went off. Did the Scala project did it? In a way that would, you know, make any full-time Scala developer cringe, because it was Java without semicolons.
5:29 Yeah. And we were probably even putting semicolons. And that point, you know, it was just, it's a new light bars and yeah, I think the files just ended in dots call. Oh, that was really the only difference and yeah, play obviously is Java. Well, it's Java is shit. Actually is a Java. Work. If you choose, you know, it's Java or Stella. So yeah, we built a project using Scala there and that just put it on my radar. And at that point in time, I was still 90 95 %, Java little bit of Scala and then just generally tinkering with other languages, whatever came up. But at that time, you were still like, oh Java's. Okay.
6:20 It does the job you weren't beginning to have the frustrations that you did later. Yeah, I didn't have anything to contrast it with really because, yeah, the way I was writing Scala wasn't fundamentally different. So, yeah, there's a little Little more streamlined. Because I remember when you had another job, when you went and experimented with kotlin, you came back saying the getting rid of the null pointer exceptions is worth the cost. Yeah, if that was all that kotlin did I would have happily adopted switched over because I was spending so much time in code reviews with newer developers at that point. Just having to hammer in. Oh wait, yeah.
7:09 Youyou checked for an olap here but you didn't check for it down here after this hand. You know, at this point in time, we actually have no certainty anymore. What the state is and it's such a mental burden, the best place to check for nulls is in production when you get the null pointer exception, that's so easy to troubleshoot, right? Because then of you're doing the actual thing. We're Joe But I was telling James that I encountered as a tweet in response to something and the person was asking all isn't a null pointer exception, the easiest thing to track down and fine and nobody's responded to him and because I think nobody can figure out. Is he joking or does he actually think that? Because he hasn't had enough experience. We'd nobody knows it's too subtle. It is clear.
8:05 And what the problem was, but where it originated that is still a total mystery when that null pointer. Why is this thing null? I don't know. So, maybe some background bill is our co-author in the effect oriented programming, book that we've been writing. So we've been able, the three of us have been able to spend a lot of time working on the book and, and then just generally hanging out and press the mute being legs together. The super fun to have Bill on Here. His journey to Z, 0, and Scala and Scala three. Yeah, because you were, I remember, you're starting to get into Z 0 because you had discovered it first. I don't remember who figured it who came across it first.
8:51 We were at a winner tech for him when we started exploring, even when I was not zero but what was it called before that? It's like Scala has said effects or so. Oh, you mean just the idea of an effect? Mmm, but it was, John diggers working on it and I seek Allah's that could be. Yeah, eventually like, forked it out of there, but right. But it just seemed like, I mean, I remember because you were looking at working for diverge, but it was kind of like oh, you know, that's a, that's an Impossible Dream. Yeah. So we've jumped forward a little bit here, so your you are a happy job. Developer and then started seeing some, I don't know different ways to do things like. Yeah, make life easier easier.
9:45 There was just a certain point where I looked at my GitHub and I realize all of my personal projects where I got to choose the language had been Scala for 45 years at that point and it was just increasingly jarring that I was getting getting stronger and stronger with this one language and then doing every Colin away that took more advantage of what's called a. Yeah it was a journey of years to get into the more functional side of Scala and sure is but the deeper you got into it like myself. The more I kind of didn't want to write Java anymore. Yeah. Because early on I'd figure out one new twist that Scala Provided and I would be able to replicate it in Java without too much trouble is a little awkward but you could do it, but then, as you just go further down the path you realize.
10:46 Okay, I'm contorting Java and trying to use it in a way that it was never designed to be used fans. It's just constant everywhere. Yeah, I know. But but, you know, even when I started seeing people doing that with code before having enough, guess depth of functional programming, I would look good. Why is this jerk putting const everywhere? It's just making my life. Well and I think that is true like even with the advantages of immutability and everything trying to do it and enforce it in a language where that is not the focus. It's not the idiom. You just spend so much time fighting. Yeah. And the joys of not having if else being expression Example.
11:35 Yeah, just yeah. All those things. So, yeah, once I had that realization of oh, I actually am a scholar. A developer even though I'm still writing Java at my day job, that's I'm just drifting further and further away from that, I started looking at jobs exclusively for Scala. Just decided it's time to make the change and I made that jump, I joined a company called X. Shawnee finance company, based out of New York City and worked there for a while and it is a really great experience. You know, they were doing, you know, maybe not the ideal style of Scala in my mind at least it was called.
12:23 Yeah. And they were they were making steps towards you know the the way that I want it to be writing code some projects more than others. But the most You can't. You know, take away from that job was meeting kit because langa get like Jim, we got on the show, we back. Yeah, yeah. And encourage everyone to go, listen to his episode because kit is just so enthusiastic and always pumping out. New crazy fun artistic projects. Yeah, so you were working with him, but in the end, he was working as a consultant from zebra, No, he was he was just a regular employee was exactly.
13:11 As I was just a full-time employee at this company. And when I was doing some kind of goal setting for the next year, You know, one of the things I said because it was on a different team and we had just had some kind of side conversations and really clicked and realize like, okay, this this guy is doing the right stuff and I told my manager at the time. All right, my main goal is work on a project with kid and I don't really care what the project is. I just want was like, oh my God, your co-workers with kit amazing. Hopefully you two can work together. Yeah. And then so I And I tell my manager that and then I talk to Kit later that day and I think I brought it up and he was like, oh man, I'm sorry to tell you but I actually just put in my notice, I'm going to be leaving soon and asked where he was going.
14:15 Yeah. Just reeling from this devastating news and he said the one Answer that just made the most sense that he was going to zai Verge, which is India. Yes. And I had seen all the open source work that kit was doing just building on top of Z 0 and just giving it more functionality. And it was much easier for me to accept it was like, okay, you're leaving which sucks, but you're going to the place where you belong. That's great. So even if I stay here, You're like I'm in a benefit from you being over there you're gonna and you all were so we're bringing zo into the code base there. And yeah is right. So you were already, kind of doing production zo work, and seeing some of the benefits of it and seeing some of the benefits and seeing some of the pain points. And I think that's what really drove kit to work on. Zo Magic.
15:17 Which the name doesn't tell you much. But the main thing that it does is, you know, there's this concept of layers and z0 which we might get into later and his Library just radically simplified working with those and reduced a lot of the pain. So, yeah, he says that he's leaving going to diverge and I continued on a taxonomy for a little while, but I was still talking to kid and he was just saying how amazing it was working with this new group and we had a conversation where I said I would eventually, you know, submit an application there and try to join No.
16:05 This is some sort of miscommunication happened and he just told them hey this guy wants to join now. Like let's start the process. Yeah, yeah. Maybe he knew exactly what I had said and he just decided to. Yeah, well let's just see what take the initiative we need somebody now. So let's just see what hand and your your uh, he knew you well enough to know that you were a good fit. Yeah. So what is why we'd already provoked started working on the book? Look. Yeah, sure I'm programming and yes. So you do have deeper into Z 0 and we're already getting to be a pretty expert level and developer with a and I am teaching others about it, which was at that point in time.
16:52 I'm not sure if it was affect oriented programming yet, I think it might have still been Atomic cell A3, which oh, that's right. That was the original idea is just going to be A full language, you know, exploration and I don't know how long we had been doing that. It was at least six months before just looking at scholar. Yeah, and I know as we got more into the weeds of various features and realized, okay, this is something you can do with scalloped by. Well you and James had been both exploring zero for a while. Yeah yeah. And Other than exploring every nook and cranny of Scala that we never actually used in our day to day.
17:41 We started reorienting on. Okay. What can be the through line of a book that, you know, addresses, the type of software that we are writing and just looking at some Arcane operators that Scott, like, gives you I don't know who that. I remember, there's this point where we were like, we don't want to teach people things that we would later tell them never to use. Yeah. And when we were doing this complete language overview, if we were going to honestly do that the had number of things these Concepts and they would be like you can do this. You can I do not overload really long operators. Yeah yeah, yeah.
18:32 I describe Scala to People now as an experimental language, which has features that have not, you know, necessarily been good at, you know, been viable, experiments in the long-term. And so I think that puts perspective on it. Because if you look at scholar and you go, oh, you have the ridiculous operator overloading thing. We don't actually do that anymore, you know? And it's like, you don't know that from. Yeah, and from java just in my time running the length. A wedge through like a sifter and think, oh, there's some really good things the like fault the, you know, that become the good stuff. Mmm-hmm, and Scala from 5-10 years ago, it was just operators everywhere. And you know, we have these crazy d s L's and implicit conversions event was one or is like oh god let's not do that anymore. And the classic example of Martin talking about the fold operator where it's a colon and a slash and it Slyke dominating in all writing, but which direction that's always been my problem.
19:40 Where were well, but that fold left and fold right, have the forward slash and backslash C. Exactly. I know there is gravity Direction. Grab me some time with the end that way. Yeah. From the beginning that. Yeah. So it's like, no, I've never really internalized it from the direction of the /. You have to understand gravity to know which way it's falling.
20:05 And which direction it's falling from Mmm. Yeah. So yeah. This is, so, we're, we're beginning to work on this book, diving further into Z 0 and you're interviewing it diverged. All of a sudden. Yeah. And at that point I guess maybe we had just made the shift because I think it was more the Oriented at that point. I think it helped possibly help to the interview because you said you were able to tell them you were working on a book on zo. Yeah so yeah that's given to remember that the content so they could see your kind of knowledge and the way you're teaching Z oh yeah.
20:52 And because we're doing everything at least currently open source. You know every scrap of work that we do on the book, it's up on GitHub for everyone to see for better. Or worse. And I know that might not always be the case. We might Button it up at some point whenever we actually go to sell it. But for the moment it's out there for anyone to critique or steel or Reason somebody commented on my commit where I fixed Booker, pretty see how this person noticed that, you know, I made some change in my GitHub action, changing the way that we load, girl, VM in and saying that, oh, you don't need this step.
21:38 I'm like Well, someone's watching what we're doing, out of all the things that I thought, someone might look at and comment on that bit of tooling. I was not expecting the curtain but hey, if that's what they're interested in, they can pitch in given the Ogle's. Yeah so you got the job as I Verge and yes been full-time CEO and working for customer and yeah. And then oh I do want to get into the work you've been doing. And contributions to 0-2 which 0 0 2, just came out, and was announced like a week ago today, right? So yes, it is. So usually out there that was part of the reason for having you on today was to talk about the zo to release and what. Right?
22:24 And one of the interesting things about that is that they had put it into whatever is going to release candidate status and then started making all of these amazing changes and I I totally understand that because when I get a book to what I think is the end, then I see, you're like, I'm so close and then suddenly I'll start seeing, you know, I'll see something new, and I'll go, oh well, I can't and because I've tried that before, it's like, you know, if you, if you don't fix it, you will be so regretful. But anyway, the point I was making was that they were able to do those things and that seems to speak pretty highly.
23:09 Of the whole zo framework that they can do such dramatic changes and not worry about busting the whole system. Yeah. Absolutely. There's a pressure that an RC puts on you and one approach you could take is oh we're so close. Let's just get this thing do. RC means we're not going to make any change. Yeah, we're not going to make any big changes. And the philosophy from zero was well, we really need to like fix this one thing and then that happened like with like a dozen different, Area. Yeah, huge. But I don't think, oh my God. Bless ya. They don't think it took the pressure of an RC to probably reveal and push a focus. Well, that's what that's what I was saying, you know, it's like, you get the whole book and you start seeing it in its entirety. And then, for some reason, those things pop up at you because you're not trying to create new material anymore, you're just like saying, how does this look?
24:07 And they were able to Fact, they were able to do that is what impresses me more than anything. Because like, I mean like I build systems into into a book so that I can do that. But most software it's like, oh no, you know, we can't, we can't start adding new features after the release candidate. That would be ridiculous. But they were able to re-architect it practically, I think they were just grinding through a lot of the minutiae and gory details and then, Then once they got through enough of that, you kind of Reach This plateau, and you can take a moment to look around and reassess, and realize has is terrible. Let's get rid of that. Yeah, this this thing that her pet really confuses new and advanced users.
24:55 Fortunately, I never had to understand it. So it was like, yes. And I'm still dealing with 01 code bases at work and we probably will be for several months as the migration happens. Across the ecosystem. But whenever I come across has now. I just Grimace because I how much better it can be and it's hard to spend, you know, potentially days trying to teach a developer this concept that we've completely obliterated, it turns out, it was just a useless abstraction. Yeah, and so yes. As far as these huge changes Changes in the RCs. II don't know the exact history.
25:44 I wasn't following it as closely 401, I was watching it as they approach the 1.0 release, but I think they might have got above 20 or seas and II. Don't know if they were changing as radically as they were in zo2. But I know Adam, John kit, Daniel, like, they're all trying to keep their eye. Rise on the long-term goals of this project. And yes, it does punish the early adopters who have been following your release candidates and we got burned by that in some of our book changes where, you know, I think it is between RCS, like two, three and four, they removed all this stuff and then re-add it it.
26:37 And so there's a lot of churn for Trying to keep up with them, but I think on the whole maybe a couple dozen people felt the pain of that versus thousands tens of thousands of people once we actually release this thing. Broadly, I remember Beyond when I was on the C++ standards committee right at the beginning, when they were going from C++ without templates to templates, and people were saying, oh, this is going to break all this. Existing code and everything and B are NE said he said, yeah, we we have only a tiny fraction of, you know, the users that are going to be. It was definitely long-term thinking he's going.
27:24 Yeah, and this will be painful now but the benefit will vastly outweigh the cost and I think that's the way you have to look. I mean, that is my attitude. I'm happy to break old things to make the future better and you You might lose some people in that transition, but I think by and large those early adopters are the most passionate people about your project and I think they're going to cut you more slack of just recognizing, okay, you're figuring things out, you're improving it this hurts today, but it will be years of improved experience moving forward. And I know that is one of the big goals of zo2 is just Getting more widespread adoption which I guess is the point of every project to some degree.
28:19 But I think 01 was a proof of concept in a lot of ways and it's really great for that. I know they have managed to just make minor releases on it that there's not a z 0, 1 Point 1 Point anything. It's all one point zero point. And I think we're up to 15 now so we've had no breaking changes over the last two years or so that it's been out. So was the stimulus for zo2, the scholar 32 that, that that kind of, they from my understanding zo2, is not really taken advantage of any Escala, three stuff.
29:09 Okay, zo 3 will be where Actually, like make zo B Scala 30k space and so then they can take advantage of scholar three specific features. But today, I think 02 still works with college. So I realized we've been talking, we may have lost some people by talking about the details. And what I would like to do is back up a little and say, what problem is zo solving, because I think a lot of of people that, you know, it's like we're going a this wonderful Library. What does it do? Why would I use it when you've used it in production? So you've solve real problems that you have an interesting perspective on it. Yeah. So I guess they're kind of mission statement.
30:02 You know, in one respect, it's meant for, you know, asynchronous concurrent operations. I think that's what the homepage, still introduces it as, as a library for that. But I think it It's always much more rudimentary day-to-day problems of even if you aren't doing very complicated asynchronous workflows, I still think your code base benefits from using Z 0. And so Z 0 is, it's an alternative to some of the more Can a category Theory oriented Haskell oriented.
30:50 Yeah. Where you just are given this pile of concepts of here's Funk doors and applicative 's and we have built all these things and if you already understand functors in duplicative sin that you know that then it makes sense. But if you're coming in from Some other standpoint than it, maybe it's because I tried to understand one of those systems and it just immediately became overwhelming and so as I was getting deeper into the Scala world, I would sit down and think. Okay, Clay's Lee's I'm gonna really focus on these and spend days or weeks just trying to understand this and I would get to a point We're a reasonably, understood it.
31:41 But then it was just this floating concept that I couldn't connect to the rest of my application. I, I couldn't just bring in this one. Small piece. It was okay. You have to understand all of these components and rewrite your entire application for these things to all interact with each other. And Might just be my personal failing lack of drive or Focus or something but I just I could never make the transition and with zero that was the first time that I saw this tool and the Zio data type itself.
32:27 It explains what you need from the environment to run your code, how it could fail. And what the result type is, those are the three main things that it covers and I actually saw useful examples of Zo and you could take just a piece of your code start structuring it in the style and then you could say all right I want to do an unsafe run on this little piece of code here and I was able to go from. Okay I've just got this one network call that I'm using this zo data type for and just have it slowly percolate through. and then, You know, over the course of a couple weeks, I realized I had got my entire application reformulated to use Z 0 and you can like an incremental adopt the approach in pieces instead of having to go Whole Hog on it from the beginning, which can be hard in the existing code base. So for example that Network call it, you mentioned. So there's a normal thing that programmers are used to having to do too.
33:42 Make the call and to guard against all of the issues that might happen. And my understanding is that most or all of that extra stuff that you have to do. Has been folded into Z. Oh yeah. And if you just wrap any sort of call that might throw an exception in a z 0 then it will say all right you've got to throw a bowl as your possible are type, and that's kind of the first step is Is, you know, before you fully Embrace zo and just maximize your type safety and defining, all of your are possibilities. You can just start with simply wrap it and zo and so it's not going to throw an exception anymore. It's always going to it'll be returned as your error value and you decide what to do so.
34:34 So when I make a call instead of just getting back the quote-unquote result from the call I'm getting back an object as e object that UPS, the result. What might go wrong? What - changed in the environment or whatever? What effects have had. So, so now I'm getting a bigger thing back. And I have to say deal with the error. Yes, case. It says you have to write the code to deal with this error. Yeah. You don't have to have to but it feels really bad. If you don't, you have to if you choose to ignore it you have to use scary method names. Like or die. We're now if which is people it's much more obvious than just having an exception that you're ignoring, your app will fail if you don't deal with this. Yeah same and that makes it really easy, you know that code review setting of okay if you're not familiar with are all the moving pieces here.
35:38 I'm just looking at this one file that somebody else wrote and I can see that they're calling. Or die. Okay, that's that's a big red flag. Okay. All right. No. Okay. She is going to die here. Is that what we really like to happen, ergonomic typed Etc, checked exceptions. We're gonna make checked exceptions, it's like giving you the benefits of checked exceptions, which there are benefits of checked exceptions. It's like the compiler is going to be like you need to deal with this but making it or ignore it. We're explicitly ignore it. Which Is what often happens. And I would say, it's, it's checked errors because you can use exceptions for all of your are types, but you can use just plain old values.
36:23 It can use a string string and there are a lot of times where that's really all you want is just an error message because at this point in time, you're just you're logging at somewhere, reporting it to the user. And at that point you don't actually care about a stack Trace. You're just saying okay. You have to tell the user that something went wrong. And one thing we've discovered with Scala 3, is that it gets even ergonomically better when you combine this approach with Scala 3 because then Scala automatically some types. Your your are Channel, your are types together. And so you, if you have a zo that can produce a foo are and izia that can produce a bar are and you combine those two zeros together, you get a new z0 which can be the are type is a foo or bar or some type on yellows.
37:19 Whereas, before the Scala, compiler would bring that up to a product. The highest common type of those will product if it was a case class, right? Whereas now it actually creates a new Anonymous type that is the sum of the two times, so it just does it automatically and it's so cool. So one of the things that we've encountered while exploring zo2 and Scholar A is these kind of astounding, error messages and I'm, and now, I mean, I remember seeing them and going, oh, I think this is the best error message that I've seen, but we have, we weren't, or I wasn't clear on was that coming from Scala 3, or was it coming from Zio's and we've seen it in both. The answer is yes.
38:08 It's both Scala preacher and nurture. Improves the error messages but his done. A lot of work on the layer assembly. The layers are how you define the environment and z0 and assemble it into a graph of of things that are needed. And the error messages now around environments and providing them. And when you're missing something or you've discovered when, it's, when you have a cyclic dependency point, is says that's an error, which I was, yeah, yeah, it keeps coming. Up with this information that I'm used to having to track down myself. Yes. And it's the compiler. Doing it. Where you almost defend write a compound works are like at runtime it's like oh you didn't give me one of these. It's like are you guys could do wi to compile time? Yeah, yeah.
39:00 So going back to the zo magic the kit made for stitching together. All your dependencies and that gave you a lot of extra power. Power. But now that it's been absorbed into zo core, he's just taken it further and further of okay now it's still stitches together all your dependencies. But when something goes wrong, it gives you a level of detail that you just previously, wouldn't have thought was possible of you want to run this application. You gave us these nine dependencies but we need these other three and it will even tell you, we need these other three to create. These other pieces of the application and it gives you just the whole layout of your application or actually gives you the subset that is relevant to your problem.
39:50 It doesn't dump out everything. It just says, here's the problem area in your graph and you just start plugging in those missing pieces and a very incrementally walks you towards a working application. So, it seems like in Java with dependency injection, you could spend a lot of time I'm tracking that kind of issue down probably. So you could imagine well it's like what you've done in production systems and figure. He's so, yeah, and so, but but you only know that after you've made this change, you can look back and go, oh, I would have wasted so much time and money of my employers finances by doing this but the people are actually programming in Java, that's just the problem that, you know, it's just another problem. You have to solve is just how you Do it and in 01 there was much more of a cost of restructuring your application in this style and you would eventually get the benefits. But it was you had to kind of wander through this Forest of, you know, setting up this boilerplate that you might not really grasp why you were doing it. But now the simplest approach is also the one that gives you the best error messages where for most of your layers, you can do a one-line snippet that will take your type and basically transform it into a layer.
41:30 And once it's in a layer kit, describes them as these Lego pieces of, you know, all the different dependencies for your application. The these units You can snap them together and yeah I think 01 did that but now with CO2 they're not just Legos they're kind of magnetic Legos and self orienting of they're going to find everywhere that they are needed and insert themselves and everything that needs them over that everything that that layer needs it will go and find that as well. So it seems like there are these Pockets like We talked about dependency injection. So if you've had a really awful experience once with dependency injection that might make you go, all right, I don't want to do that again. I'll move to this thing, but then there are all of these other well concurrency, as we've been exploring and everything where you could have had nightmarish experiences and go, okay, I would rather not do that again. So yeah we'll make me congruent to be in a saying just the programming model gets so much easier for doing it. In a way that is correct.
42:44 Yeah, and you don't have to worry about mutexes and semaphores or you know, locks obviously we've been dealing with locks recently in our book code but as an end zo user, in most cases, you just type zo Dot and then check your tab completion options and you'll see for each par and just all of these methods. AIDs that match what you want to do, it's not telling you like, oh, this is an arrow or something, which is hard to connect and you have a visceral understanding of it you know more often than not you just typed and then type a word that seems relevant to what you want to do and you might have to try a few synonyms but Just type in par and then see what sort of parallel operations come up, and then you can check their type signature and they're going to guide you. So just cargo cult your way until your solution. Well, so they alter how do you know I'm a fan of that? You know, if I can get it to her, you alternative is that you have to understand the algebraic laws that your thing needs to abide by and then figure out how How to assemble the algebraic laws in the way that is correct for your. It would seem like usability that kind of programmer usability.
44:22 Oh here's a goal of ours. We want to be able to say take yours the object do.and. Be able to guess your way to a solution. Yeah. Rather than having to understand a huge amount of things in order to figure out what you're going to do next and addressing the cargo cult thing, I would say, you know, that's when Copy paste blocks of code to do. Go. What you want? Yeah. You say I don't know what this is. Sure. But there's a comment at the top that says it. Planes will literature. And I kneeled this Tower, right? Right. Yeah. You're right. You're right. No. That's not the cargo cult things. Not a good example but somehow just kind of I don't know. Fainting your way into FB int. It's very Explorer friendly like that. It's there are cases where I need to jump over to the Zio documentation site and try to look up, something very particular, but it's a very different experience than some of the alternative libraries I've used. Where it's okay, you have to spend a week with the documentation and then maybe you can start writing some code, it's no just drop into an editor. That's got, you know, good Scala Not understanding, you know, whether it's vs code or IntelliJ and just start exploring and it's discoverable.
45:51 And as far as the mathematics of, I think some of the alternative approaches, are they basically say this is math? Just transcribed directly into code. Have at it. We're zo is built on math there's very solid underpinning system isn't John single PhD in math or something I believe. So John to go man. But zeros approaches. Yes. Math is what makes all of this work. You don't need to know or care about that. Just if you really want to dive, you know, under the covers and start fiddling with that and trying to make changes. You can do that. But if you just Use this tool.
46:38 You don't have to know, you don't have to be a physicist, to build something, just an engineer. Yeah, yeah, right. So, speaking of exploration, you have considered the possibility of doing a, like a recorded exploration or, you know, but something that you're going to do online, where you play with zo, code has that? I just dream twitch. Yeah, livestream. Yeah, I've done a few twitch streams. It's certainly low-quality at this point. Sure. But if but, I mean, I like the idea of somebody going in and saying well I don't know what I'm doing here and I can kind of like poke at it and eventually get something to work. I think that could be super careful. Yeah I think the IDE driven development where you can explore by just hitting .m M on something and there's a lot of power to that and I think xia is really optimized. For that experience, whereas like it's one of the reasons why I don't think type classes are used at all and zo because you lose that explore ability that dot completion. Yeah.
47:50 The the list of options that come up in the world of type classes, the type classes and implicit seu, just really don't have to bother with that. You're just using plain old data types and it's it, It's really liberating. And, you know, some people might say that that's discarding. What makes Scala Scala, you know, the implicit mechanism that's one of its defining features. Or it's an experiment that maybe isn't applicable everywhere. Yeah. And you can do so much without it, but Circling back to zo2 in regards to naming all these operators. Yes there have been really astounding fundamental changes that they've made but then I think equally important is just going through and renaming almost every single method. Even the basic ones with this idea of usability in life. Yes.
48:58 Of If something was just an apply method before now, in most cases it that apply method might still be there but we also have a named variant of it where because that is one thing that some people get tripped up on in the Scala world. Is how do you look these things up? Yeah and apply. It's so generic so things like apply. Or fold. I was talking to John recently and he was saying that he really doesn't like fold. He doesn't want to send people in that direction. He wants them to instead because with zero, if you use a fold, you have to provide the behavior for the are case and the success case, and you pass those both in to fold and that's familiar to some people.
49:52 It's very it's a broad concept but in zo, you should prefer to just say, all right on one line, we're going to You are catch errors and Define our Behavior there. And then after that, we'll just do a normal map call and that's going to apply to the success value. And that's easier to think about. I think it is much more direct and it just Blends more granular to which is what we're always trying to do with functional programming. What's the smallest little piece and fold, can make sense to some people of you're taking. This one data structure and you're turning it into a different one. So you could say that's this abstract fold concept, but no reason you can't have the fold and then have the more problem domain oriented combinator's on top of that. Yeah.
50:49 And I think that is one of the goals of Zo again, and I try to keep revisiting that sure that, that's that question here is they want to solve Ones. They don't want to transcribe clever ideas into code. They want to give you all of these tools that map very smoothly into whatever business problem you're solving. And I think zo2 embodies that way more than zero one ever did of just all the names have this unified approach. And previously, you had Z managed and z0 + z streams and their method names were similar.
51:41 But there were so many ways that they slightly diverged from each other. They were written by different developers separated play years. But now with zo2, we have these codified naming styles of if you have two variations of a method like for each and for Each par. Previously that might have been par for each but now everything's consistent. So yeah, and the problem with that is going back to the dock completion. Mmm. Yeah, if you had for each and then par for each, those aren't anywhere close to each other and the alphabetical listing, but now everything gets more narrowly.
52:26 Defined the further you go into the name. So if you're in the neighborhood of the method that Want. Then you can just look at the suffix of each of these names and then decide. OK. 4th or 4th par or for each part. Discard, for when you don't care about the return value, that's really well-thought-out. And this is one of the things I had an epiphany the other day. Why I like python so much and it's because the developers the community or whatever they don't just get the first. They don't just take the The first solution that they come up with and say okay that's cast in stone forever. Now they keep trying and trying and redoing it and not stopping until they get something that's truly elegant.
53:17 And so I really appreciate when somebody does that and and able to have that evolvability. Yeah, there's another piece of it that you worked on for zo2. It was some of the Scala fix rules. So maybe talk about some of those because I think that's an important thing is like we You to support the evolvability as people as this is otherwise you get stuck and you have this old thing that's really crafty, but everybody has to use it because that's hard where we stopped. It's too hard to evolve. Yeah, yeah. So the the Scala fix Rule and we still have it and it's still solves some of the migration pains and I think up until probably RC 3 or 4, it was Whirring almost everything.
54:05 But then in those last few release candidates, the changes got even more significant and Scala fix as impressive as it is, it is very limited in what you can do in a single migration pass or. Yeah, because if you're going from version one to one point one, Can only apply one scholar fix rule to that. So you can't say, I want to run this update and then this update and then this update can't change them, you can't change them, you can't compose these things together which is very jarring if area under functional. Yes. Yes. And so you end up doing this like mutating in place of your source code and we made so many changes but CO2, that for any given piece of code, there might be two or three updates that need to be applied to that same token in your source and we're still looking at that and trying to improve it. But yeah, we we kind of Reach the, the upper limit of what Scala fix could do.
55:28 And the only way to really work around, that would have been to say, Okay, we have Scala 2.0 dot pre or something, and try to have people migrated through multiple intermediate steps, just for the sake of Scala fix, which, you know, could have solved more problems but would have been very unfamiliar to people of, you know. So is this actually 2.0 or it's this kind of weird, nether state, Eight in between. So thankfully, we can still iterate on the Scala fix rule, even now that to out of is out, and we can make improvements to it, that can change separate from 2.0 itself because people just download that from the web anytime they run it.
56:24 So it's not a Panacea. Yeah, fortunately yeah, but something you help make better for ask Allah to release and yes it's a tool that people can And use that they're migrating from 01 to 0-2 and ease some of the pain, not 100%. But yeah. So that was one of the things I worked on for zo2. But I think the more significant thing that I worked on was zo test for this release and it originally started as just a little hackathon project of, hey, I think we can knock this out in a couple days. We want to, we want to share layers between rzo tests.
57:09 And one of the interesting thing about each zo test is an instance of Zo itself and its A little strange when you first encounter that but zo applications once they're fully built. That's just an instance of The Zo type, but then inside of that, it's all these composed Zio's. So you have this enormous tree of Zo types, but they all compose into this one thing. And that's what lets you take, a fully-formed application and compose it with another application. And in the test is made, it was all the way down, it really is.
57:56 And for our test, you have a top-level spec file, but then you have a sweet inside of there, which is a zero and then you have possibly more sweets nested inside or just individual test cases. And these are all just more zeros. And that means that all of the The cool Machinery, that is available to you for the zo type. He is available for your test and one of the things we wanted to facilitate was layer sharing between separate test files. So if you have some large database that might take 10 30 seconds to start up.
58:47 So that's the reason for sharing is because it takes a long time to set up the layers. Yeah. And some resource like test containers Like you've done some work with test containers and CEO test and that's a good place where they're definitely a place. There are cases where you want to share your test container across multiple tests and that could be for. Yeah, the startup reasons or maybe sequential like you want to run one database command and then another database command and make sure that, you know, things work as expected. Yeah, I could be for sequence, efficiency, or just to be sure that your code really doesn't interfere with yeah, other things. And having one shared entity is a good way of checking that. So yeah, it ended up being instead of two days. I think it was more like six months before all was said and done and a lot of that was interfacing with SBT in the way that it expects test Frameworks to behave, which it was never written for this style.
59:54 I love computation you know it's much more object-oriented or imperative style test but you also did something to speed up getting information back from test. So that you could start what you wouldn't have to run everything before you got enough information to go, I need to go fix that. Yeah, so previously you would have this zo test, which is just a tree of other zo instances and we would have to execute the entire Tree. And then we would get the output in one big dump and for a small test file that would be fine. But as you got into larger and larger tests, you might be sitting there for 20 seconds, not seeing any output at all and just wondering because anything is actually executing, like, do it.
1:00:47 Do I understand? This is your stuff. But we had to do that previously because zo maximally parallelizes every piece of that tree and for very kind of complex reasons that I don't fully understand. I just take it as a given that Adam and John of figured that all out. Each sub tree within the tree, it can be executed in parallel and it won't interfere. It's fine to do. But if you're running everything in parallel, and you start just dumping the output naively, it doesn't really interlace and so you can, it's completely jumbled up. So, what I worked on for this streaming output is taking advantage of that tree structure. You would, we had talked about a Talking Stick kind of concept that starts at the top of the tree and gets passed down to the children.
1:02:05 And basically, every test that's executing is trying to grab the Talking Stick. And if it's available at their level of the tree, then you're allowed to print out. But if it's some sibling tree, that is printing out right now, you can't print anything out, you have to wait for everything in that other area of the tree to finish. So what you do is you just queue up your output and send it up the tree and you just have to recognize, we don't have permission now, there's other computation happening. We're just going to pass it up the line but Because of the tree structure, everything just funnels up.
1:02:51 And as the bottom areas of the tree complete, we know. Okay now that we've returned to this parent layer, we are free to dump out everything from the children. It's almost like an actor um because I am hesitant to say yes to that or another example of thread confinement. It's almost like the top thing is we have one quote, unquote thread, to send output and these things will come in as little packets. It is certainly you're dealing with one resource which is the console output and If, if you're just principled about that, well it's easy to make sure that you can either go one of two directions.
1:03:49 You can say dump everything out as soon as possible and you can get away with that. If you fully qualify every piece of output if you say what class you're in, what's sweet your and what sub sweet you're in, what your testes knows. He's so you'll have maybe 80 characters of description before. Actually get to your test assertion so you can do that. There are test Frameworks that take that approach to just fully qualify everything and we can dump it out whenever yeah but that can still make it hard to parse because now nothing is grouped together. We're usually you care about some subset of the test. That's probably what you're focused on and those can just be scattered anywhere amongst hundreds of lines about put.
1:04:37 So You can do that. Or you can say, we're gonna just wait until everything completes, make sure it's sorted out and then dump it out. But you took the intermediate approach. Yeah. We kind of did a hybrid approach of. Okay, we are going to queue things up when it's necessary but also we're going to eagerly dump stuff out as soon as it's available to us. And that was one of those things that just having an effect system made it Easier to reason about we're printing to the console is an effect and we can be very diligent about where that happens. So, Z 0 itself, I think uses zero test for its test, right?
1:05:25 Yes. So you have a large code base of tests that you get to evolve the test system on And see how it how it impacts things. Yes. Your changes might break something, it was good and bad. You know, for one we have thousands of tests they get run. And so it's usually pretty obvious if you've broken something, but if your misstep was that you weren't actually reporting an error to SBT, well, Now, you might have broken, a lot of things, but your test command still seems to work says that it passed. But that was just because you weren't actually digesting and failures.
1:06:15 You were just dropping them somewhere along the way, and yeah. So it It's hard when you're just changing the ground beneath you and especially because yo cross compiles to - and Scala JS and then it can also run within J unit. So there's all these different context and we would work on something, build it out, it be working, great, and the jvm all the different jvm versions, and then we'd realize, oh, no, this is completely. Incompatible with what scholar Jess needs to do with its single threaded approach. Have you gotten have?
1:07:03 You heard much feedback about your, you know, the revamped Scala test. It's being used, nobody's complaining, but that's a good sign. An open sore. No, that's a good start, but it's like, it seems like some people might go. Oh, wow, this is more responsive or something. Well, I think The unfortunate reality is a lot of times the the nice experience you have you just quietly say to yourself and your office that way. Oh cool. And you move on with your day it's only when there's a problem that you file a ticket or get on the Discord and make some noise about it, just fine. I don't begrudge. People are ya doing so, what's your favorite new scholar? Three feature features. Anyway, okay, there's our turn.
1:07:53 I think we all ready. Talk just briefly referenced it with the the sum and product types which to avoid using the jargon. It's just it's ands and ORS right? For your types. And I think it's such a good fit for Zo not, not to bring everything back to Z 0. But it lets you describe your computations where instead of having to put all of your dependencies in some larger, super object that contains all of them or extends, all of those traits. You just say, I need a user service and a messaging service.
1:08:40 And a database service. And that is what you see in your type system is just this and this and this and which is a product type. And yeah, nice features and Scarlett. Three. Yeah. So you don't have to try to come up with this contorted name that covers all of those, your name would likely be user service and database service and, you know, so yeah, to be clear Yeah, where is Scott? There's just like I will create a type without a name that is those types of things. Because how many times do you have to create a new class just to satisfy some need? And you'll never use it again. Hmm.
1:09:25 So I don't even care about its name. No yeah it's what you do but I have to come up with a name now you know and it's like it uses up your cognitive abilities when the names just get so long. And oh yeah and if you do Jam them all into this you know, 200 line. Name you can't piecemeal provide some of them. Yeah. When you can do, when the types are just anded together, you can say, all right, at this level of our application, I'm going to plug in these two pieces and that's going to leave for remaining types that I will pass in at a higher point in the application. And it works in the the mirror image of that. That is the oars, and again, that fits really well with zo for your are Channel, that's saying, you might fail with a user, not found error or an insufficient funds or an illegal argument. Things that are really disjoint, yeah, to create a new class to represent, them would just be mad. Yes, so instead you just say, these are the Possibilities. We know it's going to be one of them. And again, you can handle as many as you care to, at any level of the application, you can say, all right, here we're going to handle are insufficient funds are and we're gonna check some other account try to, you know, get resources from elsewhere that Co still make sure that you have them all. Yes, because anything that you don't handle that's going to be sitting in your remaining.
1:11:09 Meaning are channel so that will be passed along. And then maybe at the end of the world, you have to handle your legal argument or a legal state or something. Where okay, we can't actually recover from this, we just need to dump it out. Tell them this blew up. There's nothing we could do and yeah. So if I'm giving my, my one favorite scholar three feature, it's ands and ORS for types. there's there's plenty of other interesting things and the macros are all we reworked and kitten Alexander, you know, off he They are doing very awesome work with that but that's not really the space that I operate in and just day-to-day any single action that you're trying to perform the ands and ORS. Can very quickly just come to your assistance and then the compile errors.
1:12:22 Also get really nice where as we're talking about Those types that would encapsulate a bunch of and odorous types. In that case, you don't get a nice air mattresses. It says, oh, I need a foo in a bar and you only gave me a foo. You also need to give me a bar. The error message is that you get are so nice with the norms. And again, if you have your different error possibilities where previously they were all just being boiled down to, okay, there's a throwable resident fail with the throwable. Yeah, you have no knowledge of what but in what kind of durable it is that you need to deal with. So if you were handling, three are situations previously that we're all you took a throwable you pattern matched on it. You handle three cases.
1:13:12 But then you change your code and add it in a fourth case that was also a throwable, you have no idea. That is not exhaustive that your code is not aghast and nothing alerts. You to that fact and maybe something that you could have handled at this layer. Ends up going all the way up to your application Level and failing like a null pointer exception, for example sure. But aren't those the easiest thing to solve. Yeah. You know, you see it in your logs and production so I feel like I'm now at the point where you guys were when we were just starting this book in terms of oh I think I'm starting to get the way zo was and I think you guys were kind And of there at that point.
1:13:57 And now I'm starting to see it, but it feels like I still have a lot of catching up to do. It's been a journey. Oh yeah. It's that house. I very much changed how I think about building programs and testing programs. Yeah, was the there. So there's a lot of things that are how I modeled data. Yeah, yeah. It's It's fascinating. Yeah, being able to just radically change that The behavior of your application because you can wrap Behavior around an existing zo instance, you can do stuff like add logging or timing actions, that's something.
1:14:43 Previously, you would have to Cobble together a dozen lines of timing because just what you do as a programmer and yeah every single time it was a small wheel but you were Reinventing it you have to stop what? We were doing and think about something else for a while. Yeah and now with cou just tack on a DOT timed or A.D bug or a DOT debug, if you just want to retreat for now the alpha. Well and I do find this idea of being able to say okay I have everything set up now. I'll do this and I'll look for some parallel way to do it. I mean without having to go oh wait now we have to re-architect the entire program in. Order to support concurrency which is, yeah, the traditional way of doing it.
1:15:34 And is there a I'm, you know, the the what color is your function problem where you like you have to say oh this is an async function and then when I call it I have to say a way I have to do special thing. It seems like I mean, are there things like that and zero or is it just transparent everywhere if it had the asynchronous is Spirit, if that is just handled. And now, One of the other main features of zo2, I should be sure to mention is the automatic blocking. So historically, if you have blocking code, it's on you as the developer to flag that and handle it on the right thread pool. You have to indicate that now with the new runtime system and all this behind the six was created during the release candidate.
1:16:31 Yeah. Now It is intelligent enough to see, okay? Is this long-running process that you're executing? Is it actually executing and making any sort of progress or is it just sitting still? And once a certain amount of time passes and this is something you can configure is how how long it waits. Yeah. But once it identifies that it says oh you are actually a blocking call. We're gonna send you over to this other thread. Pool where you can block and wait and not interfere with the rest of the application. So it turns it from a kohring coroutine called to a thread call.
1:17:18 The actual implementation, right? It does the right thing magically. I won't try to answer that. He okay, I'm not going to give the definitive statement or are. Yeah, I will just say it's a huge part of your brain that you don't have to dedicate to that problem. Now, where you might be just a really Advanced experienced developer where, you know, every possible call that can block in your domain and if you're at your best, you can recognize those and properly, categorize them. But on a bad day, maybe not on a bad day. You're focused on other things.
1:18:09 You, yeah, you had a frustrating meeting. The amount of focus you have to have to look at every single step and make sure that it works in a concurrent situations. Don't want to have to think about resources anymore. Hmm I just want to imagine that I have enough. Yeah ways and we probably should have led with that feature because that really is impressive. Yes, another related one which is the automatic research management which is in xia was a new addition zero-two somewhere in the rcz having scope as Part of your environment and I have not fully explored that yet, I just know it. It's yet another thing that is now, codified in our types and it's in the environment, which gives us much more control over it. And so you're saying the memory management can be controlled statically rather than dynamically. I don't know if I did a memory management. It's really about resources that you open and close. Oh no resources.
1:19:11 Okay not just me. This is z managed went away. Okay, so yeah, so we incorporated into the now. Just being part of the environment. I see The Interpreter now has knowledge of opening and closing resources and that's a good one solves or at least attempts to solve the issue of. We want this tool to be usable by people of nearly all skill levels. I don't know if it's your first day ever, writing a line of code. it's probably still going to be a bit of an uphill climb for you, but the idea is you'll be able to onboard new team members that are just out of college or relatively early in their software career and They've been working in a language where they don't care about blocking or in the domain where they don't care about that and they can basically just start writing code and have the blocking managed for them.
1:20:25 And maybe in the extreme cases, where you need very fine-grained control, you might still have to take over. but, For most cases, you just use the operators, you want. And if something's blocking let the combined experience and all the thousands of person hours that have gone into Z 0 and its runtime manage that for, you know, because it's it's always working at the best of its ability. It doesn't have an off day. Remember way way back, early Resource Management things Um, writing and see. And I was just like, well, I want to read the file.
1:21:10 So I got open it. Now you can read it and it's like and then the program will land. So, and I still look, you know, I'm going, I think the operating system eventually goes and cleans up the open file handles, right? Doesn't it, I don't remember. Well, maybe he didn't back then, I have no idea that little piece of code, instead of being this thing that you can now drop into a larger application. It's this cursed piece. If you do put that into a large code base, eventually you're starved of resources because you just file handles, you meant it to be executed as a script and then disappear and we'll even was the script. I don't know that it wasn't screwing things up. Yeah.
1:21:57 Right. You had it was just like, and memory allocation. It was really just a very narrow, I guess, you could almost say selfish. It look at and I now since seen it in other young programmers, it's like, well, it works. Stop complaining, you old so-and-so. It's selfish isolated code versus something that is Team friendly and that you can just say, all right, I spent a couple hours on this. I can put that into practice or just drop it in to this larger project and actually take advantage of that. Rather than oh that was just learned time it solved. This one thing and is not appropriate anywhere else. Zo2 fewer foot guns. Yeah.
1:22:47 Far fewer. He keeps the foot guns. Locked in a cabinet. That's right. Yeah, you have to, you have to go put in the code. Yeah, get them out. Load them. Yeah, you must be this tall to you just begun. Yeah, if you want to make an unsafe call and zo2, it's Outrageous. How many times you have to write the word unsafe? Now I think it's I think it's four separate times. It's like unsafe dot unsafe and then run time unsafe, right? Because I'm psyching, you know, at the time I thought you know, I did the thing that I saw in the instructions, it worked there wasn't any flag that was saying, but if I had to write unsafe at all, All it's like oh I'm not sure, this feels unsafe, it's a yeah.
1:23:41 I know I'm not that comfortable with this for some reason. Maybe it's that word. Yeah. So to have that I really like the self-documenting names of these things. That's to me that's that could be a whole study for computer programming in general. So they just naming things so that they're look up a bubble. They show up with the It's there in the you know same regions. You are actually comparing things all that that's brilliant. Some people might think it's a trivial detail and it's not going to make a big difference at the end of the day, but I think it drastically changes. How many people have a good first experience?
1:24:30 And think oh, okay. This is something I can use rather than I'm not good enough for. Or this, I need to just go back to the quote, unquote, dumb style of programming because I'm not guarantee of mixing, get something to work there. But here, it looks like I have to learn this Bast have to learn functional and I have to learn this. Vast array of classes are category Theory or all this stuff and it's just actually have to write some code at some point and I don't see where that happens in this situation. I mean, I've had this feeling when looking at this So yeah. But on that note it seems like we've probably super fun. Yes. Is really at the 10 to you. Thanks for your contributions.
1:25:17 It is. I would say one small piece of the puzzle. Yeah. Yeah, I stand in awe of my co-workers which I Verge is another great thing to have in a job to be able to go all my coworkers are so much better than me, and I will learn so much from them. The people in charge should be in charge. They didn't just, they weren't in the right place at the right time and lucked into their position or some of these college roommate. Yes, there is no, just luck of the draw. There, they are the ones. Leading the charge doing the difficult work, getting feedback and just continually refining things and it's just so much fun to be in the room and watch that all take place. Yeah, yeah, awesome.
1:26:10 Well thanks Bill. Thank you all.