Building Desktop Applications using Native PHP with Simon Hamp

Eric L. Barnes (00:00)
Welcome back to the Laravel Creator Series. Today I'm joined by Simon Hamp, who is the creator of Lara Dir and Native PHP. And for this episode, we want to talk to Simon about Native PHP, what it is, why it's important, and just sort of learn more about the project. So Simon, did I do that introduction right? Did I miss anything important there? Ha ha ha. Love it, love it.

Simon (00:24)
That was beautiful. Thank you very much.

Eric L. Barnes (00:29)
So just to jump right in, tell me why someone would need native PHP. Why do they need to use

Simon (00:36)
Wow, that's me. I'm going to be really mad now. I'm going to say I don't think anyone needs native PHP. But I'd like to think that a lot of people would use it because they don't necessarily want to go and learn some other technology. So if you think about how you go about building native applications right now.

Eric L. Barnes (00:40)
Ha

Simon (01:00)
It's a wide array of technologies that you would need to use if you wanted to support every platform. And a few years ago, a tool called Electron came out, which enabled people to kind of just create a web application and distribute that to all the different platforms.

And that's kind of enough. Like if you know HTML, CSS, JavaScript, you can build really rich applications just with that on its own. But you know, there's this thing that tickles me, which I love using PHP for things. Even more, I probably love using Laravel to build things. And it dawned on me that it would be great as a paradigm to build a desktop application using PHP and to be able to distribute

without the person requiring PHP on their machine and I kind of just went down that path to see like is this even possible and obviously I bumped into stuff that other people giants in the community have done stuff before me particularly Marcel who Marcel Poetziart

done loads of work around trying to make distributable applications with PHP. So yeah, was just like a let's see what's possible and I think quite a few people like the idea of using PHP to build native applications.

Eric L. Barnes (02:24)
I love it. so for those maybe like me that are not from that background at all, like I've never built a native app, the word native, like I know you mentioned desktop. Does that also mean native meaning like it could be an iOS app and or a mobile app, or is it basically strictly for more like desktop traditional

Simon (02:49)
Right now, it will only really work for a desktop application. That's more of a limitation of what Electron is capable of, because Electron is what we're using to kind of ship the main UI of the app. But in principle...

and I hope in the near future in practice we'll be able to run PHP on mobile devices as well. In theory there's nothing really stopping that. A few people have put some demos together in the past and proven that you can run, you know, like a build of PHP on an iPhone for example. Especially now that Apple have kind of unified their CPUs across their entire set of hardware.

that a lot easier because you build something for a modern -day Mac it's basically going to work on an iPhone but there are a few other challenges to get past before something can actually work on on a phone I think those are more philosophical and political ones than technical ones but yeah that's where we're at

Eric L. Barnes (04:00)
I gotcha. That's awesome. and then kind of to piggyback on that, you know, I, again, coming from somebody that's never built a native app. So as, sort of knowing a little bit about electron, like a prerequisite to jumping into native PHP, or is that just sort of, we don't need to know anything about that and we can just write the code like we normally would just follow the read me things like

Simon (04:28)
Yeah, I would say the goal of native PHP is to make it so you don't have to know about Electron at all. I mean, when I kind of started putting some prototypes together, I was actually using another tool called Tauri, which is kind of a competitor to Electron. It does things in a slightly different way. And in the eyes of many people, Tauri is a better solution. And the idea is that...

you know, native PHP, you could use either of those. You could use whichever one makes the most sense. And so from that perspective...

the less you need to know about each one of those particular tools, the better. And that's kind of where we're aiming for is like, you don't really think about the environment that the application is running in. You just think I'm writing, you know, a lot of our application and I'm thinking about it as if it was like a client server application. But I just know that in the end, I'm going to ship this to one machine and it's going to just run on that person's device. And yeah, hopefully.

then you basically don't have to learn electron or tau re or anything else.

Eric L. Barnes (05:40)
Gotcha. That's pretty sweet. you know, just from like coming from a, like a Laravel developer, it's pretty much standard, right? It's sort of a standard Laravel app just with special stuff that you kind of take care of. Am I thinking about that in the right terms

