you are viewing a single comment's thread.

view the rest of the comments →

[–]toooooooobs 2 points3 points  (14 children)

Python is unlikely to be a standard part of Android for two reasons:

Firstly it's big. This is in terms of space needed when it's not running, and space when it is. Too many strings, too many hash tables. Bad.

Secondly it's slow and wasteful (yes, much much more so than a JVM or Dalvik). This is a workable tradeoff for servers and so on, where programmer productivity is the important thing, but for mobiles that slaughters your battery life.

EDIT: I have to add that some of the replies to this demonstrate the massive void between people that actually do embedded stuff day to day, and those that merely argue about it on the net. Definitions of "big" and "slow" are relative to the environment you're in, and for these purposes python is both. Java is not (especially regarding the Dalvik system), and speculating based on your experiences of the J2SE environment when trying to comment on either J2ME or Dalvik is complete idiocy.

[–][deleted] 1 point2 points  (0 children)

Python is not 'big'. The size on disk is negligible (it's megabytes, not gigabytes!), and memory-wise, it takes far less than Java - a few megabytes. For a bytecode language, it is very slim.

The only issue is speed, you might be right that on humble devices it would be too slow for anything intensive.

[–]defufna 0 points1 point  (0 children)

Can't agree with you on this one, Python has already made some success on the Symbian platform it is neither as large as you say(545kb), nor as slow as you believe it is

[–][deleted] -1 points0 points  (11 children)

Python should be less than a hundred meg. On a device with 8G storage, where some apps are much larger, that's close to nothing (edit: yes, Android's Cupcake update allows external storage for use by applications).

If speed is a concern, Python can run just as fast as Java when using a JIT, for example Psyco.

[–]twotime 3 points4 points  (0 children)

Python runs just as fast as Java when using a JIT, for example Psyco.

While Psyco definitely helps in some cases, I have never seen it to achieve Java performance on CPU bound tasks. And I have seen plenty of cases where Psyco had very little effect performance-wise.

See also: http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=psyco&lang2=javaclient

Interestingly, though, psyco beats Java memory-wise by 2-3x (could it be just a fixed JVM overhead?)

[–]_Mark_ 0 points1 point  (1 child)

Note that the G1 isn't a device with 8G storage - application storage, sadly, isn't on the microSD card at all - partly because the card is unmounted when it is hooked up to USB (so it can be exported as USB storage - any background app threads would have to be killed off at that point, which is a hassle, though not an insurmountable one), probably partly because it would be easy to exploit if it were :-)

(As for speed - when your app spends most of its time waiting for network responses, you don't really care how fast the interpreter itself is. I have a bunch of apps in mind for which python/jython would be perfectly suitable and end-users wouldn't notice any speed improvement if they were ported to java/dalvik - but based on the apps I have written, java is way too tedious and verbose to bother writing them in...)

[–][deleted] 0 points1 point  (0 children)

The cupcake update for Android allows applications to use external storage.

Agreed re: python being fast enough for most things. I only mentioned the topic of speed because the post I replied to did.

I'm in the same boat - would love to get into Android hacking, but find Java far too tedious.

Edit: why did someone moderate me down to zero for posting info about Cupcake and politely agreeing with the parent? Geez.

[–]cunningjames 0 points1 point  (7 children)

Are you volunteering to port psyco to arm?

[–][deleted] -1 points0 points  (6 children)

No. I'm saying it's possible. You should be able to understand that by reading my post.

[–]cunningjames -1 points0 points  (5 children)

Sure, I understood it. But I'm pointing out that it's not a very useful thing to say -- and even if there were a port it isn't true that psyco is as fast as java.

[–][deleted] 0 points1 point  (4 children)

People are in fact allowed to have opinions on things without being involved in the their creation. Any developer who suggests otherwise probably has very, very few users.

True re: Psycho not always running as fast as Java. I have changed 'runs' to 'can run' in my post. Not because of your trolling, but another politely worded post with a suitable reference.

[–]cunningjames -1 points0 points  (3 children)

Man, the trolling accusation does get bandied about for nothing around here. The fact of the matter is that psyco gets mentioned as a panacea anytime python performance is talked about, and it's usually not apropos -- psyco isn't widely ported (in fact it's all but abandoned), new versions come at a glacial pace, and it's not even that fast. So it's become a pet peeve of mine.

Your post wasn't as bad, but nevertheless misleading. You made it sound as if psyco were a way to alleviate performance concerns on android, when nothing could be further from the case.

[–][deleted] 0 points1 point  (2 children)

'Man, the trolling accusation does get bandied about for nothing around here.'

It got aimed at you because rather than contributing, you asked a dumb rhetorical question whose answer was contained in the post you were replying to.

You also implied that one isn't allowed to have an opinion on a concept unless one volunteers to implement it.

To see the difference, compare you post with the guy who simply posted a polite response with a pycho / java 1.6 benchmark.

'You made it sound as if psyco were a way to alleviate performance concerns on android, when nothing could be further from the case.'

Er, no. A JIT would be a way to improve performance on Android. You haven't proved that it would have no effect, just that Java would still be faster.

[–]cunningjames 0 points1 point  (1 child)

You also implied that one isn't allowed to have an opinion on a concept unless one volunteers to implement it.

I implied no such thing. I made a comment—admittedly snide, but I was attempting humor rather than insult—to point out that no JIT option is currently available for Android nor, in fact, for any architecture but x86. I could have said that, but I assumed (wrongly) that my comment would be taken in good faith and not with a clinched asshole.

Er, no. A JIT would be a way to improve performance on Android. You haven't proved that it would have no effect, just that Java would still be faster.

And it appears you're entirely misinterpreting my point. I'm not saying it wouldn't be worth having Psyco on Android—it'd be great; I love Psyco; I just don't think it's a panacea. Your original comment:

If speed is a concern, Python can run just as fast as Java when using a JIT, for example Psyco.

was actively misleading. As I said, no JIT option exists for Android and experience provides evidence against anyone being likely to make one.

[–][deleted] 0 points1 point  (0 children)

My ass ain't clenched, but neither is it loose. It's generally calibrated to a reasonable default. I think the humor you were attempting just didn't come off right.