[Mobile-sig] Experiments with Dalvik

Dima Tisnek dimaqq at gmail.com
Fri May 20 03:08:20 EDT 2016


Apologies if my response came out negative.

First off, big ups for fresh toolchain!


Let me clarify my world view:

I believe in Python, which means Android running full-fledged cpython
or pypy, including running Python code from source (for development at
least), and python runtime / stdlib (obv. some system restrictions
apply).

Beyond that, I believe that Android runtime (UX, UI, hw access, IPC,
etc.) is the way to go. That means no Qt or any other "native" 3rd
party libs.

There are tools to bridge the two, and there's where I hope to see progress.


I like what you've done with Duck, I especially like Android type annotations.
Perhaps it's possible to integrate this syntax into plain Python
program using only decorators and metaclasses, that is running your
syntax with cpython.

Cheers!

On 17 May 2016 at 19:18, Dima Tisnek <dimaqq at gmail.com> wrote:
> How about python-java bridge, like Rubicon or pyjnius?
>
> You get best of both worlds -- a good language and a mature runtime.
>
> On 17 May 2016 18:05, "David Boddie" <david at boddie.org.uk> wrote:
>
> In a belated attempt to jump on the Android bandwagon I started to look
> into learning Java and the Android APIs. I realised very quickly that I
> couldn't face writing a lot of code in that language. Looking around for
> other languages running on the Dalvik VM, I found a few that might be nicer
> than Java, but I wasn't so sure that I wanted to write in any of those,
> either.
>
> In the end, I decided to try an experiment to see how much I could learn
> about Dalvik and Java by creating tools to handle some of the file formats
> used in Android packaging, and by trying to implement a compiler for a
> subset
> of Python.
>
> The result can be found in this repository:
>
>   https://bitbucket.org/dboddie/duck
>
> It should be noted that the source language isn't really Python. The parser
> from the standard library is used to parse it, but the semantics of the
> generated code are different to those of Python. That's why I gave the
> language a different name.
>
> How is this relevant to a mailing list about Python on mobile platforms?
>
> Firstly, the language may be close enough to Python for people to find it
> more familiar than Java, even if there are places where the differences may
> trip them up. Writing code to fit into a framework designed for a statically
> typed language requires a slightly different mindset to the one you might
> have when writing regular Python code, so it may not seem so strange to
> developers once they've accepted that.
>
> Secondly, it makes it possible to write a more faithful implementation of
> Python using code that looks a lot like Python, instead of Java. You could
> use it to write support code for a compiler, or perhaps write an interpreter
> in it.
>
> It's all very experimental at the moment. I've been uncomfortable about
> publishing it before now because I keep finding things I've overlooked,
> though it's been a good learning experience. Maybe there will be things in
> there that people find useful.
>
> David
> _______________________________________________
> Mobile-sig mailing list
> Mobile-sig at python.org
> https://mail.python.org/mailman/listinfo/mobile-sig


More information about the Mobile-sig mailing list