Hacker News new | past | comments | ask | show | jobs | submit login
PyPy 2.1 beta released with ARM JIT (morepypy.blogspot.com)
77 points by wkornewald on July 11, 2013 | hide | past | favorite | 19 comments



It's maybe worth pointing out that this is the first release that has a full ARM JIT support.


Now we just need to wait for Apple to allow the JIT on iOS. Could only take a few more years guys!

(Of course having the JIT on Android, Raspberry-Pi and other ARM devices is a huge plus. I'm just frustrated by Apple's paranoia.)


Unfortunately, JIT will never be allowed on iOS because it invalidates the security model of the iOS App Store.

The current security model requires that all iOS App Store executables are monolithic - with the only exception being Apple-provided Apple-allowed dynamic libraries. You cannot publish an iOS App Store app that includes separate third-party dynamic libraries - they have to be statically linked into the final executable, which Apple then encrypts during the signature process.

This allows Apple to have 100% vetting control over the native code published in their iOS App Store. You can't side load unsigned code / code they haven't seen. There was actually an exploit / proof of concept where someone published a financial app in the App Store that called home and loaded arbitrary bytes into executable memory. The bug was patched and the developer was banned from the App Store.

A JIT would effectively allow the same thing: arbitrary native code execution on an iOS device that isn't part of an executable Apple has seen / signed.

However! This does not mean python is unavailable in the App Store. Python for iOS, Pythonista (my favorite), and several other flavors of interpreter already exist. It's just that they're bytecode interpreters only - no JIT allowed. And any attempts to use ctypes to dynamically load a module actually triggers a segfault (it's an intentional part of the iOS dynamic linker that does this - segfaults loading anything non-standard).

So go ahead and enjoy python on iOS - just don't hold your breath waiting for JIT.


Hardly "now" - there are ongoing complaints re other JITs, eg LuaJIT, not to mention Javascript...

But on the other hand, non executable heap is a reasonably valid defence against some attack types. And Apple don't care about your convenience...


Non-executable heap is an extremely reasonable default, but not even allowing you to mprotect() a page back to being executable is just annoying.


It actually makes a lot of sense. Preventing pages from being executable makes exploitation so so so much harder... Because you will need to do ROP (Return oriented programming) and Apple is quite good at ASLR (Address space layour randomization).. It also means that malware can't just load external code from a C&C server etc.. And yes, it sucks that all this means that one can't JIT.

Edit: Allowing executable pages would also break mandatory code signing.


You'll have to do ROP to get the app to make your data executable anyway. Is it really that much easier?


> , not to mention Javascript...

JavaScript support has been improved on the upcoming iOS version, even interaction with the Objective-C runtime. Not sure about JIT, though.

If you have an Apple account check the JavaScript sessions from WWDC 2013.


it's apple-approved javascript which does not have the same restrictions as normal stuff.


Yes, but that makes JavaScript one less language to complain about in iOS.


no, because you can't challenge "javascript is slow", since only apple is allowed to JIT it. If they do a bad job, there is noone else to help.


Yes there is, you can always write a native compiler for JavaScript, no one says you need to JIT it.

Lisp, Dylan are just two examples from dynamic languages with native compilers.


>I'm just frustrated by Apple's paranoia

Paranoia?

http://thenextweb.com/insider/2013/06/26/juniper-mobile-malw...


Right, thanks, I've updated the title.


Changelogs like "Bugfixes to cffi and ctypes" are pretty useless. Do these bugs affect my code? Is my code going to explode horribly if I don't upgrade? Is my code going to explode horribly if I do upgrade? etc.


They're useless for you. It typically means someone posted a bug on the issue tracker and it got fixed. If you did not try PyPy before, you can't know if it affects you. If you did and there were bugs in cffi/ctypes, this is a time to try, if you did and it worked it should continue working.

I know this is useless for you, but be a little understanding, most releases that are genuinely useful contain tons of stuff like "we fixed performance of this corner case" or "we fixed this obscure crash" etc. What else would you suggest to put there?

Also, how on earth is what you wrote related to ARM JIT support in the title?


Good point. Most projects do it this way, and I think it's kind of good to have a high level summary like this. However, I've also seen projects that also link to specific related issues -- or even better blog pages, or documentation related to it. Mozilla with firefox does it this way for example.

Your concern whether this release may break your code is only a test run away ;) But seriously... this is a valid, and common concern. I'd assume they are not intentionally introducing breaking changes, considering it's still targeting CPython compatibility. Also, there are no explicit breaks mentioned -- but I guess it might be good to communicate this explicitly.


As we say so often in the Python commmunity, "Try It And See." Do you use cffi and/or ctypes in your code? Have you run your tests against this newer PyPy?


This could be the missing ingredient in the new entrant mobile OSs: A managed language runtime. This + Qt bindings could make a nice app runtime for an OS like Jolla. Otherwise, in most cases, your choices are Web apps or Qt apps in C++.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: