How'd you like to listen to dot net rocks with no ads? Easy? Become a patron For just five dollars a month you get access to a private RSS feed where all the shows have no ads. Twenty dollars a month will get you that and a special dot net Rocks patron mug. Sign up now at Patreon dot dot net rocks dot com. Hey Carlin, Richard here. As you may have heard, NDC is back offering their incredible in person conferences around the world, and we'd like to tell you about them. NDC Copenhagen
is happening August twenty seventh through the thirty first. The early bird discount for NDC Copenhagen ends June second. Go to NDC Copenhagen dot com for more information. NDC Porto is happening October sixteenth through the twentieth. The early bird discount for ADC Porto ends July twenty first. Go to Dcporto dot com to register and check out the full lineup of conferences at NDC Conferences dot com. Oops, I did it again. It's dot and Rocks. This is Carl Franklin,
and this is Richard Campbell, and again we're year Britney Spears. Is that what you're doing now? You know, I'm so out of jokes it's not even funny. Please send your jokes somebody, please. Um. So we are continuing our pile up of recordings before the conference season starts. I think this is the last one. I think this is the last one. Yeah. Next time we record will be at Techo Rama and Antwerp. Yeah. Wow, that's right. Yeah, yeah, I'm looking boy man.
We really crushed it in the last week. We had some fun. Uh, it's been a while since we've gone. You know, this once a week thing is so easy for us. Yeah, ridiculous from going from the back in the times we did three times a week. Ye. But yeah, we sort of did that three times a week feeling schedule to get a few weeks ahead so we can go to conferences and be confident that we'll publish every week no matter what. Right, exactly. No, you won't see
any reruns here on dot net rocks. We don't do that. That's not what we do. No, there's always stuff to talk about, including better no framework. So let's roll the crazy music, all right, man? What do you got? What? God mo, hippo? Than what you got all right. So this is an article that came out on the twelfth of April on The Verge. You've been reading The Verge lately. I notice it's got some good stuff. You know, they report about stuff that you
don't hear anywhere else. That might mean it's bullcrap, but who knows. So this story is Microsoft is changing the print screen key to open its own snipping tool on Windows eleven. I think I like this, You do, yeah, and I'll tell you why because right now, when you hit print screen, you don't even know if you hit print screen. It's true, right, Like on many keyboards, the print screen button is bared behind like a function key or something else, right, so it's like, did it
hit the prince screen or not? You got to go check fire up, paint and check board. Yeah, as we all do. So the fact that now you'll know you hit it because immediately the snipping tool appears. I kind of like this, Well, there are other tools that do that, right, So if you have the what's the one from Camp Tajia tech smith, Right, there's a grabber or something like that that's everybody's been using for
years, for years and years. So people have these tools that I like you, Richard, I got used to you know, opening paint, copying, cropping, all that stuff, and it's just my workflow. So right, you know, I'll give it a try. Well, it sounds like you can adjust the setting, so if you want to use something else, right, knock yourself out. Okay, you could just set it up so
it goes to paint automatically, just opens paint. That's pretty cool. So it is the first time in decades that the print screen button functionality has changed and knows. So it's a momentous occasion, and I will give it a shot, you know, because change is fine. As long as I have a good workflow and I get used to it, that's great. No, no, change is good. You go first, You go first, all
right? Man, who's talking to us today? Grabbed a comment off a show eighteen thirty eight, not that long ago, back in March of twenty twenty three, when we talked to one Javier Nelson and Steve Sanderson. We're talking about Blazer United, because you know, it's the all WASM show these days, isn't it. We're not talking AI, We're talking WASM. By the way, a preview just came out that has some of the Blazer United stuff in it, just a couple of days ago. Yeah, as usual.
Those guys are crazy smart and that's awesome cool stuff. So Bear, and that's the name Bear. Bear says, I love the work to Microsoft does on Blazer, and I truly believe that web assembly or something similar. I don't think there's anything similar will be the future. Well, I mean client development, for sure, there are other future there's a future involving mars. I don't think it needs webisely, it might, right, I hope
it does. Actually, let's talk to Elon. I would really like to hear a show about why Microsoft chooses technology like React in their products instead of Blazer. And his example that hecites is the new version of Teams, So Teams two point zero. They moved off of Electron and they're now using React, and Bear says, what are the reasoning behind such choices? Yeah, I'd love to hear your thoughts, Carl. Yeah, Well, my thought is they like to choose stuff that's done and used and established, and not
that Blazer isn't done. But it's still, as you say, I'm moving target because of what's happening with Blazer United. They're still innovating, do you know what I mean? Yeah? No, I think I think you're you're right, yeah, yeah. More importantly, it's like you're only hearing about the move to react now when they're finished. How long have they been working on it? Two years? So what was Blazer like two years ago?
Right? And like getting to the other reality that we know very well, which is Microsoft is not one big company, right, it's many different groups, and the team's group gets to make their own choices, right, and they support open source, even open source made by Facebook. So yeah, I mean I think that choice was made a long time ago when there weren't
alternative. It's a good choice and they made a good choice. And it doesn't mean that they don't change the stack for teams three point zero because because what's the alternative, Like they come out with something that uses what Blazer not even Blazer six, Right, it would have been earlier than that. Yeah.
The love affair you have with Blazer right now is recent. Yeah, Yeah, we saw the potential long ago, but when you actually need to rebuild a product that's used by literally hundreds of millions of people, you have to have some pretty good confidence that that framework is going to do everything you needed to do. It isn't going to change and disrupt everything. I think that's the more important thing, right, I would react totally fair, So
Bart, I hope that addresses your question. I don't know if there's a show in there or not, but I'm not saying I wouldn't do it either, although I might actually do it. Over on run as Radio, we're talk a fair bit more about teams in the M three sixty five context. Bart did end is his message with dot net rocks rocks and we think so
too. Yeah, we do. And a copy of ustic Code Buy is on its way to un If you'd like a copy of music Code by right a comment on the website at dot net rocks dot com or on Facebook. We publish every show there as well, and if I read your comment, we'll send you copy of music Code Buy. And you know, you can follow us on Twitter if you like. That's great. But the real cool
people are over on mastadon, so follow us there. I'm at Carl Franklin at tech hub dot social, and I'm Rich Campbell at mastadon dot social. Send us a two ruty two two and let's bring on an old friend of dot net X. We haven't talked to Jacob Wow since what twenty sixteen? I think, Yeah, So this is going to be all about peach pie on web assembly, and Jacob Mischik is a veteran dot net developer. He's
going to tell you all about it. He's a co founder of io level, where he's working on the peach pie compiler platform, co founder of dev sense, where he's providing advanced PHP development tools for visual Studio and vs code. He's a sports enthusiast and PhD candidate in software engineering in the Charles University in Prague. Welcome back, Hider, Hey, great, great to be
back. I was asking Jacob how how I pronounced his name and he gave me this pronunciation and I said, well, what does your mother call you? And he says son? So I almost did it. I love his son is a veteran dot neet developer. No never, Okay, remind us what peach pie is, all right. So peach pie is a compiler of PHP language into the dot neet assembly. So it's actually the same compiler as a C sharp compiler. It translates the language into into this managed bytecode MSIL
but it's not just a compiler. It's also the whole supporting Grundtime library and all the PHP extensions reimplemented into the c sharp language. So it's really the complete PHP language platform, including support for visuals to do image studio code for dot Net. So it's completely managed. It is surprising to you as it is to me, that there isn't PHP support in Visual Studio and in dot Net just in the box. Actually there is like small support and visuals to
do like like text or syntax, highlighting, syntax, colorization. Actually I have a second product which fully integrates the native PHP Intevidual Studio because it's it's not there yet, okay, And there's real a lot of people working in Visual Studio and they just need to work with PHP as well. So right, yeah, so that's it, and we want something a little bit better than just a text editor. We want we want to compile right to dot Net. We have to live in the studio, right, we have all
our tools at a disposal. Yeah, wow, that's very cool. So the story now is web assembly support. Yeah? Right? Uh so, so we did it like a year ago and then just we didn't to care about it. But once you once you once I say your email, I
was surprised, as you'll remember. Actually it's pretty cool because having a compiler of some language into dot net is giving you great opportunities because once you have a language compile to dot net, you can do anything without actually doing anything, because everything is just managed by Microsoft and all the great people working on the project. So right, once you get to I L you're you're smooth sailing. Yeah, but you have debugging, you have like performance profiling,
and you have webossimbly as well. So we just we just actually tried it. We compiled PHP into msile and we run it on webostibli, which is actually like monoun time, right, it's actually mondoun time hooked into your browser like interpreting your msile code, and it magically works with compiled PHP as well.
It didn't even notice it's it's not C sharp, right. So one big use case that comes to mind is you have a Blazer application and then there's some you know, maybe some I don't know, scientific or financial or other kind of academic routines in PHP that you want to include, and rather try to convert the source code from PHP two C sharp and get it running that way, you can just turn it into an assembly and it's work. You can create its own an assembly class library with it and just add it
to your right project. Right, you can. You can have it all in the same directory, your PHP everything. It can have few project files, one project file for HR, one project file for PHP. It gets linked together, and you can even like communicate between HP, Php, JavaScript, everything together. Everything gets like native marshaled into into dot net, so so nobody knows what's the other language. Actually, you can now call JavaScript
right from PHB and vice versa, and really everything together. We can even have a component in your Blazer website, in your Blazer page which is in PHB and the rest of the page is in C sharp. So okay, So so you've got a page or a component and you might have inline uh you know, mark up control statements at if and all that stuff which is C sharp or before each or whatever. But then you call in a co behind file, right, your co behind file can be in PHP rather than
c sharp, right, you can. You can have either cod behind file in PHP or like PHP. Developers are web designers as well. They like half of the half of the projects, half the PhD projects are front ends sure, so they have a lot of front end controllers in PHB like PHP, slash slash HTML, so you can you can even have a part of your Blazer page as a PHB rendered with PHP, rendered with PHP rather than
the Blazer component model, rather than YEP. Because because you can create like small five flying code which represents a component in Blazer t sharp and incited control. You can render your PHP using our peachpi API. Like we can put it all together and in the end you don't even know what language you are
actually using. Now I'm baffled because phpgim was like HP dot net web forms, like it was a server side technology that's spat out HTML and then you posted back to the to the server to execute more PHP to render something else. Like all those metaphors involve a trip to the server, like what happens when you're living in a client. There's all the differences actually because like when you're working with PHPU are you expect the server? Yeah, and the filesystem
and database and everything. So actually we don't we don't have to care about it because there is this dot and standard library and all the phpcause all the PHP APIs are translated to something dot Net in the end. So wow, if it throws any exceptions like not supported exception, it just does. We can't we can't do anything about this web world. So which is going to keep running? Right? It just keeps wrong? Resumed next. Yeah,
but you can. You can implement almost anything. So if you if you miss a feature like filesystem or anything, it can just just creates a file system provider and make happy noises. It makes happy noises. Yeah, you can. You can have some virtual file system behind and it will work.
Right. I mean, now you're talking about PHP as SPA. That's essentially what it is, a single plage application as a single plage application, right that all of it will be executing in the browser and then possibly calling what it thinks are back end components, but are actually just components in dot Net that are making the remote called or fetch data. It's PHP as SPA. That's right. We should we should call it. We should call it allid
it, we should call it. Yeah. Yeah, because when you hear peach pie, I'm thinking raspberry pie, which is you know, it's still a fruit in front of the word I so what pitch? Yeah, I get it now. Yeah, I think we were looking for a fruit actually because everything right that time was through it so well. In peach Pie has PHP in it, Like I get it. I do equate it that way.
I don't know that you can give up on that brand just yeah, but this peach Pie spot just amuses me, right, or because that's effectively what you're doing, even though it's not necessarily the same set of metaphors. It's like, now this would work. It's just weird. It makes sense. I will use it somewhere because actually, since we have it all managed and we can like play around and we have our own run time, we
can do like stuff like for example, PHPs lifts within its request. Once the request ends, everything you did in your PHP code, all the memory or the arriables, everything just dies. Right. But with peach Pie, we actually don't have this single pro like multiple process approach. We have multiple multi threaded approach, so other requests are threads and we can keep things living
in the process. So for example, with the web assembly, we can like keep the context of the application living across more requests, so you can gain a great performance booths because like eighty percent of for example, eighty percent of empty Larva page is just initializing stuff and loading classes and declarations and everything, and we can do it just once and keep it in memories. So there's a great possibilities, like we could do it if someone would care.
You know what's interesting about that is that UM web assembly isn't really fully getting multi threaded support the plays or web assembly until that and at eight. But there's there's like a little preview. Now you can take a look at it. But but you're but web assembly obviously can be multi threaded, so you're taking advantage of that even before Blazer does. Yeah, there's a lot of things related. First, it's not multi threaded, but it's a sink,
so okay, you can. You can run small tasks in a row. But PAHP is not a sink. So so which when you say it's not multi threaded, do you mean peach Pie web assembly or Blazer like web assembly is uh as I remember as I remember when I was using it, it's everything the JavaScript was not multi threaded because it's not ready for it yet.
You don't have any any critic sections, any monitors, any locks, So I think it's purely a sin a sink, so you can, okay, you can put your small tasks into the task schedule awaited them and it will get executed somewhere. Peachbot is multi tredit, but since we have to behave like PHP, we we just behave like we are not multi tredit. So I'm reading from web Dot dev Slash, web Assembly Dash threads and it says a web assembly threads support is one of the most important performance additions to web
assembly, and this is from July twenty twenty one. It allows you to either run parts of your code in parallel or on separate cores, or on the same code over independent parts of the input data, scaling it to as many cores as the user has, and significantly reducing all overall execution time. So awesome. I know there is a like opened issue on on Blazer that Microsoft should do it. It's r and there's a framework you know or how's it called UNO which is multi tredit. Yeah, but PHP is not so
well. It looks like web assembly has multi threading through this worker's thing from JavaScript that web assembly does have multi threading, but a question is can those workers work like threads? Yeah, I'm not sure. I'm going to post this link so Richard can add it. I was actually recently doing a like extension for wes code running in browser, and I took our extension written in c sharp in dot net and we just compiled it to web assembly and running
it in wes code in browser. Nice, just like that. So we had a problem with threading because we just couldn't couldn't start threads. All the threads were just queuing after each other and we may have to use the workers worker constructor to create them. Yeah, but they couldn't talk to each other very well, so we couldn't share a memory. We had to we had to use some kind of Okay, now I'm reading that there's a shared array buffer, Yeah, something like that. It's not the threading as we are
used to put a convenient way right anyways. Anyways, Well, that's good to know that you're thinking about it and that you know eventually it'll work itself out. Yeah, definitely, one day. It would great. It would be great for PHP because they're like trying to get the benefit of threats, but it's it's not the fullidare yet. Well, yeah, because that whole
worker role thing in the browser has always been a bit wonky. I don't I don't know if it's stayed back now because websembly is pressed against it. I hope it is. But right, you used to you used to be able. We always will proposed this idea of you're gonna be able to call this worker helper and it's going to be able to run this thing independently,
but it never seemed to actually work like that. Yeah, but I think that's different when you look at the webs level and you're literally running inside the context where JavaScript would normally run and say, hey, I just want to be able to do these things because I don't think a PHP is multi threaded either, right, Like normally you're going back to a server with a short lived instance that executes and dies and so you know, yeah, maybe using
multiple threads, but they've got not do with each other. Right, There is no like native support for threads. There's an extension for doing things on a bag round tread, but again it's not like we are used to from HR. But you can share of variables and do stuff like because we're living in webland where all of this stuff is on the server and short lived, Like, why would you spend the energy setting up a bunch of threads when you're going to tear them down in a few seconds anyway. Ye are there
any other implementations of PHP as a client only? Uh? System? Actually, there is a native PHP running as a web assembly, so I think they even got through running Droople framework people in browser with with squill light uh, and it seems to work. I haven't noticed like anyone using it actually, but it's there. The only downside is it's pretty large. You have
to download like ten twenty makeabytes of data. You're talking about Droople though, that's big duple and the PHP run time itself, because yeah, you have to download the whole PHP run time. Okay, As a web assembly, you're just boumbing around GitHub. I think I've found three web assembly run times for PHP, so people are experimenting, right. Two of them are dead
already. There's just one one alive when it's driving. And obviously the performances of your code is going to increase when it's running in web assembly versus when it's on the server. It's not a system like Blazer where right, where there's like a yeah, a graph for every user on the server. And you know, it's not like Blazer's server. So I guess when you take code that you've run on the server and then now move it to the client.
There's going to be a performance increase in many many situations, isn't there. Oh yeah, there will be an increase because you have the whole PC dedicated to your request, right, so the response will be immediate. You don't have to wait for a network, you don't have to wait for the server, and the server doesn't have to process like thousands of users at many
time. But at the same time, there might be a performance decrease because it's still running on a mono run time and it's actually not compiled to the machine code, right, it's interpreted right as far as I know, because like, yeah, we are trying to make it a running, compiled native ahead of time, which will be a thin one right. Sure, Yeah, Now let's star you're bringing this up um. Web assembly requires that it
downloads well until Blazer United, which will be great. It requires that it downloads all the DLLs in web and assemblies that it needs before it can run. And so what is peach pie on web assembly? How big is that download? Yeah? We actually we actually designed it with this in mind because we wanted to take advantage of assembly trimming and make the resulting published assemblies as
small as possible. So we are actually doing a small trick during the compilation, and we are creating a table of used classes and methods so the trimming knows the methods are used and it won't just cut them off otherwise peach piece of dynamic language and you never know what metal to what function will be called. So we're just annotating and using this trick to avoid trimming stuff that will be used, it will be called, and the result you can get everything
trimmed and published to like four to six megabytes. Wow. And that's on top of the basic web assemblies including dot net, including dot neet run time, oh including Oh okay, so that's about That's about what it is anyway, isn't it It's like two two and a half megabytes right now? Some Yeah, if it's a small PHB app just just a few classes and everything,
it's just nothing. Yeah, okay, so nothing to worry about if you have pdbs embedded so you can debugging everything, which is awesome because you're like debugging PHB and the Whisle studio and we just did it. Doesn't even know it's PHP. I like it. It's like ten megabytes, which is which is all right? M So what happens in the world of plays are United? When you know there you can start off with a Blazer server application
and then it will download all the assemblies in the background. Is there any way that peach Pie can sort of ride that bandwagon? I think I'm a little bit like, I don't know what's Blazer United yet. Oh okay, a little bit. We're gonna have to talk to you later kind about this because there I think there's an opportunity. I don't know though, I don't know. I mean, but if you're basically talking about dot net assemblies just going from the server to the client, you might be able to hit your
ride on that. So essentially what it means is if you're familiar with Blazer Server in Blazer Web assembly in the two different models, Blazer server uses signal R as a circuit in the background too, and it keeps a graph of
the dom for each user in memory. And when there's some code change, some UI code change, or whatever you want to call some code, it happens dynamically through signal R and on the server the code is executed and then it looks at a diff of you know, the dom and what has changed, and it sends back these really small binary messages through JavaScript that updates the browser. So so it's fast, right, that's how it was before, right I remember, Yeah, I remember Blazer is putting IDs in generally it
remembers the dump tree with little i ds. It just updates the element. It's like magic the changes. Yeah, and so it's so what happens now is Blazer web assembly. Of course, you have to wait for everything to be downloaded. So they have this automode in Blazer United that you start on the server and in the background all the web assembly DLLs get downloaded and when they come to life, boom, you're running on the client. And that's
really cool. So and I think that's going to be the future of Blazer. It's just going to be called Blazer. There won't be a I mean is United of course. But all right, yeah, so wouldn't be cool if you guys could sort of hit your ride in that mechanism. So you should be talking to Steve Sanderson, all right. I think like a year ago, we've been working with a student from our university, Thomas Thomas,
which Thomas was it. It was that Thomas who suck another another guy and he was actually building an SDK for Blazer and PHP and he created a Blazer control which behaves like an element in the in this domtree, but it renders PHP inside it, and it could do this kind of stuff like it remembers what was changed and it could send just the differences. Yeah. I think this is the peas right that you sent. That's the one. That's the one. We still need to update it to the latest dot net but it's
in dot neet five right now. Wow. But there's a part time that we are doing this kind of stuff. Fantastic. This component is really I think it can change just just the stuff that was that was changed, and you can. We can. We even have an API for for PHP code itself, so developers can just changed only the stuff they want to, like in the reactor or other frameworks. And gentlemen, I need to interrupt for one moment for this very important message, and we're back. It's done that
rock. So I'm Richard Campbell. That's Carl Franklin. Hey, Hey, talking to our friend Jacob a bit about PHP and web assembly and I was just thinking, Wow, we've come a long way. Since Philanger. They we talked to Thomas PETRISEC back in like two thousand and seven. Yeah, yeah, two thousand and seven, early those early days. And but of course that project now I think in fully an archive, it's become peach Pie, like it has a direct lineage. Yeah exactly. Uh, like I
was working on Phalinger like sixteen years ago with Thomas. Thomas did a great stuff with silver Ete and implementing like a lot of a lot of code that that that amount, that amount of work. Yeah, and uh, it's actually pitch Pie is the incarnation of Phalinger. Because we needed a new new platform. We needed to use rosalind compile platform, we needed new dot Net. We needed to avoid the old system reflection emit APIs because that's really slow.
And thanks to this change, we cut the compile time from like on large projects from two minutes to four seconds. So Roslin the new dot net, new dotnet and Roslyn actually because we can just emit code in parallel and without calling into the native system native system stuff. So it was a great change. And I feel like with about Somebody is also the reincarnation of silver Light. And this in functionality, yes, it has the possibility at least.
Yeah, you don't get Zammal for free, right like, thank God, though thank God should die. Yeah, I you know, Billy, I love Billy, Billy love Samal. It doesn't mean I have to love sam And not a lot of m VVM in your life either, right Like, But I think that's what I think about. What I think abouts silver Light is well, yeah, VM in Zammal with C sharp. Yeah, MVM is kind of required when you use Samal and when you use Blazer.
The consensus is it isn't really all that important. There are other ways, yeah, yeah, and you can you can do the same stuff like Thomas thirteen fourteen years ago, he did a game in silver Light using PHP this helicopter. He was shooting stones or something, and we actually achieved to make a game intimbly using PHP and Blazer as well. So you can do that. Actually, wow, very cool. And you're calling into the canvas for
that. We are not rendering it. We are actually manipulating with HTM elements amazing PHP, so you can crazy. That's the other thing you can. You can call JavaScript right from your PHP comer. PHP became a client cyclanguage, yeah, which I'm still just wrestling with Yeah, it's an interesting way
to think. You know, I think I cut you off or change the subject when you just when you were mentioning the AOT compilation ahead of time compilation feature of web assembly and Blazer in particular, what were you going to say about that in the context of PHP. Yeah, it's it's a nightmare. No, because because in theory, in theory, you cannot we cannot use it because PHP is a dynamic language and you never know what API you will
need to use. You never know what functions will be called. So we have this switch in a compiler where we can tell, Okay, if you are really sure our compiler discovered all the functions that will be called, just go ahead. But in most cases I would it's it's it's just just test it. Just do a lot of tests otherwise. Otherwise, of course,
in dynamic language you just never you never know, you never know. We have we have some compiler options to exclude, to exclude references to libraries like my ESQUL, microscl bosgress and so on, so you can manually exclude references to those to those assemblies, which helps server side things. Yeah, scripting, for example, we have the whole dynamic compilation, so so you can do evil. It is it pronounced evil like evil? I don't know.
Ye. For us it's evil, we call it evil. So you can turn it off to to make it smaller, because without evil, you don't need the whole compiler, right, sure, so it makes it smaller, and so and so on. So if you are sure you are statically linking all the stuff you need, you can you can turn the native head of time compilation on it and then it works. We have some issues by people who tried it. Actually I wasn't brave enough to try it with phpyet.
Okay, I'm just reading those issues and answering things like thank you for the issue. I hope you know what you are doing? Um, yeah, that should be a great error message, right, or at least a warning. I hope you know what you're doing. It's your foot, Yeah, yeah, it should be. It should be a warning message, although it's
almost implied with every of the one of those warnings. Yeah. We we have a similar warning in there for for finalizers right in PHP, because in PHP you have this deterministic garbage collection, but in dotnet it's not deterministic. You never know when it happens, and it happens on another threat. But in PHP it's always happening deterministically, like at the end of the function or
somewhere. You can expect it because there is a reference counting implemented. So if anyone has a finalizer in their PHP code, we just pop up a warning during the compilation time you have a finalizer, it's it's not like it won't work, it just would work. Can you implement I disposable? You can implement it, but you have to call it explicitly. Sure, well, I mean that's that's the indication, right. Anytime I create an object, I look to see if it has a disposed method, and if it
does, I call it. That's just something we've gotten used to. It's not net developers. That would be nice. Yeah, uh, it's it's not there in PHP. Okay, um, all right, I know what you're gonna say, Richard. Are you sure? Yeah? I think so, go ahead, word press. Yeah, that's exactly where I was going. I mean, when you talk about PHP, it's one of the largest applications of the world. It's the most popular CMS in the world. It's bloody everywhere, and the PHP is the back end of it. But now
you could be running it in the front end. This is not a good idea, but boy would be a fun thought experiment, Like what would that even look like? All right? So uh yeah, we have some discussion with community about it. I think some people actually tried it. They ported it a lot of it already, which is the biggest business framework for PHP. Right, But WordPress is something like you just put it on the server and it works, yes, and or more a saently you buy it for
three bucks a month from a provider somewhere, right. You don't even need to install it anymore really, and you just you just download your plugins and themes from the dashboard. So right, it's totally different approach than than dot net. But in theory it works. We have it compiled in a normal way without the possembly and like twenty megabytes so compiled. It's not that I would thought you would be bigger than that. That's that's surprising. It's just
it's a small project. Well, but it's very file system based, so now you have the whole problem of where do you put all the file Yeah? Uh, thankfully we have all the filesystem APIs we have re implemented in c sharp, but we can do whatever we want. So internally, internally we have this filesystem provider, and just in case for just in the context of web assembly, we can just reimplement it to behave like something else. Sure we uh, I'm sure web assembly has or embrowser you can. You
can have storage embrowsers so you can upload your your files. Yeah you have. Yeah, it's a little little limited. I would also think like quick over SMB, which is sort of the most bare metal way to communicate over the Internet safely for files, would be pretty impressive, although if you still get the latencies in web assembly. You have access to files within your local Webrew kind of thing, but it isn't anything that you can really really access
in use. But you do have, of course local storage right in session storage. Local storage. You get five megabytes per per URL for whatever, and you could certainly use that. But it isn't like you can just reach out and open a file and the documents folder or that kind of or write a file in the system. Yeah, yeah, we could. We could bend the WordPress a little bit so it wouldn't be that excessive with the file system access. But let's be clear, WordPress is already bent right, Like,
it's not that. It's not a stretch. People do crazy things that word pressed all the time. You can do anything. There are extension points everywhere in the code. You can really change everything. So so in this way, we could just disable some functionalities to make it smaller and lighter. We could make something like a virtual file system, so your files could be on some cloud provider. Maybe other files would be behaving like they are because
WordPress is touching all the files all the time. It's it's just just calling file exists for for many things to just check it's there, right, So we can just return like true true is there is there? Now? Don't bother me with that. Here's an even more ridiculous thought experiment. Um, last time I checked, Facebook still uses PHP. Could they be shipping some stuff down the web assembly? Woll would they? Does that even make sense?
Client side Facebook even faster? That's what that will have? Like two gigabytes right, easy? Be massive. I think they moved to h h VM right, and no portion of the code is written in all the other languages. I think we spoke to to some guys from Facebook and they are using all kinds of languages. PHP is just a small portion of their of their codes that they which you expect just because you started in one places, I mean you change. You know, once upon a time Twitter was written
in ruby. There are still pieces of ruby, right, and yeah, I think so, but but it's any off the rails. Saying Facebook is PHP is any more correct than saying Twitters and Ruby right, like the Yeah, that's where they started, but things have changed several lists Twitter would be yes, well I thought you said leaderless Twitter, but I wasn't going to say that. I like how Rich Campbell has come around to my way of thinking about the crazy person in charge of Twitter. Yeah, so at least
at least it's fun. It is fun. Um. So on the list of gotcha's, are there any we we talked about sort of the threading and asynchronous stuff and some libraries that might not be ready for the browser because they access serviicide things. Is there anything else that is a gotcha that you're still
battling with? Well, the database is a question because the database libraries are working in the browser, but you would have to you would have to call your database on the server, right, So it's a question about security and also performance because you frameworks like For example, WordPress are making tons of escot queries within the samele requests, so that would be slow, I guess. But you can bundle escal light sure. I think you can fit it into
those few megabytes of storage, so nice. You could access indextb, which would be I think better than sq light. Esk light doesn't persist as it. I don't know. Yeah, I don't think it does, but I could. I could be wrong. Really. I think there's a just file and it can it can modify, but it would it wouldn't Pursis this too, Yes, yeah, but it isn't gonna It isn't gonna stay like a
database stays, you know, probably not to know. You have to if you want you can use it like but then you have to sort of persist it with some other mechanism. Um. But an XTB would be good for a local database. But I think that you know, there's there's lots of tech out there that's available in in C sharp and you know Blazer that already
does this. The problem is solved. So if you essentially hook hook into those things, then you can call your APIs and you can call you know whatever using all the frameworks that are already there and Blazer, but that's if you have a Blazer app that's calling PHP. If you have a pure PHP app, maybe you can add the Blazer components to you know, do your data management for your API stuff. That sounds yeah, yeah, good luck with tell me good list. This project part of your PhD thesis, well
partially really. I mean you are a PhD candidate, which I find fascinating because that means you're on the path to actually be a computer scientist. You're clearly enamored of language and different operating operating constructs there, So yeah, I think I started. I started my PhD in the context of the other work I'm doing, which is the language integration for a visual studio, where I'm doing a lot of like PHP control flow analysis and data analysis and all the
other stuff. So partially as because the compiler is actually an analysis tool. It is. So I did a lot of a lot of papers and presentations about code analysis and performance and maybe like twenty percent of pitch pot is code analysis, so right, it is a part of PhD. I had some papers about Phialinger, and I was working with some other students on some academic papers on peach Pie as well. So it is a part. Part of it is uh major part is my other work where I'm doing like code diagnostics
for for visuals to do. That's connected. They talk about a PhD thesis as contributing to the art. So you mean you're helping our industry grow. It's thinking around compilers. That's not to make it too heavy. That's the gig, right, Yeah, so maybe I should finish it right. And there's that too. I mean Neil's bores PhD thesis was the atomic model, the idea that protons and neutrons are in a nucleus surrounded by electrons. Like it's a lie we tell children and adults, but it was a useful lie.
And that literally, you know, he contributed to the art, like I always think in those terms. I talked to some of the working out a PhD. It's like, this is your contribution to our body of knowledge. Of course, Yeah, that's that's why I'm doing it. Yeah, sure, okay. He's awfully sarcastic, you know, and very humble. Never I'm not I know what it means. Anyway, I'm I'm excited for you. It's it's fun to see which you, which you group of you
have pulled together here. Just you know, it speaks to the power of web assembly once again, as if we didn't think it was powerful enough already, that it is possible to take this these tools and through your past work, not knowing this would ever be possible, be able to implement it into into the context of browser. Yeah, it's it's all thanks to the dotnut. It's it's really great. Yeah, Like I saw the work of native PHP guys doing all the all the work making assembly possible, but we just
didn't have to do anything. We just worked happy quickly. Yeah. Yeah, who's on the righteous path now? So what's in your inbox? What's next for you? For me? Yeah, in context of web assembly or whatever whatever. Actually, most of the time I'm working on the PHB language integration for we just we just do a code where we have tons of feedbacks and suggestions, so we are may improving code analysis and actually we are doing
AI completion like something like get up compiled and stuff. But we are we have a deeper knowledge of PHB and we have a lot of a lot of source coding PHB, so we can make it a little bit smarter. So we are working on AI right now. Nice and preferments a lot of performance
because PHP projects are huge. It's really thousands and thousands of files, and people for some reason expect the language integration for labors to the code won't eat up all day in memory and it will be super fast and things like that. So we are using various tweaks and uh like knowledge about dot net to make it super fast. And it's like most of my work because we have
people complaining all the times we are improving this kind of work. Okay, so these are phptwols or visual studio and visual studio code, yes for just and we just did a code right which is fun because we uh we started PHP twols for resal studio like ten something years ago, which is actually a part we just we just took a part of the compiler from philaner MM and use it and use it for for this intelligence for revision studio, and then
then we update it to dot Net standard, created newgate packages from it, and used compilation to native code and made it an extension for regis to the code out of the box awesome. So we didn't have to rewrite it to to type script to JavaScript or because we just did the code is in JavaScript. Nice, and we just took C sharp and move it just like that and boom we we had intelligence. What also means you can maintain it between the two code base it's one code base, yeah, exactly. We have
one set of tests. We have one code base and one place going to show up in the other. Right, Yeah, that's that's great about it. And then we have third integration for regis to the code in browser, which is all those things compiled as a web assembly. Jeez, that's crazy. That's awesome. So we really we really have just one code base and it's running everywhere my coos Linux, Windows, which studio code everywhere. And this is because dot net. Yeah, it's because I'm dot net. Yeah,
it's because we are working with dot net since version one point. Oh and we just know know some stuff. Yeah, it gives us that portability. Great story, yeah, great story, regulations on all this work. It's awesome. Absolutely. Oh, thank you very much, and thank you for spending this hour with us. It's been amazing. Oh, it's been pleasure anytime. Okay, we'll take you up on that and we'll talk to
you, dear listener next time. I'm dot net Rocks dot net Rocks is brought to you by Franklin's Net and produced by Pop Studios, a full service audio, video and post production facility located physically in New London, Connecticut, and of course in the cloud online at pwop dot com. Visit our website at dt n et r ocks dot com for RSS feeds, downloads, mobile apps, comments, and access to the full archives going back to show number
one, recorded in September two thousand and two. And make sure you check out our sponsors. They keep us in business. Now go write some code CE next time we got
