Elm Town 79 – Inspired: Gleam with Hayleigh

SEPTEMBER 3RD, 2024
|
49:19
Hayleigh talks about how Elm has inspired her work, from tools built in Elm such as elm-web-audio and the Ren language compiler, to contributing to the Gleam language and making the Lustre web framework.

Details
/
Transcript

[00:00:00] Jared: Hey everybody. Jared here. This is the first part of an inspired by Elm series. We'll venture a bit outside of town to see the impact of Elm on the larger community. But don't worry. We'll return home. Enjoy.

[00:00:15] Hayleigh: For the longest time I was like, I don't care about this backend stuff. Like Gleam, The BEAM, Erlang, whatever. Like, I don't care about that. I'm going to just use it on the front end. over time I was like, hey, this, this is Elm! This is Elm! But just like an entire virtual machine is based on this idea of like, what if I just had a hundred Elms all like running, doing their own thing? And that like blew my mind, to be honest. That like really clicked with me.

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

[00:00:50] Sponsored by Logistically

[00:00:50] Jared: But first, let's talk about our sponsor, Logistically. At Logistically, we make intuitive software to help logistics teams make better decisions and improve efficiency. Logistically pays me to record Elm Town episodes, as well as pays for our production and hosting costs.

[00:01:07] 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 logisticallyinc. com. I'll put a link in the show notes.

[00:01:19] Introducing Hayleigh

[00:01:19] Jared: Now, Hayleigh. Hayleigh is a developer with a penchant for functional programming. She built Ren, a dynamically typed functional scripting language in Elm.

[00:01:31] It's even distributed as an Elm package. She published some Elm packages under Hayleigh dot dev, notably elm-web-audio. She is an Elm Camp organizer and a Gleam core team member. Within the Gleam ecosystem, she created the Lustre framework, which has a, quote, Elm inspired runtime with state management and controlled side effects out of the box.

[00:01:56] You can find her active on Elm Slack and Discord servers. Hayleigh, welcome to Elm Town.

[00:02:02] Hayleigh: Thank you for having me. I'm so excited to be here.

[00:02:05] Jared: Yeah, I'm excited too. Um, I guess one of the things that I usually start out with this is just to get an idea of your background, how you got started with computing and programming and then kind of how that leads you to Elm.

[00:02:20] Hayleigh: Cool. Um, yeah, I actually have, like, a background in music, music technology. And I, like, picked up programming in my, like, last year of university, um, because I wanted to do, like, algorithmic composition and, like, computational art. and that kind of, like, immediately led me to, like, This visual programming language called Pure Data.

[00:02:45] And then I was doing like C plus plus Arduino things. And then like Java in this like really cool creative coding kind of like language slash library called Processing. And then like eventually found out about the Web Audio API. And, um, like JavaScript and just like, it was like way easier than everything else, right?

[00:03:09] Like super easy to develop a web site. And so I was doing that and then I got like increasingly interested in like programming languages and programming language design and specifically like languages that compared to JavaScript. Because back then I was still like too confused on how to do like compiled development, you know, like how to set up a C compiler or something like that.

[00:03:34] And yeah, Elm came on my radar and I looked at it really briefly. This was around like when CoffeeScript was still like popular. And I looked at it and I was like, no, not for me. That looks, that looks super weird. Went back to JavaScript, then took a class in functional programming. Um, at another university, learnt Haskell, came back to Elm, and I was like, oh wow, this is so easy!

[00:04:01] Um, that was in January 2019. I had a look, actually, recently. That was the first, like, bit of Elm code that I had written. It was, like, the second of January 2019. And then, like, a year later, I was working, like, my first job was working with Elm, and then it's kind of just snowballed from that.

[00:04:22] Jared: Whoa, that's really cool. Okay, so I wanna go back, because you were originally going to school for doing, what was your interest in music? What were you kind of planning to get out of that?

[00:04:33] Hayleigh: Uh, well, I was, like, an electronic music producer, but I was also interested in, like, film scoring. Like, my undergrad degree was kind of like a grab bag of all the different things that basically involved music and a computer. So we did, like,

[00:04:50] Jared: Ah, okay.

[00:04:51] Hayleigh: production, scoring, all sorts.

[00:04:55] Jared: And so, through the course of your studies, you come about, um, learning to, sort of, make music with programming things, and this, what's the, the term that you used, algorithmic,

[00:05:13] Hayleigh: Composition.

[00:05:14] Jared: Composition. What, what is that, exactly? Could you explain what that is?

