xulunfan / android-scripting

Automatically exported from code.google.com/p/android-scripting
0 stars 0 forks source link

Add Scheme support #89

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I love scheme. You love scheme. You will add scheme support tomorrow.

Original issue reported on code.google.com by luftschw...@gmail.com on 26 Aug 2009 at 4:08

GoogleCodeExporter commented 9 years ago
Scheme already runs on the iPhone using gambit - 
http://dynamo.iro.umontreal.ca/~gambit/wiki/index.php/Main_Page.  It's bound to 
run 
android apps faster than the other scripting languages.

Original comment by ChadAtNe...@gmail.com on 12 Dec 2009 at 2:48

GoogleCodeExporter commented 9 years ago
I have a Scheme interpreter, available as a set of JARfiles.  I need a way to 
shoehorn this into ASE.  I am hoping to be able to do this without rebuilding 
all of 
ASE, downloading the Android source, et cetera.

Original comment by ben.goet...@gmail.com on 10 Mar 2010 at 9:50

GoogleCodeExporter commented 9 years ago
@ben.goetter If you can point to the JARs, I can try to get them integrated.

Original comment by damonkoh...@gmail.com on 22 Mar 2010 at 4:32

GoogleCodeExporter commented 9 years ago
anyone know about the current status of this? ase is currently the best/only 
way to script an unrooted android on site, scheme is a simple but very powerful 
language, having a macro capable language would be a fantastic addition to ase

Original comment by ihatethi...@gmail.com on 24 Jul 2010 at 4:15

GoogleCodeExporter commented 9 years ago
FWIW, I had some extra time for fiddling about with sl4a and got Scheme 
(jScheme 7.2) to run on sl4a.  I do need some help to procure this to sl4a, 
though.  Anyone?

Original comment by fil...@gmail.com on 10 Dec 2011 at 8:55

GoogleCodeExporter commented 9 years ago
For the curious, here's the Scheme interpreter installer APK.

http://hdlfactory.com/files/sl4a/sl4a-scheme.apk

A word of warning, though: it currently downloads scripts from my website.  
There isn't anything dangerous there and the current contents are the script 
jar and a hello world script.

But, for the paranoid among us I advise not to use the above apk until we 
procure the interpreter to code.google.com and it receives some public scrutiny.

Original comment by fil...@gmail.com on 10 Dec 2011 at 9:46

GoogleCodeExporter commented 9 years ago
Ok, I uploaded the first version of the Scheme adapter.  

See https://groups.google.com/forum/#!forum/android-scripting for details 
(announcement is still pending in the group, though, so no direct link yet)

I think it's OK to close this issue now.

Original comment by fil...@gmail.com on 8 Jan 2012 at 10:05

GoogleCodeExporter commented 9 years ago
I tested Jscheme codes such as

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (fibonacci x)
  (if (< x 2)
    x
    (+ (fibonacci (- x 1)) (fibonacci (- x 2)))))

(do ((i 1 (+ i 1)))
  ((> i 16))
    (display (string-append (number->string (fibonacci i)) ", ")))
(display "...")
(newline)
(exit)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

It looks fine, but it seems that it doesn't include the JSON-RPC bridge module 
such as

> 
http://code.google.com/p/android-scripting/source/browse/beanshell/ase/android.b
sh
> http://code.google.com/p/android-scripting/source/browse/rhino/ase/android.js
> http://code.google.com/p/android-scripting/source/browse/python/ase/android.py
> http://code.google.com/p/android-scripting/source/browse/jruby/android.rb

Can anybody write it in scheme ?

Original comment by tomcatalbino on 26 Jan 2012 at 2:15

GoogleCodeExporter commented 9 years ago
It seems to fall(fail) when you use the Add Menu "jScheme 7.2" in SL4A.
I made/save the fibonacci script in my own editor so I didn't recognized the 
problem. 

Original comment by tomcatalbino on 26 Jan 2012 at 4:08

GoogleCodeExporter commented 9 years ago
>It seems to fall(fail) when you use the Add Menu "jScheme 7.2" in SL4A.

I figured out the reason. It's not because of the "sl4a-scheme.apk".
It's because of the "sl4a_r*.apk has to be fixed.
The script(this case scm) has to be in KnownLanguage and have a class for 
jScheme.

http://code.google.com/p/android-scripting/source/browse/android/Common/src/com/
googlecode/android_scripting/language/SupportedLanguages.java

Sorry for my foolish comments.

Original comment by tomcatalbino on 7 Feb 2012 at 11:54

GoogleCodeExporter commented 9 years ago
FYI: This issue can now be closed.  Report any problems with the Scheme 
interpreter adapter for Android at http://code.google.com/p/sl4a-scheme/issues

Original comment by fil...@gmail.com on 7 Feb 2012 at 12:21

GoogleCodeExporter commented 9 years ago
>To Comment 11

This issue shouldn't close because "sl4a-scheme" can't access to the SL4A API 
yet.
But I wrote a method to advance the sl4a-scheme in your site.

http://code.google.com/p/sl4a-scheme/issues/detail?id=3

The attached jar there would support SL4A APIs.
I hope the maintainers look here...

Original comment by tomcatalbino on 7 Mar 2012 at 2:12

GoogleCodeExporter commented 9 years ago
Note: Sl4a_R5 fixes editor editors for "unsupported" languages.
If Scheme supports TCP/IP sockets and can handle JSON packets, it should be 
easy enough to implement a bridge.
However, while I'm happy enough to provide advice, I don't know Scheme from a 
bar of soap, so it'll be up to someone who does to provide it.
Since someone has already written an installer/descriptor, it only requires 
someone to write the linking script.

Original comment by rjmatthews62 on 30 Mar 2012 at 1:41

GoogleCodeExporter commented 9 years ago
The sl4a-scheme project above is based on JScheme, which does allow access to 
regular Java classes.  If nothing else, that should allow support for sockets 
on its own, but it might also allow working more directly with the android API. 
 Are the facades accessible through the API, or just RPC?  If it's just RPC, it 
might be worth while to provide a direct facade API in Java for the languages 
that support working with Java classes.

Of course, if someone comes along with a Scheme implementation that doesn't 
allow Java access -- something with a more "native"/standard approach -- they'd 
have to work with the RPC/JSON stuff.  (And something that isn't based on 
JScheme would be nice -- it hasn't been updated in quite some time.)

Original comment by matthewc...@gmail.com on 30 Mar 2012 at 3:09

GoogleCodeExporter commented 9 years ago
Finally got a reply !!!
The jar in #Comment12 is able to access to the SL4A APIs.
But it doesn't use the linking script (like "android.scm").
I think it is possible but it's difficult for me yet.
I'm keep learning Scheme(lisp) and ... 

>Note: Sl4a_R5 fixes editor editors for "unsupported" languages. 

So other ones could try to provide it now.

Original comment by tomcatalbino on 30 Mar 2012 at 5:54

GoogleCodeExporter commented 9 years ago
Now the apk can be download from

http://code.google.com/p/jscheme-for-android/

The RPC/JSON stuff is provide with Java classes yet.

Original comment by tomcatalbino on 28 Jun 2012 at 11:32