I don't use Android devices, so I wouldn't know, but is this the first instance of mobile Python on Android OS?
Jailbroken iPhones have had this capability for years...not to say iOS is better, just that I'd expected this would happen...sooner?
That said, the Python distro on iOS is only 2.6-ish, not even 2.7, and there's no 3.x release there. It's not very useful but I guess I did use it a lot for learning back then.
Kivy developers are the primary movers behind Python for Android. Typically we are using Cython so that a great deal of the application is actually running in C without the Python runtime eating up overhead. This leaves a budget of about a million function calls per second, or roughly 10,000 per frame, as most of the overhead in the UI thread is eaten up in expensive function stack frame in the event system, passing around events that call callbacks that call callbacks that call callbacks...
It remains to be seen if we can adopt a concurrent model for some aspects of the main application thread(s). Going concurrent almost surely means more Cython and more speed. I'm interested if anyone has any ideas about using CPython to reduce the cost of certain nearly-always-performed functions to grease the event system. Not that it's slow, but fast is always better =)
is this the first instance of mobile Python on Android OS?
Honestly, I have no idea. But I'm aware that there are multiple efforts to bring "sane" languages (such as C#, by Xamarin) to Android, others than Java.
Jailbroken iPhones have had this capability for years
I had no idea about this one, but I don't follow iOS development either.
I'd expected this would happen...sooner?
I agree with you, but I believe this sort of thing should be backed by Apple (iOS) or Google (Android) themselves.
Well, I hope it's being done securely. I don't know much about the particulars of Android's iOS, but having a low-level language with access to the whole OS (which is what a real user would want for mobile programming, really) could be dangerous for native security.
On the other hand, if Google or Apple backed a high-level scripting language like Python, that could also lead to security concerns, but I would feel safer with that than something like C on my mobile device.
In what scenario do you trust random C code more than random Python code?
Unintentional security mistakes are much, much easier to make in C than most other languages.
EDIT: Sorry if this came off as a little harsh, but I guess I'm curious as to what you think the security advantages of C over python are, when everything I've heard says the opposite.
Reread my comment...I said I felt safer with Python over C.
I'm well aware that, e.g. a buffer overflow is something you'd want to worry about in writing C code. I guess I worded my comment strangely? I said I would "rather have that" than C, to which I was referring to a high level language like Python.
Jailbroken iPhones have had this capability for years
As have non-jailbroken ones. I have Python for iOS and Pythonista (my preferred favorite) from the App Store. Python for iOS even comes in a 3.2 flavor.
Nope, you've been able to run python scripts on your python phone for years. What this seems to do is make it easy to package together an app written in python into an independent package that you can install just like any other android app
Jython won't simply run on Davlik unmodified. Davlik is a brand new VM target for language designers, and Google hasn't put much effort into making it easy for other languages to run on it.
Isn't there a tool that translates Java bytecode into Davlik byte-code (dx I think). Even if not, we have functioning decompilers to go from Java byte-code into Java source-code, and a well maintained toolchain to go from Java-source code to Dalvik byte-code.
In fact, you don't even need a Java decompiler to do this. All you need is a backwords Java compiler. That is, one that treats bytecode as a source languages and compiles down to Java. This is a much easier process because (ignoring things like Enums) you don't need to try and figure out what the original code is, and instead can just do a naive decompile with optimization passes.
There's been some Jython ports to Android in the past, but all are abandoned as far as I know. There were some problems with performance as well and the dynamic nature of Python.
I know there's a maintained JRuby project[1] for Android though.
And there's also Myrah, a Ruby-like language that can produce Dalvik bytecode. I've been meaning to try it out for several years, it looks pretty promising. It's basically typed Ruby.
Comments
I don't use Android devices, so I wouldn't know, but is this the first instance of mobile Python on Android OS?
Jailbroken iPhones have had this capability for years...not to say iOS is better, just that I'd expected this would happen...sooner?
That said, the Python distro on iOS is only 2.6-ish, not even 2.7, and there's no 3.x release there. It's not very useful but I guess I did use it a lot for learning back then.
Python has been on Android for a long time. The first instances I know of is SL4A: https://code.google.com/p/android-scripting/
Kivy for Android has been around awhile as well.
Kivy developers are the primary movers behind Python for Android. Typically we are using Cython so that a great deal of the application is actually running in C without the Python runtime eating up overhead. This leaves a budget of about a million function calls per second, or roughly 10,000 per frame, as most of the overhead in the UI thread is eaten up in expensive function stack frame in the event system, passing around events that call callbacks that call callbacks that call callbacks...
It remains to be seen if we can adopt a concurrent model for some aspects of the main application thread(s). Going concurrent almost surely means more Cython and more speed. I'm interested if anyone has any ideas about using CPython to reduce the cost of certain nearly-always-performed functions to grease the event system. Not that it's slow, but fast is always better =)
http://kivy.org/#home
Honestly, I have no idea. But I'm aware that there are multiple efforts to bring "sane" languages (such as C#, by Xamarin) to Android, others than Java.
I had no idea about this one, but I don't follow iOS development either.
I agree with you, but I believe this sort of thing should be backed by Apple (iOS) or Google (Android) themselves.
[EDIT]: formatting
Well, I hope it's being done securely. I don't know much about the particulars of Android's iOS, but having a low-level language with access to the whole OS (which is what a real user would want for mobile programming, really) could be dangerous for native security.
On the other hand, if Google or Apple backed a high-level scripting language like Python, that could also lead to security concerns, but I would feel safer with that than something like C on my mobile device.
In what scenario do you trust random C code more than random Python code?
Unintentional security mistakes are much, much easier to make in C than most other languages.
EDIT: Sorry if this came off as a little harsh, but I guess I'm curious as to what you think the security advantages of C over python are, when everything I've heard says the opposite.
Reread my comment...I said I felt safer with Python over C.
I'm well aware that, e.g. a buffer overflow is something you'd want to worry about in writing C code. I guess I worded my comment strangely? I said I would "rather have that" than C, to which I was referring to a high level language like Python.
My apologies, somehow my eyes skipped over "that than" in the last sentence.
S'alright :)
Android already has C. The only difference is that the public C API is relatively minimal, so to do anything useful you need to go through Java.
As have non-jailbroken ones. I have Python for iOS and Pythonista (my preferred favorite) from the App Store. Python for iOS even comes in a 3.2 flavor.
Nope, you've been able to run python scripts on your python phone for years. What this seems to do is make it easy to package together an app written in python into an independent package that you can install just like any other android app
Jython won't simply run on Davlik unmodified. Davlik is a brand new VM target for language designers, and Google hasn't put much effort into making it easy for other languages to run on it.
Isn't there a tool that translates Java bytecode into Davlik byte-code (dx I think). Even if not, we have functioning decompilers to go from Java byte-code into Java source-code, and a well maintained toolchain to go from Java-source code to Dalvik byte-code.
In fact, you don't even need a Java decompiler to do this. All you need is a backwords Java compiler. That is, one that treats bytecode as a source languages and compiles down to Java. This is a much easier process because (ignoring things like Enums) you don't need to try and figure out what the original code is, and instead can just do a naive decompile with optimization passes.
There's been some Jython ports to Android in the past, but all are abandoned as far as I know. There were some problems with performance as well and the dynamic nature of Python.
I know there's a maintained JRuby project[1] for Android though.
[1] http://ruboto.org/
And there's also Myrah, a Ruby-like language that can produce Dalvik bytecode. I've been meaning to try it out for several years, it looks pretty promising. It's basically typed Ruby.
Haven't heard of Mirah, but looks like it's still updated and maintained so that's a plus. http://www.mirah.org/
http://qpython.com/ has been around for a while.