"PHP as fast as C" - People who are in php language development may die laughing reading this statement. Truth can be harsh, but people sometime overvalue to such an extent is hard to understand.
So there's nothing really funny about it....
41–50 of 66 posts
"PHP as fast as C" - People who are in php language development may die laughing reading this statement. Truth can be harsh, but people sometime overvalue to such an extent is hard to understand.
So there's nothing really funny about it....
Earlier quoted context omitted.
This is not what people write in Python or PHP, but this is what people write in C extensions for Python or PHP. Having your JIT be that fast allows you to forego those extensions and write the low-level hot loops in the same language, and that's a huge improvement. You usually don't care how your matrix multiplication/regex matching/unicode normalization/JSON parsing is implemented, but people had to make those, and…
Well, the problem is that Python and PHP are actually bad languages for expressing code like that. For expressing C. For one, they're not statically typed. Julia is a dynamic language that seems to do better because it was designed for this purpose. But it doesn't seem to have panned out in practice in Python, or PHP as far as I know. Those languages have huge piles of C, and whenever you call into C, the JIT gets co…
Well, C hardly is, either...
Earlier quoted context omitted.
The Psyco project (now dead) used to get very reasonable speedups (factors of several) in pure Python code, particularly for numeric algorithms. It was retired because PyPy was being developed and was expected to solve all speed problems. I wonder why this approach worked while other python JITs did not.
C is frequently 100x faster than Python for code like the example I showed. With autovectorization and other optimizations it can be 500x. So if a Python JIT does 10-50x better than CPython on a numeric workload, that sounds impressive, but it's still slow compared to C. And again they don't get 10-50x on string/hash/method call workloads. I think they're lucky to get 2x in some of those cases.
Tiny nitpick: the article describes JavaScript as an interpreted language without JIT when most major JS engines do have JIT optimisation. It’s difficult to make this call about any language with more than one implementation. But anyway, kudos to the PHP folks for yet another improvement. It’s been a long time since I used it but I’m continually impressed by how far it’s come. And it’s a useful test to how flexible a…
The whole idea of "language X is interpreted/compiled" is a simplification I wish people were more careful with. Cpython is interpreted, pypy has JIT, mypyc is compiled. It's the implementation, or even implementation's specific runtime options that decide about things like that, not the language.
Earlier quoted context omitted.
The whole idea of "language X is interpreted/compiled" is a simplification I wish people were more careful with. Cpython is interpreted, pypy has JIT, mypyc is compiled. It's the implementation, or even implementation's specific runtime options that decide about things like that, not the language.
The statement would be far more accurate as "language X is [almost always/sometimes/often/commonly/etc.] interpreted/compiled". Unfortunately a lot of people seem to like speaking in absolutes. C can be interpreted too: https://en.wikipedia.org/wiki/CINT
People like speaking in the general case. It saves time from enumeating any inconsequential / statistically not relevant exception.
The real problem is people misunderstanding casual discussion absolutes (which mean "for the large majority/for the ones people care about") with mathematical absolutes (i.e. "X is Y for each and every X")
Earlier quoted context omitted.
Do we know anyone outside of Facebook uses Hack/HHVM in production?
Wikipedia runs on HHVM IIRC. https://hhvm.com/blog/7205/wikipedia-on-hhvm
- https://phabricator.wikimedia.org/T176370
- https://phabricator.wikimedia.org/T229792
- https://launchdarkly.com/blog/how-the-wikimedia-foundation-s...
May be everyone on HN has Adblock/ PiHole on. But this Blog, a single page has 5 Google Ads in it. I dont mind one or two, top and bottom. But 5, right in the middle of every section.
Blogs like these are the main reason to use ad blocks. And from their perspective: everyone using adblocks is the reason they need 5 ads on the site
But if you believe the amount is so harmful for your experience, don't worry. I'll be more than glad to reduce this amount.
Cheers!
Cheers!
Unless we are speaking about Java before Java 1.2, it is definitely not interpreted, there are plenty of JIT and AOT implementations without any kind of interpretation step. Since 25 years, time to learn that implementations and languages are not the same.
This article is actually now quite out of date as PHP has switched to a tracing JIT which appears to be heavily based on LuaJIT. https://github.com/php/php-src/pull/5874 https://github.com/php/php-src/commit/4bf2d09edeb14467ba7955...
AFAIK tracing JITs are generally inferior to method-based ones, which is why none of the major JavaScript engines use tracing. Their only advantage seems to be (relative) simplicity, which is essential for the lightweight LuaJIT but not for PHP.