[00:05:19] Hayleigh: That's kind of like Rules based music generation, right, so you would create a system or a program that generated, you know, like notes, or it could have been sounds, according to, you know, some rules or an algorithm, basically. That was really the first interaction I had had with kind of like, quote unquote, like computational thinking, just like kind of thinking about processes and instructions and that sort of thing.

[00:05:51] Jared: And then, so you're, you end up doing some programming in C++, doing Arduino stuff. This sounds like a lot of fun. At what point did you decide, okay, I'm going to pursue doing something with programming or did it kind of naturally go that way and then you're like, well, I have this experience, I'm going to apply for a job.

[00:06:13] How did that go about?

[00:06:15] Hayleigh: It actually kind of fell in my lap. Um, after my undergrad, I did a master's in computational art, which is kind of, you know, like leaning heavier into the programming now, but still very much sort of arts focused. And that side of things. That was for a year and then I actually started a PhD in Media and Arts Technology.

[00:06:40] And that was when I started moving more, say, into the computer science side of things. And so I was actually doing like programming language research there and the HCI, Human Computer Interaction research.

[00:06:53] Discovering Elm

[00:06:53] Hayleigh: Kind of like parallel to that, that was when I started getting involved in Elm, just. because I was curious and interested in the language.

[00:07:02] And I'd been to like Elm, the Elm London meetup a couple of times, and obviously like I'm terminally online in the Elm Slack, or at least was back then. And essentially, I saw a job posting in the jobs channel on the Slack, and they were hiring like a senior engineer, like full time, obviously. And I kind of like, half heartedly left a comment and was like, oh, can you hold this open for three years while I graduate?

[00:07:32] Um, and actually reached out afterwards and they were like, okay, like, we're not going to do that, but you know, like, how much time can you give? Um, and I just kind of ran with it. I was like, yeah, I can do like one or two days a week, which is like, I can't believe they hired me to be perfectly honest. Like, uh, yeah.

[00:07:50] And it just like, it's super snowballed from that.

[00:07:53] Jared: At that point you had been in the Elm Slack active, right? What kinds of things were you doing before you started working with Elm professionally.

[00:08:03] What were you doing with it?

[00:08:05] Hayleigh: With Elm in particular, um,

[00:08:07] Jared: With Elm in particular, yeah.

[00:08:09] Hayleigh: I was mostly doing web audio things. Um, and so that, that Elm web audio package you mentioned at the beginning, that's actually kind of been a long running idea. Um, like I was super interested in JavaScript because of the web audio API. That's kind of what drew me to web development in the first place.

[00:08:29] And so when I joined Elm, I didn't realize at the time, but that was maybe like three months after 0. 19 dropped, right? And so like all the FFI stuff had, had gone very recently. And so I had joined and I was like, I want to do web audio things. This is a web API. Why can't I do this? Um, and so I spent quite a lot of time thinking about how to do it in a way that, worked with Elm and that was basically the only thing I was building, like I was just building back then The package was called, uh, Elm Audio Graph.

[00:09:05] It's published under a different name. And yeah, that, that's pretty much all I was building. I was building this, and then I was like building little experiments that used it. And then that's also all I was talking about at these London Meetups as well.

[00:09:17] Limits that led to a unique audio Elm Architecture

[00:09:17] Jared: so when you entered the Elm realm, you were right after the Elm 19 release where, yeah, the the kind of native or whatever the the term people used for it, the ability to kind of get around the managed effects of Elm and using ports and custom elements for for doing those things. Doing anything outside of that went away.

[00:09:47] So you were trying to then build this web audio API within those limitations. Were there any unique characteristics that came about because of those limitations.

[00:10:02] Hayleigh: Yeah, I think so. I came up with this idea of essentially, like, the VDOM, but for describing, like, audio graphs, right? Um, so, you know, like a virtual audio graph, basically. And that was a way of, um, declaratively describing audio graphs, and then, you know, you'd send a As Jason value out of a port.

[00:10:25] And then I'd written a little like runtime in JavaScript to turn that into web audio knowns and manage that. And I'd seen maybe only one other similar library that had taken that approach, but it was also kind of like not maintained, not that mine is anymore . Um. And I think, I think it's actually a really powerful abstraction.

[00:10:50] And so I still use that approach today with like Gleam things, even though there we have FFI, et cetera. Um, because I actually think, yeah, I think it's a really, really nice, uh, nice, uh, abstraction. And it was actually like the, the, the foundation of one of, one of the papers that I published for my PhD.

[00:11:12] Jared: So it really influ wait. So was the paper then influenced by your work with Elm Web Audio?

