1
0
Fork
You've already forked mit
0

Geiser with MIT (12.1): Hitting a snag compiling emacs.el #10

Open
opened 2023年11月28日 01:16:14 +01:00 by eightysteele1 · 3 comments
eightysteele1 commented 2023年11月28日 01:16:14 +01:00 (Migrated from gitlab.com)
Copy link

TL;DR

Hey all! I made a bit of progress working around https://gitlab.com/emacs-geiser/mit/-/issues/9. I'm signal boosting here for visibility in case folks have more context and can shed some light. :)

Overview

With geiser and geiser-mit installed on Emacs, I open a .scm file. The MIT Scheme REPL fires up but hits a snag compiling geiser-mit/src/geiser/emacs.el:

;Loading "/Users/ads/.config/spacemacs/elpa/29.1/develop/geiser-mit-20211204.1935/src/geiser/load.scm"...
; Loading "compile.scm"...
; Loading "make.com"...
; Loading "cref-unx.pkd"... done
; Loading "mset.com"... done
; Loading "object.com"... done
; Loading "toplev.com"... done
; Loading "anfile.com"... done
; Loading "conpkg.com"... done
; Loading "forpkg.com"... done
; Loading "redpkg.com"... done
; ... done
; Generating SCode for file: "emacs.scm" => "emacs.bin"... done
; Compiling file: "emacs.bin" => "emacs.com"...
;Warning: Procedure called with wrong number of arguments #[primitive-procedure 14 %record-ref] 1
2 error>

The workaround is to (load "emacs") in the REPL. From there, everything seems to work as expected:

error> (load "emacs")
; Loading "emacs.bin"...
; Loading "format.com"... done
; ... done
;Value: #[environment 15]
2 (user) =>

Good to go! Evaluating code in the source buffer works now—but—an error gets surfaced to the Geiser Debug buffer on each eval (I'm just ignoring these guys for now):

Error: retort-syntax
#[%record 32]
;Unspecified return value

Debugging

I did some casual debug sessions in the MIT Scheme debugger to investigate the initial compilation issue with emacs.scm.

After traversing the 80+ subproblems (and the subsequent reductions and environments), I was able to get a reference to the %record-ref procedure. Then, via (pa %record-ref) I could see that it takes two formal parameters (a1 and a2).

So it seems like %record-ref is getting applied with 1 argument instead of 2 (which isn't new information—the initial warning already told us that!). All to say, as a newbie it was fun to poke around but ultimately I wasn't able to uncover anything useful. :)

Environment

I'm running the latest emacs-geiser/geiser and emacs-geiser/mit from MELPA (via the Spacemacs Scheme layer) on Emacs 29.1 with MIT Scheme 12.1 compiled on MacOS (via arch -x86_64 to ensure compilation uses the x86_64 instruction set instead of the M1's arm64):

### TL;DR Hey all! I made a bit of progress working around https://gitlab.com/emacs-geiser/mit/-/issues/9. I'm signal boosting here for visibility in case folks have more context and can shed some light. :) ### Overview With geiser and geiser-mit installed on Emacs, I open a `.scm` file. The MIT Scheme REPL fires up but hits a snag compiling `geiser-mit/src/geiser/emacs.el`: ```lisp ;Loading "/Users/ads/.config/spacemacs/elpa/29.1/develop/geiser-mit-20211204.1935/src/geiser/load.scm"... ; Loading "compile.scm"... ; Loading "make.com"... ; Loading "cref-unx.pkd"... done ; Loading "mset.com"... done ; Loading "object.com"... done ; Loading "toplev.com"... done ; Loading "anfile.com"... done ; Loading "conpkg.com"... done ; Loading "forpkg.com"... done ; Loading "redpkg.com"... done ; ... done ; Generating SCode for file: "emacs.scm" => "emacs.bin"... done ; Compiling file: "emacs.bin" => "emacs.com"... ;Warning: Procedure called with wrong number of arguments #[primitive-procedure 14 %record-ref] 1 2 error> ``` The workaround is to `(load "emacs")` in the REPL. From there, everything _seems_ to work as expected: ```lisp error> (load "emacs") ; Loading "emacs.bin"... ; Loading "format.com"... done ; ... done ;Value: #[environment 15] 2 (user) => ``` Good to go! Evaluating code in the source buffer works now—_but_—an error gets surfaced to the Geiser Debug buffer on each eval (I'm just ignoring these guys for now): ```lisp Error: retort-syntax #[%record 32] ;Unspecified return value ``` ### Debugging I did some _casual_ `debug` sessions in the [MIT Scheme debugger](https://www.gnu.org/software/mit-scheme/documentation/stable/mit-scheme-user.html#Command_002dLine-Debugger) to investigate the initial compilation issue with `emacs.scm`. After traversing the 80+ subproblems (and the subsequent reductions and environments), I was able to get a reference to the `%record-ref` procedure. Then, via `(pa %record-ref)` I could see that it takes two formal parameters (`a1` and `a2`). So it _seems_ like `%record-ref` is getting applied with 1 argument instead of 2 (which isn't new information—the initial warning already told us that!). All to say, as a newbie it was fun to poke around but ultimately I wasn't able to uncover anything useful. :) ### Environment I'm running the latest [emacs-geiser/geiser](https://melpa.org/#/geiser) and [emacs-geiser/mit](https://melpa.org/#/geiser-mit) from MELPA (via the Spacemacs [Scheme layer](https://github.com/syl20bnr/spacemacs/blob/develop/layers/%2Blang/scheme/README.org)) on Emacs 29.1 with [MIT Scheme 12.1](https://ftp.gnu.org/gnu/mit-scheme/stable.pkg/12.1/mit-scheme-12.1-x86-64.tar.gz) compiled on MacOS (via `arch -x86_64` to ensure compilation uses the x86_64 instruction set instead of the M1's arm64): - geiser: https://gitlab.com/emacs-geiser/geiser/-/commit/49d12a14482ce9a193c049a5ccdd2fed90b0bdbe - geiser-mit: https://gitlab.com/emacs-geiser/mit/-/commit/4e90e9ae815e89f3540fb9644e6016c663ef5765 - [mit-scheme-12.1-x86-64](https://ftp.gnu.org/gnu/mit-scheme/stable.pkg/12.1/mit-scheme-12.1-x86-64.tar.gz) - GNU Emacs 29.1 with Spacemacs 0.999.0 - macOS 14.1 (23B74), M1
eightysteele1 commented 2023年11月28日 01:16:51 +01:00 (Migrated from gitlab.com)
Copy link

mentioned in issue mit#9

mentioned in issue mit#9
eightysteele1 commented 2023年11月29日 22:49:22 +01:00 (Migrated from gitlab.com)
Copy link

changed the description

changed the description
jaor commented 2024年02月14日 04:18:55 +01:00 (Migrated from gitlab.com)
Copy link

moved from geiser#63

moved from geiser#63
Sign in to join this conversation.
No Branch/Tag specified
master
0.15
0.14
0.13
0.12
0.11.2
0.11.1
0.11
0.10
0.9
0.8.1
0.8
0.7
0.6
0.5
0.4
0.3
0.2.2
0.2.1
0.2
0.1.4
0.1.3
0.1.2
0.1.1
0.1
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
geiser/mit#10
Reference in a new issue
geiser/mit
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?