Standard symbol collisions
It is useful to use another name for existing functions in the host Lisp implementation. So we will be able to use it and test it interactively without compiling JSCL once and again.
We could use ! to prefix such symbols and rename them in the end of the bootstrap.
I'm taking care of this. The approach is that for every function named with ! prefix an alias without the prefix will be created. Therefore any function which would collision with host function should be prefixed: !read-from-string, !read, !compile-file, !parse-integer, !proclaim, etc.
As a suggestion, it would perhaps be less noise if instead the package itself were renamed during cross-build?
eg:
(defpackage #+jscl common-lisp #-jscl jscl/common-lisp
(:use) ; nothing!
(:nicknames #+jscl #:jscl/common-lisp #:cl #:jscl/cl))
;; Use whichever CL is current; not JSCL/CL explicitly though
(defpackage jscl/int
(:use :cl :jscl :jscl/ffi :jscl/mop :jscl/cltl2 :jscl/gray)) ; ambitious!
(defpackage my-jscl-app
(:use #+jscl :cl #-jscl :jscl/cl))
(defun jscl/cl::format …)
The trick is to not use (in-package :jscl/cl) when reading the source code, so the dependent functions will use whichever CL package is correct for the runtime system, but you can always prefix the functions to call the JSCL-ish versions from within SBCL (or wherever). (in-package :jscl/int) perhaps.
Yes. I have wanted to do this for a while.
SBCL uses a similar strategy as far as I know. Everything starts i the SB!xx packages, and just before finishing the packages are renamed to SB-xx instead.
It would make bootstrapping easier. I also want to avoid, if possible, the distintion between host and target files. I imagine a single file compat.lisp to provide in ANSI CL all JSCL provides in the core (emulate oget, etc), and using the renamed packages to load all the code in the host and in the target. It is too early to do that but this would help.