Experimental MacRuby Branch Is 3x Faster
An anonymous reader writes "Zen and the Art of Programming published an article about MacRuby's new experimental 0.5 branch (project blog entry here). According to the included benchmarks, Apple's version of Ruby could already, at this early stage of its development, be about three times as fast as the fastest Ruby implementation available elsewhere."
I heard it made a guy in Michigan's head explode! That's why I stay away from the experimental stuff, man.
My wife's 17" macbook is now my dev machine! She can surf on my old XP box that takes a half hour to boot. All I have to do now is learn Ruby.
Why MacRuby Matters (Present & Future)?
Apparently because an experimental incomplete version of Ruby is fast. Colour me unimpressed.
Of course, Slashdot is a dime short and days late on the real news.
JavaScript 3-10x Faster On iPhone OS 3.0
Well, for a better, no BS news aggregator, try The Hacker News. Then after seeing it there for a few days, come to slashdot to see a regurgitated discussion.
This is great news. The work that Apple's doing on LLVM is a renaissance in compilers.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
Was the best movie of all time.
Your sig is pure evil. Nicely done!
All your base are belong to Wii.
One question. WHY?!?
"LLVM supports effective optimization at compile time, link-time (particularly interprocedural), run-time"
Amazing, truly unique ideas. If only someone had thought of doing this 30 years ago... oh wait...
What is 3x faster than super uber ultra slow? Is ruby now just plain slow instead?
Those new code contributions by Mr Aznable made all the difference.
What's so special about this implementation? It runs on an intel x86 running a modified bsd kernel. I suppose that this was spiked with a healthy dose of reality distortion field, (remember how RISC processors were X times faster than chips that fell prey to the dreaded "megahertz myth") right up until they switched, and the new systems were 4-6x faster than the old ones?
I wonder if this has any connection to what they learned creating the optimized javascript "interpreter" they made for their next generation rendering engine Webkit.
--------
* Sigh *
Common Lisp is ultra-dynamic and whatnot and still compiles to machine code, which in some implementations (SBCL/CMUCL) is quite respectable in performance. Is there something inherently less-compilable about Python, Ruby, Perl, etc., or have they just not had the same engineering work put into them?
10 PRINT CHR$(205.5+RND(1)); : GOTO 10
Sleep(30); /* used to be 90 */
Experts predict Computers to get faster with time! News at eleven.
The Long Now Foundation
But I'm a heterosexual so I will not be able to take advantage.
Because they don't want to expose high level intermediary code (too easy to hijack part of the compiler into a closed source project). Or at least that was one of the reasons LLVM was rejected for next generation GCC at the time.
They might have changed their mind now LLVM is bearing down on them ...
There are certainly places where I'd like my code to be faster, but they are very, very small places. I can easily code them in C if I have to (C/Ruby bindings are *very* easy to write).
Until you try to execute your code on someone else's computer, and your Ruby code works but the C code fails to start because unlike the Ruby interpreter, your code hasn't been digitally signed by the platform maintainer. This is already the case for JavaScript: Windows allows parts of a JScript program to be coded in C as "ActiveX" objects, but they have to be signed with a valid Authenticode certificate issued by a trusted CA first.
They don't have any particular antipathy to the GPL ... Chriss Lattner proposed LLVM as a GCC successor after starting work at Apple. The FSF kicked him to the curb. I don't know if they underestimated his and Apple's commitment into turning the compiler into a true competitor or if they are simply stupid.
As LLVM gets better GCC will lose developers, this is unavoidable, it's EGCS all over again ... but this time a merge doesn't seem on the cards. It wasn't LLVM but the FSF themselves who torpedoed one of the GPL flagships ... and for very very poor reasons.
What is different is that it uses the Foundation library for the underlying implementation. i.e. a Ruby array maps to a NSArray, a Ruby string maps to a NSString, etc.
Would a Linux port be possible using GNUstep, the Free implementation of the same API that Cocoa is based on?
...line. It is disorienting for the people that don't always read the subject line (almost everybody). And capitalizing the first word of the body text when the word takes place in the middle of the sentence doesn't help, either.
Scheme is "ultra-dynamic and whatnot", but it is an interpreted language.
Clisp has dynamic scoping, which is an unrelated concept, but as far as I know it does not have ruby/python/javascript style runtime dynamic typing... I think you may be confusing the issue.
Objective-c is a better example of a compiled language that supports dynamic types... that's why ruby and python plug into the Cocoa libraries so well.
Common Lisp is every bit as dynamic as Scheme, and yes it has fully dynamic runtime typing. It also has optional declarations, but you need not use them, and idiomatic Lisp style doesn't, except when attempting to optimize performance-critical code. Indeed Common Lisp is so dynamic that function calls can't even be resolved at compile time, because functions can redefine other functions (or themselves) at runtime.
Scheme is also not generally interpreted; there are both compilers and interpreters available.
10 PRINT CHR$(205.5+RND(1)); : GOTO 10
Apple should be enormously grateful to the LLVM project.
So should everyone else who's been living through the dark ages of GCC. The main effect of GCC for the last 20 years has been to suck all of the air out of the room for anyone else who wanted to develop compilers.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
So, GCC is making what should be technical decisions on a political basis?
Good to know. That's one more reason to be glad when GCC fades away.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
Given that the entire reason for the existence of gcc is political, your surprise at the reason for its design decisions merely highlights your ignorance. Now go play in your closed source world and leave the grownups alone.
... for them to get further along in completing it... it'll slow down.
Who cares? Ruby should just die.
The main effect of GCC for the last 20 years has been to suck all of the air out of the room for anyone else who wanted to develop compilers.
That is one of the most retarded statements I've ever read.
languages (?!) are getting faster and faster, because of more memory and faster processors ? right ? :)
Apple should be enormously grateful to the LLVM project.
So should everyone else who's been living through the dark ages of GCC. The main effect of GCC for the last 20 years has been to suck all of the air out of the room for anyone else who wanted to develop compilers.
-jcr
I'd say the one effect GCC has had over the last 20 years is to allow Apple to survive.
No way Apple could've shipped a decent, cross platform compiler without GCC's existence. No way could Apple have had their skunkworks intel project without GCC's existence. iPod compiling? OS X on arm? All with a compiler you can customise & redistribute to your heart's content.
You should thank RMS. If you've got Apple stock, you owe him a debt of gratitude.
So, GCC is making what should be technical decisions on a political basis?
GCC is making decisions to protect their intellectual property.
You're statement is like saying:
Apple aren't releasing source to the iPhone? That's making a technical decision on a political basis!!!!1!
So, GCC is making what should be technical decisions on a political basis?
GCC is making decisions to protect their intellectual property.
So now suddenly there is such a thing as IP?
Lars T.
To the guy who modded me down from perfect to terrible Karma - Apple haters still suck
s/IP/copyright/
You may not want to believe it, but when GCC came out there was a pretty healthy competition going with plenty of vendors offering C compilers, and driving each other to improve their products. RMS decided to put them out of business, and the upshot was that commercial compiler development came to a screeching halt, with a few exceptions like IBM and Motorola working on their optimizers. There were a few scattered academic projects going on, but GCC wiped out everyone in the compiler business besides microsoft and metrowerks.
Fortunately, one of those academic projects came to Apple's attention, and it's about to bring the dark ages to an end.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
Now go play in your closed source world and leave the grownups alone
Grownups need to make a living, sunshine. Very few people can get a MacArthur grant and extend their adolescence indefinitely.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
Apple aren't releasing source to the iPhone? That's making a technical decision on a political basis!!!!1!
You're not clear on the difference between a technical and a political decision.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
I'd say the one effect GCC has had over the last 20 years is to allow Apple to survive.
I'd say that's quite a stretch. Apple used GCC because there were few alternatives. GCC sharply reduced the number of alternatives. See how that works?
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
wait... is there someone who actually understands economics on ./? Someone who understands that hundreds/thousands of hours of work on software is actually worth... GASP!... Money!?
Someone who understands that maybe... just maybe... giving away the code that you spent a lot of money/time/effort on does not make sense?
There is good reason I own the gplisshitty.com domain...
The main effect of GCC for the last 20 years has been to suck all of the air out of the room for anyone else who wanted to develop compilers.
That is one of the most retarded statements I've ever read.
No. What the poster said is true. Also unfair, because GCC is a very useful tool, but it still had a bad influence as well. GCC is extremely useful and produces decent code as well, but it has effectively stifled a lot of C/C++ compiler research. And it seems to become slower with each release. I have a lot of code that was faster with 2.95 than with any 3.x release, and with 4.x it is even slower.
Now, LLVM is still a mixed bag, sometimes code is much faster, sometimes a bit slower, and does not compile everything I throw at it, but it is impressive technology. It has a more modern infrastructure, and finally allows things like compiling to bytecode and dynamic run-time optimisation with C. It may even allow for CPU-independent operating systems in the future, where you have LLVM bytecode in the binaries that will run like natively-compiled code once loaded.
I compiled some C programs _to_ LLVM bytecode and then ran them on my mac.
Their performance was comparable, oftentimes better, than that of the same programs compiled with a recent GCC. And I can still add inline assembler, which then is used only on the right architecture, if I provide C alternatives.
Think about this. This has the potential of *finally* freeing us from dependence on a CPU ISA. It may be an Apple-sponsored project, but we all should be grateful to them that they are actually pushing it.
Roberto
You may not want to believe it, but when GCC came out there was a pretty healthy competition going with plenty of vendors offering C compilers,
You may not be aware of it, but when Ford started making the model T, there was a petty healthy competition going with plenty of vendors offering buggy's.
The main effect of the automobile for the next 20 years has been to suck all of the air out of the room for anyone who wanted to develop buggies.
(Isn't that a stupid statement?)
not clear on the difference between a technical and a political decision.
What's the technical reason that the iPhone source code isn't published?
So I take it you never heard of Intel C++ compiler, Microsoft's Visual C++ compiler, Comeau C/C++, Digital Mars C++, Open64, etc... They must be figments or our collective imagination.
Slashdot, fix your code or at least hire someone who is competent at it to do it for you.
I'm not sure if you were flaming OSS there, but you do realise that Apple owes a great deal to OSS and that much of what is OSX would be next to impossible without it, given that the BSD part of OSX is, in fact, OSS.
You are not clear on the difference either, are you. Whether the source code of a piece of software, any software, should be opened or not is entirely a political *decision*. How a compiler should work internally is a technical *decision*. You don't need technical reasons to make a political decision and you shouldn't consider political reasons when making a technical decision.
What are you talking about? This is about server-side software, not executable applets in clients' browsers.
No, they're not.
Are you honestly claiming that a voluntary project and a voluntary userbase "killed" a commercial market? Do you realize how ridiculous that sounds?
Again (if you didn't get it) -- the entire process was 100% voluntary. There were no patents involved, no lawsuits, no wrongdoing at all. Just pure voluntary effort. If you don't like this, then you and the rest of the industry have every chance and every right to try to change it.
So what are you waiting for? If you or another company has something better to offer, then we'd love to see it. If we deicide that your improvements aren't worth the cost, then so be it. Good luck!
Enough said.
I thought Ruby was gay too?
Mod parent funny! The flip side of this coin is that gcc has placed certain shackles on what's possible for Apple and others to do. LLVM is about to break those chains.
I, for one, welcome our new really-truly-freely-licensed-compiler-(not-kinda-sorta-free-as-in-gcc) overlords.
If you mod me down, I shall become more powerful than you could possibly imagine.
I took him to mean that competition breeds improvements, whether they're made via volunteer development or not.
One thing I didn't like about the post was the statement that it was GCC that wiped everybody out, as at least some vendors (e.g. Borland) were wiped out by MS. Several other vendors had their compilers stagnate due to the fact that their OS lost a lot of marketshare.
This is about server-side software, not executable applets in clients' browsers.
Eventually, your server-side software may have to communicate with an executable applet in clients' browsers. Without code signing, this applet can be written only in JavaScript (AJAX), ActionScript (Flex SDK), C# or another CLR language (Silverlight 2), or Java or another JVM language (Java applet viewer).
This is about server-side software
Another thing I forgot to mention: Web hosts may restrict what kinds of server-side software may run. For example, a web host may forbid customers not on a dedicated or virtual dedicated server plan from running uploaded EXE files but allow code written for JSP, ASP.NET, Ruby, or one of the P languages.
Only a small minority of GCC has been contributed by volunteers. The rest has been developed by people getting paid for it or academic researchers.
No. Back when gcc was created, there were plenty of compilers - but there was also a proliferation of platforms and architectures, most of which had their own from-scratch vendor compiler that sucked. The reason gcc caught on was partly that it was a sort of baseline for compiler quality - vendor compilers that were worse than gcc could be replaced by it, so that a semi-decent compiler was available everywhere.
So now suddenly there is such a thing as IP?
Slashdot comments (with the exception of yourself) are from a single hive-mind, so finding a contradiction between what an AC said today & yesterday is exactly the same as a real person contradicting themselves!!!!1!
Well done - give yourself a pat on the back. This 'Anonymous Coward' character has been allowed to get away with contradicting themselves for far too long.
(You fucking retard).
Apple used GCC because there were few alternatives.
So, basically you're angry at GCC for providing a compiler free of charge that Apple could make money from?
Gosh, if only GCC hadn't existed - Apple would've been able to license a PPC/intel compiler for plenty of money & divert engineers from other projects to customise it.
Damn you GCC! *shakes fist*
So, basically you're angry at GCC for providing a compiler free of charge that Apple could make money from?
Project much? I'm not angry about the effects of GCC on the compiler business, I just pointed out what it's effects were.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
Well, you said the main effect of a freely distributable cross platform compiler was its effect on the competition.
Consider the enormous benefits GCC had on hardware manufacturers (like Apple), it's pretty obvious that you've got some anger issues towards the GCC guys.
Little bit sad really - biting the hand that feeds you & all.
it's pretty obvious that you've got some anger issues towards the GCC guys.
I already told you I didn't. Why do you insist that I do?
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
You're anger is clearly unconscious - a little sad that you don't realise yourself - but it's a fairly common affliction.
You're anger is clearly unconscious
Guess again, armchair shrink.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
Your anger at the FSF clearly shows, yet you say you're not angry - the possibilities are:
1) You're lying.
2) Your anger is subconscious.
You forgot 3) you're wrong.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
"You may not be aware of it, but when Ford started making the model T, there was a petty healthy competition going with plenty of vendors offering buggy's."
Yes, it is a stupid statement. Ford didn't invent the automobile, dummy. There *were* a lot of automobile manufacturers before the model T. They were, however, much more expensive, being luxury products. There were even electric cars.
The speed improvements in the MacRuby experimental branch come from using LLVM to generate code and from using the ObjC Runtime (for method dispatch and garbage collection) rather than a homebrew Ruby runtime like the other interpreters.
Squirrelfish does not use LLVM. I imagine using LLVM for JIT compilation of javascript would have to much overhead, and could be more difficult to integrate into the brower DOM interface.