[00:11:20] Hayleigh: Yeah. Um, My PhD research was in sort of programming language design, but specifically for interactive audio applications.

[00:11:32] And my observation there was that a lot of the people in that space, including myself, like didn't have a computer science background. And the kind of two dominant languages in that space are like JavaScript, if you're doing like web apps, obviously, Or C++ if you're developing like plugins or like desktop software.

[00:11:53] And both of these languages have like very obvious pitfalls, right? If you're not so interested in, uh, like software engineering practice. And so my research was around like designing a language that would let you be productive in this quite like a complicated area of software development, even if you didn't care or didn't have a background in the sort of things that would help you write better software.

[00:12:17] And so, yeah, to bring that back, like, this idea of Elm not having side effects and this, like, very constrained way of communicating with the outside world then led me to this particular abstraction, and then I I had essentially built the Elm architecture and then gone, well, hey, like, that's cool, but how about instead of Like, a view, you have an audio, right, like an audio function that does exactly the same thing, but like, it's not rendering to the DOM, it's rendering to Web Audio Nodes.

[00:12:52] Jared: Yeah. So it's the output sense is sound, not sight. If, if, if that's kind of the way that my mind goes with it.

[00:13:04] Hayleigh: Exactly.

[00:13:05] Jared: Okay. Cool. Wow. That sounds really neat. So.

[00:13:11] Pure interest-fueled motivation to learn functional lingo

[00:13:11] Jared: You are getting this, this influence in this, you had, you mentioned you had taken a functional programming class before.

[00:13:19] Hayleigh: Yeah.

[00:13:20] Jared: Elm in, in writing Haskell. And one of the things that I noticed as is that you have a deep knowledge of the mathy words for things in Elm.

[00:13:32] How did you gain that knowledge? Was it through that particular course or just throughout your studies?

[00:13:38] Hayleigh: Um, actually, neither. Um, just kind of like pure interest, fascination, I suppose. Just, uh, I was really interested in this idea of functional programming long before I discovered Elm or started learning Haskell. It's like, it was back when functional programming was this like trendy thing for the web and you had like people giving conference talks about functional programming and then they were just talking around like mapping arrays.

[00:14:08] And that was kind of the, the, the end of their ideas. And, like, I was always good at, like, maths and science at school, even though I never ended up sort of pursuing that. And so there was just a part of my brain that was like, there's something, there's something to this idea, that I just found really, like, interesting.

[00:14:26] And so once I had learned a bit about functional programming through this class, it was really a trial by fire, by the way, it wasn't a good experience. Then I just sort of like ended up being in these spaces of people talking about functional programming and just slowly kind of picking up the words and the terminology and just like being really interested in that side of things. Um, and I've always found it really like fun to explain those things to people that probably don't care.

[00:15:03] I've got like a, I've got a really cool memory of being at one of the Elm London meetups and I'm like sitting on a table and there's like five or six people all around me and I'm like really enthusiastically explaining what a monad is to them. And in hindsight, they probably didn't care as much as I thought they did.

[00:15:23] Uh, I was like, one of those functional programming people, but like, a bit nicer about it.

[00:15:33] Jared: Right, okay. And so this came about through some, having an interest in it. And then you mentioned these spaces, functional programming spaces. What, what were those spaces like?

[00:15:46] Hayleigh: Mostly Discord servers. I mean, one of the nice things about doing a PhD, there are a few, but they're like, at least one of them, um, is that you're kind of in charge of your time, which to me translated to, I had the ability to, Spend a lot of time in kind of like online spaces. So I was very active in the Elm Slack, but then also I was in like functional programming Discord servers and that kind of thing.

[00:16:16] Um, and then also, you know, you're just like, there's this, there's this, uh, like website, I guess, called nLabs. I think that's what it's called, nLab. And it's like a Wikipedia, but just for like category theory. And it's like super, super intense. It's like, you probably need a maths PhD to really understand most of it.

[00:16:41] but I have found myself there on more than one occasion.

[00:16:45] Ren

[00:16:45] Jared: Did the Ren language that you built in Elm, did that come after?

[00:16:50] Hayleigh: Yeah, that came quite a bit of time after. COVID kind of blurred all the timelines, so I might get, I might get it a bit wrong, but maybe like two or three years ago was when I was Really working on that, maybe two, two years ago. I was kind of like quite heavily working on that.

[00:17:09] Jared: Okay. Yeah. And so. Would you mind to describe a little bit, a little bit about what that is and how it fits into the Elm ecosystem?

