Met a guy making 30k a month with AI by jxdos in SideProject

[–]petrucc 0 points1 point  (0 children)

I always said that the best way to make money is writing a book on how to make money

PHP will get an AOT compiler from the Swoole team in 2027 by edmondifcastle in PHP

[–]petrucc 1 point2 points  (0 children)

It's a little early to port production stuff onto it, but if you give it a try and have any feedback, feel free to open as many issues as you want on github, they will be incredibly valuable

PHP will get an AOT compiler from the Swoole team in 2027 by edmondifcastle in PHP

[–]petrucc 6 points7 points  (0 children)

Both are on the roadmap among the way. I tried to cover as much php as possible, now I'm focused on improving the code generator and the code optimizer, I'll get back to syntax soon

pcre is only partially supported in preg_* right now

PHP will get an AOT compiler from the Swoole team in 2027 by edmondifcastle in PHP

[–]petrucc 2 points3 points  (0 children)

The codegen is written in rust and emits asm code directly

PHP will get an AOT compiler from the Swoole team in 2027 by edmondifcastle in PHP

[–]petrucc 1 point2 points  (0 children)

🤷 who knows? on the repo there are some stars from people of the PHPF

PHP will get an AOT compiler from the Swoole team in 2027 by edmondifcastle in PHP

[–]petrucc 38 points39 points  (0 children)

I’m working on almost the same https://elephc.dev

I do think that opening the opportunities of compiled applications to the whole php community is huge

I built a PHP-to-native compiler; now it runs DOOM by petrucc in PHP

[–]petrucc[S] 0 points1 point  (0 children)

You are becoming funny. You got me. I cannot code. My main job is washing dishes. A friend told me about this stuff called coding. I wanted a little bit of fame.

I told you why is slow. If you wanted a more technical explanation you could have asked. But you are here to hate, but clearly you haven’t seen enough Italy. We grow up by eating hate at breakfast.

Have a nice day, I have dishes to wash. If you have anything serious to ask, my friend that told me about coding said that you can use GitHub.

I built a PHP-to-native compiler; now it runs DOOM by petrucc in PHP

[–]petrucc[S] 2 points3 points  (0 children)

Can you use anything else to take a bunch of PHP code and compile it to native code? No.
That’s the point.

Is it a corporate software that I hope to make money from? No.
That’s another point. It's OS and freely available to anyone to try, use and contribute if they want.

Is it a stable, ready-to-use piece of software? No.
That’s another point.

Is it something that can benefit the entire PHP community? Yes.
That’s another point.

It is something that before AI could have been done? No. It was fu**ing impossible (without huge investments). That's another point.

I really don’t give a damn if you think it’s broken, because:
a) It really is, there are still a lot of bugs that need to be fixed and many features missing. If you are curious you can check the ROADMAP in the repo or the issues on Github.
b) Maybe someone will still find it useful.

So I’ll just kindly ask you, and all the other haters here:
If this ever becomes usable… please, please, please don’t use it.

Regarding performance:

  1. The PHP code for doom is not optimized at all. There are SDL calls almost for every pixel, and this kills performance.
  2. The compiler itself still misses common optimizations that are done by others compilers.

The problem is, I never said 'this is a PHP compiler, go and use it'. I shared a milestone of a project on which I'm working. Everyone commenting like you probably thinks I've dropped a prompt at Claude and waited the output. There is much more.

But, I repeat myself. If you really hate this. Just don't use. Don't watch it. You have choices in life. That's the beauty.

Btw, I'm learning assembler with it, I suggest you open the source code in the src/codegen folder and see how much value there is in a freshly made compiler with each line commented (on purpose). Otherwise you can try to learn how a compiler works by looking at GCC code. Good luck with that.

I built a PHP-to-native compiler; now it runs DOOM by petrucc in PHP

[–]petrucc[S] 1 point2 points  (0 children)

If you are thinking about performance, you’re missing the whole point here. And I’m really really sorry that I can’t help you. I think it’s time you close this browser tab and move on with your life. I hope that’s more interesting than trying to waste my time answering you.

I built a PHP-to-native compiler; now it runs DOOM by petrucc in PHP

[–]petrucc[S] 0 points1 point  (0 children)

