spotifyovercastrssapple-podcasts

Why We Care About Elm

We discuss our backstories, our core values and beliefs as developers, and why Elm speaks to us.
July 3, 2023
#85

Transcript

[00:00:00]
Hello Jeroen.
[00:00:02]
Hello Dillon.
[00:00:03]
Well today I think it might be time to pull back the curtain a bit and expose some of
[00:00:08]
our opaque types for our listeners.
[00:00:10]
Oh no!
[00:00:11]
No, we want to keep those things hidden!
[00:00:16]
But they need to know how we got here.
[00:00:17]
They need to know our supervillain backstories Jeroen and why we care so much about Elm.
[00:00:23]
Alright, should we not say like supervillains that stay opaque?
[00:00:30]
That's our superpower!
[00:00:31]
Yeah, but like if you discover the villain, then he's not a villain anymore.
[00:00:38]
He's just a troubled person with problems that he's trying to solve.
[00:00:43]
Then we'll just be Batman.
[00:00:45]
Okay, you be Batman and I'll be Robin.
[00:00:53]
You could be Superman.
[00:00:54]
We'll just reveal your kryptonite.
[00:00:56]
Alright, that's fair.
[00:00:58]
So I think it's fair to say Jeroen, we do care a lot about Elm.
[00:01:03]
That might even be an understatement.
[00:01:05]
Slight understatement.
[00:01:06]
Yeah, probably.
[00:01:10]
I think we've both invested a lot into Elm and really I feel a sense of wanting to invest
[00:01:19]
in this community because I think at the core of it there's something I really believe in
[00:01:24]
and I want to like fulfill this vision of this thing that I think is really important.
[00:01:31]
So I thought it'd be cool to like get at that.
[00:01:33]
What is that thing that's so important to us and like how did we get here?
[00:01:38]
What made us care about this so much?
[00:01:40]
Yeah, absolutely.
[00:01:41]
So Dillon, why do you care?
[00:01:43]
Well...
[00:01:44]
What is your origin story?
[00:01:47]
My origin, so I, my first job out of college was doing Ruby on Rails development and throughout
[00:01:54]
college I was, you know, we learned, my first college class was in Python.
[00:02:00]
Really?
[00:02:01]
And that was quite a nice experience learning in Python.
[00:02:05]
It felt very high level and it was great for being introduced to some like basic computing
[00:02:10]
ideas.
[00:02:12]
Then we started doing Java and C and C++ for the rest of my college courses.
[00:02:18]
And you know, I have mixed feelings about Java.
[00:02:21]
It's quite powerful, but, and the editor tooling is incredible.
[00:02:28]
But when I discovered Ruby for this first programming job and Ruby on Rails, I did start
[00:02:35]
to fall in love with the approach of like doing things in a way that felt like it did
[00:02:41]
away with the formalities a little bit.
[00:02:43]
And it said, let's model domain concepts.
[00:02:46]
Let's come up with APIs that are DSLs, domain specific languages.
[00:02:51]
Let's really think about the domain.
[00:02:53]
Let's think about the domain terms.
[00:02:55]
Let's speak in domain terms, not in lingo that's talking about an abstract factory instance.
[00:03:02]
And you know, like Java does start to feel like you're bending over backwards to do things
[00:03:11]
that aren't related to your domain.
[00:03:13]
So I liked that about Ruby.
[00:03:14]
I felt like, okay, I'm really spending a lot of time thinking about my domain.
[00:03:19]
So that resonated.
[00:03:21]
Then working with Ruby on Rails.
[00:03:23]
Now I liked, I think I liked Ruby more than I liked Ruby on Rails.
[00:03:27]
I know there's a lot to love about Ruby on Rails, but I found it extremely confusing
[00:03:32]
to navigate because of all of the magic and all of the implicitness and the mocking, the
[00:03:38]
mocking, Jeroen.
[00:03:41]
Don't get him started on mocking.
[00:03:45]
Have you worked with like code bases that do a lot of mocking in their test suites?
[00:03:51]
I think so.
[00:03:52]
Yeah.
[00:03:53]
It's been a while, but yeah, I think so.
[00:03:55]
Well, I know so, Jeroen.
[00:03:56]
I know that I've done it because I remember it because I really did not like it.
[00:04:01]
Like, I don't know.
[00:04:02]
I still feel the blood on my hands.
[00:04:06]
I think, I don't know, maybe that is a part of my, maybe that's my radioactive spider
[00:04:15]
that bit me or something.
[00:04:16]
I don't know, but I really don't like mocking in tests because it just feels like there's
[00:04:23]
something so horribly wrong.
[00:04:25]
If this is what we're doing, then we need to throw everything away and rethink it.
[00:04:30]
Wait a second.
[00:04:31]
You've been bitten by mocking, right?
[00:04:34]
So now you gain the ability to mock mocking.
[00:04:37]
Exactly.
[00:04:38]
And now we just make fun of it all the time.
[00:04:41]
That's right.
[00:04:42]
Yes, I do.
[00:04:43]
Superpower.
[00:04:44]
Absolutely.
[00:04:45]
Mock man.
[00:04:46]
I would like to, I'd like to make a mockery out of mocking and gosh, because it just feels
[00:04:55]
like you're, you don't, you don't know anymore what you're testing, you know, because any,
[00:05:02]
you can't trust anything that you're looking at.
[00:05:05]
So that was, that was my experience with Ruby on Rails.
[00:05:08]
I'm looking at some code and I'm like, okay, what, what things are happening to get here?
[00:05:14]
Like what global variables are there?
[00:05:18]
What, what code is mixed into this module?
[00:05:21]
So like, this is like a class that I'm defining, but does something monkey patch it later?
[00:05:26]
Or is there a module that gets mixed into it later that changes the behavior or override
[00:05:30]
something?
[00:05:31]
Is it calling some methods that depend on implicit context and depend on some, some
[00:05:39]
state that it's changing?
[00:05:41]
Does it pass in an argument somewhere and that gets mutated somewhere?
[00:05:45]
And that's like a very real thing that happened when I was debugging things and trying to
[00:05:51]
figure out what went wrong.
[00:05:53]
And so like, and then you go to fix it.
[00:05:56]
And I, and I loved like writing tests to wrap my head around what was working.
[00:06:01]
And when I was writing unit tests, I'm like, oh yes, this, like, this makes sense.
[00:06:05]
I can like understand what this is doing.
[00:06:07]
And then you start doing controller level tests, integration tests, and everything is
[00:06:13]
mocked and you're like, wait a minute now, like now there's all this magic in the code
[00:06:17]
itself.
[00:06:18]
And now I've added this, like, I don't know what I'm actually testing.
[00:06:21]
I don't know what's real and what's fake in the test.
[00:06:25]
So I was very disillusioned by that, but I didn't, I didn't know it at the time.
[00:06:30]
I didn't know I was disillusioned at the time because that I'm like, well, I guess like
[00:06:36]
this is programming.
[00:06:38]
This is like, this is what you do.
[00:06:40]
And I didn't know there were alternatives to that.
[00:06:42]
This is my life now for the next 40 years or however long.
[00:06:47]
Exactly.
[00:06:48]
So I had had a little bit of a seed planted because when I was doing Ruby on Rails, I
[00:06:54]
discovered the enumerable mixin, which is something you can use on data structures that
[00:07:00]
are enumerable like arrays to, to filter them and map them and inject fold L sort of thing.
[00:07:10]
Wait, was inject fold L?
[00:07:12]
I can't even, I honestly can't even remember now.
[00:07:15]
Sounds like a weird name for fold, but I think it might've been.
[00:07:20]
And then there was compact.
[00:07:21]
Compact was very cool.
[00:07:23]
Compact is something I do all the time now in Elm, a filter map identity.
[00:07:27]
Oh yeah.
[00:07:29]
Removing all the nils in the case of Ruby from a, from a list.
[00:07:33]
But but I fell in love with working in that way and I started to really, you know, instead
[00:07:39]
of using the shovel operator to imperatively add things into an array as you iterate over
[00:07:48]
it, it's a way to push things into a list.
[00:07:51]
That's another thing about Ruby and Ruby on Rails.
[00:07:53]
There's more than one way to do it.
[00:07:55]
You know, my mind is a little bit stuck on the shovel operator.
[00:07:58]
I'm trying to imagine what it would look like.
[00:08:02]
It's a double carrot.
[00:08:05]
I think it's two less than signs.
[00:08:07]
Okay.
[00:08:08]
Oh, so function composition in Elm, they call that shovel?
[00:08:13]
They call it shovel because you're shoveling things into an array, I guess.
[00:08:16]
Okay.
[00:08:17]
So it's more about the use and what it looks like.
[00:08:19]
Okay.
[00:08:20]
I guess.
[00:08:21]
I think so.
[00:08:22]
But these are things that you, you need to know.
[00:08:24]
And so much time was spent in code reviews, just talking about, you know, nitpicks of
[00:08:30]
like, oh, you know, I really don't like the shovel operator.
[00:08:33]
I prefer to do it this way.
[00:08:35]
I prefer to do it, you know, with a list dot map, or I prefer to do it with a for loop,
[00:08:41]
or I prefer to do it within each loop because those are all things you can do.
[00:08:46]
I prefer to use unless.
[00:08:48]
I prefer to use if.
[00:08:50]
It's like, geez, let's just like have one way to do things that works nicely, you know,
[00:08:56]
but.
[00:08:57]
Let's configure this linter to make all those choices for us.
[00:09:01]
Oh, right.
[00:09:02]
Which linter should we use?
[00:09:04]
Yeah, I prefer this linter.
[00:09:08]
This was in the days before like auto formatters were in vogue also.
[00:09:13]
So you know, that was a whole nother thing.
[00:09:16]
But yeah, it felt like there was so much churn just figuring out how to express something.
[00:09:25]
And at the same time, like, like, I wanted to just think about how do I model these domain
[00:09:30]
concepts?
[00:09:31]
And how do I understand what the heck is actually happening here?
[00:09:35]
Like, how do I get a test around it to understand exactly what inputs lead to what outputs and
[00:09:41]
what scenarios are interesting?
[00:09:43]
How do I model the domain, interestingly, and how do I avoid like magic stuff?
[00:09:49]
And so like enumerable started to feel like, OK, I like this way, but I felt a little bit
[00:09:55]
out of place because I didn't feel like everybody was on the same page as me with like, some
[00:10:00]
people could kind of get behind it, but it wasn't a widely held opinion that that was
[00:10:07]
a cleaner way to do things.
[00:10:09]
So I guess the thing after my Ruby on Rails days was I got into coaching, agile and technical
[00:10:17]
coaching and that influenced me a lot in terms of the power of small steps, the power of
[00:10:24]
being very deliberate.
[00:10:26]
And I was coaching teams, I was coaching a team using AngularJS.
[00:10:31]
And there were so many, so many challenges working with that code base, you know, making
[00:10:37]
it testable and, you know, bugs would pop up and Angular just, you know, this is Angular
[00:10:44]
1, AngularJS.
[00:10:45]
And it was, again, there were a lot of ways you could do things.
[00:10:49]
There were a lot of foot guns.
[00:10:50]
There was, you know, you could mutate the DOM.
[00:10:55]
You're definitely not supposed to.
[00:10:56]
There are like big warning signs that say, warning, don't use this, but it's here.
[00:11:02]
And you find some random stack overflow post and you don't know what's broken.
[00:11:07]
There's some subtle, like leaky abstraction that you need to fix and you don't know what's
[00:11:13]
going wrong to fix it.
[00:11:15]
And so a stack overflow post tells you to mutate the DOM and you do it.
[00:11:20]
And not to mention, it just felt like very difficult to, to even just like, you know,
[00:11:26]
I want to have this Angular dependency that I can use in this context.
[00:11:33]
How do I even get it in there?
[00:11:34]
And how do I know that it's working correctly?
[00:11:37]
You know, it like automatically injects values based on the variable name.
[00:11:42]
And you're like, is this even working?
[00:11:44]
And if it breaks, how do I know?
[00:11:47]
And at the same time, like I'm coaching this team on these technical practices and we're
[00:11:51]
helping them do legacy code refactoring, do continuous delivery, getting push button deploys
[00:11:58]
and doing trunk based development on it, all of these things.
[00:12:01]
And it had real results.
[00:12:04]
Like we were, we were shipping faster and more confidently, but there was so much work
[00:12:10]
to get there.
[00:12:11]
And I realized like the language choice plays a big role in your ability to do these practices.
[00:12:18]
And when I discovered Elm, it was a breath of fresh air because suddenly all these things
[00:12:22]
I was trying to coach, like let's avoid having our tests blow up on the first of the month
[00:12:28]
because it depends on the specific date they're run.
[00:12:32]
Let's make them deterministic.
[00:12:34]
Like these are practices I was coaching teams on that, like I saw results in the code bases
[00:12:41]
becoming more robust and teams spending less time churning on these fires and more time
[00:12:48]
focusing on the domain and shipping things faster.
[00:12:51]
But with Elm, I'm like, wow, like dependency injection is just the only way to do things
[00:12:57]
because you can't depend on impure things.
[00:13:00]
And testing is very straightforward and you have this fast feedback loop from the compiler
[00:13:06]
telling you exactly what went wrong.
[00:13:09]
Even back then, because I think you used Elm in 18?
[00:13:13]
That was in the 18 days.
[00:13:16]
Okay.
[00:13:17]
Yeah.
[00:13:18]
When the compiler was still slow, right?
[00:13:19]
Well, when I say fast feedback, I mean, everything was kind of slow back then.
[00:13:24]
So I wasn't really like noticing a speed difference between other things.
[00:13:28]
Also, this wasn't like a, you know, several hundred thousand line code base.
[00:13:34]
But when I say fast feedback loop, I mean, just more like compared to scratching your
[00:13:39]
head at why isn't this Angular thing working and it not telling you and you literally spending
[00:13:43]
a whole day trying to figure it out.
[00:13:45]
And you're like, oh, of course it was here, some dumb little thing, but it doesn't tell
[00:13:49]
you.
[00:13:50]
So it really felt like a breath of fresh air.
[00:13:53]
And it really felt like it addressed these things in my experience with Ruby that didn't
[00:14:00]
sit right with me where mocking it's like, well, you can't mock.
[00:14:05]
But more importantly, like you express the code in a way where you wouldn't need to mock
[00:14:11]
because it's not coupled to all of these side effects and external systems.
[00:14:18]
You inject that in.
[00:14:19]
So you just test the behavior.
[00:14:21]
You write something that isn't coupled to that.
[00:14:24]
Right.
[00:14:25]
So all of these like very subtle decoupling things that I was trying really hard to like
[00:14:30]
coach teams on and teach them how to practice.
[00:14:32]
It's like, well, in Elm, you don't really need to teach that.
[00:14:35]
It's just like, I mean, in Elm, you just need to tell people, write tests.
[00:14:41]
But if they write tests, then they're going to write them in that way and they're going
[00:14:44]
to write their code in that way.
[00:14:46]
So I think that's I think that's kind of my story.
[00:14:50]
That's why I really believe in Elm because all these things like that, I felt like I
[00:14:56]
didn't belong.
[00:14:57]
I wasn't in the right place because I just wanted one way to do things.
[00:15:01]
And also, I just like wanted these practices to be natural.
[00:15:05]
It just made sense to me.
[00:15:07]
Yeah, I totally see where you're coming from.
[00:15:09]
The mock spider, radioactive mocks.
[00:15:12]
Mock man.
[00:15:13]
Well, Jeroen, what is your super villain backstory?
[00:15:18]
Are you a super villain or are you a superhero?
[00:15:21]
Who knows?
[00:15:23]
The listeners can decide.
[00:15:25]
Yeah.
[00:15:26]
Please say I'm a good guy.
[00:15:29]
Yeah, so where I come from is more from working as a developer.
[00:15:36]
So my career started with CoffeeScript and JavaScript and then more and more JavaScript
[00:15:41]
until I did some Elm.
[00:15:43]
And I was pretty much always getting a little bit frustrated with all the problems that
[00:15:47]
we were hitting, crashes that were happening that felt preventable.
[00:15:52]
I started looking into ways that we can improve things by using the newest framework out there.
[00:16:01]
I remember being very excited about AngularJS when I was still interning.
[00:16:08]
I was excited by React when it was released, which is at a company where we're using AngularJS.
[00:16:16]
And later on, I became excited by Elm for the same reason as well.
[00:16:20]
I started playing with functional programming using Lodash, a specific version of Lodash,
[00:16:26]
which is called Lodash-FP, which is all those, not standard, but all those extra functions
[00:16:36]
like we have in basics extra and text extra that are done in FP style.
[00:16:42]
So nothing is mutated.
[00:16:44]
You always get a copy of things and the order of arguments is data last instead of data
[00:16:51]
first.
[00:16:52]
So that was quite different from regular Lodash, but I really enjoyed using that.
[00:16:56]
That made things feel more easier to understand.
[00:17:00]
And the Lodash, the FP stuff is using like curried JS style.
[00:17:07]
So you were already into partial application and down that rabbit hole at that point.
[00:17:11]
Yeah, in a way, yeah.
[00:17:14]
So maybe I didn't use it all that much, I feel, in retrospect, but it did make my learning
[00:17:21]
of Elm much easier.
[00:17:23]
I didn't have as much trouble with learning Elm as plenty of others have done, probably
[00:17:29]
because of that.
[00:17:30]
Yeah, yeah, I think so.
[00:17:32]
It's just like, well, it's the same things as Lodash, except you have less surprises.
[00:17:37]
And yeah, and it worked well.
[00:17:39]
So that felt very nice.
[00:17:42]
And at the same time, I was playing with ESLint, writing a lot of ESLint rules.
[00:17:46]
I wrote like 75 over the course of a year, because there were just so many problems that
[00:17:52]
you could have in our code base and in JavaScript.
[00:17:55]
So I wrote plenty for packages that were published, a few under my name, a few under other people's
[00:18:02]
names, and a few that were custom to our code base at work.
[00:18:08]
And I mean, 75 rules are a lot of rules.
[00:18:11]
I don't think I've written that many for Elm Review in the four years that I've been working
[00:18:17]
on it, or however long that was.
[00:18:19]
So yeah, at some point, I discovered Elm.
[00:18:22]
And I'm like, well, just first to play with Elm, I needed to try it out.
[00:18:29]
And Elm is a front-end language to do web applications, but I had no real experience
[00:18:36]
with making front-end applications.
[00:18:39]
What I did have experience with, however, was writing Linter rules.
[00:18:42]
So I decided, well, you know what, let's try to make a Linter, even a basic one.
[00:18:48]
And I really liked the experience, mostly because of custom types, like just the fact
[00:18:53]
that you can pattern match on AST nodes, and you know exactly what they contain and all
[00:19:00]
the AST nodes that you can encounter.
[00:19:04]
That felt like a breath of fresh air, because when I was running ESLint rules, oftentimes
[00:19:09]
I didn't know which AST nodes I would hit, which one I would encounter.
[00:19:14]
And then there were some properties that I thought would always be there that turned
[00:19:20]
out to be optional.
[00:19:22]
And when I relied on them not being optional, that crashed the whole ESLint application.
[00:19:28]
And that didn't feel nice.
[00:19:29]
So when I was playing with writing a Linter in Elm, I was like, well, the experience is
[00:19:35]
much nicer.
[00:19:36]
And I say that even while writing the Linter from scratch.
[00:19:41]
So that was a lot more work.
[00:19:43]
Right.
[00:19:44]
And that was your first Elm project, right?
[00:19:46]
That was my first Elm project.
[00:19:47]
And at some point that became ElmReview.
[00:19:50]
And that was at the beginning of 2017.
[00:19:54]
So that's been a long time.
[00:19:56]
Yeah, wow.
[00:19:58]
Yeah, so then I didn't use Elm for a few years.
[00:20:03]
Started doing it professionally at a company, and I really enjoyed it.
[00:20:08]
There was one thing that was lacking.
[00:20:10]
There's like, oh, well, there's plenty of problems in my code base that we can just
[00:20:14]
fix by telling people, hey, look at the code you wrote.
[00:20:17]
This is not how we should do things.
[00:20:18]
And I'm like, well, if only we had a Linter that could write custom Linter rules.
[00:20:24]
Well, you know the rest of the story.
[00:20:27]
So yeah, my experience with Elm was like, there's a lot less things that you need to
[00:20:32]
check with static analysis, because the compiler is already doing that, and the design of the
[00:20:37]
language is already doing that.
[00:20:38]
I actually made a blog post on Elmcraft, or an article on Elmcraft, describing all the
[00:20:45]
rules for ESLint, the core rules that don't make sense in Elm, like that you don't need,
[00:20:53]
or which ones do you still need?
[00:20:57]
And like 86% or something like that were not needed, and therefore they're not in ElmReview
[00:21:04]
either.
[00:21:05]
And that's just like a staggering number.
[00:21:08]
So yeah, these are the kinds of things that I really enjoyed with Elm.
[00:21:12]
And over the course of my Elm career, or mostly working as a tooling developer, I've just
[00:21:20]
come to appreciate how much potential Elm has.
[00:21:23]
And it's a bit of a weird potential that you have, because you can say, oh well, JavaScript
[00:21:29]
has plenty of potential, you can do plenty of amazing things, and that's true.
[00:21:33]
Rust has plenty of potential, etc.
[00:21:36]
All those languages have them.
[00:21:38]
But Elm's case is a bit particular, because for instance, for JavaScript, you're like,
[00:21:44]
oh, JavaScript is amazing, and once we have async await, or whatever new feature that
[00:21:51]
was decided by a committee, it's going to be much more awesome, things are going to
[00:21:55]
be much easier, and you're going to be able to create very cool products with it or very
[00:22:00]
cool tooling.
[00:22:02]
And the Elm way, the way that Elm has potential is not that way.
[00:22:07]
It's not like, oh, we're waiting on features that a committee has decided or that Evan
[00:22:12]
has decided.
[00:22:14]
It's more like, well, we see a lot of innovation because people push what they can do with
[00:22:20]
Elm.
[00:22:21]
And I'm just always amazed by what people do.
[00:22:25]
And it's usually just relying on the design of the language, which is like pure functions
[00:22:32]
everywhere, immutable values everywhere.
[00:22:34]
And just from those tiny facts, you can do so much.
[00:22:38]
Like ElmReview, great tool, but it's great because it has a language that is very analyzable.
[00:22:46]
And if a value doesn't appear anywhere, then you can just remove it.
[00:22:53]
Easy as that.
[00:22:54]
Lambdara, for instance, has like, well, we're just writing Elm code.
[00:23:00]
And because Elm code is just plain data, we can just send them over the wire from the
[00:23:07]
front end to the back end and back end to the front end, maybe with some additional
[00:23:12]
limitations.
[00:23:13]
But you can basically just write Elm and you have now an amazing experience writing front
[00:23:21]
end and back end languages with hosting and backups and all that.
[00:23:27]
And it's only because we're pushing on the things that Elm gives us, not because we're
[00:23:32]
expecting new features to arrive to the language.
[00:23:36]
And that's something that I haven't found anywhere else.
[00:23:39]
So that's one of the reasons why I really care about Elm, is I just see so much potential
[00:23:43]
and it's not even like because I see it, like I can think of it.
[00:23:48]
It's like I know that people will make more things because they just keep happening.
[00:23:54]
Yeah, right.
[00:23:56]
That resonates with me a lot too.
[00:23:58]
Like because, yeah, as you say, it's not just like what got you in the door, but then what
[00:24:06]
makes you see the long term vision that you want to be a part of?
[00:24:10]
And I think we both are really invested in that.
[00:24:14]
And it is, like you say, because I mean, you know, Elm Tailwind modules and Lambdaera and
[00:24:22]
you know, Elm UI and all these like innovative approaches.
[00:24:27]
I mean, Elm format, it just like it feels like there's also an ethos in the community
[00:24:32]
of being willing to think things up from first principles.
[00:24:36]
That's really cool.
[00:24:38]
But thinking things up from first principles while also being very pragmatic and user focused.
[00:24:44]
And I think that's pretty remarkable.
[00:24:45]
Yeah, Elm's design has a lot of things going for it, where we're able to mix a very simple
[00:24:53]
language with very strong guarantees to get a lot of things out of it.
[00:24:58]
So we have a simple language that is easy to teach.
[00:25:02]
Like people always tell you, oh, there's a learning curve because it's different.
[00:25:06]
But in practice, Elm is still a very simple language, especially for a functional one.
[00:25:12]
It's teachable, it's analyzable for Elm review, for people reviewing the code.
[00:25:18]
It's pretty fast.
[00:25:19]
It's super maintainable because of pure functional features and immutable.
[00:25:25]
And all of that, it goes well together.
[00:25:27]
And you add to that, like all the things that you can get out of that.
[00:25:31]
And it's just the result is just amazing, in my opinion.
[00:25:35]
That's why I stay here, because I see some potential.
[00:25:38]
I don't know what people will come up with.
[00:25:40]
I'm very excited to see things.
[00:25:42]
I see other languages, like for instance, Rust is an amazing choice for plenty of projects
[00:25:48]
at the moment.
[00:25:49]
And it's trying to improve the status quo compared to other languages or frameworks
[00:25:56]
that are in the same space.
[00:25:58]
So mostly about memory and performance, it's trying to be really good at that.
[00:26:04]
And other languages do the same thing, like F sharp is an improvement over C sharp because
[00:26:10]
of improvements.
[00:26:12]
It's a different approach.
[00:26:13]
And you've got other languages like Rescript or Reason, I still don't remember the name,
[00:26:21]
Grain, Glean, they all try to improve the status quo, improve things compared to JavaScript,
[00:26:27]
compared to other languages.
[00:26:29]
But they never go as deep as Elm goes.
[00:26:33]
Like it's always like, well, F sharp is, if you're a functional, it's a functional language,
[00:26:41]
we're not going to go deep into purity.
[00:26:45]
Glean is like, well, we're going to be pretty much just like Elm, but we have FFI with Erlang
[00:26:53]
things.
[00:26:55]
And you lose some of the guarantees that Elm has, or the Elm approach has.
[00:27:01]
And I'm like, well, it's a shame because you lose so much by doing that.
[00:27:08]
Yes.
[00:27:09]
The difference between a, I mean, a 99% guarantee isn't a guarantee, right?
[00:27:14]
And it just, it feels different.
[00:27:18]
You know, not to say that it's not a valid approach with benefits to say, I want to make
[00:27:24]
the set of trade-offs where I can do FFI with these other languages, or, you know, I want
[00:27:32]
to just write in JavaScript, or I want to use Rescript and be able to directly call
[00:27:39]
JavaScript and wrap things with their FFI wrappers.
[00:27:42]
That's great.
[00:27:43]
Like, that's a totally valid set of trade-offs.
[00:27:47]
It's just a very different set of things that fall out of that compared to Elm.
[00:27:53]
And I think you and I really find it a compelling vision when you say, let's make that drastic
[00:27:59]
choice.
[00:28:00]
And, you know, as you're saying, like, I think the thing about Elm, it's not, it's not about
[00:28:06]
what Elm adds.
[00:28:07]
It's about what Elm has removed.
[00:28:09]
And it's removed these things that you, that give you guarantees.
[00:28:15]
So now you can say, well, this is all I have.
[00:28:17]
I have custom types and pure functions and immutable values.
[00:28:23]
And that's, if that's all there is, then I can make so many assumptions and I can have
[00:28:30]
so many guarantees and I can build such interesting tools to use that.
[00:28:34]
I don't even know if I was like a tooling person before I got into Elm.
[00:28:39]
Like I feel like Elm really changed that about me where it, I mean, in my coaching days,
[00:28:44]
I really saw the power of good tools.
[00:28:47]
And I realized that if you're really good at editor tools, it's not, it's not a fun
[00:28:53]
toy.
[00:28:54]
It is like a very powerful tool that transforms you as a developer.
[00:28:58]
I think like, I think if you're able to navigate around refactoring tools and work, I find
[00:29:04]
that so powerful, like working with guaranteed refactorings, which like if you're working
[00:29:09]
with Java or Kotlin, it's like really powerful what you can do just working with like refactoring
[00:29:15]
operations that you can trust.
[00:29:18]
But the potential there in Elm is even greater because there are way fewer sharp edges that
[00:29:26]
you can encounter.
[00:29:27]
Well, as you say, Elm has removed a lot of features and in a way it has removed pretty
[00:29:33]
much all the foot guns.
[00:29:35]
It also has removed a lot of escape hatches because in some of the escape hatches, you
[00:29:40]
have a gun.
[00:29:41]
We are in, in the basement of America.
[00:29:45]
I don't know.
[00:29:47]
Plenty of guns everywhere.
[00:29:50]
And as you say, like there are trade-offs to doing things in one language or another
[00:29:57]
and making one tool in JavaScript is, might be much easier than writing in Elm or a similar
[00:30:05]
language with those same limitations.
[00:30:09]
But you don't get the same things in return.
[00:30:13]
So in Elm, like I'm almost amazed that I forgot to say that, but like there are no errors.
[00:30:19]
There are no crashes.
[00:30:20]
Like, yeah, that's kind of the main things.
[00:30:23]
So for instance, if you write things in Lambda or in Elm pages, your code will not crash.
[00:30:29]
It will not have any errors.
[00:30:32]
You could probably have a framework like Lambda or Elm pages for JavaScript or other languages
[00:30:39]
like that, but you're not going to be able to prevent it from crashing.
[00:30:45]
Or maybe it's possible, but you're going to have to do so much work on making that work.
[00:30:53]
So you're going to have to add additional limitations to your language.
[00:30:57]
So for instance, say like, well, you can use, it's just JavaScript, but don't use eval,
[00:31:03]
don't use subclassing, don't use, I don't know, whatever feature doesn't work in this
[00:31:11]
imaginary situation.
[00:31:12]
Or you're going to just do a lot more analysis work.
[00:31:16]
Like oh, please add all these ESLint plugins to make sure you're not falling into one of
[00:31:22]
these traps or using these foot guns or all these things that you need to worry about.
[00:31:28]
Like in Elm, it's just much simpler.
[00:31:31]
That's the default approach.
[00:31:33]
And then tooling authors, package authors in Elm have just this ethos of trying to make
[00:31:40]
things type safe, which just improves the situation for Elm even more.
[00:31:46]
Sometimes at the cost of a little bit more verbose API or things that are not as nice
[00:31:52]
to use because you need to handle all possible cases.
[00:31:55]
But in practice, like the result is really, really good.
[00:31:59]
And you're just going to have a hard time having the same results in another language.
[00:32:04]
At least when Elm is a good fit for your project, like not saying Elm is always a good fit.
[00:32:09]
Like we're, but.
[00:32:11]
Yeah, and obviously there is a trade off with convenience, you know, just being able to
[00:32:17]
grab an off the shelf NPM package or, you know, React hook or component library, whatever
[00:32:25]
it may be.
[00:32:26]
You know, there's a trade off.
[00:32:28]
And this is a choice that we all make when we're using Elm.
[00:32:32]
And I mean, in a way, like I feel like you and I really want to do everything we can
[00:32:39]
to make the ecosystem as compelling as we can to narrow the gap of those trade offs.
[00:32:45]
Because like inherently, yes, there is a certain like there's people want convenience and Elm
[00:32:52]
takes away convenience in a fundamental way that gives you something back that's very
[00:32:57]
valuable.
[00:32:58]
It gives you back the ability to reason about your code in a totally different way and the
[00:33:03]
ability to have guarantees and trust your code in a very different way.
[00:33:07]
But it takes away convenience and that's just a fundamental truth about the core trade offs
[00:33:12]
that Elm makes.
[00:33:14]
And some people are just not going to like that.
[00:33:16]
Some people are not going to want to be constrained in that way.
[00:33:20]
They're going to say, hey, you know what?
[00:33:21]
Like I'm an adult.
[00:33:23]
I want to be able to have a global variable if that's how I want to solve my problem.
[00:33:28]
I want to be able to bypass the compiler checks and just use a type and not have to write
[00:33:36]
a decoder for it and things like that.
[00:33:38]
And that's a reasonable preference, but it's just a very different world.
[00:33:44]
And but, you know, I mean, I think that working with Tailwind in Elm is super compelling.
[00:33:51]
And like that's, you know, as we fill out the ecosystem with more of these things, we
[00:33:57]
get closer to that vision, which it's not going to be.
[00:34:01]
I don't think it's ever going to be as big as JavaScript.
[00:34:03]
Right.
[00:34:04]
It's just I think inherently like you take away people's convenience and fewer people
[00:34:09]
will be attracted to that world.
[00:34:11]
Yeah.
[00:34:12]
But.
[00:34:13]
But in some cases, like people are going to adopt it and they'll be fine with it.
[00:34:18]
Like all the functional tools that we have in Elm, like map and filter and reduce and
[00:34:25]
whatever.
[00:34:26]
Well, we can see those in popping up in all other languages, anonymous functions as well.
[00:34:32]
Right.
[00:34:33]
So people are getting used to some of the features.
[00:34:36]
And I would kind of say like Elm's some of Elm's features are like seatbelts.
[00:34:42]
People hated them when they had to start using them.
[00:34:47]
I'm guessing I was still too young back then.
[00:34:49]
Yeah.
[00:34:50]
Oh, yeah.
[00:34:51]
But now everyone has them.
[00:34:52]
And I don't think a lot of people will just say, well, this is for nothing.
[00:34:56]
Like this is useless.
[00:34:58]
People know it's going to be helpful.
[00:35:00]
Some people will still decide to take them off or not to put them on.
[00:35:05]
And well, it's going to be very scary for them.
[00:35:08]
Should anything happen, you lose some guarantees.
[00:35:11]
Yeah.
[00:35:12]
And yeah, sometimes the tradeoffs are very much in favor of one design or compared to
[00:35:21]
another seatbelts.
[00:35:22]
It's not a lot of a lot of constraints, but it adds a lot of guarantee about like helping
[00:35:29]
you survive a crash.
[00:35:31]
So it's definitely worth the effort and not worth encountering the risk.
[00:35:37]
And I'd say in Elm, like there's just so many things that handling all cases, handling that
[00:35:43]
something is null or nothing, it's worth it.
[00:35:47]
It's not always practical, but yeah, it's a very compelling story.
[00:35:51]
I mean, it is interesting.
[00:35:52]
Like I think TypeScript has shown that like, I think that 99% guarantees are in a lot of
[00:36:02]
people's minds.
[00:36:03]
Fine.
[00:36:04]
Right.
[00:36:05]
And, and that's okay.
[00:36:06]
But a lot of people calling JSON dot parse and it returning in any type, it's like, yeah,
[00:36:13]
that's fine.
[00:36:14]
You know, or maybe they're like, well, I'll use Zod or IOTS and do a decoder style thing.
[00:36:22]
And be really careful about not introducing any types, but some people are like a lot
[00:36:28]
of people see TypeScript more as a developer tool and a productivity tool and an auto-completion
[00:36:34]
tool rather than something that prevents crashes in their system and something, I mean, you
[00:36:40]
know, prevent some, but it doesn't prevent all and people, people aren't expecting it
[00:36:44]
to and they're okay with that.
[00:36:46]
But yeah, when we can have an ecosystem built around this, it just opens up these interesting
[00:36:52]
possibilities, which we haven't really even scratched the surface of with editor tooling,
[00:36:57]
refactoring tools.
[00:36:59]
You know, I mean, Elm Review has like filled a lot of this gap, but Elm Review still has
[00:37:06]
so much more that it could do, I'm sure.
[00:37:09]
Right.
[00:37:10]
So like, we're really just scratching the surface of what we can do with this.
[00:37:14]
Not to mention that, you know, as you talked about, like the thoughtfulness of the API
[00:37:19]
design that we see is really humbling.
[00:37:22]
And I mean, I love being a part of this community for that reason.
[00:37:27]
Like it's just like people really put a lot of care into the domain and they really think
[00:37:32]
through like they put so much care into that user's experience.
[00:37:37]
Like what is it going to be like using this package and what things could go wrong and
[00:37:43]
what things can I make so the user doesn't have to ever think about going wrong because
[00:37:48]
I can prevent it entirely.
[00:37:49]
And what things can I model that can go wrong because I can't avoid it, but I can make it
[00:37:55]
explicit and nice to work with and make those choices.
[00:37:59]
So and as we talked about in our documentation episode, the Elm package docs are a big part
[00:38:05]
of that.
[00:38:06]
And I mean, navigating documentation back when I was doing Ruby on Rails development
[00:38:13]
and JavaScript development, you know, sometimes tough, like finding what you were looking
[00:38:19]
for and like, what, what can I, what can I call?
[00:38:22]
Because there's meta programming and things are, you know, except different types of values,
[00:38:30]
you know, except an object or null or undefined and have different behavior based on what
[00:38:35]
you pass in.
[00:38:36]
So it's very, very pleasant to work with Elm APIs and very easy to navigate.
[00:38:41]
And it's just so, yeah, like I think, and in general, like I think I really at my core
[00:38:48]
believe in this idea of working with pure functions as, as the basis of what we're writing
[00:38:56]
and building out all of these things around them.
[00:39:00]
Again, like the mocks, right?
[00:39:02]
Like if you're a mock man, it's just like, it solves that problem by inverting things.
[00:39:12]
If you can't do non-deterministic things, if you can't mutate state and perform side
[00:39:19]
effects and do non-deterministic outputs from, from within your code, you can only do it
[00:39:25]
from outside of your code.
[00:39:27]
You can only pass it in from outside of your code as a dependency.
[00:39:30]
You've inverted that as a language feature, which is amazing.
[00:39:36]
And I can't understate the value of that to me, having that as not a guideline and a principle
[00:39:43]
and a best practice, but as a part of the language is very powerful.
[00:39:49]
And so I just deeply believe in that.
[00:39:52]
I also believe in that not just for my beliefs about like best practices for coding you know,
[00:40:00]
taking small steps and making things testable and all these sorts of things, but also for
[00:40:07]
frameworks.
[00:40:08]
Like I believe that it's a very good way to target things as a framework author to, to
[00:40:13]
just neatly define like, here's the interface for this thing.
[00:40:19]
And I, as the framework, I'm going to be the interface between you and the outside world,
[00:40:24]
but I'm going to clearly define the contract.
[00:40:27]
Choose your contract of what you can ask me to do, and I'll go do the dirty stuff in the
[00:40:32]
outside world that performs side effects and does impure things.
[00:40:35]
So building Elm pages, that's been something I've really started to believe more deeply
[00:40:42]
as well is that Elm is actually a very powerful tool for, as a target for framework authors.
[00:40:51]
And I, well, actually the day that we're recording this is the day after I released Elm Pages
[00:40:58]
V3.
[00:41:00]
And I hope that there will be more big framework releases like this to come in the Elm ecosystem,
[00:41:07]
because I think it's a very promising part of the Elm language.
[00:41:10]
And I hope it's for the maintainer because it's been a lot of work.
[00:41:16]
It has.
[00:41:17]
Yeah.
[00:41:18]
Very true.
[00:41:19]
Yeah, I think we could do with maybe a suite of tools to empower framework authors.
[00:41:26]
I'm not sure if that would be at the compiler level or a set of meta tools, but whatever
[00:41:33]
it is, yeah, we could definitely empower.
[00:41:36]
And in general, I think, I mean, I think that's what I most wish for the Elm ecosystem is
[00:41:42]
that we could empower authors of tools to do more, like having more access to type information
[00:41:50]
and things like that.
[00:41:52]
Like if we have that, I feel like so many powerful tools would come out of that.
[00:41:58]
Yeah.
[00:41:59]
See, you're not even asking for new features in the language.
[00:42:03]
Right, exactly.
[00:42:04]
You just want the things that we have to be even easier to access to make even better
[00:42:09]
tools or better frameworks or better packages.
[00:42:13]
Yes, exactly.
[00:42:15]
Because there's so much rich information that the compiler has.
[00:42:18]
And when you pair that together with the guarantees that the language gives you, the tooling
[00:42:25]
possibilities are endless.
[00:42:28]
But if we had an easier way to make use of those and didn't have to reinvent the wheel
[00:42:33]
every time as tooling authors, I think it would enable a lot of innovation.
[00:42:39]
And that's like, I think that's really what Elm needs to blossom.
[00:42:44]
Like you said, it's not, it's not so much new, like there aren't that many language
[00:42:50]
features that Elm really needs, maybe a handful of small improvements, but nothing, nothing
[00:42:57]
massive.
[00:42:58]
There's like, that's not the main thing it needs.
[00:43:00]
I do feel like we're both on the, of the opinion, like what Elm is missing is more tools.
[00:43:07]
At least that was what we said.
[00:43:10]
And I'm sure that if we, if other people talked about the same topic in Elm, like more regular
[00:43:16]
users of Elm, just people who write Elm to do their day job, then they would have a very
[00:43:22]
different reply to this or different opinion of this.
[00:43:26]
At least I don't think they would focus on tooling as much.
[00:43:30]
Yeah.
[00:43:31]
In practice, I think most people, they want better tools and for people in the JavaScript
[00:43:37]
world, for instance, that often comes, that often comes from new language features or
[00:43:43]
new framework or new build tools or whatever.
[00:43:46]
So yeah, also tooling, but also sometimes new language features.
[00:43:50]
Yeah.
[00:43:51]
I mean, we, we would definitely benefit a lot from a larger ecosystem.
[00:43:55]
You know, I mean, it would be great to, if you want to use a particular, you know, view,
[00:44:02]
view library, it would be great if there were some no brainer choices for doing material
[00:44:08]
UI or Ant design or whatever it is in Elm.
[00:44:12]
That would definitely be a huge boon for, for the Elm community, I think.
[00:44:17]
Another reason why I care about Elm is just, I find it fun.
[00:44:20]
It's like just working on, no, not even working on Elm things.
[00:44:27]
It's like working with Elm.
[00:44:28]
I'm for instance, super happy that I've built Elm review in Elm, at least mostly in Elm.
[00:44:34]
The Elm parts are the more, the most fun ones and just the, yeah, the, the sheer simplicity
[00:44:42]
of refactoring and adding new features and making sure you don't have to, not having
[00:44:50]
to think about all the edge cases because the compiler will remind you about those.
[00:44:56]
It's just feels so nice.
[00:44:58]
It's just very enjoyable, very relaxing compared to when I work on Elm review, but on the CLI
[00:45:05]
part, which is in parts written in JavaScript.
[00:45:09]
Now with a slightly bit TypeScript or JavaScript with JS doc and it's not a fun.
[00:45:16]
Yeah, I feel the same way.
[00:45:18]
And I definitely make the sacrifice of writing JavaScript and TypeScript to build these meta
[00:45:25]
frameworks to make it nicer to work in the Elm ecosystem.
[00:45:28]
But then once I can move away from that and just say, okay, I built all this infrastructure.
[00:45:35]
Now let me sit down and write an Elm pages script, you know, or let me write a route
[00:45:40]
module in my Elm pages app.
[00:45:42]
Like yeah, I feel so happy just having that explicitness and the Elm compiler to help
[00:45:47]
me.
[00:45:48]
And again, like not having to wonder, does this throw an exception?
[00:45:52]
Does, does this change some state somewhere, you know, or should this use the shovel operator
[00:45:59]
or a map or a for loop or an each loop, you know, or it just see like, it really does
[00:46:08]
feel like there's, there's almost one way to express a lot of Elm code.
[00:46:14]
Of course it's not literally one way, but it, it, it feels like you write Elm and it,
[00:46:19]
you don't have to think about all these details.
[00:46:21]
You think about what is the problem I'm solving and, and you can refactor your code.
[00:46:27]
It's fun to refactor your code.
[00:46:28]
It's not scary.
[00:46:30]
And like, well, here we go.
[00:46:32]
Probably going to break a bunch of stuff.
[00:46:34]
And if you, if you write tests with Elm, it's even easier to, to refactor your Elm code.
[00:46:39]
And it's very easy to write tests in Elm.
[00:46:42]
It's so nice to write tests in Elm.
[00:46:44]
And the kinds of tools that we see, like Martin Stewart wrote Lambdaera program tests, which
[00:46:51]
I'm absolutely amazed by just emulating.
[00:46:54]
So similar to Elm program tests, where you have something that, that emulates a browser,
[00:47:01]
letting you click on something in an Elm view and navigate around an Elm application and
[00:47:06]
make assertions about what the view shows.
[00:47:08]
Lambdaera program test builds upon that, but it lets you simulate multiple connected clients
[00:47:14]
interacting with an actual Lambdaera backend and actually executing that backend code.
[00:47:21]
And it's not mocking it.
[00:47:23]
It's running the same code that's going to run in your backend in production and the
[00:47:27]
same code that's going to run on your frontend in production.
[00:47:30]
And you can trust it.
[00:47:32]
And there is the browser emulation piece, but that's a pretty thin layer, you know,
[00:47:39]
clicking on things and triggering on click events.
[00:47:41]
So besides that, you know, that it's going to behave the exact same way, but it's as
[00:47:46]
fast as a unit test because it's not spinning up a headless browser.
[00:47:50]
And in the case of Lambdaera program tests, it's emulating multiple connected clients
[00:47:55]
to like a real time backend framework.
[00:47:58]
And you can actually view it stepping through it.
[00:48:01]
It's just unreal.
[00:48:03]
And the, and this was something that Martin Stewart was like hacking on something.
[00:48:09]
He's like, Oh yeah, it'd be nice if I could like write a test for multiple connected clients
[00:48:13]
to make sure I've got these race conditions ironed out.
[00:48:17]
And it'd be nice if I could visualize the state of it.
[00:48:20]
And he just kind of hacks it together and he's like, Oh yeah, it actually works out
[00:48:23]
perfectly and it's really easy and elegant.
[00:48:25]
And that's how it is.
[00:48:27]
Like I feel like that's something inherent in Elm that things don't end up, you pull
[00:48:33]
on the thread and it gets messier and messier and you, and it works really nicely until
[00:48:38]
you start pulling on that thread and then it falls apart.
[00:48:41]
In Elm I feel like you start pulling on that thread and it, it comes together even more
[00:48:46]
cleanly because it's, there's an elegance and a simplicity to Elm itself.
[00:48:51]
Yeah.
[00:48:52]
It requires some work to, to, to remove all the hairy parts, but yeah, absolutely.
[00:48:59]
It requires a lot of work, but you're like, the potential is there to build amazing tools
[00:49:07]
that like don't have these caveats and these messy edges.
[00:49:11]
If you're willing to put in that work as a tooling author.
[00:49:14]
Yeah.
[00:49:15]
I'm thinking of Cypress for instance, where Cypress is a testing framework where you can
[00:49:20]
emulate your browser and it actually runs a browser and it's super powerful, but everywhere
[00:49:28]
in its docs it says things like, don't do this or don't do things this way.
[00:49:33]
And whenever you go to another test, then we just start from scratch.
[00:49:38]
It's like kind of the same experience that you just said, like you, you pull on a thread
[00:49:44]
and the result is nice, but at some point if things get hairy and in the case of Cypress,
[00:49:51]
because it's JavaScript, it's playing with a browser, which is complicated in practice.
[00:49:56]
Well, they don't put out something nice.
[00:49:59]
They just say, okay, well not start from here.
[00:50:02]
You should not do this.
[00:50:03]
You should not do that.
[00:50:05]
And the result is not as nice and you don't get the same results.
[00:50:10]
Like it's slower, well for good reasons potentially, but it can crash.
[00:50:16]
It can crash in weird ways.
[00:50:20]
I might be a little bit biased, but you get what I mean.
[00:50:25]
Yeah.
[00:50:26]
I mean, you know, I think that's what we get for the price of Elm, the price of writing
[00:50:32]
pure functions, which is a limitation that we take on.
[00:50:37]
And that's what we get from that, right?
[00:50:40]
So really interesting things emerge from that.
[00:50:42]
But that's why tooling is so important in Elm, because we paid that price.
[00:50:47]
So give us our money's worth by giving us amazing tools and dedicating your life to
[00:50:54]
building really cool tools, tooling authors.
[00:50:57]
So that's why we do it.
[00:50:58]
I will dedicate my life to make these awesome tools that rely on the purity and functional
[00:51:05]
and blah, blah, blah.
[00:51:07]
Okay.
[00:51:08]
So that's not my villain story.
[00:51:09]
That's my priesthood story or something.
[00:51:12]
Maybe it's a curse.
[00:51:13]
I don't know what it is, but here we are.
[00:51:18]
You talked earlier about people who do TypeScript and they're happy with the new guarantees
[00:51:24]
that they gain from TypeScript compared to JavaScript.
[00:51:28]
And I mean, it was a lot of work to convince those people to use TypeScript for good reason,
[00:51:33]
because it has a lot of complexity still and a lot of build steps and all that.
[00:51:39]
And some people got convinced and some people are now very, very happy with it.
[00:51:43]
And TypeScript is now pretty much the standard, even compared to JavaScript, at least in the
[00:51:49]
circles that I...
[00:51:51]
Sometimes you just don't know how bad you have it, right?
[00:51:54]
Like the people who did JavaScript and not TypeScript, they didn't know how good it was
[00:51:59]
to have types.
[00:52:01]
We often say that they've been bitten by Java and they're pretty lousy type system.
[00:52:07]
And that might be true.
[00:52:08]
But yeah, if you go to Reason or to Elm or to F Sharp, the types are really nice.
[00:52:15]
And I would say from TypeScript compared to Elm, you now have a type checker, which works
[00:52:23]
well.
[00:52:24]
It doesn't use the same technology or the same idea behind it.
[00:52:28]
So the TypeScript one is not as reliable.
[00:52:32]
Like something that is still missing is side effect tracking.
[00:52:36]
And I don't think the TypeScript people know how bad they have it, that they have to handle
[00:52:41]
all those side effects.
[00:52:43]
Yeah, right.
[00:52:45]
Every time I go to the Netherlands, I'm just always amazed by something that is very simple
[00:52:51]
and that is traffic lights.
[00:52:53]
Have you ever been to the Netherlands?
[00:52:55]
No, I'd like to go.
[00:52:57]
Okay, well, the road infrastructure is very nice because you've got bikes everywhere.
[00:53:04]
You get a separated bike lane and a separate pedestrian lane on top of the normal roads.
[00:53:11]
And the traffic lights are just amazing.
[00:53:13]
Like for instance, if you're in a car and you go to a crossroad, so we've got traffic
[00:53:19]
lights everywhere stopping people.
[00:53:22]
And if you're the only one who's driving through that.
[00:53:25]
So for instance, if you're driving in the middle of the night, then the traffic light
[00:53:29]
will be red.
[00:53:30]
And once you arrive at this traffic light, it will go green and you can just go now because
[00:53:36]
the traffic light knows there's no one around.
[00:53:40]
And every time I go there, I'm like, ah, this is so amazing.
[00:53:43]
And then I go back to France and I get to a traffic light that is red and I look everywhere
[00:53:50]
and there's no one in sight.
[00:53:52]
No pedestrian, no bike lanes.
[00:53:54]
Oh, well, there are no bike lanes and no other cars.
[00:53:58]
I'm like, why am I waiting?
[00:54:01]
And just being able to have a green light right away would improve traffic for sure
[00:54:07]
because people don't stop for nothing.
[00:54:11]
You don't have a large lane of cars just waiting for this red light.
[00:54:18]
And the people, at least in France, I don't think they know how bad they have it because
[00:54:23]
they haven't seen, they haven't been to the Netherlands.
[00:54:27]
When they have, they go there for bad reasons like French tourists.
[00:54:31]
Right, right.
[00:54:32]
And yeah, I think for typescript, it's the same.
[00:54:36]
Like if you go to Elm, you won't have the same type system.
[00:54:39]
It will be a much nicer one.
[00:54:41]
Limiting, potentially, but much nicer.
[00:54:45]
Side effects, not an issue, but you don't know how bad you have it when you have that.
[00:54:51]
So trade-offs everywhere, but sometimes the results are very, very nice.
[00:54:56]
And I think it would be nice for people to try out those things.
[00:55:01]
And by the way, go to the Netherlands.
[00:55:03]
It's a nice place.
[00:55:04]
Yes, I definitely will.
[00:55:06]
Yeah.
[00:55:07]
But don't take the plane too much.
[00:55:09]
Yeah.
[00:55:10]
Yeah.
[00:55:11]
Yeah.
[00:55:12]
I mean, it's definitely, you kind of buy into a way of working and thinking.
[00:55:20]
And I find it really interesting.
[00:55:22]
My time as a coach, doing my coaching work really influenced me on this as well, of how
[00:55:28]
much somebody's mental model of something can influence the way they interpret what's
[00:55:34]
going on.
[00:55:35]
So for example, like a lot of my coaching work, I was trying to get teams not being
[00:55:44]
blocked by things, not being blocked by needing things from other teams, but being empowered
[00:55:50]
to work on things on their own and being able to ship things all within one team and being
[00:55:55]
able to deploy something with the push of a button.
[00:56:00]
But if you're perceiving things as being more efficient by another team working on something,
[00:56:08]
then you're going to interpret the pain points around that in a different light.
[00:56:14]
Whereas if you perceive the pain of fitting pieces together, where two different teams
[00:56:20]
built something and now you go to integrate those two pieces and they don't work, or these
[00:56:26]
two systems don't understand each other, or they have a very heavy handed contract with
[00:56:31]
each other because it's not people operating within the same context, or you're going to
[00:56:38]
ship something and you have five months of work that you're going to spend one month
[00:56:44]
testing.
[00:56:47]
You're going to perceive that very differently if you have a mental model that says, well,
[00:56:51]
let's be efficient with our testing.
[00:56:53]
We have to manually test this, so let's be efficient by batching everything up.
[00:56:58]
We don't want to ship something today and then have to go test the whole app.
[00:57:02]
That would be inefficient.
[00:57:03]
Well, if that's your mental model of things, then it is going to look inefficient.
[00:57:08]
But if you have a different mental model, then you look at it as the more we batch things
[00:57:16]
up, the more that can break at once.
[00:57:19]
And the more we've lost context from the thing that we've worked on to know what we're looking
[00:57:25]
for.
[00:57:26]
And the less we've automated testing things and the less confident we can be about our
[00:57:32]
deploy process and the less we automate our deploy.
[00:57:35]
So looking at it through different lenses totally transforms the way that you see it.
[00:57:40]
I think it's the same with looking at the tradeoffs of Elm versus TypeScript.
[00:57:45]
If you're looking at it as the value of guarantees versus the inconvenience of having to pass
[00:57:54]
through side effects explicitly, not being able to trigger them from anywhere, the hindrance
[00:57:59]
that that causes you, you're going to perceive it very differently.
[00:58:02]
And I think some people just have a different mental model and a different preference fundamentally.
[00:58:08]
And I think that's fine.
[00:58:10]
But for those who, I mean, my bottom line is if you make a set of tradeoffs, then cash
[00:58:18]
in the good things from those tradeoffs.
[00:58:22]
You've paid the cost of making the sacrifices of the cons of that tradeoff.
[00:58:28]
So get all the pros from that tradeoff that you can.
[00:58:32]
And right.
[00:58:33]
But you need to know which tradeoffs you made.
[00:58:37]
If you only know JavaScript, what are the tradeoffs of JavaScript compared to other
[00:58:43]
things?
[00:58:44]
Like where does it shine?
[00:58:45]
Absolutely.
[00:58:46]
Absolutely.
[00:58:47]
Yes.
[00:58:48]
And I mean, I think, I mean, I've heard a lot of people say that try Elm out, you'll
[00:58:53]
learn something even if you end up not using it in your production stack.
[00:58:57]
So I definitely think it's a good learning experience for people to try it out regardless
[00:59:02]
of whether they end up using it.
[00:59:03]
It's interesting because when you say, tell people how to write good code, it's usually
[00:59:07]
like stay simple, write good names and just use simple functions.
[00:59:14]
Right.
[00:59:15]
That in practice, that's what it boils down to.
[00:59:17]
Like keep codes very simple.
[00:59:20]
Kiss.
[00:59:21]
Keep it stupid, simple, silly, simple, silly.
[00:59:25]
Okay.
[00:59:26]
Is that stupid?
[00:59:28]
Usually people say keep it simple, stupid.
[00:59:30]
I was just being silly.
[00:59:31]
Well, I mean, it's maybe a less offensive one.
[00:59:35]
Yeah.
[00:59:36]
Not the one that I had heard at least.
[00:59:39]
I mean, in practice, like if you want to go towards better and simple code, you go to
[00:59:46]
words code that it looks like Elm and Elm just makes that the default.
[00:59:50]
Yes.
[00:59:51]
Also like the only thing you can do.
[00:59:53]
So we might feel like a limitation, but in practice, like, yeah, it's just good code
[01:00:00]
because that's what good code tends to words.
[01:00:03]
Yeah.
[01:00:04]
I mean, I definitely am convinced personally, my, like all of the things that I've learned
[01:00:11]
about what makes a code base maintainable are very aligned with Elm and happen very
[01:00:18]
naturally with Elm.
[01:00:19]
Making code traceable, you know, decoupling things, inversion of control, all these types
[01:00:25]
of practices.
[01:00:26]
It's very natural with Elm.
[01:00:28]
Also like it's hard to imagine with how core parse don't validate and these types of principles
[01:00:35]
make impossible states impossible are to how I think about writing good code and fixing
[01:00:40]
bugs and keeping them fixed.
[01:00:43]
I don't think I could go back.
[01:00:44]
I don't know, I don't know how I would write code without tools in my tool belt that make
[01:00:50]
it really easy to do that.
[01:00:52]
And when I, when I'm writing TypeScript personally, I honestly don't do that much of things like
[01:01:00]
parse don't validate and make impossible states impossible.
[01:01:03]
It's just cumbersome and I don't really get the full guarantee.
[01:01:07]
So it feels like, why am I bending over backwards to make discriminated unions that like, I
[01:01:14]
can't really trust.
[01:01:16]
It feels like it's going against the grain of how the whole ecosystem is working that
[01:01:20]
I'm using.
[01:01:21]
Yeah.
[01:01:22]
On top of that, it's also like, there's this distraction or there's this temptation, this
[01:01:29]
little devil telling you like, Oh, Hey, this could be much simpler if you just mutate this
[01:01:36]
argument.
[01:01:37]
Right.
[01:01:38]
Like, and potentially for good reason, because also like can be more performance.
[01:01:47]
Sure.
[01:01:48]
But there's always this temptation to write code in a, not a nice way.
[01:01:54]
That is, I just find distracting and sometimes I get tempted in practice to do that.
[01:02:01]
And that's how my code turns out.
[01:02:03]
And that will, or the might create problems, but you don't have that in Elm.
[01:02:08]
And that feels just nice.
[01:02:09]
Like it's not an option.
[01:02:12]
Stop thinking about it.
[01:02:14]
Just write the good code from the start.
[01:02:17]
And if it's not great, then you can refactor it because refactoring is safe.
[01:02:23]
Great.
[01:02:24]
It feels good.
[01:02:26]
Little angels everywhere.
[01:02:28]
Yeah.
[01:02:29]
Yeah.
[01:02:30]
And it just, it really does feel like Elm takes it a step further, you know, like something
[01:02:38]
like Haskell or pure script.
[01:02:40]
Like I've never felt that drawn to, to some of these other languages, because again, there's
[01:02:47]
just like Elm really makes this hard choice of like not having escape patches and having
[01:02:54]
pure functions and exhaustive case checks and all these things that are, it's just like
[01:03:01]
airtight at the core.
[01:03:03]
Like all of its core decisions are made around being airtight and then having pragmatic APIs
[01:03:09]
that are focused, like making, you know, which maybe somebody who's really big into Haskell
[01:03:18]
would say, well, yeah, but you're missing out on the power of a lot of things that type
[01:03:23]
systems can provide to you.
[01:03:24]
And you're missing out on some of the ease that you have from things like type classes
[01:03:30]
and stuff.
[01:03:31]
And there, there are definitely trade-offs there.
[01:03:33]
There are definitely valuable things that come from that.
[01:03:36]
But Elm, it goes all in on saying no escape patches.
[01:03:43]
It's an airtight system that you can completely trace and understand pure functions all the
[01:03:49]
way, and let's be pragmatic and talk about things in more domain terms than category
[01:03:57]
theory terms or things like that.
[01:03:59]
And to me, that just really resonates like that, that that's my love language, just like
[01:04:05]
speaking in domain language and simple, understandable, traceable code that you know exactly what
[01:04:11]
it does and its pure functions.
[01:04:13]
Like it just works for me at the core.
[01:04:16]
And Elm does that in a way that I think is very unique.
[01:04:19]
And I think I definitely am keen to see what Richard Feldman's project Rock does.
[01:04:26]
I think that like he is kind of bringing a similar ethos to a different context and more,
[01:04:34]
you know, more of a sort of the types of things you would do with Rust back end, more performance
[01:04:39]
focused projects.
[01:04:41]
But I think he's bringing a similar ethos there that I'm very keen to see what he does
[01:04:46]
with.
[01:04:47]
I think that will pull up my heartstrings as well.
[01:04:50]
Yeah, I'm looking forward to playing with it more as well.
[01:04:53]
And I really hope they don't make any choices that go counter to what we like about Elm,
[01:05:00]
the large parts.
[01:05:02]
From everything I've seen so far, it has.
[01:05:05]
Yeah.
[01:05:06]
But yeah, I agree.
[01:05:07]
Yeah, we kind of mentioned like it's about pushing Elm to its limits.
[01:05:13]
But as a tooling author, it's also just simply intellectually fun to see how far you can
[01:05:19]
push it.
[01:05:20]
For instance, I had a lot of fun making pull requests to Elm Optimize Level 2.
[01:05:25]
Yeah, to make things even faster, but relying on the fact that it's Elm codes that I'm optimizing.
[01:05:34]
Right, right.
[01:05:35]
Yes.
[01:05:36]
You can do isomorphic things with Elm code because if it can give you the same result
[01:05:41]
and it's pure, so it's so easy to swap it out for something else that does the same
[01:05:46]
thing, then you can do whatever dirty tricks you want.
[01:05:49]
Yeah, yeah, exactly.
[01:05:50]
Yeah, also like Tail Recursion module concept I worked on that I made blog posts about,
[01:05:56]
because it's still Elm, but now the compiler can change the resulting source code, the
[01:06:05]
resulting JavaScript in a way that is more optimized.
[01:06:08]
And that would unlock some ways of running Elm code that are currently like not stack
[01:06:14]
safe or something.
[01:06:15]
That would be amazing.
[01:06:16]
Is that a feature for the language or is it just like optimization?
[01:06:21]
That's a good question.
[01:06:22]
Stack safety is a feature.
[01:06:25]
Yeah, it's borderline.
[01:06:28]
It's still Elm, but...
[01:06:31]
I mean, put it this way, if Elm didn't have tail call optimization, then certain use cases
[01:06:36]
wouldn't be possible.
[01:06:38]
And being able to make a guarantee about that is definitely compelling.
[01:06:41]
So yeah, I think in conclusion, like Elm is just such a nice bundle of features that are
[01:06:51]
put together in a very nice and polished way.
[01:06:55]
The fact that it doesn't crash, the fact that its language is super simple and teachable,
[01:07:00]
compared to Haskell for instance, the fact that the resulting code is good code and maintainable
[01:07:06]
code and that you can have tools around it that are just so powerful that just make so
[01:07:12]
much good use of all the guarantees that the language gives you and the compiler gives
[01:07:19]
you.
[01:07:20]
And I'm sure I'm forgetting more things, but it's just such a dense, small, little language
[01:07:27]
that is with so much good in it.
[01:07:30]
It's just super enjoyable.
[01:07:32]
And a community of inspiring people who believe in that stuff too, which is really cool, you
[01:07:37]
know, and who pull up their sleeves and try to build cool things with it.
[01:07:42]
Yeah, I really like the ethos of the community, like everyone trying to make good stuff.
[01:07:49]
Yeah, and just the quality of the average Elm package is pretty impressive.
[01:07:55]
Yeah, so that's why we care about Elm.
[01:07:57]
Well, this was a fun trip down memory lane.
[01:08:02]
And perhaps you're a superhero trying to build cool static analysis and I'm a super villain
[01:08:09]
trying to destroy all mocking in the universe.
[01:08:15]
Mock man!
[01:08:17]
I'm one step closer.
[01:08:22]
Well Jeroen, until next time.
[01:08:25]
Until next time.