From b71a63c28f11328e3bbfd59d2736750c737f98bb Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sat, 24 Dec 2016 08:33:36 +0100 Subject: Add build scripts for CLISP. --- build-clisp-haskell.bash | 12 ++++++++++++ com/clisp/savesys.lisp | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100755 build-clisp-haskell.bash create mode 100644 com/clisp/savesys.lisp diff --git a/build-clisp-haskell.bash b/build-clisp-haskell.bash new file mode 100755 index 0000000..d6fc502 --- /dev/null +++ b/build-clisp-haskell.bash @@ -0,0 +1,12 @@ +#!/bin/bash + +dirs="ast backend cfn cl-support com command-interface csys depend derived flic import-export parser prec + printers progs/prelude runtime support tdecl top type util" + +for dir in ${dirs}; do + mkdir -p $dir/clisp +done + +export Y2=$PWD + +clisp com/clisp/savesys.lisp diff --git a/com/clisp/savesys.lisp b/com/clisp/savesys.lisp new file mode 100644 index 0000000..7010b03 --- /dev/null +++ b/com/clisp/savesys.lisp @@ -0,0 +1,40 @@ +(make-package "MUMBLE-IMPLEMENTATION") +(load "cl-support/cl-init") + +;;; Set various internal switches to appropriate values for running +;;; Haskell code. +(proclaim '(optimize (speed 3) (safety 0) (compilation-speed 0))) +(setf *compile-verbose* nil) +(setf *load-verbose* nil) +(in-package :mumble-user) +(setf *printers* '(compiling loading)) +(setf *optimizers* '()) +(setf *compile-interface* '#f) + +;;; Load the prelude. +(compile/load *prelude-unit-filename*) + +;;; Set up the saved system. +(define *saved-readtable* (lisp:copy-readtable lisp:*readtable*)) + +(define (haskell-toplevel) + ;; Saved system always starts up in USER package. + (setf lisp:*package* (lisp:find-package :mumble-user)) + ;; Saved system seems to forget about our readtable hacks. + (setf lisp:*readtable* *saved-readtable*) + ;; Set printer variables w/implementation-defined initial values + ;; to known values + (setf *print-pretty* '#f) + (load-init-files) + (do () ('#f) + (cl:with-simple-restart (restart-haskell "Restart Haskell.") + (heval)))) + +(define (restart-haskell) + (cl:invoke-restart 'restart-haskell)) + +(ext:saveinitmem "bin/clisp-haskell" + :executable t + :quiet t + :init-function 'haskell-toplevel) +(ext:exit) -- cgit v1.2.3