Aaron Francis on Torchlight

September 16, 2022

I was a guest on the Twenty Percent Time podcast to talk about Torchlight, my syntax highlighting service.

Transcript

Dave
00:00:00 – 00:00:08
Welcome to 20 Percent Time, a podcast from the team at Titan, a web development consultancy that specializes in Laravel, Vue, React, LiveWire, all kinds of stuff. My name is Dave Hicking,
Zuzanna
00:00:08 – 00:00:09
and I'm here with my amazing
Dave
00:00:09 – 00:00:12
co host, Susanna, as always. Susanna, how are you today?
Zuzanna
00:00:13 – 00:00:15
I'm doing very well. Thank you, Dave. How are you doing?
Dave
00:00:15 – 00:00:35
I'm doing great. The weather has been nice and cool here. Fall is arriving in the northeast. This is we're we're getting close to, like, one of our 3 3 weeks in the spring and 3 weeks in the fall when it's actually nice, and it's not either a hot, swampy, like, mess, or it's not like a frigid ice hellscape. These are the I'm just kidding.
Dave
00:00:35 – 00:00:39
It's not really that bad. But, no, the weather's lovely, so that means I'm in a good mood and yeah.
Zuzanna
00:00:39 – 00:00:48
Oh, that's good. I mean, the UK, we we we tend to have only one sort of kind of weather. It's the overcast rainy weather. But I have to say this year has been really good. The summer was really, really hot.
Zuzanna
00:00:48 – 00:00:53
Oh, yeah. Some people didn't like it. So Yeah. It's not so much. Not very British weather.
Dave
00:00:53 – 00:00:53
So you're
Zuzanna
00:00:53 – 00:00:54
looking to the overcast. I
Dave
00:00:54 – 00:00:56
was gonna say you're looking forward to that cool down.
Zuzanna
00:00:56 – 00:01:03
Well, we've it arrived. It's here now. Summer's over now. Like, let's not push it, and back to rainy days.
Dave
00:01:03 – 00:01:08
Yeah. And while we've been sitting here just chatting about the weather, we, have our wonderful guest
Aaron
00:01:08 – 00:01:09
who's
Zuzanna
00:01:09 – 00:01:10
British of us,
Dave
00:01:11 – 00:01:21
Wonderful guest has been sitting here in silence so patiently. We are joined today by Aaron Francis who, he does a ton of stuff in the Laravel community. If you are if you know this podcast because it's put
Zuzanna
00:01:21 – 00:01:26
on by Titan, I can't believe you couldn't be following Aaron already on Twitter. Aaron, how are you?
Aaron
00:01:26 – 00:01:35
I'm doing great, and I am jealous about the weather y'all are talking about. I'm in Texas where it's gonna remain hot for another month and a half. So unfortunate. That's why I was quiet during the weather segment.
Dave
00:01:38 – 00:01:52
Oh, yeah. Texas, I, I we have a number of folks at Titan who have either who either live in Texas now or who have lived in there in the past. I went to high school in rural Oklahoma right over the Texas border. So I I remember. It's very hot.
Dave
00:01:53 – 00:01:54
Even the wind is hot.
Aaron
00:01:55 – 00:02:03
It is. Yeah. It's pretty brutal. Fortunately, I'm not in Houston or Galveston where it's hot and humid. I'm in Dallas where it's where it's just hot, but, boy, is it just hot.
Dave
00:02:03 – 00:02:18
It's just hot. Yeah. Alright. Well, Aaron, thank you so much for joining us today. So for folks who may not have, heard of you before, maybe, you know, heard the name but don't you know, can't place the the voice or don't know much about you, can you can you tell us a little bit about yourself?
Dave
00:02:18 – 00:02:20
What do you do? Who are you?
Aaron
00:02:20 – 00:02:38
Yeah. Absolutely. So I'll start with context maybe in the Laravel community. I've, built a couple of packages. I think at the last Laracon, I was doing a demo on Sidecar, which is a Laravel package that helps you with AWS Lambda functions, and that one is just, like, a whole lot of fun.
Aaron
00:02:39 – 00:03:10
More recently, I've done one for pagination, kind of like a database, like, kinda hack, but makes your pagination faster, and it's called Fastpage. So that's kind of some of the context for Laravel. We've I've built a lot of packages, and they all kinda live under hammerstone dot dev, which is my main, side project area. What we're gonna be talking about today is Torchlight, so I'll save that one. But then professionally, I now work at a database company.
Aaron
00:03:10 – 00:03:28
It's called PlanetScale, and I'm now a developer educator there. So I had been working on this, MySQL for developers course for a super long time and kind of been tweeting about it and writing articles to get people on the mailing list. And the CEO of PlanetScale DM'd me and was like, hey. How come you don't work for us? And I was like, well
Dave
00:03:29 – 00:03:29
That's a
Aaron
00:03:29 – 00:03:32
what? 1, because I have a I have a job,
Zuzanna
00:03:32 – 00:03:33
and 2, because nobody's
Aaron
00:03:33 – 00:03:36
nobody's ever asked me to come work anywhere.
Dave
00:03:36 – 00:03:39
What a DM to get. Yeah.
Aaron
00:03:39 – 00:03:41
Total power move that only the CEO could do.
Dave
00:03:41 – 00:03:42
Yeah. Seriously.
Aaron
00:03:42 – 00:03:54
He was he was like, hey, what if you come work for us and we buy this unfinished course off of you and you do it for us and you just keep writing your same articles, but you do it for us? I was like, you know what? That sounds amazing. Let's do that.
Dave
00:03:54 – 00:03:55
Yeah. Awesome.
Zuzanna
00:03:55 – 00:03:57
How is the course going? How far along are you?
Aaron
00:03:58 – 00:04:21
You know, Susanna, that's an interesting question, isn't it? It's funny it's funny you should ask that. So here's the deal with the course. I've read I don't know if you could see it in the background. I've read, like, maybe 7 or 8 MySQL books and kind of pulled out all of, I think, the interesting parts of which there are many, but maybe fewer than you would expect.
Aaron
00:04:22 – 00:04:48
And I have the outline and the references and the material totally done. So that part, I feel super good about. I haven't recorded a single video, but I'm have maybe a 1000 people on the mailing list. And I have my outline and all the stuff I wanna hit totally finished. And it's really interesting because the whole shtick is like MySQL for developers, not for DBAs, but, like, you as Laravel developers, what do we need to know about MySQL?
Aaron
00:04:49 – 00:05:04
Like, not only to get by, but to make it performant, and, like, fast enough. And so it's been a whole lot of fun. I've been working on it for maybe, you know, a year, but recorded videos, 0. Content outline, a 100 percent. So I don't know.
Aaron
00:05:04 – 00:05:05
You you tell me.
Zuzanna
00:05:06 – 00:05:15
No. I think from from what I've done and seen, I think the hardest you've done the hardest part. You've got the outline. You've got the material, the recording. You know?
Zuzanna
00:05:15 – 00:05:16
It's easy peasy. Yeah.
Aaron
00:05:16 – 00:05:21
I hope so. Yeah. That that's the encouragement I was looking for. So thank you. There you go.
Zuzanna
00:05:21 – 00:05:25
And, also, I think you printed out the my it's my secret docs, haven't you?
Aaron
00:05:25 – 00:05:26
Yes. See, that's the
Zuzanna
00:05:26 – 00:05:30
Like, that's way above anything I've ever seen.
Aaron
00:05:30 – 00:05:40
Yeah. So I, yeah, that gives you an idea of how into this I am. Yeah. I printed out 2 chapters of the MySQL docs. 1 was on optimization, and 1 was on, like, data schema.
Aaron
00:05:40 – 00:05:49
And I I wanted to know, like, these books are great, but the books are based on something. Right? And I wanted to go to the source and see, like, where are these people getting their information?
Zuzanna
00:05:50 – 00:05:50
And I
Aaron
00:05:50 – 00:05:58
can't sit there and read it on a screen because that would just be brutal. So I just went to FedEx and was like, hey. I have this PDF. Can you print and bind it? And they're like, yeah.
Aaron
00:05:58 – 00:06:00
That'll be $20. Like, amazing. So yeah.
Zuzanna
00:06:00 – 00:06:01
It's cheaper than a book.
Aaron
00:06:02 – 00:06:10
I know. So they print it and bound it for me, and it's it's been awesome. I can highlight and put stickies in it. And it's super nerdy, but it's a lot of fun.
Zuzanna
00:06:10 – 00:06:16
I think you're probably the first person I've heard saying that beating dogs is awesome and super fun and your highlight.
Aaron
00:06:16 – 00:06:43
I love it. I mean It it's great because it's like, reading reading blog posts is fun, but it's kinda disjointed. Reading a book is great because it gives you this super high level overview of, like, the universe in which you're working. Reading the docs is wonderful because besides reading the source, it's like as close to the source as you could get. And the people that write the books are pulling, you know, from their experience, of course, but a lot of it comes from, like, just the raw documentation.
Aaron
00:06:44 – 00:06:51
And so if you can go down there and look and see what's actually there, I feel like it's really, really valuable once you kinda have a framework where you can slot it in.
Zuzanna
00:06:51 – 00:06:56
Yeah. Definitely. Oh, it sounds exciting. I can't wait for the course to be finished. Hint hint.
Zuzanna
00:06:56 – 00:07:01
You know? Just saying. Yeah. Thanks. I think half of Titan has already signed up for it.
Zuzanna
00:07:01 – 00:07:02
I think we will Yeah.
Aaron
00:07:02 – 00:07:02
I think so.
Zuzanna
00:07:02 – 00:07:03
All take it. Yeah.
Aaron
00:07:03 – 00:07:10
Well, the good news is it's gonna be free now because Planet Scaled obviously makes money otherwise. So the course is gonna be totally free.
Zuzanna
00:07:10 – 00:07:17
Yeah. That is amazing. I cannot wait, honestly. Especially now seeing how excited you are about it. I just I mean, I've known you are excited with databases.
Zuzanna
00:07:17 – 00:07:26
I know that about you. But now hearing you speak about it, I just I wish people could see your face, how you light up when you speak about database queries. You know, it's amazing.
Aaron
00:07:26 – 00:07:34
Yeah. Well, we all have our thing, and I am I am of the firm opinion that you should lean into your thing and be unabashedly excited about it.
Zuzanna
00:07:34 – 00:07:36
Yeah. Good for you.
Dave
00:07:36 – 00:07:50
Okay. So Torchlight. First of all, great name. Thanks. I wanna I wanna ask about we can ask about how you came up with the name, but let let's start actually just with, like, for folks who don't know what Torchlight is, what's the elevator pitch for Torchlight?
Aaron
00:07:51 – 00:08:24
The elevator pitch for Torchlight is it is a syntax highlighting API. So you're used to highlight JS, Prism. I get that confused with Prisma, but Prism JS, and those do syntax highlighting on the client side. Torchlight does syntax highlighting via API. So I've built a bunch of clients, that contact the API, but we do, I wanna say, perfect syntax highlighting because it uses a much more powerful engine than you can use in a browser.
Dave
00:08:24 – 00:08:30
Do you have that on the website? Do you have the phrase perfect syntax highlighting? Because that's pretty that's pretty good. That's interesting. Yeah.
Aaron
00:08:31 – 00:08:32
We we need to talk
Zuzanna
00:08:32 – 00:08:33
about both for it. Sure. Yeah.
Aaron
00:08:33 – 00:08:41
We need to we need to talk about the website because y'all actually did an amazing redesign that I haven't pushed out there yet. So maybe I'll put that as the headline.
Dave
00:08:41 – 00:08:43
Perfect syntax highlight. That's interesting.
Zuzanna
00:08:43 – 00:08:51
Obviously, it it works when you're bold and when you go after what you want, you know, case in point when you your job. So just be bold. Go for it.
Aaron
00:08:51 – 00:08:55
Yeah. I like that. I may I may actually do that. I may take a stance and say this is perfect syntax highlighting.
Zuzanna
00:08:56 – 00:09:09
Yeah. And, like, so, obviously, when you before you built Torchlight, what was the problem you were trying to like, why? What made you even think about building something yourself? Because I know us as devs, it's often like, oh, we don't need a package. We just build it ourselves.
Zuzanna
00:09:10 – 00:09:17
Some people go for it, some people don't. So what what was it for you that made you think, okay, I'm gonna build it myself. I'm gonna make my own Yeah. Autoliter.
Aaron
00:09:17 – 00:09:38
Yeah. So I was writing all the docs for these various packages that we have at Hammerstone. Primarily, I was writing the docs for a package called refine, which is like a visual query builder. And in the docs, I was there were 2 things that were happening. 1 is I was getting bad syntax highlighting, so it was just, like, objectively wrong.
Aaron
00:09:39 – 00:10:02
And a lot of that was coming a lot of that was coming with maybe some new PHP, you know, 8 stuff that Mhmm. Let's say, highlight.js or Prism wasn't caught up to yet. And so I was getting these really gross, like, the second half of the code block was just gray. I was like, man, this looks really unprofessional. Like, would Adam Wathan be okay with this?
Aaron
00:10:02 – 00:10:24
No. So I, like, I am always trying to live up to his standards, and so I was like, this is terrible. It looks stupid. So that was the first thing. The second thing was, I really wanted so like as I was writing these docs, I had these giant code block sections, and I wanted to be in the code block, giving more context to what I was trying to communicate.
Aaron
00:10:24 – 00:10:33
Right? So in in documentation, you're trying to communicate a thought, and I wanted to be in the code block being like, no. No. No. Look right here at this line.
Aaron
00:10:33 – 00:10:45
This is the line you should pay attention to. But I couldn't just, show that line because the surrounding context was important, but I wanted to focus the reader's attention on a particular thing.
Zuzanna
00:10:45 – 00:10:45
Yeah.
Aaron
00:10:45 – 00:11:08
And so I was I ended up having, like, all these hacky workarounds to, like, add extra classes to a certain line, and I thought, man, this is really painful. And so the reason that I built it is because I found this great, tool called Shiki, which is a which is a syntax highlighter, but it's node only, and it's really rough around the edges.
Zuzanna
00:11:08 – 00:11:09
And
Aaron
00:11:09 – 00:11:37
so I thought I could, like, I could write an entire framework around this and then use Shiki to, like, do some of the syntax highlighting and then kinda write my own renderers to add all these extra touches to it. And then that would give me the best ability to communicate what I'm trying to teach to the reader. And so that's kinda where I ended up. It was like, one, the syntax highlighting is wrong, and 2, I'm not able to add context that I think would be helpful.
Zuzanna
00:11:38 – 00:11:50
Yeah. Kinda when you when you mentioned it, I think it should have been possible. Like, it seems such an obvious thing to do. Like, you know, obviously, I can see the use case for that. But, yeah, so how long did it take you to so when how how long have you been working on?
Zuzanna
00:11:50 – 00:11:52
When did you start? Has it been a long time?
Aaron
00:11:52 – 00:12:06
Oh, yeah. It's been over a year. I did this adorable thing on Twitter where I was like, I'm gonna launch this project in a day. Follow along with me. And that was that was literally 18 months ago, and I look back, and I'm like, oh, you cute naive spring child.
Aaron
00:12:06 – 00:12:45
So, yeah, I mean, the the proof of concept I got done pretty quickly and was using on the hammerstone.dev site pretty immediately. And since then, it's been a whole series of tweaks and optimizations and improvements. Just just recently, I've launched a parallel infrastructure to do all the rendering that I'm about to switch everybody over to. Because as you can imagine, like, doing all of this rendering, like, it has to be so fast because in some cases, it happens in the request response life cycle of people's applications. Like, for Jigsaw, it doesn't.
Aaron
00:12:45 – 00:13:17
You build it. It gives you perfect syntax highlighting as HTML, and then you ship it to, you know, s 3 or whatever wherever you host your website. For some people, they're using it in Laravel in the middle of the request response life cycle, and so I can't be, you know, dorking around for 5 seconds, like, highlighting code. It has to come back super fast. And so there have been some pain points along the way, but I think I've got the infrastructure set up such that now I can almost guarantee fast enough response times across the board regardless of load.
Zuzanna
00:13:17 – 00:13:27
Do you feel like it's finished? It's done, the package? Or, I mean, obviously, there's always things to improve, but, like, the major features, do you feel like you're done?
Aaron
00:13:27 – 00:13:46
I feel like from the user perspective, so from the perspective of somebody that wants syntax highlighting, it's done. I think there are a lot of great features. One, it works. Like, it gives you correct syntax highlighting. Whatever you're gonna get in Versus Code, you get in Torchlight, and I feel good about that.
Aaron
00:13:47 – 00:14:10
And 2, it has all these great, like, annotations where you can highlight or show diffs or do collapsing or blurs or whatever. So from that perspective, I feel like it is done. From my perspective, I feel like it's not even close to done. I have big plans for it. One is, I finally got this new infrastructure set up, and so I need to I need to switch over to that so that everybody's using it and not just a few people.
Aaron
00:14:10 – 00:14:24
And then, corresponding with that so that is, like, step 1. And then step 2 is make it free. Like, right now right now it costs money. I mean, it quote, unquote costs money. I don't enforce anything.
Aaron
00:14:24 – 00:14:51
So, you know, do whatever you want. It's free. So right now, it costs money, but I wanna make it explicitly free. And this infrastructure obviously is a prerequisite to that because I'm hoping that the load will go up when it becomes free. So once it's free, then I need to, as a part of making it free, I need to launch this new design that y'all have done for me that looks amazing and looks modern.
Aaron
00:14:51 – 00:15:28
And then after that, I have an in browser client that actually, contacts the API. So it doesn't do the highlighting on the client because that's still too expensive to ship all the stuff required, all the all the language files, but it does the highlighting from the client. And so I feel like that is just gonna explode the use cases because now people can just put a JavaScript snippet on their page like they are used to, but then get Torchlight instead of, like, highlight JS or Prism or something like that. So I I have a long way to go, but I feel like from the user perspective, yeah, it's done. Go for
Zuzanna
00:15:28 – 00:15:29
it. Yeah.
Dave
00:15:30 – 00:15:48
Yeah. You you you sort of talked a bit about some of the things that you really sort of motivated you. And, you know, reading through the existing website, I noticed, I don't know, I I kinda feel like you you can get a little bit of sort of the story behind this. Right? Things that really kind of, I'm assuming, drove you a little little nuts about earlier sent you know, sort of previous syntax highlighters.
Dave
00:15:48 – 00:16:01
You call out, you know, there's no flash of unstyled, you know, text. There's you're not using JavaScript. Aside from those, are there any other sort of specific real annoyances that you really wanted to make sure Torchlight solved that we haven't talked about yet?
Aaron
00:16:03 – 00:16:28
You know, I think the biggest one is, yeah, the Flash of Unstyle, the huge JS bundles. Like, oh, that's a pain. I think the biggest one is is the context. So being able to add all of these annotations in your actual code block and that's something I focused really, really hard on was I want people I want the authoring experience to be delightful. Right?
Aaron
00:16:28 – 00:17:02
When you're writing your documentation, I want, your code examples to remain valid code because if you're if you're putting all these fake markups inside your code and then you hit auto format in your editor, like, it's gonna it's gonna make your code blocks all wonky because it's, like, encountered this, you know, torchlight syntax that it doesn't recognize. And that's what happens with other syntax highlighters. It's, like, just put these curly braces wherever you want, and then in your editing experience, it's like, well, this isn't valid code anymore, so I don't know how to format it. So now your docs look crappy. Right?
Aaron
00:17:03 – 00:17:49
So I spent all of this time figuring out how could I weasel this extra metadata into a real code block without dorking up the the formatting. And I figured out that I could in every language, there is comment syntax besides JSON, but in every language, there's comment syntax, and I could put all of this extra rich metadata inside an actual code comment. And at that point, it doesn't mess up your formatting, it doesn't mess up your editing, and then I can, like, read that metadata out and then strip the comment and throw it away. And so now I can do all this super powerful stuff, and your user never sees it. And as the author, you get to write real code and not have to worry about, like, these weird annotations that are gonna throw everything off.
Zuzanna
00:17:49 – 00:18:02
So you mentioned, like, how well, the things that Torchlight does. But how do because syntax syntax highlighting seems quite complex to me. I mean, I've never looked into it. So how does Torchlight do it? Like, can you walk us through an example?
Zuzanna
00:18:02 – 00:18:04
How Yeah. How does it do it?
Aaron
00:18:04 – 00:18:28
Totally. So Torchlight, sits on top of a package called Shiki, and Shiki sits on top of a package. I don't know what it's called, but it's like the Versus Code engine. Right? So at the bottom is this open source Versus code, and what that does is the Versus code engine takes in what's called language files, and I think they're, like, TOML files.
Aaron
00:18:28 – 00:18:48
It's this weird I think it's Tom's obvious markup language, but it's these super old files that everybody uses. Yeah. Text Wrangler, like, everybody uses these files, and these files are, like, the biggest, grossest, nastiest set of regular expressions that you've ever seen in your life. It is Oh, no. It's insane.
Aaron
00:18:48 – 00:19:18
And I've only written 1, and it was a brutal experience, so I don't have to muck around with them too much. But under the hood are these giant language files that are constantly updated, like statomic has its own, PHP has 1, you know, everybody has these language files. Right? And so the Versus code package does all of the parsing and, what they call, I think, tokenizing. So it takes a block of code and turns it into tokens based on the regex.
Aaron
00:19:19 – 00:19:35
And so it's like, this is a keyword. This is a variable. This is a comment. And so what I get from Shiki, and Shiki just adds a little bit of, like, it pulls in themes and language files, and it kind of packages it up for you. What I get from Shiki is a bunch of tokens.
Aaron
00:19:35 – 00:20:04
And it says, you know, this is the block that the user gave me, Torchlight, and then I pass that through to Shiki, and it gives me back a set of tokens. And then once I have those tokens, I'm back in Torchlight land where I have to figure out how do I turn those tokens into HTML. And that's where that's where I start, like, scrolling through all of the tokens and inspecting each individual one and seeing, like, okay. Is this a comment? If it's a comment, does it have a torchlight annotation?
Aaron
00:20:04 – 00:20:37
If does, well, I need to start, like, building up some diffs or I need to start building up, like, some blur syntax or stuff like that. And so I get the tokens back. I go line by line, token by token, and just start building up HTML, and then I return it back. And so I sit on top of a whole lot of helpful libraries, but the renderer is, you know, 2,000 lines of JavaScript that I handle. So all I get back is tokens, and then I have to do all the rest, which is great because the tokenizing seems a lot harder, honestly.
Aaron
00:20:37 – 00:20:38
Yeah.
Zuzanna
00:20:38 – 00:20:49
So how did you why did you choose this approach? Why even use, like, the this item then, like, not the client side syntax highlighting. Why did you go for this approach?
Aaron
00:20:50 – 00:21:19
I found it could have been it could have been an abundance of naivety, but I thought it was gonna be easier, which is, you know, how we all start. Wow. This is gonna be easy. So I found that it was really, really hard to get the syntax highlighting right on the client side because the client side libraries don't use, these TOML files. They don't use these language files.
Aaron
00:21:19 – 00:21:38
They have their own kind of, without being disrespectful, kind of more anemic. They're a little bit weaker. Like, these language files that they use, it's like, you know, it works 80% of the time, 90% of the time. And the reason they do that is because the the browser is so underpowered compared to a server. Right?
Aaron
00:21:39 – 00:22:06
And so part of my part of my operating hypothesis was if I can sit on top of Versus Code, then I can take advantage of an entire, like, multibillion dollar ecosystem that is hell bent on keeping these language files up to date. Right? Because Yeah. It's a much bigger problem if syntax highlighting doesn't work in Versus Code than if it doesn't work on Aaron's fun highlighting site. Right?
Aaron
00:22:06 – 00:22:28
Yeah. And so I thought there's an entire ecosystem of thousands of people that are concerned with these TOML files that are gonna keep them up to date. Like when PHP 8.2 drops, somebody is gonna update that file, and it's not gonna be me. And so that was kind of like, as one person, what can I do? Not write language files, but I can sit on top of some open source ones.
Aaron
00:22:28 – 00:22:30
And so that was kinda my that was kinda my theory.
Zuzanna
00:22:30 – 00:22:36
That sounds good. So you said as one person doesn't mean you're the only one working on Torchlight, or do you have anyone to help you?
Aaron
00:22:36 – 00:22:39
Nope. Just me. I'm the only one. Yeah.
Zuzanna
00:22:39 – 00:22:39
Okay.
Aaron
00:22:40 – 00:22:41
Yeah. Yeah. It's been
Zuzanna
00:22:41 – 00:22:49
it's been How do you manage with all the other things? So you've got you mentioned Hammerstone. You've got your job at Matzka. How do you how? That's a
Aaron
00:22:49 – 00:22:50
that's a good question.
Zuzanna
00:22:50 – 00:22:52
And you've got you've got twins, don't you? Right?
Aaron
00:22:52 – 00:22:53
I've got twins. Yeah.
Zuzanna
00:22:53 – 00:22:54
I mean
Aaron
00:22:54 – 00:23:16
Yeah. 16 16 month old twins. The first and most honest answer is my wife is a stay at home mom, and I wouldn't have time or space to do a lot of this other, like, fun outside of work stuff. If she had a full time job, I just wouldn't I just wouldn't have I wouldn't have the space. And so most of the credit goes to her, to be honest.
Aaron
00:23:16 – 00:23:28
And then beyond that, like, I don't I don't this is going to sound really sad. I don't think I'm that interesting. Interesting. Like, I don't have a lot I don't have a lot of other hobbies. I don't I don't, like I'm not into the NFL, so I don't watch.
Aaron
00:23:31 – 00:23:42
Like I don't spend all my Monday nights and Thursday nights Sundays watching football or anything like that. So I don't play video games. This is like I love working on this kind
Zuzanna
00:23:42 – 00:23:44
of stuff, and so I just end up, like, thinking
Aaron
00:23:44 – 00:23:59
about it and working on it. And, you know, I go in cycles. I burn out and, you know, don't work on stuff, and then I come back and work on it a bunch more. So I don't have I don't have, like, a huge secret. I don't have, like, a Notion system that keeps me focused every minute of every day.
Aaron
00:24:00 – 00:24:14
I miss, like, I miss a lot of stuff. Like, I sit on emails longer than I should. So, like, I'm not, like, the picture of productivity. I just I have a lot of fun doing some stuff, and so I work on it. I I basically follow my energy as much as I can.
Aaron
00:24:15 – 00:24:22
And, you know, kids go to bed right now at, like, 7 or 7:30, and then we have dinner, my wife and I, and then that's like, well, what do
Zuzanna
00:24:22 – 00:24:23
you wanna do? I don't know.
Aaron
00:24:23 – 00:24:31
You wanna watch TV? You wanna work on some stuff? You wanna recently gotten into reading sci fi? And so, like, I don't know. I just kinda follow whatever I'm interested
Zuzanna
00:24:32 – 00:24:35
in. I think that's really good. I like it. Like, just follow your energy. That's what you
Aaron
00:24:36 – 00:24:36
Yeah. Totally.
Zuzanna
00:24:36 – 00:24:46
Wasted. Yeah. That's I think because a lot of things we do these days, they train our energy rather than you know, pump us up. So Exactly. Just follow follow.
Zuzanna
00:24:46 – 00:24:50
Yeah. Go with the wind. I like that. Yeah. And well done.
Zuzanna
00:24:50 – 00:24:57
I mean, I wouldn't you are quite interesting. You say you're not that interesting. I mean, to me, you printed MySQL docs. You are interesting. Come on.
Aaron
00:24:57 – 00:25:00
Well, for certain definitions of interesting, sure.
Dave
00:25:02 – 00:25:25
So, Aron, you're pretty heavily in the Laravel or PHP ecosystem. And Torchlight, I think, you correct me if I'm wrong, seems to somewhat target that community even though, you know, it's not like at at the top of the current side. It's not like it says, you know, you're not really trying to hit that that that too hard. But I've also seen on Twitter that you occasionally dip your toe into mingling with the rails world. You know?
Dave
00:25:25 – 00:25:29
Mhmm. And the other your your partner at Hammerstone is is in the rails world.
Aaron
00:25:29 – 00:25:29
Yep.
Dave
00:25:29 – 00:25:39
And so Totally. Obviously, Torchlight is an API, so folks outside the Laravel world could use it. Do you do you see a push in the future towards targeting other communities, or are you sort of happy where you're at?
Aaron
00:25:41 – 00:25:42
Both. Yeah.
Dave
00:25:42 – 00:25:42
I I
Aaron
00:25:42 – 00:25:59
think I'm I'm happy where I'm at in terms of, like, objectively, I made a thing that people use, and that feels pretty cool. Yeah. So yes. And I have plans for Torchlight. So so that y'all all the listeners don't tell everyone.
Aaron
00:25:59 – 00:26:02
I want Torchlight to take over the world. That's the plan. And so
Dave
00:26:02 – 00:26:03
It's a modest plan.
Zuzanna
00:26:04 – 00:26:04
Yeah. Yeah.
Aaron
00:26:04 – 00:26:19
Yeah. So keep it keep it under your hat. So the the plan, you know, the time dilates before me. I think everything's gonna happen quickly and then anyway. So the plan has been move to this new infrastructure, which I would love to talk about because it's interesting.
Aaron
00:26:19 – 00:26:52
Then, launch this new website and then or maybe in opposite order, have the in browser JavaScript client. And so once all of those things are done, the the plan is to basically, you know, Hacker News, Reddit, Product Hunt maybe, to say free syntax highlighting that's better than what you have. I won't say it that way. But that's better than what you have, drop in this JavaScript snippet, and you're off to the races. If you want to do a deeper integration, it's an API, so you can do a deeper integration.
Aaron
00:26:52 – 00:27:13
So, like, all these static site generators, like, I wrote the one for Jigsaw, but that's just because I know Jigsaw and I use it and I like it. I don't know, like, I don't know Jekyll. I don't know I don't even know what the other ones are. But, yeah, the goal is to expand into the entire known universe and have Torchlight be out there. So, yeah, that that's my goal.
Aaron
00:27:13 – 00:27:26
We'll see how long it takes to get there. But I think in the next couple of months, I'll have it ready where it's free, it's available in the browser, and the infrastructure is, like, totally scalable and solid.
Dave
00:27:26 – 00:27:36
So you you just kinda teased a little bit this new infrastructure. You wanted to talk more about it. So let's let's just give you the nice softball question. Aaron, could you tell us more about this new infrastructure?
Aaron
00:27:37 – 00:27:45
Wow. Love love this podcast. I I love being set up like that. Yeah. So, historically, it has run on so it's all it's all Node.
Aaron
00:27:45 – 00:28:00
Right? So I'm a little I'm a little outside of my traditional area of expertise already. So I've run the whole thing on Vercel, and Vercel is great, serverless, scalable, whatever. Super nice. It's not that great, candidly.
Aaron
00:28:00 – 00:28:37
Again, don't tell anybody, but it it so it sits on top of LaMDA, which I know and love, and Lambda suffers from cold boots, which maybe we all know about. But when you, like, when you step up a level so, like, I I've used Lambda, and I can, like, pretty much control it however I want. When you step up a level, you lose some of that control. So Vercel gives you a lot of developer experience niceties, but I also lose a little bit of, like, what's actually going on here? And so I would hit these cases where people would have these requests, and they would just time out after 5 seconds.
Aaron
00:28:37 – 00:28:46
You know, Vercel will run longer, but I have the clients time out after 5 seconds. Seconds. So and people would DM me and be like, hey, man. Why is this timing out? And I'm like, oh, because Vercel sucks.
Aaron
00:28:46 – 00:28:54
And I would never say that, but that's what I was thinking. Right? I was like, oh, gosh. Let me, like, look into it. I'll see if I can make any tweaks that make that better.
Aaron
00:28:54 – 00:29:16
And I just couldn't. And it was really, like, it was really discouraging for a super long time. And so the new infrastructure is raw AWS Lambda. So I have I have all the rendering done on Lambdas, but Mhmm. What I didn't wanna do is enter this world of, like, now I'm this serverless AWS hero.
Aaron
00:29:16 – 00:29:20
Like, those people are geniuses, and I just don't wanna learn I don't wanna learn all of that.
Dave
00:29:20 – 00:29:21
Like, I
Aaron
00:29:21 – 00:30:03
don't have the time, and I don't have the energy, and I don't think that's how I want to architect my applications, to be frank. So what I did was fly. Io is this new kind of platform that gives you geographically distributed servers, like for real servers, not like serverless. You get an actual server you can SSH into. And so now the the architecture is such that I've got, I think, 7 or 8 fly servers all around the world, and that's gonna be really important when it comes to client side highlighting because you need you need the response times to be super fast, and the speed of light is still a thing.
Aaron
00:30:03 – 00:30:21
So having a server in Paris and a server in Sydney is gonna help, you know, people in Paris and Sydney. So in the front, like, the requests are received at the fly. Io layer, and that's actually just running a Laravel serve or Laravel application, which is awesome because we love Laravel and it's easy. Right?
Dave
00:30:21 – 00:30:22
Yeah.
Aaron
00:30:23 – 00:30:35
So it's running a Laravel app with Octane enabled, and that's important. I'll come back to that. So it has Laravel Octane running. Right? So these 7 or 8 servers are just hanging out all around the world, receiving requests.
Aaron
00:30:35 – 00:30:49
Fly is doing all the routing to find the geographically closest location. Totally rules. It's amazing. Then what that, Laravel server does is that so let's say that, like so laravel.com uses Torchlight. Right?
Aaron
00:30:49 – 00:30:56
One of their pages could easily have 250 code blocks on it because, you know, the the page is super long and
Dave
00:30:56 – 00:30:56
there are tons
Aaron
00:30:56 – 00:31:22
of examples. I can't send 250 blocks to a single renderer because, you know, even even at 10 milliseconds each, that's gonna end up taking a long time, and it takes a little longer than 10 milliseconds. So what I do is at the Laravel layer, I break that up into chunks of, say, 5 blocks each, and I dish those out to rendering lambdas using sidecar, a package that I wrote, right?
Zuzanna
00:31:22 – 00:31:24
So yeah. It's so meta.
Aaron
00:31:25 – 00:31:49
I know. It's wild. So at the Laravel layer that is hosted on Fly, it ends up with, say, I don't know, 50 requests that then are dished out to individual Lambdas to do all the rendering. Then those Lambdas render everything, and it comes back to Laravel where I stitch the whole response back together and send it back to the browser or to the client or whoever requested it. Right?
Aaron
00:31:50 – 00:32:14
And so this is super nice because regardless of how many blocks you send me at once, I'm not bound by whatever machine received it, which was the issue with Vercel. Right? I was bound to the single Lambda. Now it's totally able to be, sent out in parallel, and so regardless of how many you send me, it's fine. What I can do also is I can cache at the Laravel level.
Aaron
00:32:14 – 00:32:55
Right? So these machines, these fly machines are proper machines, and so I can do caching at that level which is important again for the client the in browser, client because I can, at that point, cache the responses such that they never have to reach the Lambda in the first place. Right? So if I've seen a particular code block with all of its options and configuration and everything, if I've seen that before, I can just return it without hitting Lambda, and we're talking, like, 35, 50 milliseconds, something like that. And so that that gives me a whole level of API side caching where historically it was only client side caching.
Aaron
00:32:55 – 00:33:07
And then if you'll indulge me, the final thing is Laravel Octane. Right? So I thought Octane was cool and Octane is the thing that keeps Laravel alive from request to request so it doesn't have to reboot.
Zuzanna
00:33:07 – 00:33:07
Mhmm.
Aaron
00:33:07 – 00:33:26
I thought it was cool. I didn't realize and and don't scoop me on this, listeners, because I wanna write an article about this. I didn't realize one of maybe the best things about Octane, and it has nothing really to do with Laravel, it's Guzzle. Right? So Guzzle, we all know and love.
Aaron
00:33:26 – 00:33:38
Everybody uses it. It's our HTTP whatever. So everyone uses Guzzle. Guzzle will keep connections alive as long as the Guzzle client stays alive. Right?
Zuzanna
00:33:38 – 00:33:38
Mhmm.
Aaron
00:33:38 – 00:33:59
So in typical Laravel world, the the request comes in, Laravel comes to life, the universe is built, the universe is destroyed. That's it. Game over, right? Yeah. In Octane, the universe sticks around for a while, which means if you do it correctly, Guzzle a Guzzle client can stick around for a while.
Aaron
00:33:59 – 00:34:43
And so in my case, it reuses these connections to the AWS data centers so that it doesn't have to reopen and renegotiate SSL every time. Right? So Guzzle stays alive, and then I can reuse those open connections so that my next requests to AWS Lambda don't have to negotiate any sort of connecting. They're already open and they just fire them back through the same one. And this is like default Guzzle that I had never ever heard about, but it saves a ton of time when you're talking about, let's say, 15, 20 milliseconds round trip if you don't have to renegotiate that TLS handshake or whatever it is that's above my paygrade, but it reuses it.
Aaron
00:34:43 – 00:35:03
And so that part of that part of Octane is really, really crazy to me and something that I never knew would be a benefit. But when I was looking at these request times, I was like, man, it's having to reopen these requests to the AWS data center all the time, and that's super painful. I wonder if that's work aroundable. And Guzzle was like, yeah. We support that by default.
Aaron
00:35:03 – 00:35:19
Just don't kill the client. It's like, wow. This is incredible. Wow. So that's kind of where I ended up, and that's I think I think the logical extent to as fast as I can make it, provided my same restrictions that I want to kind of keep Laravel in a stack and keep it easy on me personally.
Aaron
00:35:19 – 00:35:23
I'm sure I could make it faster, but I don't have enough knowledge to to do anything different.
Zuzanna
00:35:24 – 00:35:36
I mean, it's well, listening to it, it's amazing. Like, you are obviously passionate about Torchlight. But Yeah. What's the point during you building it or marketing it when you thought, oh, maybe it's not worth it? Whatever.
Aaron
00:35:37 – 00:35:57
Yeah. How long how long do you have? Yeah. I mean so I think I harbor this dream of being, like, you know, a sass boy where I just make a ton of money off off sass and just get to sit in my shed and do whatever I want all day. And, like, so when Torchlight came to me, I was like, yeah.
Aaron
00:35:57 – 00:36:26
I'm gonna, you know, I'm gonna get rich. And, you know, it's really hard to sell syntax highlighting, and and the dollar amounts we're talking about, like, or I think it's like, I don't know, $14 a month for a business. And it's just it just doesn't make any sense. And so there there have definitely been times where I've been working late at night, and, you know, the MRR is, like, in the beginning, it was, like, $32 a month. I'm like, what the heck am I doing?
Aaron
00:36:26 – 00:36:41
This this makes no sense at all. And I wouldn't have kept going if it wasn't fun. Right? So clear clearly, I care about it, and I'm not just in it for the money because otherwise I would have given up a long time ago. And so, yeah, there have been a ton of time.
Aaron
00:36:41 – 00:37:04
And the times where it's like I'm getting these DMs from these people that I respect and they're like, hey, this stuff isn't working. What's the deal? And it's like that just fills me with dread and I hate it so much. And so my my personal constitution is not, like, is not totally resilient to those kinds of things where some people would be like, I don't know. You know, I shipped it before I was ready and who cares?
Aaron
00:37:04 – 00:37:26
It's like, oh, man. That really stings for me personally. So a lot of those a lot of those have been like, what am I actually doing here? But I think because I find the problem so interesting, because I find the results so useful, and because I think there is a path forward. I've just I've just kept going.
Aaron
00:37:26 – 00:38:04
I mean, this new infrastructure makes me personally feel a lot more at ease. I feel like I'll be disappointing fewer people in the off chance that, like, Vercel, you know, takes 2 and a half seconds to wake up. So I feel a lot better personally about that. And then I think separating it from this dream of, like, you know, $10,000 MRR and making it free and just kind of like dissociating that altogether, I feel like that's gonna be a big win, because then then I'm less concerned about, like, okay. Well, I've spent 400 hours working on it, and I've made $8.
Aaron
00:38:04 – 00:38:19
Is that a good ROI? I don't think so. And then that that just kinda goes out the window, and it becomes a separate thing of, like, marketing for the Hammerstone Aaron universe, and I just I feel better about that.
Zuzanna
00:38:19 – 00:38:24
Yeah. Is there something you would have done differently looking back over the whole journey?
Aaron
00:38:25 – 00:38:33
It's a good good question. That requires introspection. I prefer the infrastructure talks. Let's see. Let's see.
Zuzanna
00:38:33 – 00:38:33
We do
Dave
00:38:33 – 00:38:35
both here on 20% time.
Aaron
00:38:35 – 00:38:50
Yeah. For real. Yeah. I think I think from the beginning, I think from the beginning, I would have maybe, god, that's hard to say. I was gonna say I would have maybe done this infrastructure differently from the beginning.
Aaron
00:38:50 – 00:39:12
However, Vercel was the most obvious path forward because of its ease of use and developer experience. So I don't know even with what I 2 separate answers. Knowing what I know now, I would have done infrastructure differently. If I had to do it all again with the same knowledge that I had back then, I would have done it the exact same way. So I don't know.
Zuzanna
00:39:12 – 00:39:15
That was very politically correct answer.
Dave
00:39:19 – 00:39:36
So you we you've talked a bit throughout, this episode about kinda like what's coming in the future. Right? You've talked about the redesign. You've talked about, you know, what's coming with infrastructure, price changes. Is there anything else kind of coming next for Torchlight that folks who are listening to this should, should pay attention to or be on the watch for?
Aaron
00:39:38 – 00:40:00
Yeah. I think I've covered everything that's coming. I guess my one, request would be when the time does come Yeah. That it's time to, like, start the hype train that we get people on the hype train. And so at some point at some point in the future in the near future, there will come a time where Torchlight has a brand new Titan implemented design.
Aaron
00:40:01 – 00:40:28
Torchlight has a JavaScript and browser client, and Torchlight is publicly free. Like I said, it's kinda already free, but Torchlight is advertised as being free. At that point, I'm going to be trying to, like, spread the good news of Torchlight. And should you feel so inclined, dear listener, I would appreciate the help. But I think that is, like, that is very transparently my road map, and I hope to execute on that in in the coming weeks months.
Zuzanna
00:40:28 – 00:40:41
Yeah. I think we're gonna do all we can because, I mean, I we all love Torchlight already. And with all the things that you've outlined, like the things that are coming, who wouldn't want to use it, really? Come on.
Aaron
00:40:41 – 00:40:43
No. Thanks. That means a lot. I appreciate that.
Dave
00:40:43 – 00:40:53
So that's actually all the questions that we had. Is there before we go, is there anything that you wish we would have asked you about Torchlight that we didn't get a chance to cover?
Aaron
00:40:53 – 00:40:55
You mentioned the name. I'm I'm Oh, yeah.
Zuzanna
00:40:55 – 00:40:57
How do you think so? How do you Yeah. Tell us.
Aaron
00:40:58 – 00:41:00
Particularly pleased about the name.
Zuzanna
00:41:01 – 00:41:03
I I don't know. I shouldn't have brought this up because
Aaron
00:41:03 – 00:41:18
I don't really know. I just I just it just came to me. I just love it so much. No. So I was thinking, like, how do I get how do I kinda get highlight worked in there, because I I'm, you know, not exceedingly clever, and I kinda wanted to, like, be on the nose about it.
Aaron
00:41:18 – 00:41:41
And so I just started looking up different words that had light included in it. And I came across torchlight, and the dot dev was available. And I thought of all the cool, like, logos that could be made out of it, and I just it just it just tickled me so much that I had to do it. And so I was super pleased with it, and I have like, if I had to do anything over again, what would I change? Not the name.
Aaron
00:41:41 – 00:41:44
The name totally rules. I love it.
Zuzanna
00:41:44 – 00:41:46
I think it's really clever, and I like it.
Aaron
00:41:46 – 00:41:47
Thanks.
Zuzanna
00:41:47 – 00:41:48
Very good.
Dave
00:41:48 – 00:41:53
Alright. Aaron, where can folks, find you online? Where should they go?
Aaron
00:41:54 – 00:41:56
Yeah. So what we've been talking about is torchlight@torchlight.dev.
Dave
00:41:58 – 00:41:58
Yep.
Aaron
00:41:58 – 00:42:12
You can find a bunch of other packages at hammerstonedot dev, including sidecar refine, all of that stuff. And then you can find me personally on Twitter at Aaron d Francis, d as in Daniel. So I'm there all the time. Come, hang out.
Dave
00:42:12 – 00:42:20
Woah. Aaron, thank you so much. This has been a lot of fun. I learned way more about Torchlight than I than I expected. I think I understood most of the infrastructure talk.
Dave
00:42:20 – 00:42:27
I'm I'm not a dev. I just pretend to know what I'm talking about sometimes. So thank you so much. And, yeah, this has been fun.
Zuzanna
00:42:27 – 00:42:28
It's been amazing.
Aaron
00:42:28 – 00:42:29
Thanks for having me.
Zuzanna
00:42:29 – 00:42:30
Thank you, Aaron.
Aaron
00:42:30 – 00:42:31
Thanks.
Me

Thanks for reading! My name is Aaron and I write, make videos , and generally try really hard .

If you ever have any questions or want to chat, I'm always on Twitter.

You can find me on YouTube on my personal channel or the Try Hard Studios channel.

If you love podcasts, I got you covered. You can listen to me on Mostly Technical .