SummaryPicoLisp can be compiled for android and a simple web server can be created.
To make it easier to work on the device, I strongly suggest Terminal IDE
Telnetting into the device is optional - much easier than using a keyboard I found.
ISSUES: 1. Initially the externally defined functions would not work, e.g. ht:Pack. I was able to work around it for ht:Pack by compiling in ht.c and then manually defining it. I found other issues though with other externals and stopped due to time 2. Because of this, I can't run (html) or (http) by default
Bootstrapped Steps: 1. Install Terminal IDE from the android market 2. Telnet into your device For this, I've had the most success with running utelneted manually after starting terminal IDE) 2a. Launch Terminal IDE 2b. Run the following: utelnetd -p 2300 -l $HOME/system/bin/bash 2c. Terminal IDE outputs your IP address on the shell firstname.lastname@example.org:~/ 3. Once connected through telnet, fetch arm-picoLisp.tar.gz from my dropbox account wget http://18.104.22.168/u/20783971/arm-picoLisp.tar.gz *Note: IP Address is used because Terminal IDE can't resolve host names without a rooted device and /resolve.conf 4. mv arm-picoLisp.tar.gz to ~/bin 5. tar -zxvf arm-picoLisp.tar.gz 6. ./pil
To fire up a web server:
./pil lib/http.l (redef http (S) (in S (line)) (out S (prinl "Hello World!"))) (server 8001)
As you can see, we need to define ht:Pack. I could have added it to a file but wanted it here to be transparent
./pil @lib/http.l @lib/xhtml.l -'(de ht:Pack (U) (pack U))' -'server 8001 "test.l"' -wait :
FULL STEPS: 1. On ubuntu, install gcc-4.4-arm-linux-gnueabi sudo apt-get install gcc-4.4-arm-linux-gnueabi 2. Replace Makefile abbreviated form here. You can see the full version in the tar.gz above] Main changes: a. replace gcc with $(CC) b. make it statically link c. remove flags that aren't compatible with arm-linux-gnueabi-gcc-4.4] 3. make
bin = ../bin lib = ../lib picoFiles = main.c gc.c apply.c flow.c sym.c subr.c big.c io.c net.c tab.c ht.c CC := arm-linux-gnueabi-gcc-4.4 CFLAGS := -c -O2 -pipe \ -falign-functions -fomit-frame-pointer -fno-strict-aliasing \ -W -Wimplicit -Wreturn-type -Wunused -Wformat \ -Wuninitialized -Wstrict-prototypes \ -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 OS = Linux PICOLISP-FLAGS = LIB-FLAGS = -static -lc -lm -ldl DYNAMIC-LIB-FLAGS = -m32 -static -export-dynamic STRIP = picolisp: $(bin)/picolisp all: picolisp .c.o: $(CC) $(CFLAGS) -D_OS='"$(OS)"' $*.c $(picoFiles:.c=.o) ext.o ht.o z3d.o: pico.h main.o: vers.h $(bin)/picolisp: $(picoFiles:.c=.o) mkdir -p $(bin) $(lib) $(CC) -o $(bin)/picolisp$(exe) $(PICOLISP-FLAGS) $(picoFiles:.c=.o) $(LIB-FLAGS) # Clean up clean: rm -f *.o
Open IssuesI haven't yet figured out how to port ht:Out. This is my current progress:
As you can see I think it should be evaulating what comes after the header.
|http://picolisp.com/5000/!wiki?androidwebserver||TeX PDF 23feb12 joebo|