On Sat, Jul 15, 2017 at 6:56 AM, Alexander Burger <a...@software-lab.de> wrote: > > Hi Matt, > > > In order to minimize flash footprint, I was wondering if it would be > > possible to compile code down to byte code? The reason i wanted to do that > > is then I could make of some library functions in reader macros off-target > > and avoid installing libraries on the target. > > Can you explain what you mean? Compile *what* to byte code? Not the PicoLisp > binary, right?
Correct. I am working on a project that uses a MIPS processo embedded in an SoC. But I would like to take advantage of native, in particular to allow me easy access to some hardware registers on the SoC using mmap. I need the 64-bit PicoLisp, but MIPS isn't one of the architectures currently supported. I started to look at how things are done for ARM and intel, but don't have the time right now to properly add MIPS. So, I got the 64-bit PicoLisp compiled in emulator mode, after cross-compiling sysdefs, capturing the output in a text file, and then using that output in places where the output from sysdefs was read via a pipe. I had assumed (perhaps incorrectly) that, using emu, VM bytecode was created on the fly and that it gets "executed" (I think this is a bit how lua works - not LuaJIT). > Note that normal PicoLisp doesn't compile anything. It "compiles" to > structures > of pointers to pointers, where the compiler is called the "reader" in Lisp. > > As you talk of libraries, you should look at miniPicoLisp. It "compiles" Lisp > source files to C structures, to be able to put them into ROM instead of > precious RAM at runtime. However, these are still not byte codes, but the good > old pointers to pointers :) Believe or not, on this project, flash storage space is becoming a problem. Don't get me started on the decisions that led to this :). That was my motivation for storing just the picolisp binary, and finding some way to only "pay" for the storage space for the library functions that I use. I can collect them manually, I know, but I am lazy and wanted to make the reader to my work for me. I will look at miniPicoLisp too. I am completely open to the idea that I am being completely wrong headed about something. > ♪♫ Alex > > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe