Projects that use Akku as their package manager can be developed with Emacs, an extensible editor, and Geiser, an extension that allows different Scheme implementations to talk to Emacs. You can open a REPL, browse documentation and other SLIME-like operations, all within Emacs.
Install Emacs and Geiser
You can probably install Emacs from your OS package manager. Otherwise, there is general advice here.
On top of Emacs, you can install Geiser by using MELPA. Just type
M-x package-install RET geiser inside Emacs. Here you can find more detail.
Now, in order to make Geiser aware of the directories that Akku creates to manage project dependencies, you need to have a startup file in your home directory that is called
.<your scheme implementation>-geiser, e.g.
.racket-geiser. Please refer to the Geiser documentation to check which Scheme implementations are supported.
This startup file can contain any scheme code that you want to run before Geiser starts a REPL integrated within Emacs with your preferred Scheme.
Here is an example of a simple startup file that checks for an Akku root folder in the current folder, and then extending the
library-directories of Chez Scheme with the correct subfolders, or otherwise checks the four next levels of parent directories for the same:
(let ([dirlist '("." ".." "../.." "../../.." "../../../..")]) (call/cc (lambda (return) (for-each (lambda (dir) (let* ([akku-dir (string-append (current-directory) "/" dir)] [akku-list (string-append akku-dir "/.akku/list")] [akku-lib (string-append akku-dir "/.akku/lib")]) (format #t "~a~%" akku-list) (when (file-exists? akku-list) (library-directories akku-lib) (format #t "(library-directories ~s)~%" akku-lib) (return 'done)))) dirlist))))
Here is a more extensive example that checks all parent folders up to the root for an Akku managed folder, and, if it finds one, sets both the
library-directories parameter and the FFI environment variables to work with Akku:
;; © 2019 Göran Weinholt. SPDX-License-Identifier: MIT. (let () ;; This code has the same effect as .akku/lib/activate, but runs ;; directly in Chez Scheme. (define dirsep (string (directory-separator))) (define (find-akku-root) (let lp ((dir (cd))) (let ((libdir (string-append dir dirsep ".akku" dirsep "lib"))) (if (file-directory? libdir) dir (let ((parent (path-parent dir))) (if (equal? parent (path-root dir)) #f (lp parent))))))) (define (set-ld-library-path variable root) (putenv variable (string-append root dirsep ".akku" dirsep "ffi" (cond ((getenv variable) => (lambda (dir) (string-append ":" dir))) (else ""))))) (cond ((find-akku-root) => (lambda (root) (printf "~%Using ~s as the Akku project root~%" root) ;; The search directory for Scheme source and compiled objects (library-directories (list (cons (string-append root dirsep ".akku" dirsep "lib") (string-append root dirsep ".akku" dirsep "libobj")))) ;; The search directory for the FFI (set-ld-library-path "LD_LIBRARY_PATH" root) (set-ld-library-path "DYLD_LIBRARY_PATH" root))) (else (printf "~%No .akku/lib found in or above ~s~%" (cd)))))