PHP bugs me. It's a language with so many inconsistencies, it's just screaming to be cleaned up. I'm surprised it hasn't happened yet. That's why I'm starting a series of articles on Fep, a cleaned up version of PHP.

Fep has the following goals:

  • Eliminate many of the inconsistencies of PHP while maintaining the core feel of the language. For example, why is there print and echo? Answer: it's complicated. But it doesn't have to be! isset() is a language construct that requires brackets but require doesn't. These are the types of things I'd like to fix.
  • PHP has a ton of string functions that are just screaming to be separated into classes. Fep will do this. This will be also done to groups of functions in a similar state.
  • PHP isn't the nicest language, but it's easy and familiar. It also has a ton of support. Fep will be a sort of meta-language. Fep code will be converted to PHP code before it is run in order to maintain compatibility with the PHP ecosystem.
  • PHP's OO model is a bit strange. Why is the constructor called __construct? To me that's ugly as shit. I'm also not a big fan of using -> to access methods and attributes. I'd much rather use ., but in order to do that, we'll probably need to stop using . for concatenation. I'm ok with doing that.

That's just a few of the things of the top of my head. The development process will follow this pattern:

  1. write a series of articles to map out the language (maybe even write a language reference like Python),
  2. write a compiler that'll convert Fep code into PHP code,
  3. write a module for Apache that'll convert .fep files to .php files and then feed them to the PHP module.