Simon (05:58)
Yeah, I mean, there's obviously steps that you have to take. I if you're to use electron or you're going to use Tauri, there's going to be different things that need to be done to kind of make things work with that environment.

But we're sort of smoothing over the cracks and trying to make all of that just really, really easy. And you know, you just type a few basic commands into the command line and it's doing the work for you. So yeah, the goal there again is just keep making that developer experience really, really smooth and obvious, hopefully, and just very, very convenient. So you could even get to a point where you're switching like the tools that you're using and you're not even noticing.

but you're benefiting from whatever you want to benefit from that other tool that you want to use. So yeah, that's kind of where I'd like it to get to. Obviously there's a bit of a way to go.

Eric L. Barnes (06:51)
Yeah, yeah, speaking of that, mean, I think the documentation says it's still in alpha or did we just release the first beta? I know it's pretty early, right? Yeah. Do you have any kind of ETA or anything like that when you think it's going to be, I guess, fully stable maybe?

Simon (06:59)
Yeah, it's still in alpha technically at the moment.

Yeah, I would say right now it's

quite stable for a while. Like there's not been any major new issues. A lot of the previous issues that we've had since, you know, Marcel announced it last year at Laracon US and obviously loads of people got really excited about it. We got loads of issues and for a long time I was just kind of sat on this pile of issues and not knowing what to do for the best because there was just so much stuff. But earlier this year I managed to work through a lot of those because they were

around like this doesn't work on Windows well now it works on Windows so kind of managed to get through a lot of that and as I say there's not been much more much more issues to like fight through so it's quite stable but I think there are still

areas that are needed to make it really like production ready and I'd kind of got in the back of my mind that a beta would come when I'm confident that we can get code

shipped in like production builds. So there's a process in Electron, for example, where you publish the app and it kind of does a non -debug build and you can then distribute it to the different devices that you want to distribute your app to. And that we would basically have run through that process at least once and had like the apps signed so that people don't get warnings when they try and open it or that, you know, they can actually open

run the application. So that's like the yardstick at the moment for like if I can get past that then I think I'm happy to just flip the switch and say yeah this is beta now you know.

Eric L. Barnes (09:02)
Gotcha. Yeah, that's awesome. And one of the, yeah, I mean, you talked about like when it was first launched. Yeah, it was, it sort of took the PHP world by storm because like it seemed like everybody was talking about it. It was like one of the biggest probably launches, I guess that was last year. And the original launch, were Mac only, but recently, like in the last what month or two, you've added Windows support. So now you support both platforms.

Simon (09:19)
Yeah.

Yeah.

Yeah.

I can't remember exactly when it was, but yeah, I mean, I've been looking at working on the Windows build for a while and it's just the, you know, the underlying technology that we're using, it is just PHP, but the way that PHP has been packaged up, nobody's really tackled doing this on Windows before. Like most of the PHP world probably use Linux or Mac, you know, whether it's development, but certainly in production.

predominantly Linux. So Windows has just kind of been left behind as this like gammy

thing that's hanging off the edge of the PHP community. I don't mean to offend anybody with that, it's just a bit of an afterthought. And yeah, it's taken a while, but it is there. And I think it's quite stable as well. I mean, I don't use Windows day to day, so I don't really know. But that's another thing. It's just like having people building apps and getting it out there and trying it on all the different platforms and that level of confidence in it as a tool to be able to produce

platform apps is just going to increase. So hopefully, yeah, everyone's still excited about it.

Eric L. Barnes (10:45)
For sure. I think so. Like even the windows announcement seemed like it was a, it seemed like that was pretty popular. at least, you know, on the, liberal news site, you know, when we covered the news item, it seemed like it got a lot of visits and a lot of traction. that's, it seems like people are still very excited about it. which leads me to like, is, is anything actually out? you know, that maybe somebody could go and look at, be like, Hey, this is built on native PHP or because it's still in more of alpha stage. they're

Simon (10:58)
Yeah.

Yeah.

Eric L. Barnes (11:14)
They're not really out there, but people are kind of working on

