News for hackers. Stuff that matters.
Re:Are Google employees being discouraged from using Python ... by Tichy on Tuesday November 10, 2009 @01:30PM (#933611)
"I don't think it's possible to make an implementation like CPython as fast as an engine like V8 or SquirrelFish Extreme that was designed to be fast above all else."

Are they saying that JavaScript is already faster than Python? I've only recently started using some Python, and while it seems to be a decent language, I have not yet seen much that would make me prefer it over JavaScript. Some things are a bit smoother in Python, others are smoother in JS. Here's hoping that JavaScript will win :-)

Re:Are Google employees being discouraged from using Python ... by rbranson on Tuesday November 10, 2009 @02:47PM (#933788)
V8 is very impressive. It is one of the fastest virtual machines for dynamic languages. Look where it scores on the shootout.

http://shootout.alioth.debian.org/u32/benchmark.php?test=all...

It is nearly 10x faster than Ruby 1.8 and 5x faster than CPython. Of the shootout, it is the fastest dynamically typed language other than LuaJIT.

Re:Are Google employees being discouraged from using Python ... by igouy on Tuesday November 10, 2009 @10:06PM (#934504)
> the fastest dynamically typed language other than

You could select just those languages...

http://shootout.alioth.debian.org/u32/benchmark.php?test=all...

Re:Are Google employees being discouraged from using Python ... by swolchok on Tuesday November 10, 2009 @03:49PM (#933909)
That surprises me. Doesn't LuaJIT simply spit out subroutine-threaded code?
Re:Are Google employees being discouraged from using Python ... by whye on Tuesday November 10, 2009 @04:03PM (#933934)
No. It is much, much more sophisticated than that. See this message by Mike Pall, LuaJIT's author for the details:

http://article.gmane.org/gmane.comp.lang.lua.general/58908

Re:Are Google employees being discouraged from using Python ... by Tichy on Wednesday November 11, 2009 @08:07AM (#935160)
That's one badass post.
Re:Are Google employees being discouraged from using Python ... by jrockway on Tuesday November 10, 2009 @04:12PM (#933954)
Uh, SBCL is dynamically-typed.
Re:Are Google employees being discouraged from using Python ... by mhd on Tuesday November 10, 2009 @06:13PM (#934162)
Well, the shootout entries generally blur the line, using lots of type declarations.
Re:Are Google employees being discouraged from using Python ... by bad_user on Wednesday November 11, 2009 @03:50AM (#934923)
The SBCL tests submitted to the shootout are using type annotations heavily.

In that test it doesn't count as a dynamic-typed language.

Re:Are Google employees being discouraged from using Python ... by jrockway on Wednesday November 11, 2009 @04:08PM (#936236)
So is C dynamically typed when it converts an integer to a pointer?
Re:Are Google employees being discouraged from using Python ... by bad_user on Thursday November 12, 2009 @04:57AM (#937448)
No, that's called loosely typed.

Having type annotations is a big deal because you can infer certain things at compile time.

Take for instance (+ x y). In CLisp "+" is a multi-method, the dispatch being done at runtime, but if you know that x and y are both integers, there's no need to search the right method to call at runtime, its address is already known. And then you can also decide to inline its code at compile-time if there aren't any conflicts (mostly like a macro, but without the laziness).

Of course, in dynamically-typed languages you have the freedom to infer these things at runtime, in certain situations you can infer the types of "x" and "y", you can use a cache for the call sites, and so on, but it's a lot more complicated, and one of the reasons is that for every optimization you do, you have to be ready to de-optimize when the assumptions have been invalidated.

That's why I said SBCL doesn't count as being dynamic in that test because it probably makes full use of those static annotations.

Re:Are Google employees being discouraged from using Python ... by jimmybot on Tuesday November 10, 2009 @02:10PM (#933698)
Anyone have numbers on how much faster V8 is than CPython?
Re:Are Google employees being discouraged from using Python ... by spamizbad on Tuesday November 10, 2009 @02:16PM (#933712)
http://shootout.alioth.debian.org/u32/benchmark.php?test=all...

CPython is between 32 faster and 14 times slower than Google's V8. Most of the time, however, V8 is 2-6 times faster than Python. Overall, V8 is quicker.

The authors of Unladen Swallow have talked a bit about performance challenges in optimizing - a big one is the fact that they're not breaking anything that depends on the CPython interpreter- include C-based modules, and even esoteric Python modules that modify python bytecode on the stack.

Re:Are Google employees being discouraged from using Python ... by alecco on Tuesday November 10, 2009 @02:59PM (#933808)
Watching V8 and Python development progress, I bet V8 performance will improve significantly in the next couple of years. Also Python comes with the baggage of a much more complex language and feature set.
Re:Are Google employees being discouraged from using Python ... by igouy on Tuesday November 10, 2009 @10:01PM (#934497)
> CPython is between 32 faster

When the CPython program uses GMP and the JavaScript program doesn't.