[gambit-list] Gambit for Android Platform

Steve Graham jsgrahamus at yahoo.com
Tue Jun 28 12:36:07 EDT 2011


Thanks, Marc.

Keith:  I added my code as a script and ran it repeatedly from there without a hitch.

Steve

On Tue Jun 28th, 2011 11:40 AM EDT Marc Feeley wrote:

>I suspect that it might be related to garbage collection.  If the foreign code (in C) in "Gambit for Android" keeps a reference to a movable Scheme object (or to a still object whose reference count is 0), then if a GC is started from the C code, or from Scheme code called from C, then you will get a dangling reference problem.  These GC related problems tend to occur at unpredictable times.
>
>Here's a suggestion... add a trace at the top of ___garbage_collect (in lib/mem.c) and see if the app aborts soon after a garbage collection.
>
>Marc
>
>On 2011-06-28, at 11:02 AM, Steve Graham wrote:
>
>> Not sure what else or how else to test.
>> 
>> On Tue Jun 28th, 2011 5:25 AM EDT Keith Flower wrote:
>> 
>>> I have some automated JUnit/Robotium tests to drive the app. Repeated (1000x) evaluation of your example expression permuted with other test expressions and programs don't cause problems on a 1.6 emulator (the closest thing I have to your device). However, such tests won't fully exercise my fairly simpleminded Android REPL window code, so bug(s) may lie there. Any further details you note may be helpful.
>>> 
>>> Many thanks for the feedback.
>>> 
>>> On Jun 27, 2011, at 5:51 PM, Steve Graham wrote:
>>> 
>>>> Thanks, Keith.
>>>> 
>>>> Thought I should mention that sometimes even simple code causes the app to abort to the desktop.  I noticed this happening with "(* (+ 35 31.5) 45)".  Sometimes this works and sometimes it aborts.  Not sure why.
>>>> 
>>>> Steve
>>>> 
>>>> On Tue Jun 21st, 2011 1:12 PM EDT Keith Flower wrote:
>>>> 
>>>>> Hi Steve,
>>>>> 
>>>>> Thanks again for trying out the little app and providing feedback.
>>>>> 
>>>>> Depending on the kind of app you want to write, it might not currently be the most efficient process to try to use Gambit, but there are a couple of approaches one might take. If you look in the source for the app, you'll see Scheme code working with HTML for the app's "Edit Scripts" page. Another alternative would be adding Java-Native (JNI) functions to allow Gambit to make the actual Java/Android function calls you desire. You could also use Gambit to generate C code that you compile with Android's Native Development Toolkit and call from Java using JNI.
>>>>> 
>>>>> The tree recursive fibonacci example is designed to consume lots of memory (~7-8 megs), so your phone (and mine) with limited memory resources has to thrash around to satisfy those memory needs.
>>>>> 
>>>>> Regards,
>>>>> 
>>>>> Keith
>>>>> 
>>>>> 
>>>>> On Jun 21, 2011, at 7:52 AM, Steve Graham wrote:
>>>>> 
>>>>>> Keith,
>>>>>> 
>>>>>> I like your implementation, including the features beyond plain Gambit.  I wonder if someone could use it as a basis of a system for coding Android apps.
>>>>>> 
>>>>>> Question:  On the fib function, why do you suppose it was so resource hungry and experienced the faults?  I am using a G-1 running version 1.6 .
>>>>>> 
>>>>>> Thanks, Steve
>>>>>> 
>>>>>> ---
>>>>>> 
>>>>>> Gambit v4.6.1
>>>>>> 
>>>>>>> (time (fib 25))
>>>>>>  47258 ms real time
>>>>>>  8010 ms cpu time (7950 user, 60 system)
>>>>>>  47 collections accounting for  566 ms real time (550 user, 10 system)
>>>>>>  8377804 bytes allocated
>>>>>>  124 minor faults
>>>>>>  no major faults
>>>>>> 75025
>>>>>> 
>>>>>> 
>>>>>> On Sat Jun 18th, 2011 7:04 PM EDT Keith Flower wrote:
>>>>>> 
>>>>>>> Inspired by Marc's iOS Gambit REPL, an alpha Android release and source are available at:
>>>>>>> 
>>>>>>> http://apps.keithflower.org/?page_id=152
>>>>>>> 
>>>>>>> Requires Android 2.2. Comments, criticism, suggestions are welcome.
>>>>>>> 
>>>>>>> Thanks to all for a great Scheme environment.
>>>>>>> 
>>>>>>> Keith
>>>>>>> _______________________________________________
>>>>>>> Gambit-list mailing list
>>>>>>> Gambit-list at iro.umontreal.ca
>>>>>>> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>>>>>> 
>>>>> 
>>>> 
>>> 
>> 
>> _______________________________________________
>> Gambit-list mailing list
>> Gambit-list at iro.umontreal.ca
>> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>




More information about the Gambit-list mailing list