Simon (11:17)
I know of lot of projects that are on the go and I know of quite a few projects that I would guess at this stage they're kind of on pause. They're just kind of waiting for us to say, yeah, this is ready. You like you can build production apps with this now. I would really like for somebody, anybody, multiple people to really push the boundaries there and just try and build a production ready application, get it out there and kind of...

find the problems and like report those issues, know, and then I can start kind of fixing that stuff and getting it even more ready. So there's none that I can like really point to as a specific example at this stage. I've worked on a couple of projects, so there's...

One, it's just a very simple tool that people can check out. It's fully open source and it's on GitHub. It's called Chronicle. It was meant as a demo app of what can be done using things like the scheduler and notifications and what have you.

Eric L. Barnes (12:25)
Awesome. Yeah, I was gonna say we'll definitely put that in the show notes too. So that way people can check it out, you know, right from, right from here. go ahead.

Simon (12:32)
And I've been trying to collect more projects. there's awesome native PHP repository, which we created to kind of give people an opportunity to go and add their own to the list. And there's quite a few like open source projects that have been listed on there, which is cool. But again, as I say, there's not any that I would go, this is a really cool, production ready distributed app that people like.

going out really hard, like pushing it out there. So yeah, we'll just have to wait a little bit longer for that.

Eric L. Barnes (13:09)
you I know it's on GitHub and it's open source. I assume you're looking for people to come in and help and submit pull requests, issues, things like that. Are you at the point where you're trying to get a lot more community involvement into

Simon (13:17)
Yeah.

Yeah, I mean, there was a lot of community involvement right at the very beginning when there was a lot of interest around the initial announcement and a bit of follow -up when the Windows announcement came through. I think because we've kept it in that like alpha phase, my guess is that that's kind of kept people away a little bit

Yeah, I mean, I would definitely encourage folks to get involved. There's a load of people on a Discord channel that we've got. So there's about 800 of us now on there with quite a few that kind of come on regularly and share.

tidbits and questions and helping others out with answers. There's quite a lot of stuff going on on GitHub normally. So yeah, wherever you feel like most comfortable getting involved with is just discussing stuff or raising issues or helping answering questions.

Definitely with code as well. This is quite a niche area and it's complicated because of all the different parts. But if you feel up to the challenge and you want to dive in, I'm happy to jump on calls with people and give you a rundown of what I'm thinking and how you can get set up so that you can develop and that kind of thing. I'm not just leaving it to...

contributors file, know, and there you go, try your best. You know, I'll definitely lend a hand. If it helps people get up to a point where they can help me with it, then yeah, let's go.

Eric L. Barnes (14:58)
Ha!

love it. Yeah, that's sort of in the early startup stuff, getting people out there, getting them involved. So how are you finding, this is kind of off topic from Native PHP itself, but how are you finding discourse for running the community behind

Simon (15:24)
Do you mean Discord? chat? Yeah. I don't like Discord. I'm not a fan of using it in this context. It's very much like a

Eric L. Barnes (15:25)
Yeah, Discord, sorry, yeah.

I don't even need be honest with you.

Simon (15:44)
community and it very you know feels like that. There's a lot of bits of the UI that just don't make sense for what what we're trying to use it for. I think it's fine because it's free and a lot of people have got it installed you know people will go yeah Discord I can join that in a couple of seconds I've already got an account blah blah blah but yeah I'm not I'm not a particularly big fan of using that for this kind of thing.

Eric L. Barnes (16:12)
Yeah, I might be showing my age, but I really do miss just old fashioned forums. You know, it's like you could search them, you could find stuff. It's just easy. But that's funny. But well, anything else, you you want to tell us about native PHP that, know, that maybe you're excited about or anything that, you know, I didn't ask about that you find, you think super important.

Simon (16:17)
Yeah. Yeah.

I mean, it's hard to say because there are so many things that I'm excited about. The first question that you asked about whether people should use it, you know, why should somebody use it to build native applications? I think in a couple of years from now, this will be a really accepted approach to building like a good production level, you know, really robust.

I'll say native application across desktop and mobile. And there's just so much stuff that will come along the way that's going to be

interesting for like the whole space of like people trying to do distributable PHP applications, whichever way you want to do that. A lot of that's already happening. So as I say, some of it's to come, like even if you don't want to use Electron or Tary or whatever else, and you don't want to ship an app full of PHP code onto people's devices.

there's just going to be so many cool things that come out of this that are going to be beneficial for like if you're building a hosting service or if you want to securely distribute some PHP app so that, you know, customers of yours can self host it safely and performative, you know, without too much headache on your part or having to create and manage Docker containers and all of that kind of stuff. You know, it's just like the, the potential from some

this tech is like quite wide, it's got quite wide appeal.

Eric L. Barnes (18:21)
Yeah. The, in a past lifetime, I was, I worked at a motorcycle dealership, you know, selling motorcycles. And one of the apps that we spent a ton of money on was, this, this app that was in the store and would let you like browse the different motorcycles. And this was back in early 2000s when it was not like on the web yet. And I just, I just keep coming back to things like that, or even like,

Simon (18:29)
Cool.

Yeah.

Yeah.

Eric L. Barnes (18:48)
You know, like even the little toolbars that sort of became really popular now in the tech space, you know, where you can like, hook in with like the four JPI or, you know, things like that and see what all servers you have running or see if something like that. I just think, like you said, the use cases of this is, is, is huge. so many different possibilities.

Simon (19:09)
Yeah, taking it to a very specific example, I do kind of have this vision in my mind of being able to build using a single code base, which is always that dream that has never been fully realised, an application that works just in the browser on the web, like traditional client to server paradigm.

But then, you you just install a package and run a command and then all of a sudden you get Windows, Linux, Mac, iPhone, Android builds and you just, you know, install it and it just works like many people would say, yeah, we have that with the web and it's kind of true. We do. But if that has limitations, you know, the technology is still kind of very nascent, but

distributing native applications is still like a widely respected way to do a really rich experience on each user platform and device. And I think the web has got such phenomenal technology already available to it. If we can just like cross that divide of it's not just a PWA, but it's also not a full blown native application.

with this, you know, I think native PHP kind of does sit right in the middle there. You could see it being that, yeah, maybe I'm getting too, like, hopeful, but I think that's where it could end

Eric L. Barnes (20:47)
Yeah, I think so too. just, I mean, if you look, you know, sort of the history of tech on even the last five years, I don't think like just how fast things progress. mean, I don't think five years ago we, nobody even thought about like chat GPT or open AI or anything. And then boom, now it's just everywhere. So I feel like as things, you know, keep progressing, all this, all this should get easier and easier. And at least that's my pipe dream.

Simon (21:14)
Yeah, it would be nice if it keeps getting easier.

Eric L. Barnes (21:17)
Yeah. Yes. What you could, so now your other project Lara Dir Do I say, do I pronounce that the way you pronounce

Simon (21:24)
Yeah, that is the way that I pronounce it. I've heard people say it lots of other ways as well, so that's fine.

Eric L. Barnes (21:30)
Yeah, so it's, it's, and it's of a directory of Laravel developers that, are looking for jobs or just wanting to be listed and have profiles.

Simon (21:41)
Yeah, I mean, I would say the majority that have created a profile probably are looking for jobs. But, you know, the place, the point of having the place there is just to say, like, there are loads of us.

One of the things that I faced up against a few years ago in my previous kind of full -time employment role was, know, are there even enough Laravel developers out there for us to justify using this technology? And I was like there with my boss, like, yes, look, I'll show you them. They're all on Twitter. You know, he's like, who are these people on Twitter? They're not real people. And it's like, yeah, but I know that they are. I need to prove to you that. And I just think,

And.

I want to help the Laravel community at large by showing that there are thousands and thousands of us. We know that there are, but sometimes they're just like numbers, newsletter subscribers, Twitter followers, video watchers. But there's thousands of really, really interesting people in this community and they've all got really interesting histories and backgrounds, like why they're in Laravel now, why they enjoy that so much.

And yeah, I mean, it's maybe not quite that yet, but I think that Larida could be a platform to give every one of those individuals a voice, you know.