[00:17:20] Hayleigh: Yeah, it kind of doesn't fit into the Elm ecosystem in the sense that, I had, had this idea or this suspicion at the time that the things I really liked about Elm were not the things that are like typically what people are excited by. And I wanted to explore this idea of dynamic types, immutability, pattern matching, just like those three features.

[00:17:56] Because to me, like, I like really enjoy writing JavaScript. Like, that's kind of like a dirty thing to say in the Elm community, but like, I really, I actually really liked the language. Um, but the There are bits that I don't like about it, and also there are bits that I like from Elm or from other functional programming languages, which is like pattern matching.

[00:18:20] And I had this hunch that you could be super productive in a language like, like maybe you could get 80 percent of the productivity that you might get out of Elm. But for a much, much sort of lower entry fee. Right? Like, you don't have to learn to think about problems in like this pure functional way where side effects go to a runtime.

[00:18:45] You do still have to learn to think about them in an immutable way, but you know, that's, that's a much lower, lower hurdle to clear. And so that was really where I was coming from when I was developing this. I was like, this would be a great language for when I want to write like It's like a code generation thing, or like what you might use like a shell script for, or like just a tiny little one off program.

[00:19:09] Like, I don't want to use Elm for that. It's really awkward for that. And I don't want to use Haskell, and I don't really want to use JavaScript because, you know, it's got like all these features that I don't care about and some things that I don't have, don't like, sorry. And so I, yeah, I was really developing it from that kind of perspective.

[00:19:28] Jared: It sounds like it was inspired by Elm, but I guess what I mean by how it fits in the ecosystem, because as I understand it, the compiler at least is published as an Elm package. Could you describe a little bit how that works?

[00:19:46] Hayleigh: Yeah, um, the way I had written the compiler was essentially that, you know, like, because the compiler is written in Elm, like, that whole part of it, it doesn't have side effects, right? Like the, the part where you read files from the disk and that stuff, that happens with some glue code outside. And so I was like, well, I could publish this as a package and then I'm a bit obsessed about like a code organization.

[00:20:13] So like I'll publish the core of the compiler as a package and then I can write a separate program to do, you know, like the CLI and then I could, because 'cause Elm doesn't have, you know, like git, git deps or something or like private dependencies. I was basically publishing it so that I could use it in other Elm programs.

[00:20:33] But actually that kind of, I mean that's, that's how it ended up anyway, but that did also lead eventually to this channel in the Elm Slack for language development. And there, there are like a handful of us still kind of talking about programming language things. But at the time it was very much like programming language things in Elm, which was like this new thing.

[00:20:59] area, right? Like, not so many people were doing that kind of stuff.

[00:21:03] Jared: Yeah, that's really neat. So, you have this language that you built a compiler in Elm and then you write a little bit of glue code around the edges to make it work as someone would expect, right? Or you need effects at some point, right? You need to talk to, uh, write to the disc, read from the disc.

[00:21:27] Gleam

[00:21:27] Jared: What's interesting is I feel like this kind of leads us to talk about Gleam a little bit, which we haven't done much yet, and I think because, you know, you're talking about, you wouldn't write a script with Elm, most likely. Of course, there is elm-pages scripts, but as far as like a widely used tool, you, you're looking for, you know, kind of building something and you wanted it to have a lower barrier of entry, right?

[00:21:59] For people to try out and get some of the benefits, some of the things that you liked and some of the things you like from JavaScript. And so, And I think this ties in with Gleam because I think this might fit into that space as well, although it has a different set of of design decisions. So, I guess one of the things that we should probably mention is that Gleam was announced 1. 0 recently,

[00:22:27] Hayleigh: Yes.

[00:22:28] Jared: that you, yeah, you're in the Gleam core team. Um, so. What does 1. 0 mean for Gleam? Or, and I guess maybe you just step back first, describe what Gleam is, and then, uh, for folks who don't know, and then

[00:22:43] Hayleigh: I think maybe the best way to describe Gleam is, it's like a functional Go, and by that I mean it's like this, like, simple, easy to understand functional programming language. It runs on the BEAM, the Erlang virtual machine, which is really, really great for, like, web things, right? It's really, really good for concurrency and scaling.

[00:23:13] And then also it compiles to JavaScript, which means that you can run it, you know, in the browser or you can run it Node or Deno or whatever. Um, and similar to Elm and similar to Go, we have like a very tight feature set, very, very, very, very focused on being easy to pick up, easier, easy to write. And yeah, we recently, we recently announced version one.

[00:23:37] And actually what that means is we think, we think two things. We think one, we aren't going to break the language now going forward. You know, there are going to be no backwards incompatible changes, as far as we can anticipate. And two, that we think that the language is ready to be used. In production, specifically, we think the language has been ready for years, but now we're really signaling, Hey, you should come build your Sass platform in Gleam.

