PHP 5 Released; PHP Compiler, Too
TheTomcat writes "After years of anticipation, PHP 5 was released today. This release represents a milestone in the evolution of PHP. It sports the new Zend Engine II, a completely re-worked object model, and many many new features. Check it and the changelog out."
In other PHP news, remote_bob writes "There have been many attempts, like
BinaryPHP
and PASM,
but finally there is a complete
compiler
for PHP. The Roadsend compiler produces standalone, native executables, and supports the entire PHP language (but not all extensions). It uses
Bigloo Scheme
to do its job, a variant of Lisp, the language that
Paul Graham writes about.
Benchmarks say that performance is pretty good. Is this another sign that dynamic languages are the future?"
Am I the only one who is troubled by the blend of proprietary and 'open' systems surrounding PHP? I mean a proprietary system, Zend, powers PHP, plus to get best performance I'm suppose to license another proprietary system? I am a big advocate of Free Software and feel uncomfortable using PHP even though it is a great tool because of the strange mixture of proprietary and open development. Maybe it's just me.
Even if I knew that tomorrow the world would go to pieces, I would still plant my apple tree. -Martin Luther
I was talking about mass adoption to PHP executables, not a website, nor anything about a dying OS from the overpriced Microsoft of the UNIX world.
I can't believe this has a 5 rating; it's obviously just an advertizement for Ruby. Before I begin rebutting what the Anonymous Coward wrote, line by line, I'd like to say that I'm *not* a Pythonista, my favorite language is Kogut, or Scheme for real development.
"Ruby is basically a superset of Python and Perl."
I have no idea where that statement came from. Ruby is a completely different paradigm than Python or Perl, with completely different syntax.
"'len(str)' instead of 'str.len()'"
For historical reasons, really, but it can still be overloaded with the __len__ method.
"'[f for f in n if f 4]' instead of something like 'n.each { |f| f4 }'"
You find the Python way less readable? It only has one more character, and I'm not sure they actually do the same thing. Either the Python version should be changed to
[f4 for f in n]
or the Ruby version should be changed to
n.select { |f| f4}
or something like that. Either way, now the Python version has fewer characters. I can read both of them easily. I prefer the Ruby approach slightly, because it's more flexible, but you can't say the Python way looks bad.
"If you ever programmed Perl..."
Well, I can't really defend Perl, but I don't see why you're doing UNIVERSAL:: when you'd usually just import that and have the line be
isa $val, "FooClass"
which fits fairly well into the Perl syntax. Besides, when Perl6 comes out in 2025, they should have a real object model.
"If you like adding your own methods to base types"
I have to admit, this is a major shortcomming of Python, but you can do this in Perl5 if you're using multimethods and also in Perl6 whether or not you're using them. Also, most functional languages can do this too, and have the functions be scoped in a module.
"If you like distributed programming you'll get a kick out of DRb"
I'm supposed to choose a language because there's this one library that it has? Is there something in Ruby that makes it the only language capable of wielding the awesome power of DRb?
"Do you need extended your languages with external C libraries? You will positively, absolutely shit yourself three times when you try out Ruby/DL, which lets you extend Ruby with arbitrary C libraries at run time without any compiling or setup."
Using C without compiling? What the hell?
For making it easier to use C, nothing beats being able to freely embed C code and be able to compile programs the same way you always do.
"If you wonder why Java takes 3-5 lines of code just to parse an XML file or set up a loop you will find Ruby quite a change. And REXML is the most lightweight easy to use XML parser I've ever used (PHP5's new parser comes *close*.. but PHP is not Ruby)."
And REXML, like DRb, is so powerful that no other language can do anything like it? Have you compared REXML in Ruby with SXML in Scheme? It's really easy with SXML.
"If you like writing code FAST without worrying about heavy syntax or arbitrary design choices, you'll like Ruby."
What are you talking about? Syntax is completely a personal preference issue, and not everybody likes Ruby syntax the best. I personally like sexprs and Kogut syntax (which is kinda like a cross between C and ML), even though you would probably say they're really ugly. Design decisions are rarely arbitrary, and if you would name one, then I'll refute it. Everything has a reason.
"If you like passing anonymous code blocks to your functions like SmallTalk, you'll get a kick out of Ruby"
I have to agree with you here, except it's really annoying how in order to make a block that can be stored in a variable, you have to write lambda, and then to use it you have to prefix it with an ampersand. The functional way of just sending an ordinary function as an argument (and making convienent syntax for that) is much better, IMHO
"If you are into agile programming and merciless refactoring, you'll like Ruby"
I'm not really into meaningless buzzwords like "agile programming", and I don't se