Greetings,
currently I’m a PHP + JS Fullstack Developer and I’m at the moment evaluating if I maybe should use Haxe for some of my private projects.
The language in itself seems nice, so that is a big Plus for it.
But the big But that speaks against it is are some things:
-
First of all the PHP code that gets generated.
- I would Imagine that the Main Class that I define gets turned into the Entrypoint of the Application. In the case of PHP I would imagine it gets turned into the Index.php, which it does not instead I get a Generated index.php that does some haxe intern Bootstrapping before starting my Main class.
- Question: Is their a way to Disable this behavior? So that I can generate my own Index.php and handle the bootstraping myself? This would make it easier to use existing PHP frameworks together with haxe
- The haxe lib files that get generated Why are they situated in the same Namespace as my Application if I use the
-D php-prefix=App
compiler flag?- These Haxe-libs should not be in this Namespace they are not part of my Application.
- They should have their own Namespace like
namespace \Haxe\Php;
- And they should not be located in my Application folder, it should be more like this See the Screenshot
- Someone already made the effort to build a composer Package for it https://github.com/cedx/haxe.php
- Maybe we could have a compiler Flag that makes use of that package instead while building the Application like
-D php-composer=true
something Like that flag could be used for NPM as well.
- Maybe we could have a compiler Flag that makes use of that package instead while building the Application like
- I would Imagine that the Main Class that I define gets turned into the Entrypoint of the Application. In the case of PHP I would imagine it gets turned into the Index.php, which it does not instead I get a Generated index.php that does some haxe intern Bootstrapping before starting my Main class.
-
Integration of Composer packages
- Currently it just seems like a Pain to use Composer packages together with Haxe.
- What I understand is that I would need to write an external Class for nearly every Class of a Package that I want to use in my application.
- I know their is a already a project on github that want’s to deal with that problem: https://github.com/RealyUniqueName/peg
- But would it be an Option to check if a Composer Package already includes External definitions for its classes? Like in JS where a npm package can provide it’s own Type definitions.
-
Project Structuring
- Currently we define our targets per CLI arguments or per .hxml file
- But that makes it hard in my eyes to define a Project with multiple Components Like One part is the Backend and One part is the Frontend. could we per chance maybe define this instead of a custom file format with either an .xml file or even Json/yaml file with a corresponding Schema definition so that It gets more readable and maybe even gives better integration with IDE plugins since they don’t need to read a custom format and write their own parser but could use existing ones.
I will still give Haxe a try and see how far I get with it.