[00:24:09] Jared: Right on, okay. Well, with that then, talking about how this relates to Ren, I really like that description of a sort of functional Go, but you also mentioned that the feature set is rather small, and I believe that's somewhat inspired by Elm, as well as, I believe, the type system.

[00:24:33] And I know, Louis Pilford originally created Gleam and then you joined the core team at some point, but maybe since you've been in the Gleam area for a while, Gleamtown or Gleamshire, not sure what to say there. Um, Um, and, and so maybe you could talk a little bit about how that was inspired by Elm and what trade offs and things that didn't do that Elm has.

[00:25:07] Hayleigh: I think our big inspiration from Elm in terms of language design really comes from its, like, philosophy rather than its feature set. And so we do kind of end up having a similar feature set to Elm. You know, we're an immutable functional programming language with a static type system, so there's only so much space to play with there.

[00:25:31] But we kind of diverge in some quite significant ways, and so one of the big ones is that Gleam isn't pure, and so you can kind of perform side effects as and when you feel like it, and also we have, controversially, for the Elm community at least, um, a synchronous foreign function interface. And so when you need to diff into JavaScript or Erlang or Elixir, you can do that quite readily.

[00:26:02] That really comes from, our perspective is that, you know, like 90 percent of the time really you don't want to be doing that. But then, you know, there's like, maybe a one percent, one percent of your career you'll spend like fighting fires and what you really, really need then is a, is an escape hatch, right?

[00:26:19] Because like, you know, prod's gone down or there's some bug in the library or just something that was, is gonna be easier to fix if you could just break out and say, hey, I know what I'm doing. And so, you know, you know, we have, we have that feature. Um, we try not to, we try not to push it too hard.

[00:26:39] Jared: Sure. Okay, so yeah, that sounds like it would, might be the, the largest difference from Elm other than the, the way that it looks, right? The, the style is

[00:26:54] Hayleigh: right. Yeah. We've got the ugly JavaScript, Rust style syntax. Um, we used to have an Elm, Elm looking thing. Um, we used to have like a, like a ruby looking thing for a while. We, we eventually landed on the, on the rust thing, just because it's familiar to most folks.

[00:27:15] Jared: Yeah. That, I guess, in a way is a lower barrier of entry in the, in the populace. So then I was wondering, because you were on the BEAM Radio podcast, episode 72 with Louie. And you mentioned that Elm looks an awful lot like an Erlang process or genserver, would you mind to explain that in a way that Elm folks might understand?

[00:27:45] Hayleigh: Yeah, yeah. So. The BEAM, the Erlang virtual machine, is based on this idea called the Actor Model, or like Actor Based Concurrency, and essentially your program is made up of these, these little units called Actors or Processes, and these are little mini Elm programs. They have an init and they have an update loop and they get messages from the outside world and they just keep ticking like this um, and it's like We have, we have that in Elm, right?

[00:28:19] We have that platform worker, like an Elm app, without a view function. And it's just like, what if you could have a million of those running on your laptop all at once, all just talking to each other, doing their own thing? That's, that's what the BEAM is about, basically. And, and that blew my mind. Like I'm, I'm really into the front end, right?

[00:28:41] Like I am diehard front end web developer. And for the longest time I was like, I don't care about this backend stuff. Like Gleam, The BEAM, Erlang, whatever. Like, I don't care about that. I'm going to just use it on the front end. And then, you know, you know, like you spend enough time in a language that does do backend things, you inevitably end up trying.

[00:29:05] And just over time I was like, hey, this, this is Elm! This is Elm! But just like an entire virtual machine is based on this idea of like, what if I just had a hundred Elms all like running, doing their own thing? And that like blew my mind, to be honest. That like really clicked with me. Much to my dismay, to be honest.

[00:29:27] Jared: yeah, but that is, is exciting because when, you find yourself in a, an area that you didn't expect to go can be pretty exhilarating, right? Where you're like, Oh, how did I get here? Oh, well, I, I said, I saw this and, you know,

[00:29:52] Lustre

[00:29:52] Jared: as we talk about these, these little things that kind of guide. Guide us on our journey.

[00:29:58] you're going from. Algorithmic composition to functional programming to Elm and building your own programming language.

[00:30:07] And now you are a core team member of Gleam and we haven't even talked yet about Lustre. Maybe we should get into that now. You Mentioned Elm's FFI. And I wonder, has that influenced your work with Lustre at all? And maybe as a first step to explain what Lustre is, how that fits in.

