This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: repl for android
- From: Per Bothner <per at bothner dot com>
- To: Sonny To <son dot c dot to at gmail dot com>, Kawa mailing list <kawa at sourceware dot org>
- Date: Thu, 31 Aug 2017 09:31:23 -0700
- Subject: Re: repl for android
- Authentication-results: sourceware.org; auth=none
- References: <CAJxjsJt2Ph04S9dXseAUET4ZEaxZtjZ=r4ihK-RkNUnP2VFbLw@mail.gmail.com>
On 08/31/2017 08:43 AM, Sonny To wrote:
One thing I like about Clojure for Android is the repl. Is there a
repl for android where I can attach from emacs and eval some code and
dynamically construct a UI?
Kawa does includes a telnet server. You could start it on the phone with:
java kawa.repl --port PORTNUM
where PORTNUM is the listening port. (If you use 0, an available port is used.)
Then from your PC you can telnet to that port:
telnet IPADDR PORTNUM
where IPADDR is that of your Android device.
I haven't tested this with an Android device. Of course note that telnet
is unencrypted and insecure, so don't use an unencrypted WiFi connection.
Better, but more complex, would be to use a ssh server on the device.
Kawa's eval/repl on Android does have some limitations because you can't
construct new classes on the fly. (On other targets repl/eval code is
first compiled to bytecode before it is executed. That is not an option
on Android at this time.)
--
--Per Bothner
per@bothner.com http://per.bothner.com/