These may be the preferred languages for these platforms, but at the end of the day, mobile phones and web browsers are computing platforms, and with a little work, you can use any language you want. With the BeeWare suite of libraries and bridges, you can use just Python. And, you can use the same code to deploy on all these platforms.
This article offers a preview of our upcoming PyCon US 2017 talk, Snek in the Browser, which is a deep dive into how the BeeWare project tackles using Python for front-end development using Batavia and Toga.
Python is one of the easier languages to pick up, and it doesn't have the learning curve of Java or Objective C. And recently, many scientific communities, including astronomy and data science, have picked up Python as their go-to language. To be able to use a language they already know to create their own applications, such as mobile-based data recording systems, without having to learn entire new languages would be a great asset to all these scientists.
How does it work?
Emerging technologies such as ASM.js and WebAssembly make the prospect of in-browser language interpreters even more promising, given the performance improvements these projects provide.
To be able to render websites with the same code as for a mobile deployment, we need a universal wrapper that allows us to target these platforms. This is where Toga, an OS-native Graphical User Interface (GUI) toolkit, comes in. Toga abstracts out the interface options of different systems. If you want to create a Quit button, it will be in a different place on macOS than on Windows or Linux. It's not just a wrapper around native system calls—it's abstraction over the native layer, capturing the high-level user interaction use cases.
At the end of the day, a web page and a mobile screen are just bitmap devices rendering font, shapes, and lines on a screen. HTML has brought in a new way of thinking about the building blocks of graphic user interfaces, but by consolidating how we think about putting stuff on a screen, abstracting this to all platforms is made simpler.
Work in progress, but you can help!
The entire BeeWare suite, including Batavia and Toga, are still a work in progress. We have an open offer to mentor anyone who wants to get involved with the project. If you make a contribution to the project, be it code, documentation, writing a tutorial, or helping someone else contribute, you'll earn yourself a shiny challenge coin.
We'll be at PyCon US 2017 throughout the entire event, from the first tutorial day (our tutorial has, sadly, already sold out), all the way through the sprints. We'll be in the Exhibit Hall in Booth 103 during the main conference, so drop in and say hi, and see just how shiny our coins—and code—are.