Skip to content

Instantly share code, notes, and snippets.

@drewc
Last active October 6, 2023 20:10
Show Gist options
  • Save drewc/5f260537b7914a2b999c8a539fb48098 to your computer and use it in GitHub Desktop.
Save drewc/5f260537b7914a2b999c8a539fb48098 to your computer and use it in GitHub Desktop.
gerbil-swank for wiki?
━━━━━━━━━━━━━━━━━━━━━━━━━
I LOVE A SLIME'Y SWANK!
Drew Crampsie
━━━━━━━━━━━━━━━━━━━━━━━━━
Table of Contents
─────────────────
1 Installing the gxpkg package
2 Running the listener
3 Connecting and REPL'ing from emacs
I'd been using Common Lisp, full-time, since 2004. The user interfaces
to CL implementations, on the free and multi-platform side, were almost
all emacs related. Due to ILISP and then SLIME, Emacs ended up becoming
my primary editor, as it has for many, due only to lisp interaction.
So, like a lot of Common Lispniks, I found SLIME and the features it
offered valuable. Even if not used for editing files, SLIME it makes a
wonderful REPL that works across lisps and schemes. It also may work on
frauds, swindles, and rackets.
Beyond that, it interacts with gerbil on a level that allows us (read:
me) to see more about how gerbil works compared to CL.
1 Installing the gxpkg package
══════════════════════════════
It is quite simple to get up and running. In the shell, type:
┌────
│ gxpkg install github.com/ecraven/r7rs-swank
└────
┌────
│ ... install github.com/ecraven/r7rs-swank
│ ... build github.com/ecraven/r7rs-swank
│ ... compile gerbil-swank
│ ... tagging packages
└────
2 Running the listener
══════════════════════
Now, start a `gxi' (or `M-x run-scheme' for emacs), and start a swank
server. Note that it takes over the REPL, as it is single
threaded. `C-c' will get you out of it.
┌────
│ drewc@aine ~/src $ gxi
│ Gerbil v0.12-DEV-1232-gacb1af1 on Gambit v4.8.8
└────
┌────
│ > (import :ecraven/gerbil-swank)
│ > (start-swank 4205)
└────
┌────
│ swank listening on 4205
└────
3 Connecting and REPL'ing from emacs
════════════════════════════════════
Make sure that you're using the slime-repl.
┌────
│ ; This is emacs-lisp
└────
`M-x slime-connect' is all that's needed to connect. We started it on
port 4205, and emacs will ask for the port number. At which point, we
have a prompt!
┌────
│ ; SLIME 2.20
│ (user)>
└────
It has `(user)>' as the prompt. CL has packages, but gerbil does not,
/per se/, so what does user refer to?
@corpix
Copy link

corpix commented Jan 24, 2021

Hello. I've run into an issue with ecraven/r7rs-swank, but your fork is working for me.

Here is my gerbil version:

$ gxi -v
Gerbil v0.16-120-g3f248e13 on Gambit v4.9.3-1232-gbba388b8

And here is an error I've got with ecraven/r7rs-swank. I hope it will help other people.

$ gxpkg build github.com/ecraven/r7rs-swank
... build github.com/ecraven/r7rs-swank
*** ERROR IN #<procedure #23>, "gerbil-build.ss"@23.21 -- No such file or directory
(call-with-input-file "gerbil-build-deps" '#<procedure #24 read>)
Process exited with non-zero status
17920
(path: "/home/user/.gerbil/pkg/github.com/ecraven/r7rs-swank/gerbil-build.ss" arguments: ("compile") environment: #f directory: "~/.gerbil/pkg/github.com/ecraven/r7rs-swank" stdin-redirection: #t stdout-redirection: #f stderr-redirecti...

@NightMachinery
Copy link

I, too, get an error:

❯ gxpkg install github.com/ecraven/r7rs-swank
... install github.com/ecraven/r7rs-swank
... build github.com/ecraven/r7rs-swank
*** ERROR IN #<procedure #23>, "gerbil-build.ss"@23.21 -- No such file or directory
(call-with-input-file "gerbil-build-deps" '#<procedure #24 read>)
Process exited with non-zero status
17920
(path: "/Users/evar/.gerbil/pkg/github.com/ecraven/r7rs-swank/gerbil-build.ss" arguments: ("compile") envir...

❯ gxpkg build all
... build github.com/danielsz/gerbil-gumbo
... build github.com/fare/gerbil-utils
*** ERROR IN gx#core-expand-ref% -- Syntax Error
*** ERROR IN "hash.ss"@46.14
--- Syntax Error: Reference to unbound identifier
... form:   (%#ref hash-ref/default)
... detail: hash-ref/default at "hash.ss"@46.14
Process exited with non-zero status
17920
(path: "/Users/evar/.gerbil/pkg/github.com/fare/gerbil-utils/build.ss" arguments: ("compile") environment: ...

BTW, what does a successful setup give us? Only the REPL? No introspection, docs, auto-complete, etc?

@corpix
Copy link

corpix commented May 17, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment