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?
@tjroth
Copy link

tjroth commented Aug 11, 2018

Thank you for publishing this guide to installing swank for Gerbil scheme. I'm getting an error when installing the gerbil-swank package...

remote: Repository not found.
fatal: repository 'https://github.com/ecraven/r7r.git/' not found
Process exited with non-zero status
32768
(path: "git" arguments: ("clone" "-q" "https://github.com/ecraven/r7r.git") environment: #f directory: "~/.gerbil/pkg/github.com/ecra...

@drewc
Copy link
Author

drewc commented Aug 30, 2018

tjroth, looks like it was a typo. Try now: gxpkg install github.com/ecraven/r7rs-swank

@dleslie
Copy link

dleslie commented Oct 1, 2018

#> gxpkg install github.com/ecraven/r7rs-swank
... install github.com/ecraven/r7rs-swank
... build github.com/ecraven/r7rs-swank
*** ERROR IN gx#core-expand-ref% -- Syntax Error
*** ERROR IN "common/handlers.scm"@354.23
--- Syntax Error: Reference to unbound identifier
... form:   (%#ref $macroexpand-all)
... detail: $macroexpand-all at "common/handlers.scm"@354.23
Process exited with non-zero status
17920

Looks like it broke since Aug29.

@dleslie
Copy link

dleslie commented Oct 1, 2018

#> gsc -v
v4.9.0 20180930122740 x86_64-unknown-linux-gnu "./configure '--prefix=/home/dleslie/.local' '--enable-single-host'"

And gerbil is from a546f8cd

@jboynyc
Copy link

jboynyc commented Mar 4, 2019

Fails for me, too:

$ gxpkg install github.com/ecraven/r7rs-swank
... install github.com/ecraven/r7rs-swank
... build github.com/ecraven/r7rs-swank
... compile gerbil-swank
*** ERROR IN gxc#gsc-compile-file -- No such file or directory
(open-process '(path: "gsc" arguments: ("-debug-environments" "-debug-source" "~/.gerbil/lib/ecraven/gerbil-swank__0.scm") stdout-redirection: #f))
Process exited with non-zero status
17920
$ gxi
Gerbil v0.12 on Gambit v4.8.9

@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