[00:30:34] Hayleigh: yeah, Lustre is actually a, a very faithful sort of Elm implementation. And by that I mean, you kind of see this update loop thing crop up in, in all sorts of places. And they usually forego the effects side of things. Um, but no, in Lustre we, we, we have that too. And so Although you're technically in a language that doesn't have managed side effects and does have a synchronous FFI, the construction of the runtime for Lustre really just, like, means you have to use, we call it effect, Elm calls it command.

[00:31:22] You have to use those if you want to speak to the outside world anyway. Um, I think the big difference is that you can write your own. And so You know, like the HTTP package for Lustre. That's not an official package. Someone else made that because they could, and there's an animation one, and a websocket one, etc.

[00:31:43] Um, but actually the core idea is Elm, just straight up. Like, I just stole Elm. I'm not, I'm not, I'm not gonna lie. Like, it's just

[00:31:56] Jared: Sure, yeah, well, I mean that's What is the, I forget the exact phrase, but something like copying is the, the greatest form of flattery. So, or imitation, I believe it may be the quote imitation is the, is the greatest form of flattery. So, you're obviously inspired by The Elm Architecture with Lustre so much that you sort of copy it and create this managed effect system, but also allow folks to build their own effect tools within it.

[00:32:35] Hayleigh: Yeah. Um. That's, that's true. I think, for me, Lustre is taking what's really, really great about Elm and then taking it to new spaces and building on these ideas because you can't do that, right, like in Elm. Or at least not so drivily, you know, like I could fork the compiler, I could Work on Gren, or, you know, I could make a Lamdera or something, but I'm not smart enough to do that.

[00:33:04] But I am smart enough to write a JavaScript runtime and so And so, you know, we take this idea of like very literally we take this idea of an Elm app and then we say hey what would that look like if you could build web components from it or hey what would it look like if you could run that like in the server and just stream the HTML to the client.

[00:33:26] And so what you get is this really, really nice framework where you can write your Lustre program. And because it has managed effects, you can do things like use this Lustre HTTP library and make a network request, but then you can run that on the backend instead, right? Your program doesn't need to know about that, you just swap out the runtime, or you can compile it to a web component and you can drop it on another web page, without Gleam, without Lustre.

[00:33:59] And those are the bits that I think are really, really

[00:34:03] Jared: Yeah, it sounds like there's a lot of opportunity there and a lot of different ways you can go in. What trade offs do you experience with your decision with Lustre to have managed effects And then yet Gleam has a synchronous FFI.

[00:34:23] Hayleigh: The trade offs are probably obvious, in the sense that because I can't, at a language level, or at a framework level, you know, stop you doing something stupid, you can shoot yourself in the foot, right? Like, you can write some dodgy JavaScript that throws an exception and breaks your program, or you can write some code performs some sort of side effect outside of this managed effect system that then ruins things like the time travel debugger.

[00:34:55] you know, ruins the assumptions that we make about your program. So that's the trade off. In practice, I'm not so sure it's a big deal. That's, that's my controversial statement, is that like, the, the, the compiler would be great to stop you doing it. Like, on the maybe 20 percent of the times that you're just being an idiot, but most of the time I just think it doesn't, it doesn't come up as a problem.

[00:35:24] Or at least it hasn't yet, you know. It might come up as a problem when a big company starts using it, but that's a problem that we'll tackle one day.

[00:35:32] Jared: Yeah. Yeah. I think, you know, when you get to a large code base, one of the beautiful things that Elm allows is you can do the optimize flag, right. And because it knows all the spots where JavaScript could be put in because it's only allowed in a few places. It can optimize that and, and only include the things that are actually used.

[00:36:01] Active code inclusion, I believe is, is the way it is described, but, but yeah, I think particularly if you're trying to just get something up and running and you, you're not a, a huge company trying to, you know, manage a lot of people working in a codebase that, yeah, that would be a very nice way to, to make, you know, again, the trade off, right?

[00:36:27] Of, of saying, we know this can happen, but the surface area is not large enough where it's going to cause

[00:36:34] Hayleigh: I think it's, I think it's all about, , you know, like, uh, cost benefit thing, right? Well like, uh, I kind of think, kind of think in terms of like 80 20, and so like my explorations with Ren were like, you know, like I took 80 percent in the sense that, you know, I had the immutability and the pattern matching and I had like, uh, it was dynamically typed but I effectively had, you know, some types.

