Mammouth is a small language that compiles into PHP
btwael.github.io
btwael.github.io
I think you judging it on a premature release. Maybe he is looking for your suggestions before going down the improvement path.
* Edit: I just remembered PHP's "barewords".
CoffeeScript took off because that was the best way to write client-side code with a cleaner language/syntax. But for server-side, if someone wants a better language/syntax, there are a lot of options to choose from and you don’t have to continue with PHP if you don’t like it.
Ease of deployment with PHP, and the run anywhere on any shred hosting service really is a game changer for people learning how to code on the web.
I think this project has the ability to build a language that could hide allot of the things developers do not enjoy about PHP while still keeping the huge platform already existing for cheap hosting and integrating with existing code bases.
why would you need shared hosting?
Example:
$shared = 3;
function ($a) use (&$shared) {
echo "In function before assignment: shared: " .
$shared; $shared = 5;
echo "In function after assignment: shared: " . $shared;
}
echo "After function: shared: " . $shared;For example, if I had Wordpress site running and needed to write a plugin or an extension I'd rather do it in something other than PHP.
I've not used Mammouth so I don't know if plays out nicer than just plain PHP, but I like the idea.
The way around php has it is both annoying, since most php is not mere template anymore, and error-prone, thanks to the potential problems from trailing whitespace.
You are supposed to leave out the closing ?> in the PHP file - then you don't have that problem.
Inverting doesn't really make any sense:
<P><?=$message?></P>
The HTML is primary, the PHP is used to output whatever is needed.As for your little snippet, inverting does make sense:
<?php
// ... 1000 lines of php
...?><p><?=$message?></p><?...
// ... 1000 lines of php
?>
But tacky little examples aside, there's nothing stopping <?= tags from working just as they always have once you've escaped into html.And why is it that some of the case values in the documentation are followed by "then", and some are not? It seemed random.
What if you want to do:
checkValue($val) or die('bad input');
It's a very nice way to write code since it's very clear. for($_i = 0; $contat > count($contacts); $contat++) {
$contat = $contacts[$_i];
echo($contacts);
} foreach ($contacts as $contact)
echo $contact;Edit: As child post asked: That is the purpose on making something like this or coffeescript. We may all know the edge cases and bugs and know how to write pure php that gets around this, but why should we? Shouldn't our tools serve us and not the other way around? Something like mammoth might actually bring me productivity and enjoyment - which I think in the end is what drives developers.
There's nothing in there that actually helps with the idiosyncrasies of PHP -- for example, returning a sane default when accessing nonexistent array elements.
Also, PHP 5.4 already has the JS-style array notation.
And I really have to wonder about the enforced breaks in their implementation of switch/case, because there are times when you do want to fall through to the next case.
I am sure if it matured, you would start to identify way in which it could improve PHP by hiding PHP gotchyas, and doing all the boilerplate to get around them.