I’ve been working on some things like git commands and makefile functionality. This makes it possible to do a complete workflow from DrRacket.
Next I was looking for a way to use the racket REPL like a shell. I found rash; and it looks very promising. I created some Linux coreutils equivalent for rash for my Windows workplace. Next I moved on to my ssh terminal on my Linux server. Tried to start rash and stumbled on a readline ffi problem. As I understand it, racket has moved on to xrepl; but rash doesn’t seem to be this far.
What error did you see exactly? Do you have the Racket package readline-gpl installed? (It is not by default.)
On Linux, Racket normally expects the underlying shared library to installed by the operating system. By default, Racket uses BSD libedit: installing the Racket package readline-gpl makes it look for GNU libreadline instead. A system intended for interactive use will usually have these libraries installed for other reasons, but, if starting from a more minimal system, you might need to explicitly install one with your distro’s package manager.
Currently things may not fail as gracefully as they should if the system library is missing:
More precisely, xrepl is the high-level layer for the command line REPL that implements meta-commands like ,help and ,enter, and it is still in use. The change you are thinking of is that xrepl changed its default input mode to use the Racket expeditor library, which is derived from Chez Scheme and is S-expression–aware. But the readline input mode is still supported (see ,input), as is using the Racket readline library directly (as Rash does). And again, the Racket readline library actually uses libedit unless specifically configured to use GNU Readline.
I installed readline-gpl with raco pkg install readline-gpl.
When I start racket with -l rash/repl, I still get some memory corruption?
Do I need to do something specific?
~$ racket -l rash/repl
You can use the `raco docs` command to look up documentation for Racket functions and macros. Try running `raco docs rash`.
(To turn these hints off, run (current-repl-display-startup-hints? #f) in a rashrc file.)
13:07 /data/www/
invalid memory reference. Some debugging context lost
exit
(exit)
^C#(struct:exn:break user break #<continuation-mark-set> #<procedure>)
13:07 /data/www/
exit
(exit)
^C#(struct:exn:break user break #<continuation-mark-set> #<procedure>)
13:07 /data/www/
^C#(struct:exn:break user break #<continuation-mark-set> #<procedure>)
13:07 /data/www/
(exit)
^Z
[1]+ Gepauzeerd racket -l rash/repl
www-data@gilgad:~$ kill %1
www-data@gilgad:~$ fg
-bash: fg: taak is afgesloten
This is what happens if I remove readline-gpl again:
~$ racket -l rash/repl -i
Welcome to Racket v9.1 [cs].
invalid memory reference. Some debugging context lost
context...:
body of "/usr/local/racket/share/pkgs/readline-lib/readline/pread.rkt"
>
I wonder whether "remove" means raco pkg uninstall readline-gpl.
Searching for "readline" and "invalid memory reference" took me to this. Is libtermcap still in use? This looks like a stuck situation where building from Racket source is the only way to resolve the incompatibility: