Elm Town

Elm Town 64 – The network effect

Episode Summary

Martin Stewart comes back to share his experience using Elm and Lamdera to make all the things, from games to professional apps.

Episode Notes

Martin Stewart comes back to share his experience using Elm and Lamdera to make all the things, from games to professional apps.

Thanks to our sponsor, Logistically. Email: elmtown@logisticallyinc.com.

Music by Jesse Moore.

Recording date: 2023.07.10

Guest

Show notes

[00:00:14] Sponsored by Logistically

[00:01:01] Introducing Martin Stewart

[00:02:21] A New Year's gift from Thea & Martin

[00:06:52] Discovering Lamdera

[00:09:54] Lego Loco Remake - Take 2

[00:17:46] Move fast and not break things

[00:23:02] elm-serialize

[00:25:47] Performance challenges

[00:28:56] Building Lamdera tools and working with Mario Rogic

[00:42:21] "The real cost of using Lamdera..."

[00:45:05] Making Meetdown

[00:48:37] Using Lamdera professionally

[00:53:17] elm-map

Martin Stewart's elm-map

Jakub Hampl's elm-mapbox

[00:56:44] WebGL

[01:01:41] Realia

[01:07:03] Elm Market

[01:10:52] State of State of Elm

[01:18:07] Picks

Martin's Picks

Jared's Picks

Episode Transcription

[00:00:00] Martin: this is, you know, this is kind of the reason I'm so into Elm, because there's like a network effect where the more Elm you write, the better the existing Elm code becomes

[00:00:08] Jared: Hey folks, welcome back to Elm Town. I'm your host, Jared M. Smith. We'll be visiting with Martin Stewart today.

[00:00:14] Sponsored by Logistically

[00:00:14] Jared: But first, let's talk about our sponsor, Logistically. At Logistically, we make intuitive software for the logistics industry to help logistics professionals make better decisions and spend less time on manual tasks.

[00:00:27] From quoting to tracking, our transportation management system helps squeeze every drop of efficiency from logistics teams of all sizes. I enjoy writing Elm at work. I do it nearly every day. I do full stack, but I enjoy it, so come check us out. Logistically pays me to record Elm Town episodes, as well as pays for our production and hosting costs.

[00:00:50] We build the front end for all new features in Elm. If you're interested in our mission and enjoy writing Elm, please drop us a line, elmtown at logistically. com. I'll put a link in the show notes.

[00:01:01] Introducing Martin Stewart

[00:01:01] Jared: Now, Martin, Martin is a prolific Elm developer. You might say he's all in with Elm using Lamdera to build full stack Elm apps from games and side projects to a real estate startup.

[00:01:16] Some of his projects include ASCII Collab, an app for drawing ASCII art with other people, Circuit Breaker, Meetdown, it's a meetup alternative. Awesome. State of Elm Survey 2022, uh, several packages, a couple of them I'll mention under Martin S. Stewart, is elm-audio and elm-serialize. He wrote at least the initial version of lamdera-program-test.

[00:01:46] He also developed the interactive UI source maps for Lamdera, and many, many more. Uh, he is an advocate for Elm, he presented "Hobby scale: making web apps with minimal fuss" at, was it Func Prague Sweden?

[00:02:03] Martin: Uh, Func Prague Sweden and, and also at GOTO Aarhus.

[00:02:07] Jared: Oh, wow, okay, excellent, yeah. Well, Martin, welcome to Elm Town.

[00:02:11] Martin: Thank you. Yeah, it's uh, it's really nice to be back. It was a while since I got to be on the show.

[00:02:17] Jared: Yeah, yeah, it's been a few years, so we gotta catch up.

[00:02:21] A New Year's gift from Thea & Martin

[00:02:21] Jared: Um, I guess one thing I wanted to start with is to kind of go back, and there was something that you mentioned, And I usually go out and get a question from somebody you know, and so I got a question from Thea, your sister. She says, quote, One project we worked on together was a cute little New Year's gift for our friend group, recapping some of the fun conversations we had that year, end quote.

[00:02:46] So, could you tell me a little bit more about that? I know you mentioned that on Elm Town 48, uh, the last episode you were on, but, uh, maybe we get a little bit more history behind that idea and... How that all worked,

[00:02:58] Martin: Uh, well, hang on. So there's actually two, um, cases where Thea and I made a little, like, New Year's present for my friend. So I'm not sure which one she's referring to. But, but in both cases, uh, she's right, we, um, it was, we like, we found, we collected a bunch of like, silly quotes our friends had said over the past year.

[00:03:24] And we, uh, drew pixel art versions of roleplay characters they had used, and, like, because we like to run, like, Dungeons Dragons type of roleplays. So we have little pixel art versions of those characters saying the things they wrote on Discord over the past year. And we would pair it up to some, you know, relaxing music or something.

[00:03:47] Um. As far as I can tell, everyone enjoyed it. But this is not to be confused with the game I made for my sister, which is yet another thing. That's what I talked about on the original Elm Town.

[00:04:02] Jared: Right. Yeah, this is different. I think you had mentioned this just in, sort of in passing and we hadn't really heard the details about it. So, um, was this project written in Elm, correct? Yeah. Was it?

[00:04:17] Martin: to assume, unless I say otherwise, it's an Elm.

[00:04:20] Jared: Yeah, yeah.

[00:04:21] Martin: Elm.

[00:04:21] Jared: Yeah. And so, um, Was this an early project for you as far as like projects you've written with Elm?

[00:04:30] Martin: To be clear, we're talking about the thing I made for my friends New Year's

[00:04:35] Jared: Yes, yes.

[00:04:36] Martin: Yeah, so that would have been, uh, the second one was two years ago. The first one was three years ago, I believe.

[00:04:43] Jared: Okay. So, so yeah, and I guess you started with Elm in 2018, so folks were kind of talking a little bit of history, repeating some stuff here, but just so you kind of know, and I'll kind of quickly go through this. Martin, you can correct me if I'm wrong, but from what I understand, you started with Elm 2018.

[00:05:05] And then I'd kind of been using it on side projects, been working at a consultancy and, um, you know, got a couple opportunities, one of which you got kind of to work on Circuit Breaker, um, kind of on your, uh, during work hours, um, between clients, which is pretty awesome. That's an awesome game as well. Um, and then like up to the point where you had the last episode, this would have been pre COVID 2020.

[00:05:32] So, you know, we were all like. You know, super happy folks in, in, in January,

[00:05:38] Martin: know. We didn't know at the time.

[00:05:40] Jared: yeah, yeah.

[00:05:41] Martin: were unprepared.

[00:05:43] Jared: Um, but yeah, so at that point then, um, it'd been a couple years since you've been, uh, writing Elm. And this project was a front end only, correct? Not full stack Lamdera?

[00:05:55] Martin: That is correct.

[00:05:56] Jared: Yeah, well, that makes sense. Okay, so, um... Yeah, so what was kind of this, this project that you decided to do in Elm? Was it because you were just giddy about Elm, or was there something about it where you were like, Okay, I'm going to think about different options, and then I chose Elm because X, Y, and Z? the project that you built with your sister Thea.

[00:06:21] Martin: Yeah, it's just, that's what I, like, I use what I enjoy. And I enjoy Elm, and I don't enjoy many other languages. So, yeah, there isn't much to pick from. But with that, okay, that makes it sound like I, like, wish I had more options. Elm is, uh, as they say, delightful. So, yeah, I use it because I enjoy it.

[00:06:43] Jared: Yeah, I mean that, that makes sense, I wouldn't expect any other thing, um, but, but I guess it's kind of them moving on.

[00:06:52] Discovering Lamdera

[00:06:52] Jared: You, at the point of the last episode when you recorded with Kevin, had you discovered Lamdera yet?

[00:07:01] Martin: That's a good question. I think the answer is no. If I remember the timeline correctly, Mario might have... I think Mario had given his talk about Evergreen Elm. So that's when he talked about how to handle migrating data from like N past versions of an app. But he had not taken that idea and built the rest of the Lamdera framework around it.

[00:07:26] Jared: Sure. Yeah. I mean, that seems to make sense from my listening back to that conversation. One of the things that you had mentioned was that you had been, one of your first projects with Elm, if I recall correctly, was a Lego Loco remake, right? Where, um, you had mentioned that... One of the, one of the challenges that you had with that was that your front end was in Elm, your back end was in C Sharp, and you were recreating logic between those, a functional language, an object oriented language, and, and, you know, trying to make those two, um, together and work together was just something that, you know, you ended up saying, well, there are, Other things I can do that don't have this problem.

[00:08:13] And so you kind of moved on to other projects. Um, do you have anything else to, yeah. Do you have anything else to say about that as far as like that, that project, any updates maybe, or

[00:08:27] Martin: Yeah, so, at the time, and let's see, that was like, I guess that was about three years, no, 2023 now, so it must have been like four, four and a half years ago at this point. Um, yeah, I thought that was it, because there was no good way to write Elm on the backend, so I was stuck using C Sharp. And, yeah, trying to rewrite game logic code in Elm and in C Sharp.

[00:08:53] You know, not fun, and I want to do things that are fun. But going forward three years then, once like, I guess I heard about Lamdera like two years after that, maybe one year, again, time flies. It's hard to keep track exactly when things happen. But at some point I learned about Lamdera. And, um, the, the first things I did were much like, much less ambitious.

[00:09:19] I made a app called the best color where people can just, you know, there's one globally defined color that if you go to the website and pick a different color, then that's the different color everyone sees, and then they can decide. They disagree and pick a different color. Anyway, that, that was like the first, very first thing I made in Lamdera.

[00:09:37] And there's a whole bunch of other things I made, you know, I made Meetdown. I made a couple other small things. I was working at a company called Insurello at the time, uh, and, and some of the apps we used internally I didn't really like, so I made, like, Lamdera replacements for those.

[00:09:54] Lego Loco Remake - Take 2

[00:09:54] Martin: But, um, about, a year ago at this point, I decided, you know what?

[00:10:00] It's time to restart that, uh, Lego Rem Lego Loco Remake. Um, I decided to rename it to Town Collab, uh, instead. But, same game essentially, except now I was gonna use Lamdera for it. I believe you had time to try it out. I don't know what your thoughts are on it.

[00:10:20] Jared: yeah, I did get a chance to try that out now. I don't think you've, uh, exactly announced this, this project, um, to the community, but, um, I did ask for an invite, and played around with it. Really enjoyed it. I was sitting on the couch with my son next to me, he's playing Minecraft, and I'm playing that, and he's over, you know, pointing like, hey, that's cool, what do you, what do you think about that? So, yeah, I was, um, Talking with him about it.

[00:10:48] Unfortunately, he usually plays on a tablet. So, um, tablet is not supported for, for it. So, um, so yeah, he, yeah, I couldn't invite him yet. But, um, but yeah, hopefully, uh, hopefully that'll be a thing we can do in the future. Um, but yeah, I, I really enjoyed it. Um, I guess to, to talk about some of the different aspects of it that I enjoyed.

[00:11:14] Um, one of them was that. I could put things together that, that made sense together like it was kind of like this you know when you think about Legos right like things fit together like it was clear that all these these different parts would fit together right? Like it wasn't A lot of effort to figure out like, oh, okay, these things don't work, these things, you know, and you, you're trying to, a bunch of different things that just don't, don't make sense together.

[00:11:43] So, so that was nice. Um, I like the ability that I could customize colors on things. That was fun. Um, it took me a little bit to figure out that when you're at the train, uh, house, where you can kind of,

[00:11:57] Martin: Yep, the train house.

[00:12:00] Jared: pop a train into existence. I tried to connect the track back into that train house, and it would always stop at the end of it and say, help, help. Um, so then I learned like, okay, the train house goes before and then I put a split and then, you know, I can let the train keep on going around if it kind of enters into that track and then, um, And then keeps going around from the, the split, so, I don't know if that makes sense, but that was something that, uh, That it looked like I could connect, but when I did, then it was like, it considered it a dead end.

[00:12:38] Martin: for our listeners, maybe I should give a quick summary of what Town Collab is. Uh, perhaps you can link it in the show notes as well. But the idea is, it's a little town building game, like a top down, two dimensional perspective. Uh, you know, like... Legend of Zelda perspective, and you can place little houses, and crucially, it's multiplayer, so you can, you can collaborate.

[00:12:59] Town Collab, uh, you can collaborate building your town together, and there's, there's railroads, and there's post offices, and you can send letters to each other with those post offices. I, I don't know if you found that feature. It's not the most, uh, A tutorial is required for this game, and it doesn't exist yet.

[00:13:15] But, yeah, I've heard a genre of game called the "cozy" games, and I think this might fit that genre.

[00:13:22] Jared: Yeah, yeah, I think that makes sense. The, the music is quite delightful, you know, calm, but enjoyable, and the train is not overbearing, and I like that as the train starts to move off the screen, the, the volume gets lower as it, you know, sort of fades into the distance, and then when it comes back, it slowly fades back in, so, um, that was quite a nice touch.

[00:13:50] Um, and the collaboration is really cool. I have not sent a message yet, but, uh, I think that's, that's really cool, and just kinda looking around at what other people are building is a lot of fun, so I'm excited about it. One thing that I noticed... Was that it reminded me a lot of ASCII collab. I'm guessing that you must have gained some knowledge from that project that then you were able to build upon for this one.

[00:14:17] Martin: Yeah, there, there is a connection. Uh, the name might suggest it as well, given they both have collab in the name. But actually, the, the core code for running both games is the same. I essentially built Town Collab by just taking the ASCII Collab code, and then making very large modifications to it. But the, the core of it's the same.

[00:14:38] Like, the, the way it handles, uh, Undo. Even with multiple people playing at the same time, it's the same code. Like, the, yeah, essentially the netcode is the same. Um, from the beginning, basically what I did was I, Cause, cause ASCII collab is just ASCII, so I have a texture with every possible ASCII character.

[00:14:59] And I just replaced that texture with, uh, pictures of houses instead. Uh, to begin with, and then built from there. Um, Obviously, there's some, like, departures from ASCII Collab, like trains. There's no trains in ASCII Collab. Maybe there should be, but there isn't. You know.

[00:15:18] Jared: Right, unless you design one yourself out of ASCII art.

[00:15:22] Martin: Well, okay. In that case, there is trains. Uh, at least there's, there are, there are definitely railroads in ASCII Collab. I think I drew some railroads there. I think there's a train. It's been a while. I'm not sure.

[00:15:36] Jared: Nice. Okay, so, yeah, I mean... Even the original, the ASCII collab, I think there were a lot of really interesting challenges, like you briefly mentioned there, where if you are dealing with multiple players, real time, interacting on the same surface, right, like you have to deal with What happens when those things collide and I know you mentioned this briefly Or I mean you mentioned this in more detail in the past and we can link to those different resources But could you maybe talk about that a little bit and how you solve that problem?

[00:16:14] Martin: Yeah. Um, I think the best analogy is, uh, if I refer to Git. Admittedly, if you don't use Git, then this analogy is of no use. But for those who are, think of it as you have a, you have the main branch, and then you have your own feature branch. Those are the changes you're making to the canvas. Um, and then those changes get sent to the server, and the server sends back confirmations that it got your change.

[00:16:44] And whenever that happens, think of that as like a, uh, a rebase. It's taking your commit, placing it on the main branch, and then all your remaining features, uh, on, on the, uh, feature branch branch off from that new spot on the, uh, commit history. And so if someone else makes a change, then you're now rebasing off of that, and you're replaying off all your changes from the latest, uh, change from the server.

[00:17:09] Uh, hopefully that makes things clear. Otherwise, I have a better presentation.

[00:17:14] Jared: Yeah, that makes sense and so you were able to reuse that core logic and I guess probably some of the features of how you log in, things like that. So, okay, um, I like that. I like the simplicity of the login method too. Just, here, what's your email? Here's a link. Um, really nice. Okay, and so, This was something that you came back to.

[00:17:46] Move fast and not break things

[00:17:46] Jared: What was it with Lamdera that you felt like enabled you to do this? I'm assuming that, you know, that was the case because, uh, before you discovered Lamdera, this, this project was shelved and now you came back to it and used Lamdera to build it.

[00:18:04] Martin: Yeah. So, as mentioned previously, the original version used C Sharp on the backend. Not ideal, because now I have to rewrite the... code for the game logic twice, but even hypothetically, like, let's just suppose I had Elm on the back end, you know, I just, you know, I, it's not directly supported within Elm, but you can always do a platform worker, run some Elm code in the back. Uh, in, in the backend and, you know, some kind of, in, in some kind of, um, AWS microservice, something like that, that's something you could do. Um, I think even in a situation like that, I probably would not have had the motivation to do Town Collab because what that does not do and what Lamdera does provide you is like, handling all of the, the message passing between the front end and back end, for instance, so like if I was writing my backend from scratch with no Lamdera framework, I need to write an encoder and a decoder for the data that's gonna be sent from the back end to the front end. Likewise, I need to do the same thing from the front end to the back end. Um, so, that's already a lot of, you know, it's a lot of effort. And of course now there are tools that have emerged that can try to generate that for you. But they're usually not perfect. They're not... They're not as seamless compared to Lamdera where, you know, you don't even need to think about it.

[00:19:38] It's just not a thing that needs to cross your mind. It just works in the background. And then there's other concerns which Lamdera handles. Migrations is one of the big ones where... Like, you've released version 1, great, you don't need to worry about migrations at that point. But, when you have version 2, and you've changed a bunch of things, because, you know, it's still early days, lots of new features, and refactoring has happened.

[00:20:06] You now need to, like, take the old data, and somehow migrate to new version. And, with Lamdera, it generates, it, like, saves your version 1 types. And they can do a diff between version 1 and version 2 and see what has changed. And then generate almost all of the migration for you. All you have to do is write the code for the bits that have changed.

[00:20:31] Which typically isn't that much code. So it's a massive time saver. And on top of that, it's type safe. So where in, like outside of Lamdera, I'm always worrying like, Am I about to do a deploy? And that's it. Everything's gone. Uh, here I can be, uh, much more like fast moving and not break things. And I think that's really nice.

[00:20:56] Jared: Move fast and not break things." I like that. Yeah. So evergreen migrations. Helps the, the ability to do serialization. Of course, the, I want to say to do serialization automatically for you. So there's, you know, you don't have to think about that as even a concept. Um, and then the other thing is, uh, of course the, the idea that your game logic is in one place, right?

[00:21:28] And you can reuse that in the front end and back end.

[00:21:30] Martin: Oh, there's one more thing I might add, uh, which is maybe for some people, this isn't a big deal. For me, I hate writing deploy scripts. So it's really nice in Lamdera where you just write Lamdera deploy in your command line. And it just deploys. Like, the first time you deploy, you need to, like, go to the Lamdera dashboard and create the name of your app.

[00:21:53] But that's 20 seconds. Uh, in contrast, when I've worked like with AWS, I'm just like scratching my head, like, so what service do I need? How do I deploy to it? And there's, there's always that point where you have some kind of GitHub CI script and you run it. Or rather, you don't run it. You deploy. Wait five minutes.

[00:22:13] Did it work? Oh no, it didn't. Okay, let me think for a while. What, what did I do wrong? Oh, typo there. Try it again. Oh, it got a little farther. Fine. You know, five minutes later, I find out I got a little farther. I got to figure out. Maybe some people are much better at that than I am, but I think that's my least favorite part is like the DevOps step.

[00:22:32] So I am so glad that Lamdera takes care of that for me.

[00:22:36] Jared: Yeah, that's pretty great. I would say that, you know, there are entire roles, positions at companies where people work to handle the DevOps. So, I think, yeah, to be able to say, well, that's just, you know, that's not a concern for this is pretty amazing. So, that is really cool.

[00:23:02] elm-serialize

[00:23:02] Jared: I want to mention, because you mentioned the serialization, you wrote a package for Elm, elm-codec, that does some of this serialization type of thing.

[00:23:14] Was that something that you needed before you discovered Lamdera, or did it solve a different problem?

[00:23:20] Martin: That's before I discovered Lamdera. Lamdera actually made that work not so useful to me anymore. I sometimes use it, but, oh, sorry. One minor correction. Uh, elm-codec is, uh, Minibill's work. So

[00:23:32] Jared: Oh,

[00:23:32] Martin: was the one who had the original idea, um, to make like these functions you could build up that were both the encoder and decoder at the same time.

[00:23:43] Um, he had the original idea for that, though at the time, I think he called them, the type for it was not codec. It was called meta. I, I, I think I can claim credit for suggesting it be called Codec instead, but otherwise, all that work, like, that stuff, uh, credit goes to him. And then for Elm Serialize, I decided to just, there were some parts of his package, which, there was like, it was built with JSON in mind, and I wanted something that was built to be where the actual data being encoded was an implementation detail.

[00:24:18] So once you're no longer thinking in terms of JSON, you're just thinking in terms of data in some form, could be bytes, could be a string, whatever, you can simplify the API a bit. So that's where Elm Serialize comes from. So if. If you want to, like, think of a way of distinguishing the two, Elm Codec is, you want to work with JSON, and you sometimes want to work with well behaved third party APIs, whereas Elm Serialize, it's like, no, you're just 100% working with your own data.

[00:24:47] It's your app that's encoding and decoding. Then Elm Serialize, I think, is, uh, the, the, like, the better choice.

[00:24:54] Jared: Right,

[00:24:55] Martin: But yes, this is

[00:24:56] Jared: Yeah, that makes sense. Thank you for clarifying that.

[00:24:59] Martin: Yeah, this is something I worked on and I used for a bit, for like Circuit Breaker, for example, that game, uh, well, for one, uh, when you, when you beat levels, you know, you want to save the high score data and the fact that you unlock new levels and then also you can change the colors of the levels.

[00:25:18] So all that data I wanted to be able to, um, uh, serialize to like local storage. Uh, Local Storage, because at the time, I didn't have Lamdera, so everything was local storage or downloaded to your file, to your, uh, file system. But so I had Elm Serialize for, built for that, and then once Lamdera came along, uh, Elm Serialize became not as relevant, though I still sometimes use it if I want to serialize something to local storage.

[00:25:44] Jared: Yeah, that, that makes a lot of sense.

[00:25:47] Performance challenges

[00:25:47] Jared: And so were there any other, were there any challenges that, we've mainly talked about all of the, the pros of this process, but were there any challenges that you found that, you know, trade-offs, if you will, um, with doing it this way versus. Um, you know, some of your other attempts or, you know, other tools that you've used.

[00:26:10] Martin: Uh, are you referring to Elm Serialize versus ElmCodec, or Lamdera versus

[00:26:15] Jared: I'm referring back to the Lego.

[00:26:18] Martin: I think the big challenge, and this is kind of... It wouldn't have mattered if I used Lamdera or something else. The big challenge was performance. Like, one of Elm's, like, big benefits is performance, but there's a bit of a caveat to that, which is that Elm is very fast when it comes to doing, uh, like, DOM rendering, because it can very, uh, efficiently figure out what has changed.

[00:26:46] You know, there's Html.lazy, so you can, uh, avoid doing redundant work. But... When it comes to making games, you don't want to be working with HTML, unless it's a very simple game, or it's like a turn based game where you don't have, you know, you don't need to run something every animation frame, you just need to change what the user's looking at when they make an input.

[00:27:09] But for more real time games, uh, WebGL is basically, like, you can also try using SVG, but I think quickly you reach a limit where that's too slow, and then it's like WebGL is the way forward. But even then, quickly you reach, like, a point where you, I'm just constantly thinking about, Well, how can I make this faster?

[00:27:31] Because I, like, I don't want to generate lots of garbage that causes, uh, garbage collector pauses in the game. Um, I don't want the game to, like, feel like it slows down when you're placing lots of houses quickly in a row. Uh, so there's lots of, uh, caching that I need to do. Um, so I, I spent a lot of time thinking about that, which I think overall, it's in that positive.

[00:27:54] Like, I lost time thinking about this performance stuff, but, you know, I, I still gained a lot of time by the fact that it's Elm. You know, I'm not, there's a whole, whole class of exceptions that You know, there's no null exceptions. I don't have to think about that. No time loss there. Uh, so overall, it's, it's still good, but I'm always now thinking about like, well, but, but what, what can we do to make this faster?

[00:28:17] One, one thing I've always been thinking about, could we take, uh, Elm Optimize Level 2? Um, Which, I don't know how well known that is within the community, but it's, it's a tool that, uh, I, I, I apologize. I don't remember the people who have been working on it, but it's something that some people have been working on and it tries to take the output, the JavaScript that, uh, the compiler generates and do some tweaks to it to make it faster.

[00:28:43] So I've been thinking like, well, should I try out that? See what that does. It'd be really cool if, uh, Lamdera had that built in so that. Uh, all Lamdera apps automatically get a performance boost from that.

[00:28:55] Jared: that's a good point.

[00:28:56] Building Lamdera tools and working with Mario Rogic

[00:28:56] Jared: We've talked about Lamdera quite a bit. And for folks who may not be familiar with Lamdera, Lamdera was created by Mario Rogic and I, I understand that you have, you know, kind of worked with him.

[00:29:11] Of course, we mentioned earlier the program-test tool and the interactive UI source maps features that you built for Lamdera. Maybe you could give us a little bit more detail about those and kind of your relationship there?

[00:29:26] Martin: Yeah, so I can start with, uh, Lamdera program-test, I believe. Yeah, that one came first. Um, I forget exactly what sparked the idea. Might have just gone to those. Huh, I wonder if I could. Yeah, that ought to work. I should try it. Specifically, Lamdera program-test swaps out all of the, um, all of the, like, core functions.

[00:29:52] So, for example, you know, you can import the HTTP library and then do you know, Http.get, or Http.post and Lamdera program-test swaps out those functions for another module called Effect http. But otherwise, the, the a p I is identical. And once you've swapped out all of these, uh, effectful, uh, modules, then what you can do is. You don't need to change your program too much, you just need to, like, use Effect. mostly. But, after that, you can write these tests where you simulate things happening. So, for example, you simulate a frontend, a user connecting to the backend. And then you can simulate them clicking on a particular button, maybe waiting a second or two.

[00:30:48] Clicking another button, typing some text, something like that. And... When I say simulate, I mean like a unit test. It's all synchronous. There's no actual spinning up a backend or spinning up a web browser. It's all done with an Elm code. You can simulate all the HTTP requests, all the... Data sent from the back end, uh, specifically a Lamdera back end then, all the data sent from the front end to the Lamdera back end, all the data being sent back within this unit test, and by doing so, you can verify the app does what you expect it to do.

[00:31:24] Um, I... Again, I'm not sure what caused me to start making this. I must have just had a thought, like, yeah, I gotta try this. But, what I, yeah, what I figured out is like, wow, this, this can really pay off in certain situations. Like, if you have an app with a, some kind of onboarding flow, and then the user does, you know, fills out a form or whatever, and then clicks the submit button, and then they get maybe, maybe they get an email back or something.

[00:31:56] Um, all of these different steps, and you want to somehow check that it works. Uh, when you can just write this, uh, single unit test that simulates this entire flow, it saves, it saves so much time when you're just, you know, you want to make a change, and then you want to make sure nothing broke, and you have to go through the happy path by yourself.

[00:32:19] So, first I used this for, uh, Meetdown. It was probably the first, quote unquote, real world test, and it was promising there. So then I decided to use it that, um, uh, shortly after I started working at a startup called Realia. So I used it there, um, and used it extensively because, yeah, it was really useful stuff.

[00:32:41] Um, one, one caveat to all this is that, um, it does not work as well if you have, uh, JavaScript. If you have web components, for example, or if you have third party APIs. This, this is why it's, it's integrated with Lamdera because now you know exactly what the backend looks like. So it can be integrated into this program-test framework.

[00:33:04] Um, but, but as soon as you have lots of other third party APIs that you have to, uh, Now you need to mock out, um, now, now you risk introducing bugs with your mocks and things become harder to work with. Um, this is, you know, this is kind of the reason I'm so into Elm, because there's like a network effect where the more Elm you write, the better the existing Elm code becomes. Uh, before I ramble on too far, I should, I should credit, uh, AVH4 with making the original program-test. So, this idea was not purely from my mind. I, I had, uh, prior work that was part of the inspiration. His version, I believe, instead of, um, where in, uh, Lamdera program-test, you have Effect dot, you swap out all the modules with, um, this Effect dot version, his version instead, you ... no, excuse me, you might still do that, but what you do instead of swapping it out completely is that you then write a Effect function.

[00:34:01] So you have your own data type that represents all of the effectful things that can happen in your program. And as a final step, you take that, you have like a function that takes that Effect type and converts it to actual commands and subscriptions. So that's, that's one distinction between the two. I guess that's where I can maybe claim some of my own ingenuity.

[00:34:21] Maybe. I'm sure someone else will tell me, No, no, I thought of that before you did, Martin. There's so much, like, just building upon other people's work.

[00:34:30] Jared: The program-test, uh, tool is, is pretty mind boggling. You know, I think you, you hit the nail on the head when you said that the more Elm that you use. The more, you know, benefits you gained at this, you know, it's exponential, it seems like, and it, and I think it's, it's really clear when you look at, you know, some of the, the things that you've been able to build upon Elm, and then, you know, when you were able to, uh, then get full stack Elm with Lamdera, then, you know, these other really incredible things, um, that you were able to build.

[00:35:04] So, I think, yeah, that is, that is truly a testament to, um, you know, the magnification of, uh, magnifying effect. Elm Of this, um, of these, uh, intentional limits, if you will. You know, the constraints that, that Elm places that allow us to do all these really amazing things. So, yeah, um, I think, yeah, it is unique and it is, you know, definitely...

[00:35:30] Um, building upon, like you said, Aaron Vonderhaar's, um, program-test, but yeah, definitely taking it to new heights. So, uh, I guess standing on the shoulders of giants, if you will, but, but it's really incredible. So, yeah, thank you for building that. Um, Yeah, and then so the other one, Interactive UI Source Maps for Lamdera as well.

[00:35:51] You want to talk about that?

[00:35:52] Martin: Yeah, um, so again, I don't know where the idea came from. It's possible. I had some inspiration and I've since plagiarized it by accident. Um, but the idea is, um, when you're... Now I'm going to talk in terms of Lamdera, but this isn't actually Lamdera specific. But the idea is when you're like working on a Lamdera app, and you have the UI in front of you, that you can hit some hotkey, some kind of hotkey that shouldn't come up in practice, so it doesn't conflict with your actual app.

[00:36:22] But you hit some kind of hotkey, and a drop down will be produced over where your mouse pointer is. So whatever UI was underneath your mouse pointer, Uh, it will show, it will show a drop down that has a column of buttons, and each button, each button row is... It's a line of code in your program that says, like, okay, the first thing under your cursor is a, like, let's say it's a text input.

[00:36:54] So, the line of code that creates that text input, that's what the first button's for. If you click that button, then you're taken to the IDE. With your cursor placed on that line of code. And then, the second button, perhaps, in this drop down, is like, the div containing the text input. So if you click on that, you go to the line of code that creates that html.

[00:37:17] div. And so forth, all the way to the div that contains your entire window. I admit, this is one of those things where, So like, I was just, you know, raving about, like, Lamdera program-tests, so useful, I love it. With, uh, the UI source mapping, I don't use it that much, actually. Like, people have told me they like it.

[00:37:38] Mario, I think, is the one who really loves it. But for me, it's like, well, I work with WebGL a lot. It doesn't work there. It's not the same. You can't really do that with WebGL. Or I'm working with apps that... They're not that complicated visually, so there's not as much to gain, um, so, I mean, I think it's still cool.

[00:38:00] I, I'm glad that it works. It's one of those things that just says so much about Elm that you can have this idea and try it, and then in contrast to, I think, a lot of other languages where you would realize, oh, no, This doesn't work in practice because there's escape hatches, and that causes it to conflict with this other code, or this other thing people can use, or there's so many features in the language, this isn't going to work so nicely with some of them, and it's going to be a whole lot of work to make it work everywhere.

[00:38:29] In this case, it's just, you know, try it. Oh, yeah, that worked. It works flawlessly, really. So, like, uh, in this case, specifically, because you, when you create HTML, like, uh, Elm's HTML package, the HTML you create cannot be modified. It cannot be introspected. So it's completely safe for, uh, the compiler, the Lamdera compiler, in this case, to sneak in some extra code that adds, uh, attributes to your divs that says, like, This div was created at this line number, which then, when the, when your web app is running locally, some JS, uh, some JavaScript code can read that attribute when you hit the certain special hotkey and create the dropdown for you.

[00:39:20] Um, where, yeah, this wouldn't be possible if, uh, if, uh, if the Elm compiler was more relaxed about restricting this sort of thing. If there was some more sort of escape hatch. That lets you read the DOM structure within your Elm code, then this wouldn't work, because suddenly adding arbitrary attributes could break someone's code.

[00:39:42] Jared: Yeah, my, my mantra for the year is there's freedom in your limits, and I think, you know, kind of going back to what, uh, we talk about with the constraints that, you know, they're artificial, right? Like, obviously, there are plenty of frameworks and tools that do things differently that take, you know, shortcuts that provide some, some benefit, but it's, it's pretty incredible how this particular set of constraints leads to so many.

[00:40:08] Things that, like you said, you just kind of try it and then you're like, Oh, okay, that was not too bad. Actually, wow, you know, that was pretty amazing. Um, but with this one in particular, if you said it relies on these, these lines being put into the source code, I'm guessing then you had to collaborate with Mario or did you learn some Haskell to do this or how did you approach this particular problem?

[00:40:35] Martin: Credit goes to Mario for helping me with this. Yeah, he was, he was completely open to the idea of just like... I had this idea, I proposed it to him, you know, we thought about it for a bit, like, could this work? Yeah, it's worth a shot. So I just went out and did it. Uh, he, he showed me how to, like, you know, set up the compiler to get it running on my machine.

[00:40:55] Um, uh, specifically the Lamdera compiler. Uh, just get the Lamdera compiler running on my machine. Uh, I had never written Haskell before, but it's pretty similar to Elm, so that really didn't take much time. And... Because the Lamdera compiler is a fork of the Elm compiler, the code is pretty similar. So I think I should give Evan most credit with like...

[00:41:17] You wrote really readable Haskell code. Like, I've never written Haskell before. It was no problem to understand it. So I just, like, you know, navigated through the code, like, Okay, yeah, this makes sense. This is where I want to, like, insert these lines of code for generating attributes. And once I had it set up, like, it took a few hours, and then the basic idea worked, just as a proof of concept.

[00:41:42] From there, uh, Mario had to do a bit of legwork to, like, bring it up to, you know, compiler standards, uh, and make it work, uh, more nicely with the existing tooling and whatnot. Um, so, uh, thank him for bringing it from, you know, my idea to production, but, yeah. He, he was instrumental in helping me get this set up.

[00:42:05] Jared: , yeah, that's a nice collaboration then, um, to hear about. And again, you know, kind of building on, uh, the shoulders of giants. Thank you, Evan, um, for building Elm. Uh, none of this would be possible without that. Um,

[00:42:21] "The real cost of using Lamdera..."

[00:42:21] Jared: so one of the things here that I found on the Lamdera.com website is a quote.

[00:42:28] Uh, I think this quote is from you. Quote, The real cost of using Lamdera is that it makes me not want to put up with the infrastructure and

[00:42:38] tools we have at work. End quote.

[00:42:40] Martin: Yeah, uh, I think that's more of a warning. It's on his marketing page, but I think that's a warning. Yeah, um, it's not a feeling I've had exclusive to Lamdera. I think the same thing happened when I learned Elm. Or like, I learned Elm and now I don't, I'm not really feeling motivated to work with C Sharp anymore when I, when I know there's better things out there.

[00:43:04] And then when I, same deal, start working with Lamdera, it's like, I don't want to write GitHub CI scripts anymore, or, you know, I don't want to write all these encoders and decoders to do the basic communication between the front and the back end, because I know there's better. Um, I don't know if other people work that way, but for me, it's like, yeah, if I know there's a better way, it's really, it really drains my motivation to do it the way it's always been done.

[00:43:30] I want to do it the best way.

[00:43:32] Jared: Yeah, I totally get that. I think it is, um, sort of a double edged sword in a way, because, yeah, if you are limited, and you cannot kind of break out and do your own thing, then, um... You're gonna feel a lot of demotivation. I, I certainly had that myself in 2018. I actually had, um, had agreed to be laid off with some other folks and then actually started searching for a job where I could use Elm when I, when I actually found the Logistically job in January 2019.

[00:44:06] So, um, yeah, I, uh, I know that powerful feeling and it definitely motivated me. And it's funny now, because I, I talk to people with work and we use Python on the back end. And, you know, once they kind of get into Elm, then they're like talking about all these other things, like for the back end. And we're far enough along that there's, you know, it's, it would be very difficult to change.

[00:44:28] It's probably not going to happen. Sorry folks. But, um, the reality of it is, you know, like, Hey, we get to use Elm on the front end. So it's, it's, it's wonderful. Um, and then, you know, we just try to, to bridge that gap as much as possible. Um, but yeah, so anyway, that, that is, I guess, the, the kind of trade off.

[00:44:47] It's like, once you go down the rabbit hole and you get all these benefits, then you are aware when you don't get these benefits. And I think it's, you know, it's a huge productivity thing. It's, it's clear in the, a lot of the tools that you've been building. Uh, and we've only talked about a few of them. I mean,

[00:45:05] Making Meetdown

[00:45:05] Jared: you briefly mentioned Meetdown, but maybe we should talk a little bit more about that.

[00:45:09] Martin: Yeah.

[00:45:10] Jared: probably the first one that you had written, I would say, as not game related, but to me it seemed like it was the first one that kind of proved that we could build something that is an app, a web app, you know, that a company might build, and you build it with Lamdera and make it awesome.

[00:45:35] Martin: I think this is becoming a theme now, but I don't remember exactly why I built that. I think, I think the reason is because Mario was hosting Elm London on meetup. com or meetups. com, whatever it's called, and they were charging him money for that. And I thought, that's ridiculous. Why? Why are they charging money for that other than, you know, you know, it's a network effect.

[00:45:59] He's trapped on that website. So they know they can make him pay money. But I thought that was dumb. So I decided to make my own version instead. Um, and, and yeah, I guess part of it was also, you know. See if Lamdera was up to the task. Because it's so easy to like, you know, make the best color. It's like a hundred lines of code and declare, Oh, Lamdera is great.

[00:46:21] And then not realize that when you reach the thousand line code mark or the ten thousand line code mark, you know, something breaks, who knows what. So I wanted to like push the limits. At least I'm assuming, you know, Again, I should have written it down. I don't remember exactly why I made it dumb. But yeah, so I decided to do that.

[00:46:39] I think. I think it just took me a week or two. I happened to have some vacation time or something, and over that time period, I just made Meetdown. Um, and it went really smoothly. So, at that point, I think Mario was my first user. Uh, I should add that another reason he switched is because... Uh, he wasn't really getting a, a benefit from the network effect of having lots of users on meetup, meetups. com because he was, he was, uh, people were finding out about his events because he was, like, promoting it on Twitter and Slack. So, he, like, there was no sense in him staying around on meetups. com. So, yeah, he switched over, um, and he's using Meetdown for a group called Elm Online, which is another group that runs every month or so, or bi monthly. People are welcome to join, by the way. It's a great group. We present lightning talks. Um, but yeah, and then, and then over the past year or two, various other people have started using it. I think, yeah, Roc, uh, Roc Online is also part of it, uh, which, I don't know. It makes me really happy to see that, like, oh, a whole different group is trying it out.

[00:47:58] It's not just Elm.

[00:47:59] Jared: Yeah, yeah, that's, I mean, there is some overlap, of course,

[00:48:04] Martin: Oh, of course, yeah, it's like, oh, Richard Feldman, where's, what's he been doing before Roc? don't know.

[00:48:10] Jared: But yeah, that is, that is really neat, um, and... So, yeah, you, you built this and, you know, seemingly we're, we're thinking maybe partly motivated by, uh, Mario's comments about, uh, the cost of, of Meetup. And I think it's, it's a great tool. Again, you're using the email-link-to-login tactic, which I think works really well.

[00:48:37] Using Lamdera professionally

[00:48:37] Jared: The next thing that I wanted to get into, if you didn't have anything else on that particular topic, was to talk about using Lamdera professionally.

[00:48:47] You posted about this on Discourse, and your participation in, I think it was about a year and a half, You worked part time at a real estate startup. Do you want to tell us a little bit about that?

[00:49:04] Martin: Yeah. Um, so. One and a half years, and my last day there was about three months ago. So we'll say I started about two years ago at this point. Um, yeah. So after I had finished my previous job, which was, uh, Elm on the front end and F sharp, but at that point I wanted to use Lamdera. Again, this warning I mentioned earlier applies, I, I couldn't stand F sharp for the backend anymore.

[00:49:33] So I had to find a new job, but, so I reached out to some friends, like just. People I knew who might know other people who might need a programmer. And specifically I was looking for like a, uh, greenfield project because I wanted to bring in Lamdera. And my best odds of doing that was if there was no existing code base.

[00:49:52] Um, so, uh, one of my ex colleagues actually knew a person who was, yeah, looking for a programmer. And wanted to create this app that would help people, uh, who were selling their homes in Sweden find realtors. Um, So, uh, I met him for lunch and we chatted, and I, I showed him like ASCII collab, for example.

[00:50:15] He was looking for an Elm programmer already, and I tried to up upsell him to Okay. But, uh, How about this Lamdera thing? And, um, I think he was a bit on the edge, like, Well, okay, you seem very enthusiastic about this, and I do want an Elm programmer. Um, I think what sold him on it was just, well, for one thing, This was like, uh, we could do like an MVP with it.

[00:50:40] And after that, if we changed our minds, we could switch. And the other thing is that, um, I offered to work like a week or two for free as a proof of concept real quick. Just like, okay, I'll just take your existing thing. Cause yeah, there's a little app and some UI, uh, sketches and what. I'll just take what you have there and I'll write it up in Lamdera real quick.

[00:50:59] Just, it took me like a week and a half or something, um, just, just to prove a point about it didn't take much effort to do things in Lamdera. And I think at that point, he was like, okay, fine, you've convinced me. So, uh, yeah, I, I started working there, uh, as you mentioned, it was part time, so just 20 hours a week.

[00:51:18] Um, so I, I still had a lot of free time, which was nice. Maybe some people don't like part time work because, you know, it also means part time salary. But, uh, for me, it was like, oh, all this free time. I can do all this other stuff while I'm at it. Um, and yeah, I really enjoyed the work there. Um. The one downer, the reason I don't work there anymore, is that, um, we couldn't find any customers, unfortunately.

[00:51:46] Um, we never were really able to figure out what we were doing wrong. Was there no market? Were we just marketing badly? Maybe it was something wrong with the tech. Like, the nightmare scenario I had was like... Oh, we have lots of customers, but they can't get past the homepage, you know, or there's some bug or like, it seems very unlikely.

[00:52:05] Cause I was using program-test. Like the happy path was tested like crazy. So I felt confident, but, but still like. Some worry that like something like that was happening. In the end, we don't know. Um, it's just we never really got any customers, uh, well, okay, we got one customer. I think we had one legit customer, and we got one customer who actually was just confused and thought you could buy homes with our app.

[00:52:30] And so, so when they told us that, we're like, Oh, man, dang it. Almost. Uh, yeah, but, but otherwise it was, uh, I really enjoyed my time there. I enjoyed my colleagues. And of course, I liked using Lamdera professionally. That was. That was really cool.

[00:52:46] Jared: Yeah, it sounds like you were really motivated, you know, giving away your time for a couple weeks in order to create this proof of concept and prove this point, um, in order to do this. So yeah, I mean, I guess, you know, that was like, you were living the dream at that point, right? You were, uh, writing Lamdera professionally and still had time to work on side projects.

[00:53:08] Martin: Yeah, yeah.

[00:53:10] Jared: So then you were writing this app with full stack Elm at that point, right?

[00:53:17] elm-map

[00:53:17] Jared: You're using Lamdera and one of the things that I saw that came out of that is elm-map. Do you want to talk a little bit about that? That's a net gain, I think.

[00:53:28] Martin: Yeah, it's, uh, so many things happen that I, like, forget the, the big things. They somehow slip past me. Yeah, elm-map was... So, in the beginning, we used Google Maps for, for this, uh, Realia, uh, app we had created. Um, Google, Google Maps is not, it's, it's hard to integrate into an Elm app, so we stopped using Google Maps and we switched to Mapbox, which was an improvement, but, I still wasn't satisfied with it. Um, long term, I wanted to switch to something that was pure Elm. Uh, I had already, like, over, uh, over a winter break, done a proof of concept where I just wanted to, like, verify that, like, it was possible to take the vector tile format that Mapbox provides from its servers and decode it so that, uh, it can be used within a hypothetical Elm, like, pure Elm map viewer.

[00:54:25] Um, so after I had that set up, then I just needed to, you know, get permission from my boss to do that. Um, it took a little while. I had to like, you know, Can I do it now? No, there's more important features. Fine, you're right. Okay, a couple weeks later. How about now? No, still no. We should redo the UI first.

[00:54:45] Like, okay, fine. But eventually, eventually, uh, I got permission to do it. Um, I think it took like, I mean, I wasn't timing it, so it's hard to say with precision, but Two, three months to do, and this was working part time. So maybe if it was full time, closer to half that. But, uh, yeah, I've managed to make a pure Elm Mapbox viewer.

[00:55:07] Um, and as a bonus then, I asked my boss, Hey, can we open source this? And he was like, yeah, yeah, we can do that. So I was like, yes. So now it's open source. Um. And actually, um, again, I apologize. I don't remember their name, but, but someone immediately after I announced that this, uh, elm-map was open source, they used it to display, it looked, they had like some kind of 3D data that they would place on top of the map.

[00:55:40] So as, as a guess, maybe they were like. Visualizing a glide path for like a, for a, uh, for an airplane or something. Uh, so they placed that on top of the map and they actually added a 3d effect to it, which I thought was really cool because, uh, elm-map was not built to do that, but because it's, um, elm-map is rendered using WebGL.

[00:56:00] It's, it's all, even if it's a 2d perspective, it's within a. Say, 3D context, so it's not that difficult to lean the camera to the side, um, to get a 3D perspective,

[00:56:14] Jared: Very nice. Yeah, I, I looked that up. That was, the app was GPX Magic, and the person who posted that is Peter James Ward. I thought that was pretty incredible.

[00:56:28] Martin: Thank you, Peter.

[00:56:29] Jared: Yeah, yeah, and, and thank you, Martin, and thank you, uh, to the, uh, the person that started the startup with you too, Sam, for, for open, allowing that to be open source.

[00:56:42] So yeah, um, really cool.

[00:56:44] WebGL

[00:56:44] Jared: Now are you using WebGL, the, the package that Andrey Kuzmin, uh, has worked on, or is that lower level WebGL,

[00:56:54] Martin: Uh, it's the package that... Yeah, it's the, the elm-explorations, uh, WebGL package. Um, uh, the, the reason I use it is because it gives a sufficiently low level that you get a lot of the performance benefits from WebGL and a lot of the flexibility that WebGL provides. Uh, in contrast to something like SVG, um, but in contrast to doing WebGL directly with just, just directly with browser APIs, uh, the WebGL package, it's, well, like Elm, right?

[00:57:32] It's hard to mess things up. It guides you so that things tend to just work. Um, and so, This is speaking as someone who has done OpenGL before. So OpenGL is basically WebGL, but meant for your desktop instead. And it's a, WebGL is a bit more constrained because when they made it, they wanted that it was going to also work on low power devices like phones. So WebGL is a bit more constrained, but I've worked with OpenGL before. And my experience with that is that you like, you follow to, you follow a tutorial, like to the letter. For every step you need to compile a shader program, you need to load it, you need to load a buffer with vertices and attributes, you need to make sure that adds up at the right spot, you gotta load everything together in the right order, and if you do anything wrong, blank screen.

[00:58:23] No indication why. Um, so like, I was, I was well aware of how bad it could be. And the WebGL package is just, well, I don't know how to, like, I don't know any fancy words to really capture what I felt, but it was really easy to use. It was really stable. Um, now, I should clarify, there is some flexibility you lose, like, uh, you can't, like, unload a mesh or unload a texture or unload a shader the way you can when you're writing shader API calls directly. Uh, and this is actually a concern in some cases. So for like, Town Collab, Uh, right now, if you play the game for like, an hour straight, which I don't think many people do, but if you do that, the game will freeze up because you run out of GPU memory. So that's something I need to address.

[00:59:13] Uh, so there, it's not all perfect, but it's, my goodness, like, so much time lost working with OpenGL. Like, okay, I followed the tutorial. Why isn't it working? Oh, that step. I did something a little bit wrong there. Nothing shows up on the screen. I got to fix that. Um, I don't want to go back to those days. So, thank you, Andrey.

[00:59:34] Thank you so much for putting that package together.

[00:59:37] Jared: Yeah, yeah, I think that's, uh, that's a great testament to it. And I worked with Andrey on a 3D pool game at one point, and I didn't have to do a lot of that part of the project. I was mostly working with the logic of the game, of, you know, what happens when this ball hits this other ball, and, you know, what's the rules regarding that.

[01:00:00] Um, so it was, you know, kind of separated in that way, but the part that I did interact with that, and when I was playing around with this before I worked with Andrey, I just played around with elm-3d-scene by Ian McKenzie, which is built on top of Elm, uh, WebGL. And so, I mean, that was just like, that was such a dream.

[01:00:24] Uh, you know, and, and I didn't, had no idea. You know, no experience, prior experience with any of it. And the fact that I was able to, like, get things working on the screen was amazing. I was even able to build this tool at work that visualizes how pallets and, and containers are placed inside of a semi truck trailer.

[01:00:50] So, um, and we, we use that at work and that, I mean, it's a huge, um, thing that, that we always tout because visually it's, it's really, uh, nice to see that and, and get that feedback. Originally, I just did it because I was trying to figure out a bug with the original. And so I rewrote the whole thing in Elm.

[01:01:11] Um, in order to

[01:01:12] Martin: As you do,

[01:01:13] Jared: as you do, yeah, um, and it really, yeah, again, kind of what you're saying, like you just start, and you try a little bit, and you're like, okay, this is going alright, this is going alright. And then you're done and you're like, wow, that, that really wasn't that bad. I'm like, I just did this thing that to me would have seemed impossible any other way.

[01:01:30] Um, and, and it, it turned out great. So yeah, thank you to Ian. Thank you to Andrey, uh, for those tools. Um, yeah.

[01:01:41] Realia

[01:01:41] Jared: So at Realia, what was the team size there?

[01:01:47] Martin: We were a team of three people, so me included. Me and two other people. Um, I was, so I was the programmer on like the front end and sort of the back end because we had the Lamdera back end. But my boss, uh, Sam, he wrote a small Python script and also set up a database. So the architecture was something along the lines of, you know, your front end requests to the Lamdera back end for Realtors, like a list of realtors to show on the map, and then the Lamdera back end would ask the Python script, which would ask the database.

[01:02:24] Um, and it worked, it worked fine. You know, like, you might guess this, but I'm not a big fan of Python, but I didn't, it wasn't much Python code. The Python code worked fine because, you know, there wasn't that much of it. It was pretty simple and straightforward. So, yeah, all that went smoothly. Oh, and then my boss also, um, to populate the database with realtor information, he wrote up a web scraping script so he could, uh, collect, because there's a bunch of, uh, Realtor, there's a bunch of different Realtor companies in Sweden that have listings of what Realtors work for them and the houses they've sold.

[01:03:03] So we collected that data. So we could have something to present on our website. Um, so we, we, we essentially were the two programmers, and then the third person, uh, Sina, was like our UI designer, and he also worked as a, a bit of a businessman. Both Sam and him were the businessmen.

[01:03:21] They were, uh, co founders together, but Sina's other responsibility was doing UI design. Um, So, he, he would, uh, put together stuff in Figma, and then I would be responsible for implementing it. Uh, a bit of a tangent here, but, uh, because he was using Figma, uh, and Figma supports writing plugins in JavaScript, I wrote a Elm, like, Platform dot worker Elm app that would compile to JavaScript so I could run it as a plugin in Figma. And what it would do is, it would take the, like, if I click on part of the UI, It would try to convert that into Elm UI code. Um, so it would save me some typing. Um, unlike the other stuff we talked about here, this felt more of on the edge of like, Oh, is this really saving time?

[01:04:11] Maybe. Because the code it generated wasn't, you know, it wasn't quite where it would need to be to really be useful. But, uh, I thought it was pretty cool to have, like, to be able to just make something like that. Uh, just kind of... I suppose it's... It's sort of an unintended benefit of JavaScript being everywhere.

[01:04:33] Is that, well, it means Elm is everywhere too. You can try it wherever you think it might work.

[01:04:40] Jared: Yeah. Yeah. Okay. So, a team of three working on this. You were working half-time. How many lines of code for the Lamdera Elm side of it?

[01:04:53] Martin: Uh, so I actually counted this at some point, and now I don't quite remember the numbers, so I'm afraid if I say a number now and check later, I'll realize they don't match up. But I'm gonna guess, I think it was about 30, 000 lines of code. Specifically, with the caveat that, like, I think we had a module that was like test data, but it was not in the test folder because it was easier to structure having it in source folder.

[01:05:20] So, not counting that, for example, um, I think it was like 30, 000 lines of code. Which, to me, is kind of like, that's it? Like, really? This entire app and it's 30, 000 lines of code? But, I think just... In a normal app, there is so many lines of code that just go to, uh, what Mario refers to as glue code, where it's just writing the encoders and decoders, writing the HTTP requests, all that sort of stuff, um, that you don't need to do in Lamdera, um, and that, that, that just renews, reduces a, like, the amount of boilerplate you have to write is so much less, but, but maybe I should go check that number and we'll put something in the show notes if I'm wrong, just, just so I'm not like spreading misinformation here.

[01:06:10] Jared: Yeah, that sounds good. So, yeah, you're guessing around 30, 000 lines of Elm code for frontend and backend. And this... Would include whatever serialization, deserialization you needed to do with the Realtor data, correct? That you were connecting

[01:06:32] Martin: Yeah, yeah. So, because that's third party data, uh, we needed to have decoders for that. It wasn't that much decoding. The, the format wasn't that complicated. Um, you know, this is an advantage of being able to speak to the person who's writing, you know, who's creating the data. Um, but, but this line of code count, it does include like the entire map viewer.

[01:06:53] Jared: Oh,

[01:06:53] Martin: That just, yeah, even that wasn't that many lines of code.

[01:06:58] Jared: Yeah. Wow. Yeah, that's pretty incredible.

[01:07:03] Elm Market

[01:07:03] Jared: Is there anything else that you've been working on that you want to talk about?

[01:07:08] Martin: Um, yeah, so, well, so I have been working on a project with Mario. Uh, I think I'm allowed to talk about it because he's talked about it during Elm Camp. Yeah. Ooh, juicy gossip. Um, yeah, we've had the idea of, uh, we want to make a website called Elm Market. The idea. At least for the initial version of it, being something where you can create feature bounties.

[01:07:36] So if you think like bug bounties, a person creates bug bounties, they pay you when you find and report bugs to them. The idea with a feature bounty is you place money on a particular feature you want to see completed, and then the person who decides to complete that feature gets the bounty. So that's what we something we want to try.

[01:07:57] So basically, uh, it rewards people for being like the, the good Samaritan who goes around fixing bugs in the Elm ecosystem. Um, so that's something we want to try out. Um, but yeah, that's. Lots of details to work out, um, so, probably should leave it at that.

[01:08:13] Jared: Sure. Okay. Yeah. I have a ton of questions, but I'll, I'll reserve them for when you

[01:08:19] Martin: Might wanna like, reach out to Mario, chat with him. It's, it's uh, credit to him, I think. Yeah, this is mostly his idea.

[01:08:26] Jared: Yeah, yeah, I think I saw some conversation about this at one point in one of the discords. I don't remember which one, but, um, yeah, it kind of seemed like it was one of those things where a lot of, it seems like the, the collaborations you've had and the projects you all worked on, it's like you kind of joke about it for a little bit and then it becomes a little more like, well, you know, could be a real thing, you know?

[01:08:49] And uh, that's great. I think that's, that's,

[01:08:52] the way it

[01:08:52] Martin: so I can add a little bit more. I can add a little bit more, um, So, there, this is not a totally new idea, I checked online. There's other websites that do feature bounties, but as far as I can tell, they're all, you know, dead. There's nothing going on there. Um, and I have a theory why. Um, I think if you're doing a feature bounty service for everything, like all possible GitHub or GitLab or, you know, all the other Git repos out there, the problem you arrive at is that a lot of code, it takes a lot of time for someone new to just step in and figure out what's going on before they can even begin solving someone's feature bounty. But I don't think that's the case in Elm, at least not in my experience. Like total strangers can just go, yeah, that issue right there. I can fix that. You know, I've got like a weekend that I don't have anything planned. They can just step in and do it. And because Elm is, you know, as, as, you know, preaching to the choir here, it's like, it's so easy to understand Elm code.

[01:09:57] Um, it's so easy to just, just dive into someone else's work. Um, with exceptions, uh, Mario actually, during Elm Camp, ran a session called, uh, something along the lines of "The Worst Elm Code Possible", where we had to think up how to write the worst Elm code possible. So, you know, there's pathological cases where this is not true.

[01:10:16] But, yeah, I, I think in the case for like... Where you have a GitHub issue that is some kind of, you know, self contained feature, or maybe a bug even, that you want fixed, uh, in those sorts of situations, I think Elm's a really good fit for this idea, because someone can just easily step in, do the work without too much fuss, um, and I think, yeah, I think that sort of thing should be rewarded.

[01:10:40] So, well, we'll see what happens, you know, hopefully it works out.

[01:10:44] Jared: Yeah, well, that's exciting. We'll, uh, be listening and hoping for more details to come soon.

[01:10:52] State of State of Elm

[01:10:52] Jared: Um, what about, uh, State of Elm? You did that last year. Is that something you think

[01:10:57] Martin: Oh, oh no. Yeah, I did it. Yeah, last year. Um, specifically, I did it last year. I think it was like April, maybe late March. And, uh, it's this year. It's a few months past those months. What happened, right? Um, yeah, what happened is, I don't know, just kind of felt unmotivated to work on it. And actually, like, the two days before this podcast, I was thinking, oh, I should really, like, wrap that up, so I don't have to say this during the podcast.

[01:11:27] Um, but it's not ready yet. Um, so now my next, like, my next, like, last, like, Hail Mary is, okay, well, I can finish it before this podcast goes live. So when people hear me saying this, well, they'll know that it's already out, at least. And so I will be redeemed, but yeah, it just, I know, you know, it's one of those things where sometimes you feel motivated to work on something and sometimes you don't, and it's hard to control why it's just, yeah,

[01:11:56] Jared: Yeah, yeah, I totally get

[01:11:58] Martin: you know, it sucks because some part of me does want to work on it.

[01:12:01] It's just not the part in charge of the fingers, I guess, so I can't type the code out. Um, but yeah, um, I'm hoping to have that that finished before this podcast episode goes live, um, and hopefully. If there's any statisticians out there who are actually hoping to use the State of Elm data to draw some sort of, like, inference, um, hopefully the fact that the first State of Elm and the second are, like, a year and a half apart.

[01:12:31] Hopefully that doesn't mess with any, like, conclusions you're trying to make. I'm sorry otherwise, I should, yeah. I should have had it done earlier, but, yeah. I'll have it done soon.

[01:12:45] Jared: Well, no pressure. I appreciate that you did it, you know, the one time, so we'll take what we can get, um, But yeah, I, uh, I think it will be interesting if, you know, if that does get out there to see, you know, how it's, how it's changed. It's just neat, you know, from a, again, not having to do the, the work, it, it, it's nice for me to say that, but, you know, um, just to be able to, look at that information and get something that is, again, targeted to what we work on.

[01:13:16] I do the State of JS survey every year and it ends up being just, I don't know that feature, I don't know this feature for JavaScript, I don't know that, I've never heard of this library. No, no, no, no, no. Enter in Elm.

[01:13:30] Martin: Yes. Yes. Yes.

[01:13:32] Jared: Elm, Elm, into all the free text places I can get, and then if there's not a free text, I, you know, I get frustrated, and then, you know, just move on to the next question, and And so yeah, it's nice to have something that is targeted for, for us, so

[01:13:51] Martin: Uh, don't forget you need to enter an Elm Radio and Elm podcast in the, uh, the section that involves, like, news and podcasts. That's

[01:14:00] Jared: you

[01:14:01] Martin: thing you got to do.

[01:14:04] Jared: So I'm guessing if you are thinking about this for this year, will you be putting the podcasts on there as, as you know, do people listen to the podcasts or about Elm Camp, anything like that?

[01:14:16] Martin: Sorry, putting,

[01:14:18] Jared: Putting those questions on the State of Elm survey, will you be, will you be doing that for this year? Do you think?

[01:14:26] Have you thought about that?

[01:14:27] Martin: um, Probably nothing with Elm Camp. Um, right now, the issue is I just, you know, I just want to get it released. Um, towards, like, the start of this year, there was discussion around, like, well, what questions should we add? You know, people have lots of good ideas and, you know, yeah, don't make perfect the enemy of good, right?

[01:14:50] Like, I just need to get it released. There are some questions I've added. One of the big ones that I really do want to add is collecting information about what packages people use. So, uh, specifically, I have a question where you upload an elm.json for your application or several applications, and it extracts all the packages, all the dependencies you have.

[01:15:17] Uh, I think that could be really useful information to tell people, like, what packages are, like, heavily depended on, or, like, what version of those packages is heavily depended on, um, and see if there's any trends, especially going forward, like. If a new package comes out, it'd be cool to see what kind of, like, how, how quickly a new package gets adopted, or, you know, how much churn there is in dependencies, like, assuming, um, State of Elm goes for several years, that would be interesting information to collect.

[01:15:48] Um, but yeah, I, I've been mostly focusing on just trying to get it out, um, and

[01:15:57] Jared: Yeah.

[01:15:57] Martin: perhaps this is unpopular, but I've also been, like, thinking about what questions I should remove. Because at the end of the day, once the surveys are in, I gotta also sort the data. Uh, that being said, now with GPT being a thing, uh, it might be feasible to just give it a, you know, big blob of free text answers and go, you sort it, figure it out, you know.

[01:16:22] Jared: Yeah, perfect

[01:16:23] Martin: hopefully it'll come up with something good. Um. But I still want to hedge my bets there. And I think some of the other questions, some of the questions just didn't really make sense to keep. Um, yeah, not all the questions are there from last year, but I've tried to, you know, I don't want there to be too much churn with the questions because it's hard to do any kind of, you know, analysis over a long period of time if the questions are different every year.

[01:16:48] Um, but yeah, I'm, I'm thinking like it's going to add the elm.json question and then maybe next year there'll be more advice and I will feel more motivated to include those questions that people suggest. But then maybe after that, there'll be some kind of like, for the most part, just locking off. This is it.

[01:17:04] These are the questions we're going to ask so that we can get, you know, it's kind of like Elm, right? It doesn't change too quickly and to some part, that's a downside. But to another extent, that's a benefit because everyone knows what they can expect. It's something that can be relied upon.

[01:17:20] Jared: Yeah. Yeah, I like that. And I think it goes even further with what you're talking about with removing questions that don't make sense. You know, that's definitely something that, that happens in the Elm ecosystem in the language of removing things that don't make sense or they're, You know, they're causing more harm than good, so, yeah, I think, uh, you know, and again, you're the one doing it, so if you feel motivated, uh, to do it, and that helps, then I say, go for it.

[01:17:48] Martin: All right.

[01:17:50] Jared: Alright, so, is there anything else you want to talk about before we move on to Picks?

[01:17:55] Martin: Um, Oh, I'm looking at the timer. I think based on the current time, I'm going to say no.

[01:18:02] Jared: Okay.

[01:18:02] Martin: Save something for the next episode, perhaps.

[01:18:05] Jared: There we go. Alright, that sounds good.

[01:18:07] Picks

[01:18:07] Jared: Well, Martin, what Picks do you have for us today?

[01:18:10] Martin: So something that's come up recently, uh, Minibill has been working on a, well, I don't know if it's the final, yeah, I don't know if it's the final name yet, but it's a package called elm-interpreter. Which, to me, kind of came out of nowhere, but it's really cool.

[01:18:24] And basically, it's taking your Elm code, parsing it with the Elm syntax package, and then just running it. So, it skips the type checking step. So, this is what distinguishes it from, like, Elm and Elm, for example, which tries to be a full on compiler. But, thanks to skipping that step, it also is much easier to implement.

[01:18:46] So, Minibill has been able to have, like, uh, an Elm interpreter put together in a few weeks time that I think is really cool. And I think it's also really cool that, um, uh, Jim, JXXCarlson, as he's referred to on Slack, I believe, uh, was able to immediately use it to put together a, uh, uh, like a Jupyter Notebook style application.

[01:19:10] Um, so, cool to see Elm Interpreter and really cool to see someone immediately, like, build upon it, use it for their own application.

[01:19:18] Jared: Yeah, totally. That's a really cool one. I forgot about that, but now that you mentioned it, that wasn't that long ago that, um, the Elm Notebook came out by Jim. That's so cool. And yeah, that, of course, builds on Minibill's Elm Interpreter. Really neat. Okay. What else?

[01:19:38] Martin: I guess I should just give shoutouts. Uh, my sister's girlfriend was the one who set up this microphone, the web camera, everything, and, uh, I think, well, I'll have to confirm it when I'm listening to this podcast later, but I think I sound much better than I would otherwise sound. So, shoutouts to her.

[01:19:57] Jared: Alright, yeah, and what's her name?

[01:19:59] Martin: Uh, Jenny,

[01:20:01] Jared: Yeah, thank you, Jenny. Yeah, that's awesome. Okay. Any other shout outs?

[01:20:07] Martin: No, I'm feeling like maybe I should have thought of something more. I've only got those two, unfortunately.

[01:20:13] Jared: No, that's great. All right. Well, for me, my picks, uh, they're pretty straightforward. One is the Lamdera docs. The, I think it's the main page where it shows the lack of glue code in those diagrams. I think those... Pictures are worth a thousand words and obviously they're worth a thousand packages by Martin Stewart here because he's been able to build some really amazing things with Lamdera and with Elm so yeah check that out if you have not and then the other one I thought about it while we were doing this podcast you mentioned Elm Online meeting on Meetdown and it's on meetdown dot app. I'll put a link to it in the show notes but definitely if you are into Elm, go to that. A lot of the things that Martin's been talking about, they're mind blowing and I got to get them more incrementally because he would present on them at the Elm Online meeting and so that was really exciting. So yeah, if your mind is blown right now and you want more of that, probably go check that out.

[01:21:24] And thanks to all the folks listening out there, so please rate and share if you're enjoying the show. And thanks, Martin, for coming to Elm Town. Hej då.

[01:21:32] Martin: sorry, I do have one more pick. This might be a little pandering, but thank you for hosting Elm Town again. I'm so glad to be back. It's been a while.

[01:21:40] Jared: Oh, you're welcome. You're very welcome. Yeah, I'm glad to be doing it. Yeah, of course. All right, well, hej då!

[01:21:49] Martin: Bye.

[01:21:51] ​