5 ms·
Hi guys, I'm the author of PHP.reboot and also one of the guys that worked on JSR 292 (invokedynamic in Java). First, I don't know based2 and please don't be to
by remi_forax 15y ago
Hi guys,
I'm the author of PHP.reboot and also one of the guys that worked on JSR 292 (invokedynamic in Java).
First, I don't know based2 and please don't be too serious, PHP.reboot was written as a small prototype to see what can be done on top of invokedynamic. It was also used to debug the hotspot implementation of JSR 292.
The language is tailored unlike any dynamic languages. Instead of adding features and wondering how to optimize them after, I have worked backward and carefully pick/design features only if I was able to optimize it to be at least as fast as Java.
The hidden jewel of PHP.reboot is its runtime which first interpret the script and then use a type inference/type checker algorithm to try to emit exactly the same bytecode as javac.
So some parts of the language are quite fast, but not the whole language because some parts still run in interpreted mode only.
As a demo, I've taken the mandelbrot benchmark from the Computer Language benchmark[1] and write it in PHP.reboot
(I hope with no mistake). Here is the result on my laptop:
[forax@localhost phpreboot]$ time bin/phpr.sh test/mandelbrot.phpr >/dev/null
real 0m34.189s
user 0m34.087s
sys 0m0.088s
You can compare with your favourite dynamic language :)
cheers,
Rémi
[1] http://shootout.alioth.debian.org/u64/performance.php?test=mandelbrot http://shootout.alioth.debian.org/u64/performance.php?test=m...
- catch23 15y agoIt's cool to do it as a prototype language, but I doubt someone would make use of it over php. Until someone ports drupal or wordpress to "the next php language", php in the current form probably isn't going anywhere.
- jerf 15y agoIf you're serious about this moving forward, I very strongly suggest renaming it. PHP.reboot is a very hostile, aggressive name that is clearly trying to steal thunder. Call it a reboot of PHP informally, playfully base the name off of PHP somehow, but don't outright call your language "PHP.something that Google won't correctly parse as part of the same word so the search will still pull up nothing but PHP results". In addition to the hostile nature of the name, being effectively Google-blacklisted isn't a great way to start. Also, admittedly off of just a glance, beware the specialized syntax sinkhole. Can I easily take two XML snippets and compose them together somehow? Can I easily take two SQL snippets and compose them together? A lot of times these specialized syntaxes make for cute-looking demos but in practice work out worse than just using language constructs because they are so highly specialized you can't do anything with them but exactly the one use case the author had in mind. I'd submit there's a reason that basically no large-scale successful language has this sort of specialized syntax built into it, and you may want to ponder on those reasons until you understand them. It isn't because it's hard to write the grammar or anything implementation-related like that. (And I'm not saying don't do it. Personally, I think it's a solvable problem. Look to LINQ for what is probably the closest to date. I'm suggesting you try to spend some time understanding why the obvious solutions haven't worked before you go too far down what can be a language-killing rathole.)
- remi_forax 15y agoHere is why I've chosen the name the language PHP.reboot. My father ask me to patch one of the page of his website written in PHP so I've written one page of PHP. 3 days later, my younger brother (not 18 years old at that time) call me and ask me to never touch a PHP page again because I had introduced 3 security holes. It was a painful day for me, I have a Phd in Computer Science, I study computer languages, compilers and runtimes but I'm not able to write a correct PHP script. That's why I think I own the right to call this language PHP.reboot. Rémi
- stephenr 15y agoThat's the worse reason I've ever heard of to create a new language. If I was asked write ruby or .net or java it probably wouldnt be great code either. That doesn't mean they're language issues, that means I don't know those languages, plain and simple. Php reboot has less to do with php being broken and more to do with your ego refusing to accept that you're not the worlds nest programmer.
- jigs_up 15y agoAnd thank god for that, birds would be falling out of trees all over the place!
- remi_forax 15y agoNo, unlike PHP, PHP.reboot is secure by default. That's why PHP.reboot use DSLs, because it enables the runtime to know the context thus sanitize the inputs by itself. Rémi
- stephenr 15y agoApologies for the typos - I posted from a phone. As for "Secure by default". PHP can be perfectly secure. PDO supports parameterised queries, and was first available in PHP 5.1, which shipped just short of SIX YEARS AGO. Even mysqli supports parameterised queries, and that shipped more than SEVEN YEARS AGO. If you're using the ancient mysql extension (i.e. the mysql* functions) that is YOUR FAULT, not the fault of the language.