Joe, Christophe, re: miniPicoLisp (c to asm.js via emscripten) and stream management:
Simlarly maybe "Query" could be adapted via emscripten: https://github.com/tj64/picolisp-by-example/blob/master/mainmatter/rosettacode-C.tex "[ Calling a PicoLisp function from another program requires a running interpreter. There are several possibilities, like IPC via fifo's or sockets using the PLIO (PicoLisp-I/O) protocol, but the easiest is calling the interpreter in a pipe. This is relatively efficient, as the interpreter's startup time is quite short. ]" "[ int Query(char *Data, size_t *Length) { FILE *fp; char buf[64]; sprintf(buf, "/usr/bin/picolisp query.l \%d -bye", *Length); if (!(fp = popen(buf, "r"))) return 0; fgets(Data, *Length, fp); *Length = strlen(Data); return pclose(fp) >= 0 \&\& *Length != 0; } ]" On Fri, May 9, 2014 at 8:19 AM, Joe Bogner <joebog...@gmail.com> wrote: > Hi Rick, Christophe, > > I was thinking the same thing. miniPicolisp might be a simpler first step > to port > > > On Fri, May 9, 2014 at 7:51 AM, Rick Lyman > <lyman.r...@gmail.com<lymanr...@gmail.com> > > wrote: > >> Christophe, >> >> How about porting the c version using: >> https://github.com/kripken/emscripten? >> >> -rl >> >> >> On Thu, May 8, 2014 at 5:08 PM, Christophe Gragnic < >> christophegrag...@gmail.com> wrote: >> >>> Hi, >>> >>> I'm currently embedding a «pedagogical pseudo-code like language» in >>> PicoLisp. >>> As using plain browsers is a nice thing to have in front of students, >>> I tried with >>> EmuLisp (PicoLisp in JS, by Jon Kleiser, that I won't thank enough, with >>> Alex), >>> which proved to be a good solution for me. >>> >>> So I had some thoughts, ideas and questions. >>> >>> 1) EmuLisp lacks some functions. The first idea I had was to write them >>> in the >>> available functions (like 'glue' with 'pack'). It worked for some, but >>> some others >>> needed to be implemented in JS. Now my question: how far could be pushed >>> the >>> idea to write a maximal subset of Picolisp in a minimal subset of >>> Picolisp? Like in >>> the original paper of McCarthy or «the Jewel» in SICP? I'm not talking >>> about >>> performance here, just functions availability. >>> >>> 2) Since PicoLisp64 is written in a «generic assembly» embedded in >>> PicoLisp, >>> I was wondering (only wondering, since the concepts are a bit vague for >>> me) if >>> instead of building the .s files we could build some >>> http://asmjs.org/file(s). >>> >>> 3) Regarding EmuLisp again, and for your information, I've created >>> (and am using seriously!) a JS pil, that I named `piljs` which runs on >>> node >> >> >> >