spotifyovercastrssapple-podcasts

Projects We Wish We Had Time For

We discuss the power of the Elm when paired with developer tools, and we go through our notes to look at Elm tools we wish we had the time to build.
August 29, 2022
#64

Sponsor: CareRev

CareRev is looking for Senior Frontend Elm engineers (job listing).

  • elm-review-simplify
  • Elm Radio Root Cause of False Positives episode
  • Dillon's pairing session using snapshot testing prototype with Corey Haines
  • elm-snapshot-test prototype repo
  • Approval testing
  • elm-coverage
  • elm-instrument
  • Llewellyn Falco Gilded Rose kata video
  • Idea: intellij integration for elm-coverage
  • Idea: code actions for safe refactorings
  • Idea: elm-review integration in intellij
  • Idea: sparksp/elm-review-imports either new feature, or separate project to give suggestions to make all inconsistent imports in a project consistent
  • Idea: elm-review code actions
  • Idea: elm-review collection mechanism to gather data from an AST
  • Pairwise testing (or all pairs)
  • Idea: pairwise permutation API that minimizes the number of permutations to go through to get complete coverage
  • Idea: mutation testing tool for Elm (is Phillip's tool relevant here?)
  • Idea: generated API for elm-graphql but with factory-style API for mocking out data that is compliant to the graph schema, for use with things like elm-program-test
  • Idea: Browser.application wrapper that provides some common initial flags like start time, initial window dimensions etc
  • Idea: HTTP Error type to get bad status payload that can be shared between libraries to reuse the same type (similar to the HttpError type defined in elm-graphql)
  • Aaron's community-standard elm-color package
  • Idea: tool to automatically vendor or un-vendor Elm packages
  • Idea: elm-format in Elm
  • Idea: elm diff, but it gives you more detailed information about code changes even if they don't change the API
  • Idea: Phantom Builder analyzer that generates a state diagram from Elm code
  • Idea: suggest types based on what's possible in your current editor context
  • Idea: type inference and value inference in elm-review
  • elm-http-fusion
  • Idea: use a collection of HTTP requests to an endpoint in elm-http-fusion to gather better type incormation about an API
  • Idea: make tools like elm-http-fusion embeddable in the elm-pages dev server so you can interactively fix decoder errors, etc.
  • Idea: elm-pages dev server code actions from the UI, like scaffolding new routes
  • elm-codegen
  • Idea: use elm-codegen for elm-pages scaffolding for user-customizable templates
  • Official Elm blog post The Syntax Cliff
  • Idea: show ANSI color code error messages embedded in blog posts
  • Talk about the Hedy language: What every programmer should know about cognition by Felienne Hermans
  • Elm Guide translated into French
  • Idea: translatable error messages and language keywords for Elm
  • Idea: elm-css tool to make inline styles into static CSS files and replace the styles with a reference to the generated class. Goal: reduce bundle size and performance overhead
  • Idea: codemod tool to post-process Elm code using elm-review fixes in a hidden temp directory
  • Idea: Elm step debugger
  • Idea: elm/parser debugger to see the state machine of what has been consumed
  • Idea: Elm debugger improvements like filtering Msg types, customizable inspecting for certain types
  • Idea: inspectable Cmds in the debugger, or similar idea for debugging elm-pages DataSources to see why a failure happened and what the breadcrumbs are
  • Idea: React ink, but for Elm
  • awesome-elm-sponsorship repo

Transcript

[00:00:00]
Hello, Jeroen.
[00:00:01]
Hello, Dillon.
[00:00:02]
You know what I wish I had?
[00:00:05]
Plenty of things.
[00:00:06]
Money, but I think you're going to talk about...
[00:00:10]
Power, time.
[00:00:11]
Money, power, soul, space.
[00:00:12]
More time in the day.
[00:00:13]
Oh, time.
[00:00:14]
Yes.
[00:00:15]
Doesn't everybody wish they had more time in the day?
[00:00:20]
I wish I had more time in the day, but I would also settle for a bunch of people working
[00:00:25]
on open source Elm tooling code.
[00:00:27]
That would be cool, too.
[00:00:29]
So not necessarily your time.
[00:00:31]
You want other people's time.
[00:00:34]
That is so greedy.
[00:00:38]
It's our time, our community's time.
[00:00:40]
What are we talking about today?
[00:00:42]
Today we're talking about the projects that we wish we had time for.
[00:00:47]
Time that resource sets, lets you do things, but that is necessarily in too little amounts
[00:00:54]
in your life.
[00:00:55]
Always too little.
[00:00:56]
But at least it feels like that.
[00:00:58]
Oh, yeah.
[00:01:00]
Especially for people with insatiable appetites for amazing Elm tools.
[00:01:06]
I think that to me, what makes Elm exciting is Elm is not exciting to me by itself.
[00:01:16]
It's kind of exciting, but it's only exciting because of what it enables you to do with
[00:01:22]
outside projects and tools.
[00:01:25]
Without that, I wouldn't find Elm that interesting.
[00:01:28]
Give a few examples.
[00:01:29]
I totally agree with you, but I want to know exactly what you have in mind.
[00:01:35]
This is what in my head sits under the label, the promise of Elm, which is when you work
[00:01:45]
within a constraint, you are sacrificing something.
[00:01:50]
We make a sacrifice, and what do you get for that sacrifice?
[00:01:54]
Certainly we do get immediate sacrifice within just using the Elm language.
[00:01:59]
We do make the sacrifice of not being able to perform side effects and mutations wherever
[00:02:05]
we want and pull down global state.
[00:02:10]
It's not easy.
[00:02:11]
There are times when that shortcut would be helpful, but of course it does give us immediate
[00:02:16]
payoff in that we do end up making more long term maintainable code.
[00:02:21]
We do end up being able to reason about our code more easily.
[00:02:26]
We can build in constraints with opaque types and rely on them.
[00:02:30]
So there's immediate payoff just by using the language.
[00:02:33]
But to me, the really exciting thing about Elm is what can we use those guarantees and
[00:02:40]
constraints in the language to do with tooling?
[00:02:45]
For example, unit testing in a pure functional language is very exciting.
[00:02:50]
Elm test is a really cool tool.
[00:02:53]
It's not as much exciting.
[00:02:57]
It's just like the opposite of what you have in JavaScript or languages with mutation.
[00:03:04]
That is just painful.
[00:03:05]
Exactly.
[00:03:06]
In a way, it's delightful because you don't have to care about all these problems.
[00:03:12]
Delightful is such a nice word.
[00:03:14]
It is a nice word.
[00:03:16]
Delightful even.
[00:03:17]
Yes, delightful really captures that feeling of those things that we get from the constraints
[00:03:23]
we accept working with Elm.
[00:03:26]
But then, as you've talked about many times, Elm Review, the most interesting thing about
[00:03:32]
Elm Review is that it gets to work with the language with the guarantees that Elm has.
[00:03:37]
You take that away and it's not as exciting.
[00:03:41]
Just like Suik, I worked on a addition to Elm Review Simplify where I was basically
[00:03:47]
able to detect if branches that can't execute.
[00:03:51]
Therefore, I can simplify the conditions by replacing some conditions to true or false
[00:03:57]
or removing the if branches that won't execute.
[00:04:02]
That was quite complex to do, but it was so much easier with the fact that I can just
[00:04:08]
rely on the fact that there are new mutation.
[00:04:11]
If you see if x equals f of n and then you see the same condition inside of it, like
[00:04:20]
if x equals f of n, well, those are the same.
[00:04:25]
The result will be the same, so you can just remove the second one.
[00:04:29]
But if you had mutation or side effects, you're like, I don't know.
[00:04:35]
It was still quite a lot of work, at least to get to something that worked as I expected,
[00:04:41]
but it was so much easier than having to think about all the other things.
[00:04:45]
I only realized that after the fact, like, oh, this was easier.
[00:04:51]
I didn't even have to think about it.
[00:04:55]
That was really nice.
[00:04:57]
It's like the difference between a few pots of coffee and some weekends versus several
[00:05:04]
years of research with grants and a team of postdocs to 100% guarantee that those things
[00:05:14]
are safe.
[00:05:15]
Well, actually, the reason why I worked on this is because this was a rule that exists
[00:05:21]
in ESLint.
[00:05:22]
I noticed, oh, we don't have this one for Elm Review.
[00:05:26]
It's the only one that is missing from the recommended rules for ESLint.
[00:05:32]
So I just added it and then noticed the original one in ESLint actually can create false positives
[00:05:40]
because of the potential for side effects and mutation.
[00:05:45]
I'm like, okay, so I did something nicer.
[00:05:48]
But I also go a bit further than what they're doing.
[00:05:52]
Because you have more information working in the environment with Elm, like we talked
[00:05:55]
about in our false positives episode.
[00:05:58]
Absolutely.
[00:05:59]
So to me, Elm is just ripe for tooling, which I would say that you and I really hopefully
[00:06:08]
demonstrate with our actions how much we deeply believe that because we really want these
[00:06:14]
tools to exist because they are, to me, what makes Elm really exciting and delightful.
[00:06:20]
So I have a bunch of things, sort of lists that I keep mentally and in my note taking
[00:06:29]
app of things that I think would be interesting, but I just don't have time for with all the
[00:06:35]
other things I want to build.
[00:06:36]
So I thought it would be fun to like dive into some of those.
[00:06:39]
And I would love it if, well, I would love it if I were magically given more time in
[00:06:43]
the day.
[00:06:44]
That would be great.
[00:06:45]
But I would also love it if hopefully this conversation inspired some people to pick
[00:06:51]
up some of these ideas and run with them or inspired them to do some other ideas that
[00:06:57]
have been on their lists or spark some new ideas in their minds.
[00:07:01]
So I would just love to see more people that we could welcome into the sort of Elm tooling
[00:07:07]
community because I think it's like such a cool space to be kind of innovating in.
[00:07:12]
Absolutely.
[00:07:13]
Yeah.
[00:07:14]
I mean, if we can have more people working on the existing tools and new ideas, then
[00:07:19]
that would be amazing.
[00:07:20]
Today's episode is sponsored by Carev.
[00:07:23]
Carev is looking for senior Elm engineers based in the US for fully remote positions.
[00:07:30]
Engineers at Carev get to work on a meaningful product, bringing the future of work to healthcare.
[00:07:35]
Carev is a modern marketplace platform offering professionals the freedom to choose how and
[00:07:40]
when they work, tools and training to develop their careers, and personalized growth opportunities.
[00:07:45]
Carev is looking for Elm engineers who will have a front end focus and get to work alongside
[00:07:50]
their peers doing code reviews, working in an agile environment, and mentoring other
[00:07:55]
engineers.
[00:07:56]
They use Elm test, Elm verify examples, and Elm review in their CI, as well as Tailwind
[00:08:01]
CSS and custom elements.
[00:08:03]
And they do multiple releases per day with fast builds, preview environments, and they
[00:08:08]
recently converted their code base from React to Elm, so the code base is as clean as it
[00:08:12]
gets.
[00:08:13]
The role is 100% remote, and it includes benefits such as comprehensive medical care, dental
[00:08:19]
and vision benefits, short term disability, covered 100% by Carev, life insurance, paid
[00:08:25]
parental leave, generous paid holidays and unlimited PTO, 401k and company matching,
[00:08:31]
an office equipment stipend, and a learning reimbursement program.
[00:08:35]
So if you're a US based developer who loves Elm and has five plus years of JS or other
[00:08:40]
front end web experience, reach out to Carev, take a look in our show notes, or search for
[00:08:45]
Carev, and a big thank you to Carev for sponsoring.
[00:08:49]
So I've got like a few sort of like criteria slash questions that I thought we could consider
[00:08:55]
for our ideas, which is like, what problem does it solve slash is it valuable?
[00:09:02]
How difficult would it be and would somebody else be able to pick it up?
[00:09:07]
No one can pick your ideas up.
[00:09:11]
Yeah, I tried to include some low hanging fruit.
[00:09:18]
Well you know what, I would consider it, I do take pride in trying to think about simple
[00:09:25]
ideas.
[00:09:26]
As long as that may seem, I try to think about simple ways to get valuable things.
[00:09:33]
So I would consider it a personal failing if none of my ideas were things that people
[00:09:37]
could easily pick up.
[00:09:39]
Because I do try to come up with big bang for your buck ideas as much as possible.
[00:09:44]
Okay, so it's not only the world's ideas that you had.
[00:09:50]
Right, which those are delightful as well to think about at least.
[00:09:55]
Somebody to like dive into is less delightful.
[00:09:59]
All right, well, should we dive into some?
[00:10:01]
Yeah, absolutely.
[00:10:02]
So what is on your list Dillon?
[00:10:05]
Well, one of the areas that I think is really interesting that we still have a lot of opportunity
[00:10:13]
to explore in is testing in Elm.
[00:10:16]
I did a video with Corey Haynes a while back, which was a lot of fun.
[00:10:21]
He's a fantastic thinker in testing code craftsmanship in Elm.
[00:10:30]
So I had a lot of fun playing around with this concept of snapshot testing in Elm.
[00:10:37]
We did the Gilded Rose Cotta.
[00:10:38]
I'll share a link to the YouTube video.
[00:10:42]
I played around with a proof of concept, sort of hacked together just to demonstrate what
[00:10:48]
it would be like working with snapshot testing in Elm.
[00:10:52]
So snapshot testing is the idea that you have a golden standard that you...
[00:11:00]
Another term for it is approval testing.
[00:11:02]
So you approve a certain output.
[00:11:06]
Usually it's in some form or another.
[00:11:08]
At the end of the day, it's a string.
[00:11:09]
Even if it's JSON and you can compare JSON output in a more intelligent way where you're
[00:11:15]
not just comparing string literals and you don't care about the order of JSON keys, at
[00:11:19]
the end of the day, you're typically storing some output to a string and you're able to
[00:11:25]
intelligently compare that output to see if it's changed.
[00:11:29]
And if it has changed, then the test is read.
[00:11:32]
And if you want to approve the new test, you essentially are just committing that new approved
[00:11:38]
output as part of your test suite.
[00:11:41]
Yeah, so it would be a separate file which you commit to your Git history.
[00:11:45]
Exactly.
[00:11:46]
It's part of your Git history and you're saying, I intended for the output to change for whatever
[00:11:52]
reason.
[00:11:53]
It could be because I expect different results now that some code has changed.
[00:11:59]
It could be because my test has changed and therefore there's new output.
[00:12:03]
Or it could be that something changed and you didn't intend it to and it caught that
[00:12:08]
mistake and then you go and you fix the test by making the output what it was before.
[00:12:14]
So the reason I love this technique is, for one thing, it's a very easy way to get some
[00:12:21]
very valuable tests.
[00:12:22]
So I'm a big fan of approval testing.
[00:12:25]
I think it would be really valuable to have a tool like this for Elm.
[00:12:28]
So we did a demo of that proof of concept.
[00:12:34]
So what problem does it solve?
[00:12:37]
I think it does solve a meaningful problem of providing this valuable technique for us
[00:12:42]
to use in Elm.
[00:12:43]
How hard would it be and what would it take?
[00:12:46]
It would take making some changes into the Elm core testing library.
[00:12:51]
Yeah, so it would just be additions to Elm tests.
[00:12:55]
Right.
[00:12:56]
And probably some APIs around building up permutations of inputs.
[00:13:01]
That's like a common, you know, Llewellyn Falco has sort of a suite of approval testing
[00:13:06]
tools in different languages.
[00:13:08]
And one of the core things he uses in that suite of tools is an API for building up permutations
[00:13:14]
of inputs.
[00:13:15]
So you can essentially, like it's a really cool legacy testing technique to basically
[00:13:20]
feed in, ideally, something that's going to hit all the possible code paths and then just
[00:13:27]
say, OK, this is the current behavior.
[00:13:29]
It's really cool for like legacy code refactoring because you say, OK, well, we've now captured,
[00:13:34]
say, like all of these different conditionals that we're hitting.
[00:13:37]
We know we're hitting all those permutations of those conditions.
[00:13:40]
And therefore, we have confidence that we have coverage of all these code paths and
[00:13:45]
the like a broad range of their output because we've sort of just cast a wide net and cut
[00:13:51]
all these outputs.
[00:13:53]
And now we can go and sort of safely refactor things.
[00:13:56]
So it's a really cool technique for that.
[00:13:59]
Is there something to this technique that makes more sense in Elm than in, say, JavaScript,
[00:14:05]
in your opinion?
[00:14:06]
That's a great question.
[00:14:07]
I mean, I think just the determinism of Elm makes it a little more interesting that you're
[00:14:14]
going to have more predictable output.
[00:14:16]
You're going to have less flakiness because in general, when you're doing any sort of
[00:14:21]
end to end testing or higher level testing, unit tests tend to be more well behaved and
[00:14:27]
predictable in general, and end to end tests, the higher you get, tend to be more flaky.
[00:14:33]
Like interdependent.
[00:14:34]
One test impacts the results of another test.
[00:14:37]
Yeah.
[00:14:38]
Right.
[00:14:39]
And they start depending on global state and side effects and mutations and environment,
[00:14:44]
non deterministic things, what time it is, what day it is.
[00:14:47]
So for that reason, I think it's interesting because you can do like very high level and
[00:14:52]
sort of easy to write tests that cast a wide net and verify a lot of things, but in a language
[00:14:59]
that is deterministic.
[00:15:02]
So it's going to be less flaky.
[00:15:04]
So I think that's the main thing.
[00:15:06]
Otherwise it's going to be, yeah, and I don't know, maybe that offers some interesting opportunities
[00:15:12]
for like tooling around an approval testing tool in Elm.
[00:15:15]
But otherwise, I think it's going to be pretty normal.
[00:15:17]
Do you know if there's an issue already discussing this in Elm tests?
[00:15:22]
I don't think there is.
[00:15:23]
I did mention this idea once to Harry Sarson, who is actively maintaining Elm tests.
[00:15:32]
And he said he was interested in the idea.
[00:15:34]
So that's kind of cool.
[00:15:35]
So if I had more time in the day, I would definitely want to work on this.
[00:15:40]
Maybe at some point I will.
[00:15:42]
Maybe somebody else finds this idea exciting.
[00:15:44]
But I think it's a pretty interesting idea.
[00:15:47]
We said we don't have time for this.
[00:15:50]
That's the whole point of this episode.
[00:15:54]
You could maybe create an issue so that people can hop in.
[00:15:57]
Yeah, that's a good idea.
[00:15:59]
And I've mentioned this in the past, but I do try to like, sometimes I get ideas to completion
[00:16:07]
where there's a certain definition of the term completion.
[00:16:11]
In this instance, the milestone was like demo a working proof of concept to show what it
[00:16:17]
would look like to use this technique in Elm and what an API for doing permutations and
[00:16:22]
that sort of thing would look like.
[00:16:24]
So I do have a complete working prototype that's a proof of concept.
[00:16:29]
So I did get it to that goalpost at least.
[00:16:32]
And I do think that that can be a valuable technique to kind of share your findings and
[00:16:36]
show proofs of concept.
[00:16:38]
I think that can be a really good technique to just say, here's the thing I built.
[00:16:43]
And here's the artifact I wrote my takeaways and what I learned in the process.
[00:16:48]
In a similar vein, another idea that I think would be really neat is to so I think I know
[00:16:55]
what you're going to talk about.
[00:16:57]
So Elias van Peer, you can pronounce his name better than I can.
[00:17:01]
Elias van Peer.
[00:17:02]
There you go.
[00:17:03]
Pretend I said it like that.
[00:17:07]
He's built some really cool projects.
[00:17:08]
Yes.
[00:17:09]
One of them being Elm coverage.
[00:17:11]
I actually think Elm coverage is sort of an underutilized tool.
[00:17:16]
It is so much.
[00:17:17]
It works so well.
[00:17:18]
Yeah, but I think I kind of know why.
[00:17:22]
Why do you think?
[00:17:23]
Because we're ashamed of our code coverage.
[00:17:26]
That's fair.
[00:17:29]
Because the thing is like, we use type so much to make sure that things don't misbehave
[00:17:36]
and that they behave kind of like what we want them to.
[00:17:39]
And that like some people say it's either you write tests or you write types.
[00:17:45]
And obviously we can do both and we should do both.
[00:17:48]
But I feel like, well, most of the things are already handled by the type system.
[00:17:53]
So in essence, we tend not to write a lot of tests.
[00:17:56]
That has been my experience, at least in some projects.
[00:18:00]
And in those projects, when they run coverage, I was like, well, this is disappointing.
[00:18:05]
That's a good insight.
[00:18:09]
I also think it's just not, I don't know, people aren't as aware of it as they could
[00:18:14]
be.
[00:18:15]
So, but it's a very cool tool.
[00:18:18]
How does it work?
[00:18:19]
Does it run Elm tests for you or does it take the output of Elm tests?
[00:18:24]
It runs Elm tests for you.
[00:18:25]
I think you can give it a binary to use for Elm tests.
[00:18:30]
But what it does is it...
[00:18:31]
I think it runs the tool and then it modifies the compiled JavaScript at some stage.
[00:18:40]
Just to add markers, like this has been executed, this has not been executed.
[00:18:45]
And then it compiles that information and creates a coverage reports for you.
[00:18:51]
Exactly.
[00:18:52]
It uses another tool that Ilias created, which is called Elm Instrument to instrument the
[00:18:57]
lines of code with something that hooks in and performs a side effect to mark something
[00:19:04]
as executed.
[00:19:06]
So it works incredibly well.
[00:19:08]
It's very reliable.
[00:19:10]
And one of the reasons I think you're asking if snapshot testing is particularly interesting
[00:19:17]
in Elm for any reason, I think one of the reasons that these things are really compelling
[00:19:22]
to me in Elm is because if you watch Llewellyn Falco, I'll share a link to a video which
[00:19:28]
you and I have discussed a lot where he does this gilded rows cata.
[00:19:32]
It's what inspired me to do this demo of this proof of concept of Elm snapshot testing,
[00:19:38]
using that to guide building up a test suite and then doing safe refactoring around gilded
[00:19:45]
rows in Elm.
[00:19:46]
And these safe refactoring techniques, it's not just like hacking away at code.
[00:19:53]
It's this very methodical approach that feels more like provable steps where you have a
[00:20:01]
very high degree of confidence that your changes are not breaking and you're being very careful
[00:20:07]
not to mix changing behavior refactoring.
[00:20:13]
And these sort of techniques where you, so Elm lends itself very well to that sort of
[00:20:19]
technique of doing safe refactorings.
[00:20:23]
That's why I think it's really exciting.
[00:20:26]
The way Llewellyn uses coverage reporting in Java, I think it is in that example, maybe
[00:20:32]
C sharp, but is really nifty.
[00:20:36]
And in Elm, a coverage report is a little bit more compelling because it's a deterministic
[00:20:42]
language.
[00:20:43]
It's not going to choose a different code path based on the time of day and things like
[00:20:46]
that.
[00:20:47]
So yeah, first tests, but that's it.
[00:20:51]
Right.
[00:20:52]
That's a good point.
[00:20:53]
Yeah.
[00:20:54]
So the tool around this that I think would be neat is just an integration into IntelliJ
[00:20:58]
because, and I think that's one of the reasons Elm coverage isn't used as much as it could
[00:21:04]
be is just integration into tooling makes a big difference.
[00:21:07]
That workflow of having to run it every time you want to see the results and then open
[00:21:12]
up an HTML file.
[00:21:15]
So I would love to see an integration where you can hit the run test with coverage button
[00:21:20]
in IntelliJ on your test suite.
[00:21:22]
And you can then see inline coverage highlighting in your editor.
[00:21:27]
Just to clarify, we wanted it in IntelliJ because that's the editor that we would use, but if
[00:21:33]
someone was working...
[00:21:34]
I would settle for it in anything.
[00:21:35]
Yeah.
[00:21:36]
If you want to add it to language server protocol or to have it in VS code or VM or something
[00:21:42]
else, that's fine too.
[00:21:44]
But we would be happier with IntelliJ.
[00:21:47]
Yes, that's true.
[00:21:49]
Yeah.
[00:21:50]
So I think this is definitely something that somebody else could pick up too.
[00:21:53]
I think it's like a pretty well defined problem.
[00:21:55]
Yeah.
[00:21:56]
And I imagine that the editors already have some kind of support for that already.
[00:22:01]
We need to instrument in a way that the editor gets that information.
[00:22:06]
Yeah, exactly.
[00:22:07]
Yeah, that would be pretty cool.
[00:22:09]
Yeah.
[00:22:10]
So to continue on the idea about improving the editor and making small changes, something
[00:22:17]
that would be very useful is to have a lot more code actions in your code.
[00:22:23]
Like being able to say, well, I have this expression now wrap it in an if expression
[00:22:29]
where this value is in both branches with some dummy condition or not with a dummy condition.
[00:22:36]
And then, yeah, just have all of these kind of safe refactors that you can use, commit
[00:22:43]
and then combine so that you can get to the place you want to in very simple steps.
[00:22:50]
Yes, 100%.
[00:22:51]
Yeah.
[00:22:52]
So I have an IntelliJ Elm wishlist.
[00:22:54]
I'll share a link in the show notes.
[00:22:56]
And I just think there are a lot of things that are pretty straightforward that would
[00:23:01]
be high value, a lot of bang for your buck items there.
[00:23:06]
Which are often already implemented for other languages like C sharp or Java.
[00:23:10]
Exactly.
[00:23:11]
That's actually an amazing source of inspiration is, I mean, kind of like you were looking
[00:23:15]
at ESLint rules and saying, what do we not have in the Elm community?
[00:23:19]
I think looking at editor tooling and saying, what do we not have in the Elm community is
[00:23:23]
really a cool thing to do.
[00:23:24]
And oftentimes, like with that ESLint rule where you were able to eliminate one area
[00:23:30]
where there were false positives in ESLint.
[00:23:32]
Similarly, like there are cases where a refactoring might not be safe in certain languages and
[00:23:37]
in Elm, it's just always safe.
[00:23:39]
So we can do even more with these things.
[00:23:42]
Yeah, I would love, it's been on my wishlist for a long time to just have the basic suite
[00:23:51]
of sometimes people call these like the sort of crud operations for editing.
[00:23:58]
Create reads, updates, deletes.
[00:24:00]
Yeah.
[00:24:01]
Right.
[00:24:02]
So like deleting, either deleting unused references or inlining, like if you inline a constant
[00:24:09]
or a method or an Elm function, if you create one from usage, you update either renaming
[00:24:18]
or and create can also be like extracting a method, turning something that's inline
[00:24:23]
code into a let declaration or a function, those sorts of things, moving things to other
[00:24:29]
modules.
[00:24:30]
So like I would love to have, I would love to be able to just fly through my editor key
[00:24:36]
bindings, making safe refactorings without worrying about whether I've changed behavior
[00:24:40]
and then commit, commit, commit, refactor, commit, refactor, commit, refactor, commit.
[00:24:45]
And then, okay, now that I can sort of read this code a little better, let's go make some
[00:24:49]
behavior changes.
[00:24:50]
That would be so amazing in Elm.
[00:24:52]
So I wish I had more time for that.
[00:24:54]
I've considered just saying, you know what, let's like try to make a paid tool so I can
[00:25:01]
just like focus on this for a while.
[00:25:03]
But I'm not sure if that'll happen, but it's, I really want this to exist.
[00:25:08]
Yeah, same here.
[00:25:09]
Like some of them are probably not that hard to accomplish also.
[00:25:17]
But it's like when you have a lot of these simple things, that's where you get a lot
[00:25:20]
of value.
[00:25:21]
Yeah, right.
[00:25:22]
Absolutely.
[00:25:23]
In the same vein, like I would love to have Elm review integration in editors.
[00:25:29]
So VS Code already has it, well, LSB I guess, but it's not as performant as it should be,
[00:25:36]
I think, because it's not every time you want the review reports, it starts over again and
[00:25:43]
that's only going to work for a very small project.
[00:25:46]
And I don't think that people know about this feature a lot.
[00:25:49]
Like you have to go through the settings to enable it, which makes sense maybe.
[00:25:53]
But for IntelliJ, it's in a branch from someone who worked on it and is not available anymore.
[00:26:01]
So someone needs to pick that up and get that merged into the tool at some point.
[00:26:06]
I would just love that.
[00:26:09]
Me too.
[00:26:10]
So much.
[00:26:11]
These workflow things, like really, there's one thing, like I've learned so much from
[00:26:17]
people in the sort of software craftsmanship circles.
[00:26:22]
And I used to go to a lot of conferences in that space, sort of agile technical practices
[00:26:28]
and coach teams on that stuff.
[00:26:31]
And I learned a lot from some really smart people who I respect a lot.
[00:26:37]
And I think there's a lot of knowledge in those circles.
[00:26:40]
And one of the lessons from all of that for me was tooling is not just a convenience,
[00:26:48]
it fundamentally can change the way you work.
[00:26:52]
It can qualitatively change the way you work when you have better workflows.
[00:26:56]
That's like being able to use shortcuts effectively, refactoring tools, testing tools, continuous
[00:27:03]
integration feedback, and things like getting review errors in your editor, being able to
[00:27:09]
respond to them in real time, like just shortening that feedback loop, right?
[00:27:14]
Shortening the feedback loop is so key.
[00:27:17]
And having better workflows for tooling allows you to shorten the feedback loop.
[00:27:22]
And that can really change the way you work with code in a big way.
[00:27:27]
So I would love to see that integration into the editor.
[00:27:31]
I remember when I was using Atom, there was a very good plugin called Elmjitsu.
[00:27:36]
I loved Elmjitsu.
[00:27:37]
Yeah, I loved Atom, to be honest.
[00:27:41]
Yeah, me too.
[00:27:42]
And I really liked the editor.
[00:27:44]
I really liked the plugin.
[00:27:45]
But there was one feature that it didn't have that IntelliJ did have.
[00:27:49]
And I only learned that when I switched to IntelliJ, because my colleagues just said,
[00:27:54]
you should use IntelliJ.
[00:27:56]
And I was adding an import for something.
[00:27:59]
And because I didn't have this, I got pretty fast at doing it myself.
[00:28:05]
Like I knew, well, okay, I just type abc.foo.
[00:28:10]
So I go to the beginning of the file, and then I go a few lines below, and then I type
[00:28:16]
imports, and I type the abc.
[00:28:20]
And it happened pretty quickly for me.
[00:28:23]
But when I got to IntelliJ, I was like, well, use add import.
[00:28:29]
Yeah, well, that's a lot nicer.
[00:28:32]
Yeah, I love that feature.
[00:28:35]
And sometimes you can just refer to something and then say qualify import.
[00:28:40]
You can say add import.
[00:28:42]
If you do like adder.class, you say add import and it says, would you like to import HTML.attributes
[00:28:49]
as adder?
[00:28:50]
Yeah, pretty cool.
[00:28:51]
Yeah, I think VS Code has that automatic addition of imports.
[00:28:57]
So when you do adder.class, it automatically adds the imports or something like that.
[00:29:03]
Very cool.
[00:29:04]
Yeah.
[00:29:05]
The thing that I noticed compared to when I was working with MQ2 was like, the import
[00:29:10]
names, they become a lot less regular from one file to another.
[00:29:17]
You have aliases that are not the same across all modules because it's too easy and you
[00:29:24]
don't know which one it was.
[00:29:26]
But that's it.
[00:29:27]
Interesting.
[00:29:28]
Well, that could be a cool Elm review rule.
[00:29:31]
I know that Sparks SB has built something.
[00:29:37]
Phil Sparks, he created an Elm review rule for checking consistent imports.
[00:29:42]
But the way it works, I think you have to declare in your rule configuration, the import
[00:29:48]
conventions that you want to use for an explicit list.
[00:29:52]
But I could imagine a cool version of that tool or feature for that rule that it could
[00:29:59]
automatically find inconsistencies in your code base.
[00:30:04]
Absolutely.
[00:30:05]
I think that was in the talks back when he was working on it.
[00:30:09]
He's less active at the moment.
[00:30:12]
But yeah, that was definitely among the things that we wanted.
[00:30:16]
I don't know if that's the same rule or a different rule or a different setting.
[00:30:21]
Right.
[00:30:22]
Yeah, absolutely.
[00:30:23]
Yeah, I think there's a cool opportunity there.
[00:30:24]
And I mean, it would be very cool if it could just intelligently say, Elm review doesn't
[00:30:29]
– it's currently kind of binary where it's like, there's an error or there's not an
[00:30:34]
error.
[00:30:35]
Do you want to not fix it?
[00:30:36]
But it could be really cool if it was like, hey, I found these two different ways that
[00:30:42]
you're importing HTML.attributes in your code base.
[00:30:46]
Would you like to use the first one or the second one?
[00:30:50]
And then fixes those with that input from the user.
[00:30:52]
Yeah, what it could probably do is find all the aliases of imports, and then it suggests
[00:30:59]
the more common one.
[00:31:01]
True.
[00:31:02]
Yeah.
[00:31:03]
And then they know and go change it themselves.
[00:31:05]
That would also work.
[00:31:06]
That's a good point.
[00:31:07]
You could feed input to Elm review by putting a magic comment somewhere that's like, dash
[00:31:13]
dash at Elm review input for the preferred option.
[00:31:20]
As long as that's comments.
[00:31:22]
Yeah, I mean, why not?
[00:31:23]
It's removed.
[00:31:24]
Yeah.
[00:31:25]
You had the debug to do.
[00:31:27]
Yeah.
[00:31:28]
Where you insert HTML.
[00:31:29]
And that's fine because it gets removed after one iteration.
[00:31:33]
So that's fine.
[00:31:34]
It doesn't stay in the code.
[00:31:35]
Yeah, it could like the prompt when it tells you there are inconsistent imports could give
[00:31:41]
you different lines that you could copy paste into your code.
[00:31:46]
And when you copy paste that exact comment, it deletes that comment and applies that choice.
[00:31:54]
Actually maybe that would work fine.
[00:31:55]
Maybe that would work well.
[00:31:56]
Yeah.
[00:31:57]
I don't know.
[00:31:58]
I've talked to you about this idea in the past.
[00:32:00]
I think we've talked about it on the show, but I think it would be, this is a big idea.
[00:32:06]
This is not the well scoped manageable idea.
[00:32:09]
This is like a very big picture idea.
[00:32:11]
And I think you know what I'm about to say.
[00:32:12]
I think that Elm review code actions could be incredible.
[00:32:17]
I think that the pitch is basically just like you have code actions in VS code and IntelliJ
[00:32:24]
where your cursor is at a certain point.
[00:32:27]
There's the context of where you're sitting in the cursor.
[00:32:31]
And based on that context, there are certain actions available.
[00:32:33]
If you're on list.map, you could turn list.map into a fold L. If you're on a pipe, you can
[00:32:40]
remove those pipes.
[00:32:41]
There are certain actions that are available if you're in an if condition or a Boolean
[00:32:48]
condition of any kind and it's not this and not this, you could use De Morgan's law on
[00:32:56]
that.
[00:32:57]
And that's not a rule.
[00:32:58]
That's not something that's incorrect.
[00:32:59]
That's just a transformation that you can apply.
[00:33:03]
It's not right or wrong one way.
[00:33:04]
It's bi directional.
[00:33:05]
You can go either way and they're both acceptable forms to have it in.
[00:33:10]
And so I think that would be really interesting if Elm review had a mechanism for in a performant
[00:33:18]
way in a way that hooks into the editor being able to say, okay, here's the context.
[00:33:25]
Here's where my cursor is.
[00:33:26]
Would you like to hook in and participate in contributing an action that can be performed?
[00:33:33]
And then you can you can say yes or no for your particular code action.
[00:33:37]
That's a user defined thing like an Elm review rule.
[00:33:39]
And then once you execute that, you get that context and you're able to perform something
[00:33:45]
like a fix, but it's not really a fix.
[00:33:46]
It's transformation.
[00:33:47]
Yeah, I feel like that's kind of the point of a language server.
[00:33:52]
The idea that you have behind this is, I think, the fact that anyone can contribute this idea,
[00:33:59]
even if it only makes sense for their project.
[00:34:02]
And just so that we have more cross ID tools.
[00:34:11]
Lower the barrier to entry and people can make some amazing things.
[00:34:17]
You could even imagine having a code action that says, please draw a diagram of how this
[00:34:23]
update function works.
[00:34:25]
Something like that.
[00:34:26]
Yeah.
[00:34:27]
You would never have that in language server that is too generic or just generic.
[00:34:34]
Exactly.
[00:34:35]
That's exactly that's what I find compelling about it is that we've seen all this innovation
[00:34:41]
happening because, you know, though you write many Elm review rules, there are some really
[00:34:47]
cool things out there that that people are creating because they can because it's just
[00:34:51]
Elm code and you just publish an Elm package.
[00:34:53]
And that would be really cool if that power was extended to these transformations.
[00:34:59]
Well then let me talk about something that I want in Elm review and it's kind of there.
[00:35:06]
It's not published yet, but I have a branch where it's working.
[00:35:09]
So I think I've talked about this before at peace with you about being able to use Elm
[00:35:15]
review as something to extract data from your source code.
[00:35:18]
So Elm review already has this very useful mechanism to go through your project, collect
[00:35:25]
information in a much easier way than you would do with then through regexes or tree
[00:35:31]
sitters.
[00:35:32]
So it's a really nice tool to collect data.
[00:35:36]
But then the only thing that you can do is to create errors because it's a linter.
[00:35:40]
Well, the idea would be that you use the Elm review to allow you to extract data just as
[00:35:48]
Jason or as plain strings or something.
[00:35:52]
And I think that would open up for a lot of interesting ideas.
[00:35:56]
I'm not sure entirely which ones.
[00:35:58]
Yeah.
[00:35:59]
The code quality reporting.
[00:36:00]
For instance, you could say like, well, here are the list of all the CSS classes that are
[00:36:05]
using my program compared to the CSS that we have elsewhere.
[00:36:11]
That would be a separate tool.
[00:36:13]
Extract the data and then you do something with it.
[00:36:16]
Or potentially even you could say, please write some JavaScript.
[00:36:21]
Just try to compile this Elm code to JavaScript.
[00:36:26]
And now you have an Elm in Elm compiler.
[00:36:29]
Right.
[00:36:30]
Yeah.
[00:36:31]
Especially if you have access to things like type annotations.
[00:36:34]
Like I could imagine some really cool things where you generate TypeScript bindings based
[00:36:40]
on some Elm code that you have in a particular format that you know is going to be used to
[00:36:47]
call ports or, you know, like.
[00:36:49]
So yeah, there's so many possibilities there.
[00:36:52]
Yeah.
[00:36:53]
My question is mostly about like, but whether this is a good idea is twofold.
[00:36:59]
Would this make the API a lot more complex?
[00:37:02]
I don't think so.
[00:37:04]
I think it should be pretty good.
[00:37:08]
But is Elm review the fastest tool that you can use for this?
[00:37:12]
And for now, that's probably not.
[00:37:15]
It's a convenient one, but it can be a bit too slow for your use.
[00:37:21]
I don't know.
[00:37:22]
Right.
[00:37:23]
I mean, you could potentially say that, you know, if you have something like this that
[00:37:31]
pushes the boundaries of Elm review, then maybe it, you know, if you get really compelling
[00:37:35]
cases, it gives you more reason to really push the boundaries of performance, which
[00:37:40]
I know already you care about and are putting a lot of energy into.
[00:37:45]
But maybe it warrants a big, you know, a big direction change where you fork the Elm compiler
[00:37:52]
in order to have very performant AST parsing and things like that.
[00:37:58]
So anyway.
[00:37:59]
Potentially.
[00:38:00]
I think with the code actions idea that you had, we could achieve some reasonable performance
[00:38:07]
if we make, using the same mechanism that I have in mind for faster fixes.
[00:38:13]
Fixes are terribly slow, at least compared to what I would like them to be.
[00:38:19]
And I think we could do the same, use the same mechanism for code actions, maybe to
[00:38:24]
be a lot faster.
[00:38:25]
A lot of ideas are there and would need to be implemented before we can have this, I
[00:38:31]
think.
[00:38:32]
Like we would need in ID integration, we would need faster fixes.
[00:38:36]
We would need maybe some code extraction.
[00:38:40]
Code action is a different beast.
[00:38:42]
Yeah.
[00:38:43]
Yeah.
[00:38:44]
Very exciting ideas.
[00:38:45]
If you go back to testing, there were two ideas that I had in mind.
[00:38:50]
I think we talked about one of them before.
[00:38:53]
No, we actually talked about two of them.
[00:38:56]
So the first one is, I don't know the name of it, but there was a technique that was
[00:39:02]
found in some other community where they would try to go through all the different branches
[00:39:07]
of some function using as few inputs as possible.
[00:39:15]
Does that ring a bell to you?
[00:39:16]
Because I can't remember the name.
[00:39:17]
I don't think so.
[00:39:18]
It's not fascinating.
[00:39:19]
Because I know that you almost worked on it or we both worked on it almost.
[00:39:26]
So it's kind of like first testing, but I think.
[00:39:31]
The idea was like, well, we can analyze the code or something and then we can figure out
[00:39:38]
if we run these eight cases because we have three if branches, then we can hit 99% of
[00:39:45]
the branches or something like that.
[00:39:48]
Right.
[00:39:49]
Well, if anyone finds a name again, please let us know.
[00:39:52]
Okay.
[00:39:53]
Now I know what you're talking about.
[00:39:55]
Okay.
[00:39:56]
So you're talking, I don't remember the name of it, but I remember what you're talking
[00:39:59]
about and there's some, I'll try to find the name and put it in the show notes, but there's
[00:40:03]
some concept that you can take all the permutations.
[00:40:11]
So given a set of inputs, there is a, so the inputs have possible values that the conditionals
[00:40:19]
care about.
[00:40:20]
So if, you know, if you have a custom type, it has eight different values it could take
[00:40:24]
on a Boolean has two different values and you take all those permutations, but there's
[00:40:29]
this, there's like a theoretical concept that is optimal for generally tending to statistically
[00:40:38]
produce the most simple way of going through the code path.
[00:40:45]
This is like a statistical principle.
[00:40:47]
And so it's a way of combining those permutations where you basically only change one input
[00:40:53]
at a time or something, something like that.
[00:40:55]
Yeah, I'll look that up.
[00:40:57]
Yeah.
[00:40:58]
So the idea here is to be able to hit all the code branches, which is again, only useful
[00:41:04]
if you have code coverage.
[00:41:06]
Well, no, it's not only useful, but it's mostly useful if you have good coverage.
[00:41:11]
Cool.
[00:41:12]
I'll try to find a link to that and put it in the show notes.
[00:41:14]
Yeah.
[00:41:15]
It's definitely an interesting concept that would go along with sort of an API for creating
[00:41:19]
permutations that you could use for snapshot testing.
[00:41:22]
Yeah.
[00:41:23]
And the other idea is what you called mutation testing when we talked about it.
[00:41:29]
It's where you take some codes and you make some random changes to the code in a way to
[00:41:36]
see whether the test would now break.
[00:41:40]
Like if you have a one somewhere in your function, let's try changing that to a two and see if
[00:41:47]
any of the tests break.
[00:41:50]
And well, if the tests are well done or very thorough, then the test should probably break.
[00:41:58]
And if nothing breaks, then either the change was not impactful, maybe kind of a purpose,
[00:42:06]
or you're not testing that part of the code as well as you should.
[00:42:11]
So you should add a test.
[00:42:12]
Right.
[00:42:13]
Right.
[00:42:14]
Yeah.
[00:42:15]
It kind of, I think it's generally going to point to you either have like a sort of dead
[00:42:21]
code path or you don't have proper test coverage.
[00:42:25]
Yeah.
[00:42:26]
And this would not only be about hitting all the branches.
[00:42:29]
This could relate to actual values, right?
[00:42:32]
Which code coverage doesn't care all that much about.
[00:42:35]
Right.
[00:42:36]
Yeah.
[00:42:37]
And again, these are the types of things that start to become, I think far more interesting
[00:42:43]
in a language like Elm because it's deterministic, it's pure, you're not relying on outside context.
[00:42:50]
So there's just a lot more you can do with these sort of theoretical mechanisms.
[00:42:56]
And so yeah, mutation sort of changing actual ASTs in your Elm code.
[00:43:03]
It becomes much more interesting in Elm.
[00:43:05]
In the vein of testing, I had another project idea, which is essentially for Elm GraphQL
[00:43:14]
generating an API that looks similar to the query builders in Elm GraphQL that let you
[00:43:22]
build up a selection set for a user where you say, I want a user with first name, last
[00:43:29]
name, email.
[00:43:31]
But using that same sort of query builder API, giving you fuzzers instead that essentially
[00:43:40]
give you a mocked out fake API server that will give you responses for your GraphQL schema
[00:43:49]
that are not only, it's one thing with like fake data to say, well, here's your GraphQL
[00:43:55]
schema.
[00:43:56]
We know all the types you need.
[00:43:58]
And so we're going to send you fake API responses for tests that are conforming to those types.
[00:44:03]
Sure.
[00:44:04]
But like, is empty string valid?
[00:44:08]
Is it a valid username?
[00:44:09]
So if you just give random usernames that you don't have any control over how they're
[00:44:15]
put together, you might not be able to use that in a meaningful way in end to end testing,
[00:44:21]
like with Elm program test.
[00:44:22]
But if instead you can say, well, let's generate fake test responses, but here's an API for
[00:44:30]
defining how to generate those random values.
[00:44:33]
So it's like a fuzzer for API responses where you can say, here's my first name generator.
[00:44:39]
Here's my last name generator for this field or for this custom scale, or here's my generator
[00:44:44]
for date time values.
[00:44:47]
And for each test you want to do that, you can give it your own thing.
[00:44:51]
So it would be kind of similar to this like factory style, you know, fake test data technique
[00:44:57]
like factory bot for, you know, this sort of thought bot library for Ruby testing.
[00:45:04]
I think that's a cool opportunity.
[00:45:06]
And again, I think Elm is particularly well suited to that.
[00:45:09]
So I would have expected you to say something like, well, we have this GraphQL selection
[00:45:15]
set and from that we generate values.
[00:45:20]
Is that what you said or is that not what you said?
[00:45:22]
That is not what I said.
[00:45:24]
So this is like...
[00:45:25]
That's how I would imagine it to be most useful.
[00:45:28]
Well, usually end to end testing tends to be more of a black box where you don't have
[00:45:33]
insight into the actual code that's running and you don't care what actual code is running.
[00:45:38]
And so in that case, you don't know what selection set is being used, but you want to define
[00:45:45]
if the API asks for this kind of data, here's how you generate fake data to return there.
[00:45:52]
Okay.
[00:45:53]
Now I see it.
[00:45:54]
Yeah.
[00:45:55]
Okay.
[00:45:56]
Interesting.
[00:45:57]
You could also take the approach of saying, given a selection set, give me a fake one
[00:46:00]
of those and then configuring certain ways about how you're generating that fake one.
[00:46:05]
But that would be more for clear box or white box testing, you know, where you have access
[00:46:10]
to the more like unit level testing.
[00:46:13]
Yeah.
[00:46:14]
That's the level I was thinking of.
[00:46:16]
Okay.
[00:46:17]
So I had a couple of actually pretty simple ideas that I thought could be interesting.
[00:46:23]
One of them is, you know how there's this very common pattern to sort of either wait
[00:46:31]
for some basic context before your Elm application is ready or pass it in from a port, like the
[00:46:37]
start time and dimensions, things that you need like a task or a subscription or that
[00:46:42]
sort of thing to get.
[00:46:44]
Yeah.
[00:46:45]
Or initial flags.
[00:46:46]
Mm hmm.
[00:46:47]
Yeah.
[00:46:48]
I was thinking it could be a pretty easy thing to put together, just a simple wrapper around
[00:46:54]
an Elm browser application that, you know, doesn't call the users in it until time.now
[00:47:04]
and the dimensions are available and just has them and wraps that.
[00:47:08]
So you don't have to have every application sort of rebuilding those things.
[00:47:12]
Like you could just have those things available and you don't have to have that maybe state
[00:47:17]
in your code.
[00:47:18]
Yeah, that would be interesting.
[00:47:19]
It's a little experiment.
[00:47:20]
Yeah, it's always nice when you can remove those intermediary states.
[00:47:26]
The boilerplate is not a problem.
[00:47:27]
It's just like having to handle the other cases.
[00:47:30]
Exactly.
[00:47:31]
Yeah.
[00:47:32]
Yeah.
[00:47:33]
That can be annoying.
[00:47:34]
Yeah.
[00:47:35]
The other hanging fruit thing that I've often thought about is in Elm GraphQL, there's a
[00:47:41]
custom HTTP error type.
[00:47:43]
And the reason for that is because bad status just has an int for the status code for the
[00:47:49]
bad HTTP response.
[00:47:52]
But it doesn't include the headers of the response and the body of the response.
[00:47:57]
That's a change that was made from Elm HTTP 1.0 to 2.0.
[00:48:00]
And when that change happened, I introduced a change in the little HTTP wrapper that sends
[00:48:07]
GraphQL requests and Elm GraphQL to change the default for sending HTTP requests to give
[00:48:15]
back a custom variant of the HTTP error that includes that data.
[00:48:20]
So it's exactly the same as the Elm HTTP error type, except it includes that additional context.
[00:48:28]
And the thing is like...
[00:48:33]
See that's the thing, right?
[00:48:35]
But if it was a common thing, if it was a common package, just like Aaron Vanderhaar
[00:48:41]
created that common color package.
[00:48:45]
So it's sort of a community standard that people can align around and say, okay, this
[00:48:51]
is our color type.
[00:48:52]
We can use this.
[00:48:53]
We can use this common API for creating these types.
[00:48:56]
And when the community aligns around that, you can reuse that.
[00:48:59]
So I think it would be really nice to have a common package for HTTP errors that just
[00:49:07]
package authors can use so people can sort of not have to map back and forth between
[00:49:13]
these different HTTP error types when they're combining a pipeline with different HTTP requests.
[00:49:20]
It's like a very straightforward one.
[00:49:22]
I mean, the main important thing would probably be having a discussion thread probably on
[00:49:27]
discourse or something to get some consensus around what that would look like.
[00:49:31]
But really, I think it's pretty straightforward.
[00:49:33]
I think you could probably use exactly the type I have in the Elm GraphQL package.
[00:49:37]
But if that's out there and people can align on that, I think that would be really valuable.
[00:49:41]
I've also had a few small project ideas.
[00:49:45]
One of them has been in my head for quite a while, quite a few years already.
[00:49:52]
And that is a tool to vendorize packages.
[00:49:55]
So sometimes you use a package and it's not giving you all the tools that you want, all
[00:50:01]
the primitives that you want, or there's a bug or something.
[00:50:05]
So you create a bug report, but then you have to fix that bug really quickly or the maintainer
[00:50:12]
is not active anymore.
[00:50:14]
So you usually vendorize your proxy.
[00:50:17]
You copy it and you put it in your project.
[00:50:22]
In your source directories.
[00:50:23]
Yeah, exactly.
[00:50:25]
And that can be a bit annoying because you need to copy things and then you need to add
[00:50:30]
to change the source directories and you need to add all the dependencies.
[00:50:33]
And that's a small annoying thing that you have to do.
[00:50:37]
And as I thought, maybe a tool could be useful to make that easy.
[00:50:41]
And it could do a few more things like it could copy the license.
[00:50:45]
So you do the right thing.
[00:50:48]
It could also block you when the license doesn't allow it.
[00:50:51]
Like, Hey, you're not allowed to do this.
[00:50:54]
You're not allowed to copy it.
[00:50:56]
Which I don't know which licenses for that, but that would be something to look at.
[00:51:02]
99.9% of packages are BSD three clause anyway, but yeah.
[00:51:08]
Or an IT.
[00:51:09]
Yeah.
[00:51:10]
Right, right, right.
[00:51:11]
And I think it would be very useful to have a, the tool add a file saying, or a comment
[00:51:19]
somewhere saying the original version of this package was from this repo, from this revision,
[00:51:28]
something like that.
[00:51:29]
And then have a command to make it easy to remove it and we add the new version.
[00:51:35]
Like if you were waiting for on a bug fix, for instance, Oh, the bug fix is in let's
[00:51:40]
unvendor done.
[00:51:41]
Exactly.
[00:51:42]
Unventoring would be super handy too.
[00:51:44]
And I've seen a few people use this technique or this kind of technique to migrate packages
[00:51:51]
or for instance people who used it for migrating from elm HTTP one to version two.
[00:51:58]
I think that was Joelle that showed that technique and also so Luke Westby use that for going
[00:52:06]
from elm 018 to 019.
[00:52:09]
So like, Oh, well there's this new version of Elm core or basics.
[00:52:15]
Well let's start using them bit by bit by vendoring them.
[00:52:21]
And then you can remove the old one at some point and now you can just remove the vendorized
[00:52:27]
code and you're done.
[00:52:28]
So I think it would be not a tool that would be used very often, but when you have it,
[00:52:34]
it would be useful.
[00:52:35]
Yes, that would be very handy.
[00:52:37]
Yeah.
[00:52:38]
It's a nice one.
[00:52:39]
I would also love Elm format written in Elm because that would be useful for Elm review
[00:52:47]
at least that could be useful for if you generate code in Elm, which now since not a long time
[00:52:55]
ago, like two days, I think have a tool for called Elm code gen, but yeah, it could be
[00:53:02]
useful.
[00:53:03]
And then if you want to have an editor in Elm for Elm, like you want to recreate Ellie
[00:53:09]
or something, well you can, you have an Elm format function that would be useful.
[00:53:14]
Right.
[00:53:15]
Interesting.
[00:53:16]
And then Elm review can use that to be even better at fixes or something like that.
[00:53:22]
Another one is, you know how Elm provides a diff function or diff sub command.
[00:53:28]
So you do Elm diff name of the package and then the versions.
[00:53:32]
Well, these are the API differences between these two packages.
[00:53:36]
Well, I have seen the same thing in other languages where they also give you the code
[00:53:42]
that has changed or the functions whose implementations have changed.
[00:53:47]
And that could be interesting as well.
[00:53:49]
For instance, to know whether there are any security issues like, oh, well this function
[00:53:54]
that had the return the commands or return the task is now doing something else.
[00:54:00]
Well that's not necessarily going to be shown in the API, but it's something you might want
[00:54:06]
to know before you upgrade to your version.
[00:54:08]
Yeah.
[00:54:09]
There's so much cool static analysis stuff you could do in general with Elm.
[00:54:14]
Yes.
[00:54:15]
Well, in this case, maybe you can just go to GitHub and ask for the diff.
[00:54:21]
So maybe I don't know if this is useful, but maybe there are some ideas that can be explored
[00:54:25]
around this.
[00:54:26]
Yeah.
[00:54:27]
I had an idea which we've talked about before, which is another small little convenience
[00:54:34]
project, which would be taking your Phantom builder types and turning it into a state
[00:54:41]
machine diagram.
[00:54:42]
Oh, yeah.
[00:54:43]
Potentially, if you had like a sort of Elm review gathering helper to gather data and
[00:54:50]
output it into arbitrary formats, JSON or whatever, you could potentially use a tool
[00:54:54]
like that to sort of in pure Elm gather that up and then generate some diagram from that
[00:55:00]
output or something.
[00:55:01]
Absolutely.
[00:55:02]
That would be useful.
[00:55:04]
Or just have a code action, just have a code action to draw the diagram in your code.
[00:55:10]
True.
[00:55:12]
And let it tell you like, oh, well this diagram is not up to date.
[00:55:15]
We have changed the function, the builder pattern.
[00:55:20]
So you need to regenerate something.
[00:55:23]
Yeah.
[00:55:24]
In that same vein, I would love like more innovative tooling and pushing the boundary
[00:55:31]
with things like in our editors, understanding things about our Phantom builders and understanding
[00:55:38]
what like is contextually possible to give us the type that we need.
[00:55:44]
Okay.
[00:55:45]
Well, this is the literal only way that you can construct this type is by stringing together
[00:55:50]
these functions with something of these types.
[00:55:52]
So here, let me do all the things I know for you.
[00:55:56]
Like I would, but that is pie in the sky.
[00:56:00]
That's definitely like big idea thinking, but it is Elm.
[00:56:05]
And so it is very statically analyzable.
[00:56:07]
So there are also big opportunities there.
[00:56:09]
Yeah.
[00:56:10]
I should probably also mention that when it comes to static analysis Elm review, I want
[00:56:17]
to add some features, which I will at some point, but I could definitely use some help
[00:56:21]
to have like type inference or visiting dependencies.
[00:56:26]
Like I've mentioned this in the last episode of like false positives, like just getting
[00:56:31]
more information.
[00:56:32]
So when I worked on the if branch is pruning, I mentioned that at the beginning, I kind
[00:56:38]
of made a value inference logic machine, which I think could be made more general, but that
[00:56:47]
requires some exploration, but that could be interesting.
[00:56:50]
And then you can use that for very nice diagrams or I don't know, whatever you tell me.
[00:56:57]
Yeah.
[00:56:58]
So many possibilities.
[00:57:00]
Another one I have on my list.
[00:57:01]
So actually Mario built this really cool tool that I'm sorry to sort of, I'm not sure if
[00:57:07]
we've mentioned it in the past on Elm radio, but sorry to put it out there, Mario, but
[00:57:12]
there's a tool called Elm fusion, which we haven't really announced, but we pretty much
[00:57:18]
are ready to share it.
[00:57:20]
But Mario created this really cool tool that allows you to run HTTP requests in lime Dara.
[00:57:27]
And so it's just a web application.
[00:57:30]
You give it a URL to hit a JSON API.
[00:57:34]
It gets the JSON data back in a little web page that you can play around with and you
[00:57:39]
can click things to build up a decoder.
[00:57:42]
So Mario created this like really cool tool for sort of interactively creating decoders.
[00:57:47]
And I kind of added a few things to that that like help you scaffold out things like Elm
[00:57:53]
pages, data sources, and lets you sort of paste in a curl command and it will automatically
[00:58:00]
turn that curl command into something it can execute for you, things like that.
[00:58:04]
But there are just so many cool things I think you could do with this tool.
[00:58:08]
Like one of the ideas I have that I think would be really neat is to be able to send
[00:58:14]
a collection of requests.
[00:58:17]
So right now there's already functionality to like take variables.
[00:58:20]
So if you use like a bash variable in your curl request and paste that in, I already
[00:58:25]
have it where it'll extract out the variable and you can sort of interactively type different
[00:58:30]
inputs for that variable.
[00:58:32]
And it will generate that as an Elm parameter in the function that it creates for the scaffolded
[00:58:39]
code that you use for that HTTP request.
[00:58:42]
But I think it would be really cool if you could like say, okay, well here are some different
[00:58:47]
inputs for these variables.
[00:58:49]
So like, you know, API slash users slash ID.
[00:58:54]
And then you say, okay, well go get users with these ID values and then combine together
[00:58:59]
those results.
[00:59:00]
And now if you're looking at, you know, email and instead of just seeing, oh, this is a
[00:59:07]
string.
[00:59:08]
Well, in one of the responses, it's a string in one of the responses, it's null.
[00:59:12]
And now, you know, it's, you get more information by combining together these responses and
[00:59:18]
piecing together the bigger picture of what the types are.
[00:59:20]
Yeah.
[00:59:21]
Interesting.
[00:59:22]
So I think this could be a really cool, like basically like a Elm version of Postman or
[00:59:29]
Insomnia, these types of sort of API inspector application, but with like cool Elm things
[00:59:36]
you can do based on that.
[00:59:38]
In a similar vein, I've thought about how it'd be really interesting with like Elm pages
[00:59:43]
to be able to embed tools like that in the Elm pages dev server.
[00:59:48]
So to be able to like have an HTTP data source, get back a JSON response, and then suddenly
[00:59:55]
you have this Elm HTTP fusion embedded in there where you're inspecting the HTTP response.
[01:00:02]
You got a decoder error and you can sort of interactively fix it in line because it knows
[01:00:07]
the JSON it got back and it knows that you got a JSON decoding error.
[01:00:12]
So those are big ideas, but also doable.
[01:00:16]
And another idea with the Elm pages dev server that I've had is I think it would be really
[01:00:21]
interesting to have a sort of way of interacting with the dev server to perform code actions.
[01:00:26]
So like if you go to a 404 page, if you could say, would you like to create that page?
[01:00:32]
And then the command, which you typically use like a CLI command to scaffold out a new
[01:00:36]
page, you could use a button in the UI and that could even be like configurable.
[01:00:42]
Like we've talked about with like something like Elm review code actions or how Elm review
[01:00:47]
enables an ecosystem to develop where there's a low barrier to entry.
[01:00:51]
I think there could be a similar sort of ecosystem with Elm pages being able to do these interesting
[01:00:58]
things in the dev server.
[01:00:59]
Yeah, that would be really cool.
[01:01:00]
I think there's some cool possibilities there.
[01:01:03]
Oh, and another idea I had for the Elm pages dev server, we haven't mentioned Elm code
[01:01:08]
gen yet.
[01:01:09]
Matt Griffith recently released this really exciting library.
[01:01:11]
I did.
[01:01:12]
I did.
[01:01:13]
Oh, did you?
[01:01:14]
I'm sorry.
[01:01:15]
Like five minutes ago.
[01:01:16]
Okay.
[01:01:17]
Well then we have, well, so I think it would be really interesting to use Elm code gen
[01:01:26]
in tools for the developer experience.
[01:01:28]
For example, in Elm pages being able to scaffold out a new page using Elm code gen and then
[01:01:33]
being able to use pure Elm code that you have confidence that you're generating something
[01:01:38]
that has the correct types to scaffold out in Elm pages route module.
[01:01:43]
So yeah, so many, so many cool possibilities.
[01:01:46]
It'll be really cool to see what kinds of innovations come in the next couple of years
[01:01:50]
with this tool.
[01:01:51]
There is one very tiny tool that I would really like, but that's not going to be useful to
[01:01:57]
many people.
[01:01:58]
Do you remember the blog posts on the Elm Lang website called the syntax cliff?
[01:02:04]
Yes.
[01:02:05]
There's one really nice thing in there that you may not have noticed or may have remembered
[01:02:11]
because it's been a while.
[01:02:12]
It talks about error messages and it shows an error message at one point.
[01:02:17]
And that is actually not just a copy pasting of the report from the compiler.
[01:02:25]
And it's also not a screenshot.
[01:02:26]
It is a code block with the proper colors so you can copy paste it and it looks exactly
[01:02:35]
like a compiler error.
[01:02:37]
And I would really like to have that made easy in my blog posts.
[01:02:42]
It currently isn't.
[01:02:45]
I don't know how it's coded.
[01:02:47]
I think it was coded by hand by Evan.
[01:02:49]
Yeah, it was.
[01:02:50]
I've looked at that code.
[01:02:52]
We should pair on that, Jeroen.
[01:02:53]
We can totally make that happen with Elm pages.
[01:02:55]
I said we don't have time for it.
[01:02:58]
Well, we have time for some things.
[01:03:03]
This one might be pretty straightforward actually.
[01:03:05]
Okay, cool.
[01:03:06]
Yeah, so that would be interesting.
[01:03:09]
Yeah.
[01:03:10]
It would be useful for the two of us at least.
[01:03:13]
Yeah.
[01:03:14]
And as we've mentioned in the past, you could definitely imagine a cool doc site for Elm
[01:03:19]
review packages where you can show more interactive output.
[01:03:25]
So I want this for the Elm compiler, but I also want it for Elm review errors, obviously.
[01:03:31]
And you could also have it for like, oh, Elm pages reported this error in a troubleshooting
[01:03:36]
section or Elm SPA or Elm code gen or whatever CLI that we're using and have that inside
[01:03:43]
the documentation.
[01:03:44]
And that would be a pretty nice experience, I think, for most people.
[01:03:46]
Yeah, it's actually really not rocket science.
[01:03:49]
I mean, it's just like anti color code parsing, which they're already on packages for.
[01:03:54]
So it's really just like stringing together a few of those things in your blog output.
[01:04:00]
So that's very doable.
[01:04:02]
So onto another topic on a project that might be that will not be as small.
[01:04:08]
So I went to lambda days recently and I heard a talk about from Felina Hermans.
[01:04:13]
Does that ring a bell?
[01:04:16]
Okay, she made the Hade language, which is intended to teach coding to kids.
[01:04:22]
So it's kind of like Python, but it's cut up into several levels.
[01:04:27]
So it's a subsection of Python and sometimes like a simplified Python.
[01:04:33]
So for instance, like level one is you say you type in hello world and that actually
[01:04:40]
prints hello world.
[01:04:42]
Level two is you need to say print hello world.
[01:04:46]
Level three is you need to add quotes or something, or level four you add variables, stuff like
[01:04:53]
that.
[01:04:54]
At some point you add loops and that basically you start very simple and then you make it
[01:04:59]
slightly more complex, but that also allows you to do more things.
[01:05:03]
I thought that was a pretty interesting way of teaching that language.
[01:05:07]
I don't know if it would make sense for Elm.
[01:05:10]
Maybe it could, but there's another thing that Hade does and that is translating.
[01:05:15]
It is a language that you do on a website and the website is translated to a lot of
[01:05:20]
languages, but also the error messages are translated and the keywords are translated.
[01:05:28]
Like you would not say print, you would say imprimé in French or something like that.
[01:05:35]
Hopefully something shorter because one of the things that really help learning is when
[01:05:39]
you learn something in your own language, which in your case Dillon is English.
[01:05:45]
It's very convenient, I will admit.
[01:05:48]
In my case, my English was good enough when I started learning coding, so it wasn't a
[01:05:52]
problem, but I can totally imagine some people having more troubles than we did.
[01:05:57]
Absolutely.
[01:05:58]
They're starting to make some languages where a lot of the keywords are Chinese now because
[01:06:05]
it is like, I mean, there's enough of an audience of Chinese programmers.
[01:06:10]
It's like a large demographic.
[01:06:16]
But yeah, if you had more of an AST based approach rather than just text, the bigger
[01:06:22]
picture here is like getting away from pure text serialization formats for code.
[01:06:28]
So I don't know whether it's interesting to do the Elm in several steps.
[01:06:36]
I don't know if it's interesting to do the, instead of if, use the appropriate word in
[01:06:42]
your language.
[01:06:43]
But one thing that I could see that would be a lot less work is to translate the error
[01:06:49]
messages and translate the documentation.
[01:06:52]
That would be much easier.
[01:06:54]
You could have a wrapper around the Elm compiler that does some reg exes on the output and
[01:07:00]
then reprint it in your language.
[01:07:04]
That could be interesting already.
[01:07:06]
And then documentation translate the Elm sites in some language.
[01:07:11]
I know the French community has done that recently where they translate the website
[01:07:17]
and the whole guide.
[01:07:19]
That's great.
[01:07:20]
But yeah, you could imagine a tool that wraps the Elm compiler, but it just looks like it's
[01:07:25]
made for French people.
[01:07:26]
I love that idea.
[01:07:27]
Except that the keywords are if, then, case of.
[01:07:31]
And I would be open to that idea as well for Elm Review, like being able to translate errors,
[01:07:36]
but I don't know how much work that would be and how much work that would put on maintainers.
[01:07:43]
Because it's also like, oh, well, this error message has been translated to Chinese.
[01:07:49]
I don't know if Chinese did the translator do it in good faith or was it a troll that
[01:07:55]
just added something terrible?
[01:07:58]
Yeah.
[01:07:59]
I don't know.
[01:08:00]
So I have no experience with translating projects, but other programming language communities
[01:08:09]
have done that to some extent.
[01:08:13]
So we probably have something that we can copy from them.
[01:08:16]
And this would definitely be a community effort.
[01:08:19]
Otherwise, it would not go very far, I think.
[01:08:22]
Right.
[01:08:23]
Yeah, there's a big community element to that, for sure.
[01:08:26]
Yeah, we could cater to more communities like that, teach children not only in the US, like
[01:08:33]
where we've seen it be successful in some instances, but also like people in Germany,
[01:08:39]
people in France, people in China, people wherever.
[01:08:41]
Yeah, it could definitely go a long way for making it more accessible for people to learn.
[01:08:46]
Very cool idea.
[01:08:47]
I've got one more.
[01:08:48]
I've got a couple more categories on my list, just a few more items.
[01:08:52]
So one category that I find really interesting is bundle size and performance.
[01:08:59]
And I think that, again, I think that Elm is really interesting in the possibilities
[01:09:04]
here because it's so statically analyzable.
[01:09:08]
It's so swappable.
[01:09:10]
If you can do something that's equivalent, you can just swap it out and not worry about
[01:09:15]
whether it's going to be misbehaving in some way because it's very well behaved code because
[01:09:20]
it's Elm.
[01:09:21]
So one idea I have is an Elm CSS compiler.
[01:09:25]
Elm CSS used to be actually a CSS compiler in its original form.
[01:09:30]
And there's a fork of it that still does something similar.
[01:09:33]
But the way it worked was basically using custom types instead of classes.
[01:09:39]
And you declared sort of global styles.
[01:09:41]
And then you would compile out a style sheet with those global styles and then use those
[01:09:46]
class names, which you had like safe Elm tokens to use with these nice custom types.
[01:09:52]
Elm UI used to actually use a similar technique where you had like globally declared styles.
[01:09:59]
But my idea here is, so I think that there is a real cost to having sort of CSS and JS,
[01:10:08]
in this case, the JS output of the Elm compiler.
[01:10:11]
But in putting that in our JS bundles, there's a performance cost.
[01:10:15]
CSS, when you have it as raw CSS, is very performant.
[01:10:20]
The browser is really optimized.
[01:10:22]
I mean, it's a more constrained language.
[01:10:25]
And so it can do more optimal things with it.
[01:10:27]
And it has to do less work to deal with it.
[01:10:31]
So I think it would be really cool to take, my idea is to take inline Elm CSS that you
[01:10:39]
have in an Elm CSS style tag, and then compile those out into an actual style sheet in your
[01:10:46]
compile step, in your build step, and replace them with just a class attribute pointing
[01:10:53]
to generated styles.
[01:10:55]
So you would be compiling out inline Elm CSS styles into a generated CSS file that point
[01:11:02]
to sort of a hashed version that refer to those CSS styles.
[01:11:07]
I think it's pretty doable.
[01:11:09]
The easy version is that you say, this only works for direct inline styles in Elm CSS
[01:11:20]
lists of styles.
[01:11:22]
Or something that your static analysis tool can understand.
[01:11:26]
Exactly.
[01:11:27]
Like we talked about in the false positives episode, like making your job easier for requiring
[01:11:33]
more constraints for it to be more static and more easily analyzable.
[01:11:36]
The more deluxe version is you say, OK, well, if your styles depend on certain variables,
[01:11:43]
so you say, if active, then background color is bright blue, else background color is dark
[01:11:55]
blue, or whatever.
[01:11:57]
Then you can say, OK, well, we're going to get fancy here, and we're going to compile
[01:12:02]
that down into two different classes.
[01:12:04]
Or you can get more sophisticated there.
[01:12:07]
But I think it would be really interesting to start with a form that just keeps it simple
[01:12:12]
and says, we're going to do a code mod, modify the code inline with an intermediary step
[01:12:19]
to take this generated output, strip out all of the only static things.
[01:12:25]
If you have any conditionals or case expressions around it, we're not going to touch those.
[01:12:30]
But the things that are purely static in your Elm CSS, we're going to take all of those
[01:12:34]
and turn them into a compiled CSS class.
[01:12:37]
I think that's quite doable.
[01:12:38]
I think so as well.
[01:12:40]
The only thing that you would need to do is to set constraints like, don't write any CSS
[01:12:45]
that I can't understand.
[01:12:48]
Don't pass a variable to attribute.class that you can't infer based on the context.
[01:12:55]
Or you ignore those ones, right?
[01:12:56]
You just say, hey, those ones in the code mod that we used to generate the output, we
[01:13:02]
just don't touch those.
[01:13:03]
But then the static ones, we pull out and put that into the compiled CSS.
[01:13:08]
So there will be a mix of Elm CSS.
[01:13:12]
But now, if you're able to compile out all of the Elm CSS, then you can actually essentially
[01:13:19]
compile out the Elm CSS library entirely, which is kind of interesting too.
[01:13:23]
So I think there's some kind of fun things you could do with bundle size there.
[01:13:27]
I think it would be really cool to do a proof of concept and then do some benchmarking and
[01:13:33]
see what that looks like.
[01:13:34]
On a related note, I think it could be really interesting to have some tools for these types
[01:13:40]
of general code mods in Elm.
[01:13:43]
In Elm pages, I do some code mods, meaning modifying source code in a precise way.
[01:13:50]
Using Elm review, I use some Elm review rules and apply them and output them to a secret
[01:13:56]
temporary directory and then use that to actually compile the output.
[01:14:00]
So I use that in the case of Elm pages to actually do dead code elimination for the
[01:14:06]
server side only stuff.
[01:14:08]
Because I know that it doesn't need to run that on the client.
[01:14:12]
So I can dead code eliminate all of that with the help of Elm review.
[01:14:15]
But I think that could be a cool little helper tool.
[01:14:18]
It's something that could help you manage those secret directories for running a code
[01:14:23]
mod and outputting that code and generating the Elm code.
[01:14:28]
So yeah, for code mods, I know that Aaron van der Haar worked on Elm refactor.
[01:14:33]
That one has not been released yet.
[01:14:37]
But that would be definitely useful, especially to have new versions of libraries.
[01:14:42]
So for instance, for Elm review, I think I'm going to make a lot of changes for v3 whenever
[01:14:49]
that comes.
[01:14:50]
Like I just have ideas for now, having a code model would be super useful.
[01:14:55]
I also want to talk about debuggers.
[01:14:57]
Like I've always wanted a way to make Elm review more easy to debug.
[01:15:03]
Like why didn't this not work the way I wanted?
[01:15:06]
Like maybe go through each visit and have a step by step debugger or something.
[01:15:12]
Also like there's astxplorer.net, which is a tool where you can add your code, tell which
[01:15:20]
parser you want to use and shows you the AST for it.
[01:15:24]
And also allows you to insert like a ESLint rule or a Babel transformer, and it gives
[01:15:31]
you the output of that.
[01:15:32]
So that would be really useful for Elm review.
[01:15:35]
I have one of this for every, like from before I released the tool because that was very
[01:15:40]
cool.
[01:15:41]
I don't know if that's a barrier to entry for people.
[01:15:43]
It's not for me anymore because I know the AST well enough, but I think that would be
[01:15:48]
very useful.
[01:15:49]
And I know that other people have talked about some things being very hard to debug as well,
[01:15:54]
like parsers, like having a tool that helps you find out like what has been consumed in
[01:16:01]
which state am I in this parser state machine.
[01:16:07]
And I think we could also have very cool ideas for enhancing the Elm debugger in the browser.
[01:16:14]
Like we could have a tool like Elm optimize that changes the output code to insert a new
[01:16:22]
kind of debugger, which would be either something very different or just an improvement of the
[01:16:29]
Elm debugger, which I don't see myself using that much anymore, but because some things
[01:16:35]
are annoying, like we have a tick message and I would like to be able to filter that
[01:16:41]
one out.
[01:16:42]
That's not possible at the moment.
[01:16:44]
So things like that.
[01:16:45]
Yeah, right.
[01:16:46]
The Elm debugger is very useful, but there are a couple of things that come up that could
[01:16:52]
make it much more usable in some cases, like you said, being able to filter things out.
[01:16:57]
Sometimes when output is large, it just turns into an ellipse that you aren't able to deal
[01:17:04]
with.
[01:17:05]
And there are so many interesting opportunities too.
[01:17:06]
Like I know that like in the Clojure community and the Ruby community, a lot of these like
[01:17:12]
dynamic language communities, or am I going to get hate for calling Clojure a dynamic
[01:17:16]
language?
[01:17:17]
A lot of these, it's a dynamic language for me, but a lot of these communities swear by
[01:17:25]
having like inspectable code and being able to hook in with debuggers.
[01:17:30]
And when I was doing Ruby development, I loved using Pry and IRB to go in and look at the
[01:17:37]
application state and work with things.
[01:17:39]
There are definitely interesting opportunities there with Elm.
[01:17:42]
I think we can do a lot of things.
[01:17:44]
Like just inserting like a debugger statement in the output JavaScript.
[01:17:49]
That would be very cool already.
[01:17:52]
Right.
[01:17:53]
Also, like making commands inspectable could be really cool for the, not just for like
[01:17:59]
testing tooling, but also for the debugger.
[01:18:04]
If you could see which commands are being emitted and sort of inspect that, that could
[01:18:09]
be really interesting for debugging.
[01:18:11]
I know for Elm pages, I've been thinking about like, how could I make data sources more inspectable?
[01:18:16]
So if that data type carried sort of metadata about it that could be used in debugging.
[01:18:21]
So if there's like a, if there's a data source error, can it then include metadata that lets
[01:18:28]
you flow through to see what this HTTP error happened, but give me some context as to what
[01:18:37]
HTTP data source you were performing that caused that error.
[01:18:41]
So lots of cool opportunities there in Elm.
[01:18:44]
I think we really can do a lot more debugging tools because it really feels like an under
[01:18:50]
appreciated aspects because we don't have the tooling for it.
[01:18:54]
Right.
[01:18:55]
Right.
[01:18:56]
But we have the language for it, right?
[01:18:57]
We have the language that gives us all of these really interesting possibilities.
[01:19:01]
So one last one I wanted to bring up and one last sort of category I think is sort of runtimes.
[01:19:08]
I think Elm is better than people realize at creating runtimes to build onto different
[01:19:15]
platforms, like ways to hook into different platforms.
[01:19:18]
So for like one example I have on my list of experiments that could be cool.
[01:19:23]
There's a React tool called Inc, which is a sort of binding to creating like a higher
[01:19:30]
level way of creating CLIs where you have this React way of rendering views.
[01:19:36]
Well that view, what if that view was a CLI and what if you had view components that were
[01:19:40]
spinners, input boxes, things like that, but for a CLI.
[01:19:44]
I think that the Elm architecture would work quite nicely for that and that could be an
[01:19:49]
interesting space to explore.
[01:19:51]
So Elm review has a CLI obviously and it's using some dependencies for that, for making
[01:19:58]
very nice things.
[01:20:00]
And if that was written in Elm, we would have dead code elimination and I wouldn't be injecting
[01:20:08]
everything for that.
[01:20:11]
So yeah, that would be quite nice I think.
[01:20:14]
Yeah.
[01:20:15]
Yeah.
[01:20:16]
I think so there's a tool called Inc that does this in React.
[01:20:18]
I think there are a lot of opportunities of like X for Elm and I think Inc is a cool one
[01:20:24]
and I think just in general like Elm is really cool for building platforms because you can
[01:20:28]
really explicitly lay out the data that you get and what you build in a type safe and
[01:20:33]
well constrained way in some of these contexts.
[01:20:36]
So many opportunities.
[01:20:37]
I think as people can tell, we have a lot of ideas that we don't have time for.
[01:20:43]
We would love to have more time for these things, but hopefully people have some inspiration
[01:20:48]
to get out there and do some experiments and build some cool things in Elm.
[01:20:53]
We also have GitHub sponsors pages if you want to give us something that can help us
[01:20:59]
have more time.
[01:21:00]
True.
[01:21:01]
Absolutely.
[01:21:02]
But there are plenty of other people who ask for sponsorships.
[01:21:07]
We will have a link to.
[01:21:09]
Yeah you've got an awesome Elm sponsors GitHub repo.
[01:21:14]
We could link to.
[01:21:15]
Yeah.
[01:21:16]
So yeah, please work on these things.
[01:21:19]
Please get in touch with us if you want and make cool things.
[01:21:23]
And Jeroen, until next time.
[01:21:25]
Until next time.