New language on top of PHP?

前端 未结 12 1715
甜味超标
甜味超标 2021-01-30 02:39

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 whi

相关标签:
12条回答
  • 2021-01-30 02:55

    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!

    0 讨论(0)
  • 2021-01-30 02:57

    I agree that PHP definitely could do with some improvement, right now it allows for too much fooling around.

    Some things I'd like to see

    • Static Typing
    • Required indentation
    • Proper use of objects (using arrays as objects is just stupid)

    Then again, maybe I should just drop PHP and start working with Ruby or Python.

    0 讨论(0)
  • 2021-01-30 03:03

    Heh, great idea. My thoughts, some contradictory...

    There are precedents for civilizing bad languages by putting syntax preprocessors in front of them.

    • In the early days of Unix, Fortran was popular and about the only portable language because most machines had no C compiler. But the vanilla Fortran of the day didn't even have block structured if-then-else, just a goofy single-statement if or an if-goto. So, the Ratfor language was implemented as a preprocessor for Fortran-66.
    • I believe there were (are?) Cobol preprocessors that presumably dealt with the verbosity and limitations of early Cobol dialects.
    • To this day Unix-derived systems ship with a macro processor called m4.
    • Several CSS preprocessors are available today, most notably Sass and LESS.

    But...

    • Just let it die, and the sooner the better
    • The problem isn't really in the syntax.
    • I don't see much of a JavaScript-PHP parallel. JavaScript is a great language. It's kind of the opposite of PHP.
    • I'm not sure why you say that PHP is a great language. It's one of the worst. Every decent feature is a patch or repatch in a recent version.
    • As you noted, there is a fixed-up version of PHP already: it's called Ruby and, as a language, it's near-perfect. There is another fixed-up version called Python. The world would be better off in the long run if we support the better systems.
    0 讨论(0)
  • 2021-01-30 03:05

    The reason CoffeScript is a good idea is that if developers want to run code in a client browser they have to use javascript; so the only way to program in a different language is to allow that language to be convertible to javascript.

    I'm not sure the same really applies to server side programming. If you've got issues with PHP and want to use a new language there is no real advantage to having that language generate PHP.

    On the other hand, a language that was very similar to PHP, but fixed some of the flaws would be a great idea.

    0 讨论(0)
  • 2021-01-30 03:07

    The more I am thinking about this, the more irrealistic it sounds. The reason is simple: There actually are such language proprocessors already. Two of them (though not using PHP as implementation, only as compilation target) can be found here. But simply nobody uses them.

    Yes, if the compiler itself were written in PHP, probably more people would use it. But I really can't see a way how to get this popular enough to be worth the work.

    Another big problem is, that people mostly are used to their awesome code-highlighting, code-completing, code-inspecting IDE. Without getting IDE support probably merely anybody will use it (and IDE support can only be obtained by having many people use it...)

    Thoughts?

    0 讨论(0)
  • 2021-01-30 03:08

    Very interesting idea and if it come to life i think that i wan't to be involved in :)

    For start You may check and read this position http://www.amazon.com/Masterminds-Programming-Conversations-Creators-Languages/dp/0596515170 (iam reading it now). It makes clear how really complicated is to maintain own language.

    0 讨论(0)
提交回复
热议问题