public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* Porting SLAYER to Android
@ 2020-01-19  9:44 Panicz Maciej Godek
  2020-01-20 15:13 ` Per Bothner
  0 siblings, 1 reply; 4+ messages in thread
From: Panicz Maciej Godek @ 2020-01-19  9:44 UTC (permalink / raw)
  To: kawa

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ÖVE, which has been ported to Android (using native
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 = 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.html

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?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-23 22:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-19  9:44 Porting SLAYER to Android Panicz Maciej Godek
2020-01-20 15:13 ` Per Bothner
2020-01-20 15:26   ` Per Bothner
2020-01-23 22:47   ` Adrián Medraño Calvo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).