From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101322 invoked by alias); 19 Jan 2020 09:44:03 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 100815 invoked by uid 89); 19 Jan 2020 09:44:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,HTML_MESSAGE,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=browser, HX-Received:5c8, 2.0, UD:ua X-HELO: mail-il1-f181.google.com Received: from mail-il1-f181.google.com (HELO mail-il1-f181.google.com) (209.85.166.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 19 Jan 2020 09:44:00 +0000 Received: by mail-il1-f181.google.com with SMTP id b15so24937150iln.3 for ; Sun, 19 Jan 2020 01:44:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=sKfwOpA8ItidOYFlZrLQtnfZXAyNZyqoKzrJmSgfdGU=; b=oif7XYWuQJqigcWk8umxnZjvNioX8ScDkIAUfEdJkgC1hxeR7nastEacdiTh+KyjrM nHSlSRHrUpxrue4BT1S/i9jqg0Po59USEtYKq4D+nr6wEkS0sRxKj6KKBReAqR6gNIm0 c2jD+Dn/3VgU23xA1oG8haV5UJeYluWcTR/zKq2EKbDO07DMh9we7PgGTIe0DdiXVsg9 obctCFZc2W5b4SCunSYPI5tGzUL+ssn4UGtc33mQyV6jRUT1Dr3RsBaFwUN5Pu8EXgrV gfwFt6tZL9V5rKiI6DkJ9dDNhz1vuOozU89B91xmD9CuzV7/hrWIsoy3mjfLZP+w4UGS 48fQ== MIME-Version: 1.0 From: Panicz Maciej Godek Date: Sun, 19 Jan 2020 09:44:00 -0000 Message-ID: Subject: Porting SLAYER to Android To: kawa@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2020-q1/txt/msg00012.txt Hi! A few years back I have been working on a simple framework for developing 3d and multimedia applications in Scheme. The project is somewhat documented here http://puszcza.gnu.org.ua/software/slayer/ and its API documentation is available here: http://puszcza.gnu.org.ua/software/slayer/manual/1.1.0/ It uses Guile 2.0 under the hood, and it implements a JavaScript-like event model. When SLAYER runs, it reads a Scheme file, which sets up the callbacks for input and drawing, and then the inner loop simply calls these callbacks (and garbage collector from time to time): https://bitbucket.org/panicz/slayer/src/default/src/slayer.c#lines-219 The example project (image browser) should give the impression how to use it: http://puszcza.gnu.org.ua/software/slayer/manual/1.1.0/Getting-started.html= #Getting-started Now, I've been thinking about porting this project to the Android platform. But I know very little about Java, and even less about Android. A while ago, I managed to build some project on my PC using Android Studio, but I have since lost the computer. Fortunately, I recently ran into a project which allows to build some Android apps on Android, using the Termux terminal: https://github.com/SDRausty/buildAPKs After some digging I've found that this is the essential script for building APKs: https://github.com/SDRausty/buildAPKs/blob/master/scripts/bash/build/build.= one.bash I also managed to successfully build and run the latest Kawa in Termux, with Java acquired from this script: https://github.com/MasterDevX/Termux-Java Now I would like to use this setup to re-create the SLAYER API on Android, and I've been considering Kawa for this purpose. But I'm not sure how to do it, or wherher it's even possible, but the rough idea that I have now is, that I would like to include the sources of Kawa in my project and use it to process the Scheme files when the SLAYER app is loaded. The most similar project that I know is L=C3=96VE, which has been ported to Android (using n= ative functions): https://bitbucket.org/MartinFelis/love-android-sdl2/src So the questions are: - is there some class that could be used to represent the Kawa closures in Java that could be stored in an array and invoked from Java? - if so, is there some way to compile Scheme expressions to the instances of that class? I mean something like Closure square =3D kawa.compile("(lambda (x) (* x x))", environment); square.invoke(2); but I don't expect the first argument to be a string, but rather some representation of AST. In the documentation, I have found this: https://www.gnu.org/software/kawa/Evaluating-Scheme-expressions-from-Java.h= tml but the question is whether the Scheme.eval method compiles the expression (if it's, say, a function) or only interprets it? - given some text file, is there any way to obtain some representations of the subsequent s-expressions from that file? Does the above idea have any chance to work, or is there some other way you would recommend?