You can significantly influence new Haxe->PHP generator

450 views
Skip to first unread message

Alexander Kuzmenko

unread,
Aug 13, 2016, 10:25:38 AM8/13/16
to Haxe
Hi.

For me it looks like PHP target is underestimated currently. Not only PHP world can supply Haxe community with a lot of new people, but with release of Php7 Haxe->PHP can try to outperform Neko on web servers.

Right now Haxe compiler team does not have an active maintainer of PHP generator. If you've posted some php related issues in Haxe github, you probably know it.
So as a professional PHP developer i can try to improve this situation for the benefit of everyone (also for PHP devs which are unaware of Haxe yet ;) )

I'm currently  working on a new Haxe->PHP generator and i've reached the point when straightforward generation is almost done. Further generator implementation will mostly require to make a lot of decisions on how to generate php code which cannot be directly transpiled from Haxe.

It's important for development of PHP target to be as open as possible. To let every Haxe community member to influence Haxe->PHP convenience, reliability and overall quality.

So i think it's a good time to reveal current progress. And i encourage you to participate in development. It won't cost you a lot of time. Just go to the issues and let me know what you think. Your ideas are greatly appreciated. Feel free to comment in any existing issue or create a new one.


Here is generated code example (scroll up to see source hx file): https://gist.github.com/RealyUniqueName/2dc44c3d7a5e1f02df71c3a8186e5f43#file-test-php

Don't get confused by the name of the generator ) I'm almost sure it will be compatible with PHP 5.4+

Ben Merckx

unread,
Aug 13, 2016, 11:04:56 AM8/13/16
to Haxe
This looks great. We use the php target extensively, and a genphp was way overdue. 
Love the way you documented the genphp7.ml source! I'll be testing this in the coming weeks.

Op zaterdag 13 augustus 2016 16:25:38 UTC+2 schreef Alexander Kuzmenko:

Justin L Mills

unread,
Aug 13, 2016, 1:20:22 PM8/13/16
to haxe...@googlegroups.com

That's great news :) Hope Haxe can take over the PHP user base.

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

我每天睡不着

unread,
Aug 14, 2016, 1:04:16 AM8/14/16
to Haxe
+ 1

Tarwin Stroh-Spijer

unread,
Aug 15, 2016, 2:45:01 AM8/15/16
to haxe...@googlegroups.com
That's awesome mate. As one of the original users of the PHP code base it's great to see it in active development again! We're still using it (although 2.x version) for our user facing code with over 40 million monthly users and sub 60ms response times (of course that comes down to memcache and such, but still - pretty damn awesome).

So yeah. For anyone out there looking for server side stuff, PHP works great in Haxe!



Tarwin Stroh-Spijer
_______________________

phone: +1 650 842 0920

Developer at Fanplayr Inc. (Palo Alto)
Original at Touch My Pixel (touchmypixel.com)
_______________________

On Sat, Aug 13, 2016 at 10:04 PM, 我每天睡不着 <sen...@gmail.com> wrote:
+ 1

François Barbut

unread,
Aug 21, 2016, 4:42:10 AM8/21/16
to Haxe
That is awesome news !

I also think that PHP7 and its speed could be a target of choice for haxe.

I'm very interested in your project, as a developer of an open-source web app compiling to Neko and PHP ( https://github.com/bablukid/cagette )

The biggest concerns for me are proper error handling and source maping for PHP.
Currently I develop and test with neko, and test with PHP later because debugging is so painfull with PHP.

Good luck , I'm looking forward your next posts :)

Alexander Kuzmenko

unread,
Aug 21, 2016, 4:52:24 AM8/21/16
to Haxe
There is this task in roadmap: https://github.com/RealyUniqueName/haxe/issues/23
I'm also looking for possibilities to somehaw integrate haxe sources with xdebug

воскресенье, 21 августа 2016 г., 11:42:10 UTC+3 пользователь François Barbut написал:

szczepan

unread,
Aug 23, 2016, 5:03:43 AM8/23/16
to Haxe
It's great somebody is working on PHP target again. It's very needed target, I think, because of cheap hosting that so many people use.

I'd say source maps are the most needed feature, it'll make writing apps on Haxe-PHP a smooth and pleasant experience.

As for the debugging in current state of PHP target, I never heard of Neko debugger but Xdebug works just fine and I find that tracing stuff to output is much worse than finding out what Haxe code correspond to currently stepped though PHP code (and it's mostly very easy to handle in your head). :-)

Mahmoud Awad

unread,
Aug 30, 2016, 6:03:41 AM8/30/16
to Haxe
Thank you for your great efforts, Haxe/PHP is one of the most inetersting features of Haxe and saves you plenty of time, it is simply one of  the greatest tools to develop server logic. I have used it recently and I just loved the way how everything is done. it was just perfect the project I was assigned.

I would like to ask you, would it be possible to support react-PHP (http://reactphp.org/) any time in future? react-PHP is an event-driven non-blocking I/O with PHP, it is still in development but from what I have read its performance can beat node.js.

I am not familiar of how to use it so I wonder if it something can be done with Haxe/PHP

Alexander Kuzmenko

unread,
Aug 30, 2016, 6:45:09 AM8/30/16
to Haxe
Never heard about ReactPHP before. At the first glance it looks like it should be already possible to use it with current php generator (with little bit of untyped programming maybe). And it certainly should be usable with new php generator.

вторник, 30 августа 2016 г., 13:03:41 UTC+3 пользователь Mahmoud Awad написал:

JLM

unread,
Aug 31, 2016, 5:23:46 AM8/31/16
to Haxe
Did you look at:
https://github.com/massiveinteractive/haxe-react
Not sure what targets it supports out of the box but if you can get it running in Neko then PHP may well be feasible.

Alexander Kuzmenko

unread,
Aug 31, 2016, 5:35:38 AM8/31/16
to Haxe
Despite the name ReactPHP is not a clone of React js library. It's more like NodeJS

среда, 31 августа 2016 г., 12:23:46 UTC+3 пользователь JLM написал:

JLM

unread,
Aug 31, 2016, 11:39:58 AM8/31/16
to Haxe
oops sorry for my assumption.

Nicolas Juneau

unread,
Sep 8, 2016, 7:29:37 PM9/8/16
to haxe...@googlegroups.com
This is great news! I'll be sure to keep an eye open for that project!

S.A. Asselbergs

unread,
Oct 9, 2016, 3:23:05 PM10/9/16
to Haxe
Good stuff!!!
All your user base are belong to us ;-)  http://knowyourmeme.com/memes/all-your-base-are-belong-to-us



Op zaterdag 13 augustus 2016 19:20:22 UTC+2 schreef JLM:
Reply all
Reply to author
Forward
0 new messages