Eric L. Barnes (23:08)
Yeah, I like that. You need to, this is totally off the wall. You need a way to integrate it with in -person events. So when we're at Lyricon and we meet everybody, we have a way of being like, yeah, I met that person. And then here's all their data, or not data, but here's all their social media and here's all their, you know, their picture and all that. Here's their name. But yeah, cause that was always what I was dreaming about was like some sort of personal CRM where I could just keep up with people I meet at conferences.

Simon (23:21)
Yeah. Yeah. Yeah.

Yeah, that's a yeah

Eric L. Barnes (23:38)
It's like, you know, because you get there, there's like 500 people and it's like, yeah, I can't remember half these people.

Simon (23:43)
Yeah, I mean, I'm trying the challenge with stuff like that is it's great when it's for the community and for people in the community, but it's hard to get those individuals to.

to part with cash, you know, like I want to make a business out of this and I don't mind saying that out loud because you know, I think that's legitimately a fair thing to be able to do but in order to do that, you know, I'm trying to find, I'm trying lots of different things to find ways to make that into something that, you know, earns its keep and can keep on going. Like the main thing is to just keep it going. I don't want it even to be like my main source of income or like

It just needs to cover its costs and keep being useful to people. So yeah, at the moment I'm kind of toying with the idea of like, do I just make all of the profiles publicly? Like right now they're sort of hidden. You have to log in and you have to unlock profiles. yeah, maybe something like that would...

Eric L. Barnes (24:51)
You could build a native PHP app and then the people that are looking to hire could pay you to go in and search for people.

Simon (24:54)
You

Yeah, yeah. But I do like the idea of using it for events. I've heard of people already saying, here's my Larida profile page, and just giving out their links, which is kind of obscure because I use a UUID in the URL and stuff like that to make it a little bit tricky to find people, which is sort of weird.

I think I'll be open to respecting what the community wants and not trying to force what I want out of it.

Eric L. Barnes (25:34)
Yes, for sure. two, mean, that's the good thing about doing stuff like this, you know, just speaking about stuff off the cuff, you know, if anybody has any ideas, I'm sure Simon's welcome to hear him shoot him his way.

Simon (25:45)
Absolutely, I mean the more the merrier like at the moment it feels like trying to get blood out of a stone sometimes getting ideas and feedback from people but yeah.

Eric L. Barnes (25:57)
Yes, I'm actually the same on the Laravel news side. I used to ask for feedback all the time, would never get anything. And then I just stopped asking. then every once in a while, somebody will be like, this is what you should do. And then I'll be like, that's a pretty good idea. I'll try to do that. And then I'll put it on the back burner because I got like 50 ,000 other things to do. you know, it is. But that's great.

Simon (26:08)
Yeah.

Yeah, yeah.

Yeah, exactly. I know it's impossible. We should talk more about that, like sharing those problems. It's not even the technical challenges, but just like

How do you think about building a product that's varied and complicated and has a sizeable audience and managing all of that when you're also running a business? I know that's what you're doing and you haven't got a huge team of people working with you or for you. it's like, yeah, you just need that little bit of support. So it's like, come on, Eric, you've got this. You can do it. This is what you've got to focus on.

Eric L. Barnes (26:55)
Exactly, yes. When you are running a business, it's like, when you go full time in your business, you're like, I'm going to have all this time to do all the stuff I want. then it's like, instantly, you're way in the weeds on all the business stuff and not doing anything that you love to do in the first place. And I think that's like the most businesses when they first start out are running that same scenario. But it is hard. It's fun, though, as long as you enjoy the business side.

Simon (27:04)
Yeah.

Yeah, You're full -time on Laravel News now, aren't you?

Eric L. Barnes (27:24)
Yes. Started, guess it's been almost a year now. So it's, yeah. So we've been doing it and, I got Paul still writing and then, Jacob and Michael Durenda doing the podcast. So, and then I do all the business side and sales and all the other fun stuff that probably nobody really likes to do. Yes. I do enjoy it, which is probably why it's good that

Simon (27:30)
Congrats.

Yeah.

Yeah. I love the way you said fun stuff. Like with that.