[00:37:00] And I was like, That's 20 percent of the effort and we get 80 percent of the benefit out of it. And I think it's a similar thing for Lustre in the sense that, you know, Elm gives you that confidence, right? Because of its managed effects. You can't publish packages with JavaScript, et cetera. And that's great when you need like that, that last 20 percent of like reassurance.

[00:37:28] But. If you take a step back and you say, hey, maybe like I can take 80 percent of the safety, still get like a mostly equivalent experience, but like put in a bit less effort. That's really where kind of like Lustre is thinking.

[00:37:43] Jared: yeah, that's a good way of, of explaining it. I like that. So,

[00:37:47] Developer Relations

[00:37:47] Jared: then, I guess to go a little bit of a different direction here. Your job title is DevRel, right? Developer Relations.

[00:37:58] Hayleigh: Yeah, I have two job titles because I have two jobs, but that, that, that's the

[00:38:02] Jared: oh, okay.

[00:38:03] Hayleigh: Like,

[00:38:04] Jared: Well, yeah, I thought it was because, you know, usually talking to software engineers or something along those lines. And of course this is similar, but. Just as, you know, maybe if, if someone's not familiar, doesn't work in a place where that is a job that they experience or have interaction with, could you describe a little bit about what that's like?

[00:38:33] Hayleigh: yeah. Um, so I work at this open source company called XYflow. I kind of have DevRel as my title, but we're a team of five people and so, you know, everyone's wearing many hats. And really a large part of my responsibility is teaching, actually. So like DevRel means many different things to different people, but to me in the role that I'm in, it's teaching.

[00:39:00] Very teaching focused, and so I write a lot of content, you know, like tutorials, guides, examples, and I spend time helping people on the Discord server. Really just like helping people get the best out of this particular library.

[00:39:15] Jared: And that's similar to a developer advocate, right?

[00:39:18] Hayleigh: Yeah, there's quite, yeah, there's, there's a fair bit of overlap. I think I'm probably doing the, the term DevRel a slight injustice. There's, there's quite a lot that goes into that role.

[00:39:29] Jared: Well, it sounds really neat and it sounds like one of the reasons that I wanted to bring that up is, as being someone who's an early adopter of Elm and Gleam, I feel like it's helpful to have those skills as you are trying to make those tools more prevalent and popular. Have you found that to be helpful or, I guess you might not know it any other way, but

[00:39:58] Hayleigh: Yeah, I think it's maybe kind of cyclical or self fulfilling in the sense that I think I naturally ended up in a role like that because I enjoy that side of community and teaching and engagement. And so I'd spend a lot of time, for example, like in the Elm Slack for, you know, like three, four years, like helping new people come to the language and, and get to grips with things.

[00:40:26] And so then now like I'm, yeah, I'm here at this company and I'm, I'm doing that sort of thing. And that then definitely informs like how I approach talking about Gleam and Lustre and Elm to, to people. At the beginning of last year, I decided that this Gleam thing was getting kind of serious now, and that we really needed someone to be talking about it.

[00:40:49] I mean, like, Louis' spending all of their time building the thing, you know, they don't have the time to, to tell people about it. Um, and Bearing, like, I'd not done any conference speaking or anything like that prior. Than that year, I'd given like four or five conference talks, and then this year I've given one.

[00:41:09] I've got two more planned, and then I've got like this, the BEAM Radio episode. I just think, like, somebody needs to be, like, the hype person, you know, talking about this stuff, getting people excited. Why not me?

[00:41:24] Jared: yeah, that makes sense. You enjoy doing it. So you find those roles or seek out those roles and it sounds like it's going well.

[00:41:34] And another thing that you do is you are one of the organizers of Elm Camp. Do you want to talk a little bit about how that's going?

[00:41:43] Hayleigh: Yeah, to be honest, I've taken a pretty relaxed role in the organization of Elm Camp. Um But yes, it's going really, really well.

[00:41:53] Um, yeah, actually, like, it's, it's been, it's a lot of work. It's a lot more work than I thought it was going to be. And so, quite a lot of organizing that goes into planning a, you know, 60, 70, 80 person event.

[00:42:09]

[00:42:09] Jared: Yeah, I imagine so. guess my last question is, what are you excited about today?

[00:42:16] Hayleigh: What am I excited about today? Oh my god. Oh, actually, I'll tell you what I am excited about, is that someone that isn't me, has been building a time travel debugger for Lustre, so I'm going to keep talking about Gleam for another minute. Um, yeah, yeah, and they've built, they've built kind of like a copy of Elm's time travel debugger and now, now we have one as well.

[00:42:38] Jared: Excellent! Yeah, that is exciting. Cool. Alright, well, is there anything else you wanted to talk about before we move on to pics?

