For those interested in using Gambit on the iPhone/iPad/iTouch, I have created an example (examples/iOS) which shows how to do it. One of the key components is the "build-gambit-iOS" script, which builds the Gambit runtime library for the physical device, and the simulator.
The app, which is called "Gambit REPL", offers a simple development environment for Gambit. It is possible to interact with the interpreter/debugger using Gambit's REPL. A collection of scripts can be edited and run. The program comes with a few predefined scripts, including a REPL server which allows starting a REPL from a remote telnet client.
Below are some screenshots for the iPhone.
I may be submitting this to the Apple App store. If you fiddle around with the app, and improve it, have comments or write interesting scripts, please let me know and I will add them to the app.
Marc
Afficher les réponses par date
On Mar 15, 2011, at 1:36 AM, Marc Feeley wrote:
For those interested in using Gambit on the iPhone/iPad/iTouch, I have created an example (examples/iOS) which shows how to do it. One of the key components is the "build-gambit-iOS" script, which builds the Gambit runtime library for the physical device, and the simulator.
The app, which is called "Gambit REPL", offers a simple development environment for Gambit. It is possible to interact with the interpreter/debugger using Gambit's REPL. A collection of scripts can be edited and run. The program comes with a few predefined scripts, including a REPL server which allows starting a REPL from a remote telnet client.
Below are some screenshots for the iPhone.
I may be submitting this to the Apple App store. If you fiddle around with the app, and improve it, have comments or write interesting scripts, please let me know and I will add them to the app.
It may be interesting to see what happens if you submit it to the App Store. The Apple developer agreement still provides that no interpreter may be used on an iOS device unless all code run by the interpreter is packaged with the app at the time it's installed, and no app is allowed to unlock or add additional features after install. I would expect Apple to reject this app on that basis.
Of course, it remains extremely useful to those of us using Gambit in iOS development.
--me
On 2011-03-15, at 3:24 AM, mikel evins wrote:
On Mar 15, 2011, at 1:36 AM, Marc Feeley wrote:
For those interested in using Gambit on the iPhone/iPad/iTouch, I have created an example (examples/iOS) which shows how to do it. One of the key components is the "build-gambit-iOS" script, which builds the Gambit runtime library for the physical device, and the simulator.
The app, which is called "Gambit REPL", offers a simple development environment for Gambit. It is possible to interact with the interpreter/debugger using Gambit's REPL. A collection of scripts can be edited and run. The program comes with a few predefined scripts, including a REPL server which allows starting a REPL from a remote telnet client.
Below are some screenshots for the iPhone.
I may be submitting this to the Apple App store. If you fiddle around with the app, and improve it, have comments or write interesting scripts, please let me know and I will add them to the app.
It may be interesting to see what happens if you submit it to the App Store. The Apple developer agreement still provides that no interpreter may be used on an iOS device unless all code run by the interpreter is packaged with the app at the time it's installed, and no app is allowed to unlock or add additional features after install. I would expect Apple to reject this app on that basis.
I know of another Scheme interpreter, Pixie Scheme III for iPad, which has a "Save World" feature and which is available on the App store. I'm not sure Gambit REPL is very much different in this respect. Do you think the fact that you can "telnet" to Gambit REPL makes it objectionable with respect to the Apple license, or is it something else? Perhaps the fact that Pixie Scheme III is free makes a difference. I'm tempted to charge 0.99 $ for Gambit REPL to see if the fact that it is non-free makes a difference.
Marc
On Mar 15, 2011, at 6:47 AM, Marc Feeley wrote:
On 2011-03-15, at 3:24 AM, mikel evins wrote:
On Mar 15, 2011, at 1:36 AM, Marc Feeley wrote:
For those interested in using Gambit on the iPhone/iPad/iTouch, I have created an example (examples/iOS) which shows how to do it. One of the key components is the "build-gambit-iOS" script, which builds the Gambit runtime library for the physical device, and the simulator.
The app, which is called "Gambit REPL", offers a simple development environment for Gambit. It is possible to interact with the interpreter/debugger using Gambit's REPL. A collection of scripts can be edited and run. The program comes with a few predefined scripts, including a REPL server which allows starting a REPL from a remote telnet client.
Below are some screenshots for the iPhone.
I may be submitting this to the Apple App store. If you fiddle around with the app, and improve it, have comments or write interesting scripts, please let me know and I will add them to the app.
It may be interesting to see what happens if you submit it to the App Store. The Apple developer agreement still provides that no interpreter may be used on an iOS device unless all code run by the interpreter is packaged with the app at the time it's installed, and no app is allowed to unlock or add additional features after install. I would expect Apple to reject this app on that basis.
I know of another Scheme interpreter, Pixie Scheme III for iPad, which has a "Save World" feature and which is available on the App store. I'm not sure Gambit REPL is very much different in this respect. Do you think the fact that you can "telnet" to Gambit REPL makes it objectionable with respect to the Apple license, or is it something else?
I don't know. The developer agreement says:
"An Application may not download or install executable code. Interpreted code may only be used in an Application if all scripts, code and interpreters are packaged in the Application and not downloaded. The only exception to the foregoing is scripts and code downloaded and run byApple's built-in WebKit framework."
This clause doesn't specifically mention code that is typed in at a prompt, and I don't know whether typing code at a prompt would be considered "downloading" it--although, pretty clearly, such code can't be considered to be "packaged in the Application".
I'm not sure these fine distinctions really matter, though.
Perhaps the fact that Pixie Scheme III is free makes a difference. I'm tempted to charge 0.99 $ for Gambit REPL to see if the fact that it is non-free makes a difference.
I'm not sure what you can learn from that experiment. Apple is pretty capricious about what it allows on the App Store. True, Pixie Scheme is allowed so far. On the other hand, and inexplicably, Scratch (http://scratch.mit.edu/) is not.
You may find, as many developers before you have found, that your app is allowed at version 1.0 and disallowed at version 1.1 with only tiny changes. You may find it's allowed and then, without explanation, disallowed.
I'm curious to see what happens, but I'm not sure what we can actually learn.
--me
mikel, et al,
I haven't looked into it, but how does the Apple official in-app purchased upgrades mechanism work? Or does that not intersect the interpreted code issue by not allowing any scripts?
Mike
On Tue, Mar 15, 2011 at 5:15 AM, mikel evins mevins@me.com wrote: ...
I don't know. The developer agreement says:
"An Application may not download or install executable code. Interpreted code may only be used in an Application if all scripts, code and interpreters are packaged in the Application and not downloaded. The only exception to the foregoing is scripts and code downloaded and run byApple's built-in WebKit framework."...
On Mar 15, 2011, at 3:19 PM, Michael Wirth wrote:
mikel, et al,
I haven't looked into it, but how does the Apple official in-app purchased upgrades mechanism work? Or does that not intersect the interpreted code issue by not allowing any scripts?
If by "how the Apple official in-app purchased upgrades mechanism work" you mean what the API code does, I don't know.
If you mean the terms of the license, what it boils down to is that you can offer add-on features for sale if you agree to abide by a somewhat elaborate set of restrictions. There's nothing in there specifically about interpreters, but I doubt that anything very open-ended will fly. One of the restrictions is that you have to submit any features you're going to sell for Apple approval before you can sell them.
Ralph's speculations sound pretty reasonable. As a former longtime Apple employee, I know that makes them somewhat unlikely. :-)
Just a thought, maybe what Apple wants is complete monopoly for their AppStore on application sales, so what they don't want is any app that in turn sells anything like apps (as Scratch do)? Mikael
On Mar 15, 2011, at 7:47 AM, Marc Feeley wrote:
Do you think the fact that you can "telnet" to Gambit REPL makes it objectionable with respect to the Apple license
I think this would be the problem if there were any. The success of Pixie Scheme makes it clear that Apple has no problem with a non-javascript interpreter that runs new code as long as that new code is entered by the user on the iOS device itself.
Apple seems to be wary of the possibility of a remote exploit. The fact that a malicious hacker could, in theory, telnet into a user's iOS device and execute arbitrary code on a wireless carrier's network is what Apple seem to be guarding against.
OTOH, they may have no problem with it at all.
Finally, I don't know whether making it paid rather than free would have an impact on acceptance, but I bet making it iAd supported would increase the likelihood of acceptance :^)
warmest regards,
Ralph
Raffael Cavallaro raffaelcavallaro@me.com
On 2011-03-15, at 9:14 AM, Raffael Cavallaro wrote:
On Mar 15, 2011, at 7:47 AM, Marc Feeley wrote:
Do you think the fact that you can "telnet" to Gambit REPL makes it objectionable with respect to the Apple license
I think this would be the problem if there were any. The success of Pixie Scheme makes it clear that Apple has no problem with a non-javascript interpreter that runs new code as long as that new code is entered by the user on the iOS device itself.
Apple seems to be wary of the possibility of a remote exploit. The fact that a malicious hacker could, in theory, telnet into a user's iOS device and execute arbitrary code on a wireless carrier's network is what Apple seem to be guarding against.
OTOH, they may have no problem with it at all.
Finally, I don't know whether making it paid rather than free would have an impact on acceptance, but I bet making it iAd supported would increase the likelihood of acceptance :^)
warmest regards,
I guess I could submit a few variants of Gambit REPL to see which ones are accepted:
- Gambit REPL Free: just the REPL - Gambit REPL Lite: adds script editing - Gambit REPL Full: adds the REPL server - Gambit REPL Risky: adds the Termite server (!)
Marc
On Mar 15, 2011, at 8:14 AM, Raffael Cavallaro wrote:
On Mar 15, 2011, at 7:47 AM, Marc Feeley wrote:
Do you think the fact that you can "telnet" to Gambit REPL makes it objectionable with respect to the Apple license
I think this would be the problem if there were any. The success of Pixie Scheme makes it clear that Apple has no problem with a non-javascript interpreter that runs new code as long as that new code is entered by the user on the iOS device itself.
Then why ban Scratch?
Apple seems to be wary of the possibility of a remote exploit. The fact that a malicious hacker could, in theory, telnet into a user's iOS device and execute arbitrary code on a wireless carrier's network is what Apple seem to be guarding against.
OTOH, they may have no problem with it at all.
Finally, I don't know whether making it paid rather than free would have an impact on acceptance, but I bet making it iAd supported would increase the likelihood of acceptance :^)
Your reasoning sounds sensible. That leads me to suspect that you have never worked for any length of time at Apple. A sure sign of the non-Apple veteran is overestimating the importance of plausible rationales, and underestimating the importance of bad moods and caprice.
--me
On Mar 15, 2011, at 5:11 PM, mikel evins wrote:
Then why ban Scratch?
The Scratch motto is "Imagine. Program. Share." Apple appears (at the moment) to have no problem with the "Imagine" and "Program" bits. They have real problems with the "Share" part. As long as users are in their own private box (i.e., scheme interpreter) they can write whatever code they like. Once they start downloading and running code others have written, Apple will cut them off at the knees. Pixie Scheme is safe as long as all people use it for is inconsequential repl doodling. If people start posting, downloading, and running significant scripts/programs, Apple will ban it.
Your reasoning sounds sensible.
True, though I never claimed it would be a reliable guide to Apple's future actions. ;^)
That leads me to suspect that you have never worked for any length of time at Apple.
True. But I was a seed site for Apple Dylan and am quite familiar with Apple's "power to cancel your very best."
A sure sign of the non-Apple veteran is overestimating the importance of plausible rationales, and underestimating the importance of bad moods and caprice.
Again, I was only putting forward a logical possibility, not making guarantees about Apple's future behavior, which I agree, is likely to be quite arbitrary.
If one wants *guarantees* about being able to do anything with an iOS device, one should jailbreak it.
warmest regards,
Ralph
Raffael Cavallaro raffaelcavallaro@me.com
On Mar 15, 2011, at 4:29 PM, Raffael Cavallaro wrote:
On Mar 15, 2011, at 5:11 PM, mikel evins wrote:
Then why ban Scratch?
The Scratch motto is "Imagine. Program. Share." Apple appears (at the moment) to have no problem with the "Imagine" and "Program" bits. They have real problems with the "Share" part. As long as users are in their own private box (i.e., scheme interpreter) they can write whatever code they like. Once they start downloading and running code others have written, Apple will cut them off at the knees. Pixie Scheme is safe as long as all people use it for is inconsequential repl doodling. If people start posting, downloading, and running significant scripts/programs, Apple will ban it.
Your reasoning sounds sensible.
True, though I never claimed it would be a reliable guide to Apple's future actions. ;^)
That leads me to suspect that you have never worked for any length of time at Apple.
True. But I was a seed site for Apple Dylan and am quite familiar with Apple's "power to cancel your very best."
A sure sign of the non-Apple veteran is overestimating the importance of plausible rationales, and underestimating the importance of bad moods and caprice.
Again, I was only putting forward a logical possibility, not making guarantees about Apple's future behavior, which I agree, is likely to be quite arbitrary.
Well, maybe I exaggerate a little. At any rate, I would *like* to believe your rationale. :-)
On Mar 15, 2011, at 1:36 AM, Marc Feeley wrote:
For those interested in using Gambit on the iPhone/iPad/iTouch, I have created an example (examples/iOS) which shows how to do it.
Marc, what's the best approach to using this new development? Just grab the latest sources, or await a release?
--me
On 2011-03-15, at 3:26 AM, mikel evins wrote:
On Mar 15, 2011, at 1:36 AM, Marc Feeley wrote:
For those interested in using Gambit on the iPhone/iPad/iTouch, I have created an example (examples/iOS) which shows how to do it.
Marc, what's the best approach to using this new development? Just grab the latest sources, or await a release?
On a Mac with XCode 4.0 installed:
% curl "http://www.iro.umontreal.ca/~gambit/download/gambit/v4.6/source/gambc-v4_6_0..." > "gambc-v4_6_0-devel.tgz" % tar zxf gambc-v4_6_0-devel.tgz % cd gambc-v4_6_0-devel % ./configure --enable-single-host % make -j 2 % make update % cd examples/iOS % make examples % ./build-gambit-iOS % open GambitREPL.xcodeproj
Then in XCode in the upper left corner of the main window, select the Scheme "GambitREPL-simulator | iPhone 4.3 Simulator" and click "Run". This will compile Gambit REPL and execute it in the simulator. In the Gambit REPL splash screen, click the "Edit Scripts" button, then scroll down to the last script, and click its "Run" button. You can then telnet into Gambit REPL from a shell on your Mac using "telnet localhost 7000" (if it was a real device you would replace localhost with the device's IP address which you can get in the "Settings" app).
Have fun!
Marc
On Mar 15, 2011, at 7:18 AM, Marc Feeley wrote:
On a Mac with XCode 4.0 installed:
% curl "http://www.iro.umontreal.ca/~gambit/download/gambit/v4.6/source/gambc-v4_6_0..." > "gambc-v4_6_0-devel.tgz" % tar zxf gambc-v4_6_0-devel.tgz % cd gambc-v4_6_0-devel % ./configure --enable-single-host % make -j 2 % make update % cd examples/iOS % make examples % ./build-gambit-iOS % open GambitREPL.xcodeproj
Then in XCode in the upper left corner of the main window, select the Scheme "GambitREPL-simulator | iPhone 4.3 Simulator" and click "Run".
FWIW, this does not work for me, though I've found a workaround.
Here are the details:
Everything goes smoothly though:
% make -j 2
but when doing:
% make update
I get several errors:
[much, presumably normal, output snipped] making all in iOS make[3]: *** No rule to make target `all'. Stop. make[2]: *** [all-recursive] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [update] Error 2 rafbookpro13:gambc-v4_6_0-devel raffaelc$ cd examples/iOS/ rafbookpro13:iOS raffaelc$ make examples make: *** No rule to make target `examples'. Stop.
So I switch back to the gambc-v4_6_0-devel root directory and do:
% make clean % ./configure --enable-single-host % make -j 2 % make update
which now succeeds. then:
% cd examples/iOS % make examples
Then trying to do:
% ./build-gambit-iOS
I get a permission error (i.e., build-gambit-iOS does not have the executable bit set)
so I do:
% chmod +x ./build-gambit-iOS
then:
% ./build-gambit-iOS
and the rest works as it should.
Finally, remember that cut and paste into the repl or script editor in the iOS simulator is a bit tricky. You need to copy from some source (e.g., emacs) then hit cmd-V in the simulator; nothing will appear to happen, but your text is now in the iOS simulator's clipboard. Only now, after "loading" the iOS simulator's clipboard, should you use the touch gesture (two finger trackpad click or control-click) on the simulator screen to get the "Select | Select All | Paste" pop-up on the iOS simulator screen and paste your text. If you don't hit Cmd-V first, your clipboard contents will be stale. This extra step is to prevent the Mac OS clipboard and iOS simulator clipboard from overwriting each other.
Maybe this will be helpful to others who run into similar issues.
warmest regards,
Ralph
Raffael Cavallaro raffaelcavallaro@me.com
Thanks for your fixes. So did you get Gambit REPL running? In the simulator and/or actual device?
Marc
On 2011-03-16, at 11:31 AM, Raffael Cavallaro wrote:
On Mar 15, 2011, at 7:18 AM, Marc Feeley wrote:
On a Mac with XCode 4.0 installed:
% curl "http://www.iro.umontreal.ca/~gambit/download/gambit/v4.6/source/gambc-v4_6_0..." > "gambc-v4_6_0-devel.tgz" % tar zxf gambc-v4_6_0-devel.tgz % cd gambc-v4_6_0-devel % ./configure --enable-single-host % make -j 2 % make update % cd examples/iOS % make examples % ./build-gambit-iOS % open GambitREPL.xcodeproj
Then in XCode in the upper left corner of the main window, select the Scheme "GambitREPL-simulator | iPhone 4.3 Simulator" and click "Run".
FWIW, this does not work for me, though I've found a workaround.
Here are the details:
Everything goes smoothly though:
% make -j 2
but when doing:
% make update
I get several errors:
[much, presumably normal, output snipped] making all in iOS make[3]: *** No rule to make target `all'. Stop. make[2]: *** [all-recursive] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [update] Error 2 rafbookpro13:gambc-v4_6_0-devel raffaelc$ cd examples/iOS/ rafbookpro13:iOS raffaelc$ make examples make: *** No rule to make target `examples'. Stop.
So I switch back to the gambc-v4_6_0-devel root directory and do:
% make clean % ./configure --enable-single-host % make -j 2 % make update
which now succeeds. then:
% cd examples/iOS % make examples
Then trying to do:
% ./build-gambit-iOS
I get a permission error (i.e., build-gambit-iOS does not have the executable bit set)
so I do:
% chmod +x ./build-gambit-iOS
then:
% ./build-gambit-iOS
and the rest works as it should.
Finally, remember that cut and paste into the repl or script editor in the iOS simulator is a bit tricky. You need to copy from some source (e.g., emacs) then hit cmd-V in the simulator; nothing will appear to happen, but your text is now in the iOS simulator's clipboard. Only now, after "loading" the iOS simulator's clipboard, should you use the touch gesture (two finger trackpad click or control-click) on the simulator screen to get the "Select | Select All | Paste" pop-up on the iOS simulator screen and paste your text. If you don't hit Cmd-V first, your clipboard contents will be stale. This extra step is to prevent the Mac OS clipboard and iOS simulator clipboard from overwriting each other.
Maybe this will be helpful to others who run into similar issues.
warmest regards,
Ralph
Raffael Cavallaro raffaelcavallaro@me.com
On Mar 16, 2011, at 1:50 PM, Marc Feeley wrote:
Thanks for your fixes. So did you get Gambit REPL running? In the simulator and/or actual device?
You're quite welcome - it's the least I could do in gratitude for your many years of development of Gambit.
Yes, it runs fine on the simulator - I haven't tried running it on an iOS device yet.
Again, thanks for a great multi-platform scheme compiler, interpreter, and debugger.
warmest regards,
Ralph
Raffael Cavallaro raffaelcavallaro@me.com