Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New language on top of PHP?

I'm a PHP developer. I like PHP! It is a really good language if you know how to use it, but I know it allows very bad design sometimes.

It reminds me of JavaScript which has good parts and bad parts. One particular project, CoffeeScript, tries to focus only on the good parts, forcing you to write good code.

I was thinking if something similar could be done with PHP... A new syntax that would be compiled only to good PHP code taking advatage of all the new and exciting stuff we can get with PHP 5.3.

So, getting ahead of some people, I'll ask: Why create a new language on top of PHP if you can just use Ruby or Python or something else?

  • PHP is easy to deploy anywhere
  • The language itself has a lot of good features and ideas
  • There are lots of good libraries written in PHP
  • ...

So, my real questions here are...

  • Is this a stupid idea? Why would it be? Do you think CoffeeScript is stupid?
  • How do someone starts to create a new language on top of another? I know nothing about this, but I would like to learn. Where to start?
like image 301
Eber Freitas Dias Avatar asked Jan 15 '11 15:01

Eber Freitas Dias


People also ask

What languages are replacing PHP?

Some of the popular alternatives to PHP include Java, Python, and Go. Here are the salient features of these languages.

Is PHP worth learning in 2022?

PHP is a language that can be used to build any kind of website in 2022, starting with landing pages and simple WordPress websites, and ending with complex web platforms like that of Facebook.

What language is PHP most similar to?

In terms of keywords and language syntax, PHP is similar to the C style syntax. if conditions, for and while loops, and function returns are similar in syntax to languages such as C, C++, C#, Java and Perl.


1 Answers

The idea is definitely not stupid, especially if executed well.

I like coffeescript a lot, but it has it's approach has downsides as well. Debugging a coffeescript script still requires you read the generated Javascript code, which can be tedious, since you haven't written it actually yourself.

I've understood that Jeremy Ashkenas, the creator of coffeescript has started to work on coffeescript after reading "Create your own freaking awesome programming language" by Marc-André Cournoyer.

Good luck!

like image 165
polarblau Avatar answered Sep 19 '22 19:09

polarblau