fredokun / cl-jupyter

An enhanced interactive Shell for Common Lisp (based on the Jupyter protocol)
BSD 2-Clause "Simplified" License
198 stars 29 forks source link

Lisp kernel request for Allegro Common Lisp #17

Open djinnome opened 8 years ago

djinnome commented 8 years ago

Hi Folks,

I use Pathway-tools, which uses Allegro common lisp underneath. On the other hand, if the kernel just needs to connect to a REPL through a socket, Pathway-tools already provides a Unix socket.

Sincerely,

fredokun commented 8 years ago

I am sorry but I do not have access to ACL, hence it's difficult for me to address this issue.

mmaul commented 8 years ago

djinnome It "should" work, I did some tests with Allegro Express, unfortunately Allegro Express is 32 bit and cl-jupyter needs ZMQ and on my system I only have a 64 bit version. (I can grab one but I thought I'd let you give it a go and if you run into problems I'll rundown the dependent 32 bit libs). Anyways to get it going I'll have your create the profile for allegro manually and once it's dialed in you can give it back to me and I'll create a pull request from it and get it into the cl-jupyter install.

Not knowing how familiar with CL and quicklisp I'll go step by step

Make sure ipython3 is installed if it isn't then you can install for Ubuntu as shown below apt-get install ipython3-notebook

Install quicklisp curl -O https://beta.quicklisp.org/quicklisp.lisp alisp -L quicklisp.lisp (quicklisp-quickstart:install) (ql:add-to-init-file)

Clone the cl-jupyter repo in to the directory ~/quicklisp/local-projects directory on your system git clone https://github.com/fredokun/cl-jupyter.git

cd into cl-jupyter and run install script python3 ./install-cl-jupyter.py

Start Allegro lisp and load cl-jupyter and exit alisp (ql:quickload :cl-jupyter)

Start ipython3 and make sure it works and so it creates the ~/.ipython profile directory then shut it down ipython3 notebook

Make a directory to hold the config file for the Allegro lisp kernel mkdir ~/.ipython/kernels/alisp

Create a file called kernel.json in directory ~/.ipython/kernels/alisp with the contents below changing HOMEDIR to the fully qualified path to your home directory.

{"argv": ["alisp",  "-L", "HOMEDIR/.clinit.cl", "-L", "HOMEDIR/quicklisp/local-projects/cl-jupyter/cl-jupyter.lisp", "--", "HOMEDIR/quicklisp/local-projects/cl-jupyter/src", "HOMEDIR/quicklisp/local-projects/cl-jupyter", "{connection_file}"], "language": "lisp", "display_name": "ACL Lisp"}

Finally start ipython and test it out by creating a new notebook and selecting the ACL Lisp kernel.

Let me know how it goes. If you have problems I'll run down the 32 bit libs I need, or if you can get the folks at Pathway to give me a copy of their app and I will see what I can do.

tuh8888 commented 5 years ago

I tried the suggested procedure from @mmaul using Allegro Common Lisp's mlisp. There were, of course, issues due to mlisp being case-sensitive, which I resolved by converting a few variable names to lower case. But I got stuck trying to get the kernel to reply. There appears to be an issue with the utf-8 decoding. Here is the output I got:

cl-jupyter: an enhanced interactive Common Lisp REPL (Version 0.7 - Jupyter protocol v.5.0) --> (C) 2014-2015 Frederic Peschanski (cf. LICENSE)

[Hearbeat] starting... [Kernel] Entering mainloop ... [Shell] loop started [Heartbeat] thread started Recv: issue with UTF-8 decoding

[W 20:36:37.396 NotebookApp] Timeout waiting for kernel_info reply from f60367ee-3da9-4ee5-801f-f9655cbf9eb8

djinnome commented 3 years ago

Now that allegro common lisp is 64 bit, is it more feasible to get cl-jupyter to support allegro?