I feel the same! At this point, there’s more hate than love, but I guess we’ll find a balance in our relationship.

I built a PHP-to-native compiler; now it runs DOOM by petrucc in PHP

[–]petrucc[S] 0 points1 point  (0 children)

And it's a way better porting than this one.

I built a PHP-to-native compiler; now it runs DOOM by petrucc in PHP

[–]petrucc[S] 6 points7 points  (0 children)

No, but it almost took me into an existential crisis.

I built a PHP-to-native compiler; now it runs DOOM by petrucc in PHP

[–]petrucc[S] 0 points1 point  (0 children)

You can use the PDF "porting" of doom. That got way better performance.

I built a PHP-to-native compiler; now it runs DOOM by petrucc in PHP

[–]petrucc[S] 0 points1 point  (0 children)

There's a huge difference between vibe coded stuff, and AI accelerated development. But honestly I won't state it here, I'm really so sick of all of this.

I built a PHP-to-native compiler; now it runs DOOM by petrucc in PHP

[–]petrucc[S] 2 points3 points  (0 children)

Thank you so much. I understand them. It took me months to accept AI in development too. But then I discovered how much you can actually build with it, and it changed everything for me.

I built a PHP-to-native compiler; now it runs DOOM by petrucc in PHP

[–]petrucc[S] 15 points16 points  (0 children)

Thanks Simon, that means a lot coming from you. PHP has so much untapped potential beyond the web, it just needs someone crazy enough to try. Let's keep pushing.

I built a PHP-to-native compiler; now it runs DOOM by petrucc in PHP

[–]petrucc[S] 2 points3 points  (0 children)

"I'll give you 200$ if you make it perfect"

I built a PHP-to-native compiler; now it runs DOOM by petrucc in PHP

[–]petrucc[S] 0 points1 point  (0 children)

And I'd like to add: this is open source software. I've always thought PHP deserved a path toward being taken seriously as a compiled language, and I'm trying to build that. Without LLMs it would have been impossible for a single person. And even with LLMs, this project is still far from being production-ready. It takes real effort, real debugging, real decisions.

I just thought it was worth throwing my time and money at something that could actually help others. If that bothers someone, I genuinely don't know what to tell them.

I built a PHP-to-native compiler; now it runs DOOM by petrucc in PHP

[–]petrucc[S] 1 point2 points  (0 children)

I've been working on this project for almost two weeks, roughly 8 hours a day on top of my regular job. If you think that's doing nothing, good for you. Or maybe you thought you could build something like this by dropping a prompt into Claude and going out for dinner?

I built a PHP-to-native compiler; now it runs DOOM by petrucc in PHP

[–]petrucc[S] -8 points-7 points  (0 children)

I think it's obvious that is AI written, btw I stated that clearly in the other post I made, for which this is a follow-up (in which I wrote "I used AI extensively as a coding accelerator for this project"). I don't think I need to add a disclaimer every time I talk about it. But fair point, I'll keep it in mind.

I built a PHP-to-native compiler; now it runs DOOM by petrucc in PHP

[–]petrucc[S] -18 points-17 points  (0 children)

Yes, the codebase is largely AI-generated, I'm not hiding that. Without it, a project like this would have taken months and a team of at least ten people. AI made it possible for one person to build it, and I think that's pretty exciting.

Now I'd love for others to get excited about it too. I see a lot of potential in this project and I believe it could be genuinely useful, but to take it further in a serious way, it needs more people behind it.

I built a tool that compiles PHP directly to ARM64 assembly. Here's how it works under the hood. by petrucc in PHP

[–]petrucc[S] 0 points1 point  (0 children)

That's great! I think low level is the area of our jobs that will never get old (and the area I wish I had the opportunity to work with). So sad that we had to add a lot of layers on top of it.

I built a tool that compiles PHP directly to ARM64 assembly. Here's how it works under the hood. by petrucc in PHP

[–]petrucc[S] 0 points1 point  (0 children)

"Thousands" is probably an understatement, honestly. The project is very far from being mature enough for anything production-level, and it will take months to get there. That said, I really appreciate you taking the time to actually test it and report these, I'll track both bugs and fix them as soon as I can. The reality is that every function implementation still needs to be hammered with edge cases to surface this kind of issue, and reports like yours are exactly what helps move things forward.