PHP之上的新语言? [英] New language on top of PHP?

查看:53
本文介绍了PHP之上的新语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是PHP开发人员.我喜欢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.

它使我想起JavaScript的好坏.一个特定的项目,CoffeeScript,试图只专注于好的部分,迫使您编写好的代码.

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.

我在想,是否可以使用PHP来完成类似的工作……一种新的语法只能编译为优质的PHP代码,以充分利用PHP 5.3带来的所有新颖有趣的内容.

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.

因此,要领先一些人,我会问:如果您只能使用Ruby或Python或其他东西,为什么要在PHP之上创建新语言?

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易于部署到任何地方
  • 语言本身具有很多好的功能和思想
  • 有很多用PHP编写的优秀库
  • ...

所以,我真正的问题是...

So, my real questions here are...

  • 这是一个愚蠢的主意吗?为什么会这样呢?您认为CoffeeScript是愚蠢的吗?
  • 某人如何开始在另一种语言之上创建新的语言?我对此一无所知,但我想学习.从哪里开始?

推荐答案

这个想法绝对不是愚蠢的,尤其是如果执行得当.

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

我非常喜欢coffeescript,但是它的方法也有缺点.调试coffeescript脚本仍然需要您阅读生成的Javascript代码,这可能很乏味,因为您实际上并不是自己编写的.

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.

我了解到,coffescript的创建者杰里米·阿什肯纳斯(Jeremy Ashkenas)在阅读创建自己的令人毛骨悚然的编程语言",作者是Marc-AndréCournoyer .

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.

祝你好运!

这篇关于PHP之上的新语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