This project is a base for which to add a python interpreter to a swift iOS project. It allows us to call python functions and get the resulting string, and then use the result in swift code (to update native widgets, etc.)
There is a great disturbance in the Force --youngling Jedis are practicing their https://CircuitPython.org ways on https://circuitpython.org/board/particle_argon/ kits that have WiFi, BLE, NFC, TensorFlowLite local image/speech recognition and the ability to connect with all types and sizes of displays (ePaper to AMOLED, retinal projectors, touch, multitouch etc.) and interfaces to LTE (150/50Mbps) via https://www.dfrobot.com/product-1834.html as well as headphones, 3D-printed multi-module wearable cases, personal (airborne and ground based) drones, personal indicators and other interfaces that "New" Apple can't even begin to imagine in it's crummy foodcourt (where they fire their best for letting their little girls make a social media post that accidentally shows a prerelease build while hackers and 9to5Mac lay the entire next release bare for all the public). Time to port Blinka to iOS so that it can at least run this Future's apps using something like https://www.adafruit.com/product/2264
hah, my Karma literally went negative after that post on Friday (I don't post much so downvotes hurt) --probably wasn't the part about Python takin' over the game ;)
Are you okay with having your app's binaries string dumped by unknown parties where upon they find the underlying Python source code? Some basic encryption (or tokenization) would be better, since few would expect to go looking for it.
I believe that you need the S4TF fork of the Swift compiler. It might be doable to swap it into Xcode as part of an alternate toolchain, but it's not likely to be easy.
As the sibling commenter said, that project and kivy are geared to write android and ios apps entirely in Python.
My approach is different. I have most of the business logic in Python (I share lots of code between a web app and an Android app I have) and write the UI logic in the platform’s native language. This means the apps are always using native UIs and use the platform toolchains, and I can use all tools available natively on the platform.
The answer to that post is mine, and i confirm that there’s some delay on start but on a moto g 2014 that i have it is ~3 seconds which is not much. By comparison, Outlook takes more than 10 seconds to start on my iphone 5s..
I noticed that if I quit the app via the usual mechanism, it takes less than a second to load. However if I fully power cycle the device it’s closer to 5 seconds.
Libpython.a (and the others) have ~50MB and the standard library zip is ~4MB. But note that libpython and the others are fat libraries which includes X86 code that is only relevant for the iOS emulator and could be stripped eventually on release.
23 comments
[ 2.5 ms ] story [ 59.0 ms ] threadAs I'm a beginner in swift and iOS, I've documented all the process at https://github.com/joaoventura/pybridge-ios/blob/master/docs....
I hope this allows me to share all the Python code in my Android app (https://play.google.com/store/apps/details?id=com.flatangle....), which uses the same technique but for android (https://github.com/joaoventura/pybridge)
There are limited exceptions for apps that teach programming, such as Pythonista.
I have the same shirt as this poor guy... https://youtu.be/NeHFDf0zKs4
[0] https://www.tensorflow.org/swift/tutorials/python_interopera...
[0] https://github.com/pvieito/PythonKit
The talks from the author, Russell Keith-Magee, are very interesting, I learned a lot about how apps work.
My approach is different. I have most of the business logic in Python (I share lots of code between a web app and an Android app I have) and write the UI logic in the platform’s native language. This means the apps are always using native UIs and use the platform toolchains, and I can use all tools available natively on the platform.
https://news.ycombinator.com/item?id=23338227
That is why I always test my apps on older hardware.. That, and because i only have old devices.. :)