TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Reboot PHP: keep the philosophy, improve the syntax (PHP on the JVM)

71 点作者 cemerick大约 15 年前

16 条评论

grumpycanuck大约 15 年前
As a long-time PHP developer (12+ years, yuck it up PHP haters) I look at this with a combination of awe and disappointment. Awe that someone would be willing to take on implementing a version of PHP that can run on the JVM much like Quercus. Disappointment because what they are doing is not PHP.<p>If the goal is to recreate the "let's build a better runtime" situation that exists in Ruby but in the PHP world, that is admirable. But if you really want the project to get any sort of traction, creating almost-PHP isn't the way to go.<p>If you can't run your existing PHP code in this thing, then what's the point?
评论 #1308760 未加载
评论 #1308904 未加载
评论 #1308238 未加载
评论 #1308230 未加载
评论 #1308684 未加载
评论 #1309338 未加载
WilliamLP大约 15 年前
I think this shows a remarkable misunderstanding of what PHP users actually like about PHP:<p>* We like semicolons. The culture who thinks saving this one character is valuable tends toward a non-pragmatic purity that is completely missing the point of PHP. We like to know when the line ends and to break up lines easily.<p>* The $ before all variables is a feature, we like this too. It's jarring coming from other languages but we think it adds readability.<p>* Inline SQL with no special syntax to denote that it is special? This seems way too far off the deep end of preventing an extra character at all costs. Give me a key word or a syntax if you like but don't make it look just like a variable, please.<p>* No from/to string auto-conversion. We like this too. Having the sense to not overload "+" for strings goes a long way here.<p>1 . 1 == "1" . 1 == "1" . "1" == 11 == "11"<p>1 + 1 == "1" + 1 == "1" + "1" == 2 == "2"<p>Yes there are warts and some paradoxes but we deal with it, and we have to be very conscious of what data could be provided by users, but our web apps work fine provided we know the language. (Yes, there are very many PHP programmers who don't.)
评论 #1308498 未加载
评论 #1309293 未加载
评论 #1309360 未加载
评论 #1309754 未加载
评论 #1308915 未加载
thasmin大约 15 年前
I don't think this project is properly leveraging PHP's advantages. PHP code's ability to be run on almost any server with Apache is a big plus, but this project requires a JVM. It's different enough from PHP that the plethora of PHP programmers will need to learn a new language, which is another hurdle. It's not backwards compatible so existing PHP code will need to be rewritten. In fact, it looks very different from PHP except for the intended use of the PHP library, which is one of PHP's weakest points.<p>The project has a lot of great ideas but I don't think branding it as a PHP derivative is one of them.
DrSprout大约 15 年前
&#62;This is a reboot of PHP, like the reboot of Star Trek.<p>So it's going to be a cotton-candy superficial take on a language with a deep and active user base that basically ends up making it no different from every other language of the month that people promptly forget about?
评论 #1308615 未加载
code_duck大约 15 年前
Wait, less ';'?<p>The semicolons are only optional in JavaScript if you are okay with being incompetent. Or, well, slowing down your programs a bit and risking errors through ambiguity.<p>The JSON style syntax is nice, PHP really needs that. I'd be pleased to never see or type =&#62; ever again.<p>I have no idea what to think about the rest. Inline SQL? Isn't some heinous mixture of PHP, SQL, JavaScript and XML all in the same file something that normal people would seek to avoid?
RossM大约 15 年前
It's definitely interesting, but I think they should develop this as a separate language - specialised for the web. Inline HTML, JSON and SQL look excellent but to me this should be developed as a "new" language, so it is not bound by restrictions of trying to look like PHP.
评论 #1308237 未加载
tszming大约 15 年前
&#62;&#62; less ';' like in javascript<p>You should read the book by Douglas Crockford - JavaScript: The Good Parts, p102 (Appendix A: Awful Parts), this is not fun.
评论 #1308711 未加载
benwerd大约 15 年前
Whoa. I admire the chutzpah, and I definitely think aspects of PHP could use a Star Trek style reboot (albeit with less lens flare), but I also think the proposed syntax here actually makes PHP less clear.<p>My specific issues: As others have commented, fewer semicolons equals potential ambiguity. I'm totally not okay with the inline XML or SQL syntax presented here - clearly demarcated, storage-agnostic code makes me sleep soundly at night. That said, the duck typing and inline JSON structures are neat.
rbanffy大约 15 年前
I don't really like the SQL integration. I would prefer an object layer on top of it.<p>Making assumptions about an underlying database is a sure way to get burned when you switch to another. And assuming SQL to be the "official" persistence engine makes it hard to migrate to non-relational platforms in case you want to.
评论 #1308661 未加载
invisible大约 15 年前
It seems more like JavaScript changing more towards PHP than anything else. If that is the goal, then perhaps nodeJS is the solution.<p>I've been considering using nodeJS for more and more logic as time progresses, but truthfully PHP works 99.9% of the time.
Judson大约 15 年前
I like my ';' - Even in javascript
jrockway大约 15 年前
If you really want inline XML and SQL, why not have some sort of quoting operator so that this is actually possible to implement sanely?<p>Programming languages designed by PHP programmers... the goggles do nothing.
misuba大约 15 年前
Awesome. If it had first-class functions I'd be downloading it now.
评论 #1309262 未加载
michaelbuckbee大约 15 年前
I'd be curious to hear how PHP devs would contrast this with something like HipHop from Facebook (which requires a specific coding style and some restriction of PHP features).
评论 #1309267 未加载
catalinist大约 15 年前
I wonder if google will ever include PHP into Google App Engine ..
评论 #1308242 未加载
评论 #1309386 未加载
balding_n_tired大约 15 年前
why?
评论 #1308049 未加载
评论 #1308030 未加载