[00:42:47] Hayleigh: No, I do not think so.

[00:42:49] Jared: Alright,

[00:42:50] Picks

[00:42:50] Jared: well, Hayleigh, what picks do you have for us today?

[00:42:53] Hayleigh: Okay, the big one coming from me is unsurprisingly another Gleam thing. Um, recently Louis gave a talk at FOSDEM An open source conference called Gleam Past, Present, Future. And it's like a 30, 40 minute talk talking about like the history of the language, it's approach to design, and where we're going this year.

[00:43:19] Jared: Cool. Okay, well, I'll put a link to that in the show notes. Well, I have a couple of picks. The first one is somewhat related to Elm, and since we've been talking about FFI, I feel like it's related, it's a good one to mention, is Custom Elements. There's a little bit in the Elm Official Guide about Custom Elements, and it just so happened that in the past week I was going back to some, , leaflet map integration that we did a few years ago and making some changes, and the experience was really nice.

[00:43:56] Again, you know, I might, you know, Change out the JavaScript for Ren or Gleam or something else, but as far as doing that integration, it was pretty straightforward and I enjoyed it. So that's something that I like and might want to check out if that's something that you find yourself needing or you're doing something in Elm and you're not sure if there is a tool off the shelf that you want to use. You can use something with custom elements to integrate it. And my second pick is I recorded an episode with Taylor Troesh

[00:44:40] and, We were talking about some different things, but one of the things that I brought up that I just mentioned briefly was something that he put on his blog is a tool called Kagi, and it's a search engine.

[00:44:58] And it's one that you actually pay for, which sounds weird, but I've been really enjoying using it. I just did the trial for a month, You get 100, or maybe it was 100 searches, however long that takes. But, let's say it maybe took me a month to use those trial searches. And, it was a nice tool. I liked that there were no ads.

[00:45:24] I liked that I could filter the search results within a particular scope. So, often times I'm searching things related to programming. So I want the search results to be related to programming. So, I don't have to give as much context in my search if I can specify that. And another tool that they have is called FastGPT, which I can give it just a text question and then it will summarize it for me.

[00:45:57] And what I like how it differs a little bit from ChatGPT is it has these little links with the sources for the information that it has, and I can go out to those different sources. So that's been a lot of fun to use. And I've actually been through the trial and now I'm paying for it. So I think it's.

[00:46:22] It takes a lot for me to go pay for something when I could get it for free, so there are other tools that I've enjoyed, which I typically used DuckDuckGo in the past, but it's, uh, it's really nice using Kagi, so yeah, I'm willing to pay a little bit of money for that. And the last one is The Meaning of Culture.

[00:46:43] It's a 1929 book by John Cowper Powys. My book's really old here. Um, I think it's original copy. Um, I don't know. I think there was maybe a 2010 release of it, but it's not very popular, as far as I know. I don't even remember how I first came in contact with it. I obviously got it secondhand, but, , the, the book, it sounds a little pretentious maybe. And even after I read it a decade ago and I'm just starting to reread it, I was kind of, before I picked it up, I was like, I don't know, you know, it seems like it's going to be this pretentious thing. I don't really remember a whole lot about it, but I had been going through my notes and there was a particular idea that I got that it came from this book.

[00:47:35] And so I wanted to go back in and I've been rereading and really enjoying it. And it's more about this sort of personal. culture, personal philosophy more than some, what, what I had sort of built up in my head over the past 10 years of it being like this, uh, you know, this place of, of privilege or something where, where you, oh, you're not cultured, you know, like that type of thing.

[00:48:03] But, uh, but it's, it's actually really good. Um, it talks about culture and, in different, uh, aspects like culture and nature, which kind of seems odd, but it's, it's been, I've really enjoyed rereading it so far.

[00:48:21] And so if it's something that sounds interesting, you're looking for maybe something that's a little bit older that has withstood the test of time, might want to check it out. And I think that's it. Did you have anything else, Hayleigh?

[00:48:37] Hayleigh: No, but that book sounds super interesting. I'm gonna check it out.

[00:48:42] Jared: Well, hopefully you can find a copy. I'll put a link in the show notes. I saw that there were a couple of used copies, at least. And again, I believe there was a newer version published, uh, maybe 15 years ago. So, yeah, well, thanks to all the folks who are listening out there. And please share if you're enjoying.

[00:49:05] And thanks, Hayleigh, for coming to Elm Town.

[00:49:07] Hayleigh: Thank you so much for having me.

[00:49:08]

© 2024 Jared M. Smith