Eric L. Barnes (27:53)
doing this in this situation. But yeah, so I'm super excited. Going back to Native PHP, I think there's definitely something there in the future. It'd be super great for, I know you mentioned Marcel earlier, if you could build your own herd or anything like that in the future. You'd be like, I have this great idea for this thing. then you just, since you're already a Laravel developer, you just like, boom, I can.

develop it and deploy it in a week and be good to go.

Simon (28:25)
Yeah, I mean, I do, I think if, we can get the, the mobile side cracked, which I honestly don't believe we're that far away from, but if, if we could do that, I think that would be the killer. I think that's what would get everybody excited because everybody knows everyone is on their phones, like all of the time. I don't have the stats, but it's just like,

you you look at your web traffic and you know that the majority of people are coming from their phone. And that's holding true for almost every single website, you know, that's out there. So you just know that if you can get something that's like more permanently on people's devices, it's front of them, it's like notifying them, all of that stuff. If that's what you're trying to do, you know, is get your product to your platform or whatever in front of people all the time, wherever they are, then

It's got to be on mobile. And I think once we can get that sorted, native PHP will just like explode. But maybe my head will explode as well before then.

Eric L. Barnes (29:31)
Well, you never know. mean, if it explodes, you'll have a whole lot more people helping out and keeping things in order, hopefully. this is great. Anything else you want to add that maybe we missed during this conversation or anything?

Simon (29:37)
Hopefully.

I mean, I would say, I want to say a huge thank you to Marcel because he reached out and sort of showed not just interest in what I was kind of playing around with whenever it was the end of 2022. He offered to get involved, you know, and he did a huge amount of work leading up to Laracon to get Native PHP into the shape that it's in, you know, was kind of very...

What's the right word?

I can't think of the word, my brain's going flat. But he was just very helpful in getting a lot of the thinking done and then, you know, strategically, but then also like hands on with getting a lot of the electron stuff. I've never used electron before. So I can't like say thank you to him enough for just kind of.

running with that baton for that time and you know, it's really, it's made it exciting for me and for a lot of other people. And then obviously he did the talk on Laracon US about it. I think he was originally going to talk about AI and you know, cause that was like all hot topic last year at the time. And then he messaged me and he said, I'm talking to Taylor about potentially changing my talk topic to native PHP. And I was just like,

It was crazy. So thank you Marcel, you've been a really good support.

Eric L. Barnes (31:24)
That's awesome. Yeah. Marcel's great. Marcel, Sebastian, that whole crew over there. Yeah. And like you said, it really shines on how welcoming the community is to like, you know, try to push each other and help each other when we can, you know, time permitting and everything like that. And as long as two people have passion about something, they're very likely to work together and it's pretty amazing.

Simon (31:44)
Yeah.

Eric L. Barnes (31:50)
It just shows you kind of the community we have that's awesome like

Simon (31:50)
Yeah.

Yeah, I think you have to be open to it as well.

You know, I like working on my own things and I like the kind of idea of owning the whole thing. But, you know, there's some of that stuff where someone's going to come along and go, hey, I've got this idea or have you thought about doing this? And unless you can kind of just jump on it and run with it in that way, it may never become what it would otherwise become when you're just doing it on your own. yeah, give it a shot. You know, don't don't turn people away just because you

say want like the pride of being the only person to have come up with this thing.

Eric L. Barnes (32:35)
Yes, for sure. I totally agree with that. Well, I think we'll go ahead and end it here, but man, Simon, was so great to meet you. And as we were talking before, you're going to be at LaraCon in Texas. So, you know, if you're going, be sure to say hello to Simon, say hello to me and everybody else. You know, look forward to seeing how this native PHP plays out and just seeing all the cool things you do in the future.

Simon (32:47)
Mm -hmm. Yep.

Eric L. Barnes (33:05)
got a lot of cool projects already built.

Simon (33:07)
Thanks. Yeah. I'm looking forward to seeing you in person, Eric. That'd be great.

Eric L. Barnes (33:13)
Sounds awesome. Thank

Creators and Guests

Building Desktop Applications using Native PHP with Simon Hamp
Broadcast by