jerry40 / guile-kernel Goto Github PK
View Code? Open in Web Editor NEWGNU Guile Scheme kernel for Jupyter Notebook
License: GNU General Public License v3.0
GNU Guile Scheme kernel for Jupyter Notebook
License: GNU General Public License v3.0
The following error happens when I try to start the kernel on a Ubuntu 20.04 Docker container with Guile 2.2:
Backtrace:
7 (apply-smob/1 #<catch-closure 561b1a524880>)
In ice-9/boot-9.scm:
705:2 6 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
619:8 5 (_ #(#(#<directory (guile-user) 561b1a5ac140>)))
2312:4 4 (save-module-excursion _)
3832:12 3 (_)
In /usr/local/share/jupyter/kernels/guile-kernel/src/guile-jupyter-kernel.scm:
50:23 2 (_)
44:96 1 (create-address #f)
In unknown file:
0 (number->string #f #<undefined>)
ERROR: In procedure number->string:
In procedure number->string: Wrong type argument in position 1: #f
[I 18:22:44.513 NotebookApp] Kernel started: dc6d9eab-2a05-4dc3-a2af-64ee41f66891
195a772e3db49c8f5b3c0a7584156c3837793f4d18ce1e4e3e69dd629100ae1303caefe50c04d98acb275727b8f4cdcb38e05ee73912870016be8b857327e214a529e811408412f3819bd05145af3fed1cf0b183a5482ec42ade085235be4b20[W 18:22:54.527 NotebookApp] Timeout waiting for kernel_info reply from dc6d9eab-2a05-4dc3-a2af-64ee41f66891
0dce973ab6940e8a031b84fd5c15a4e987089f38386ba4b0a37c171467c9eae8289d6861412ea71d595f46921211c338cf48f46b332744779c805f1b490a19e66fbe726789a2045363aed4aaadc26d071fce0479287a56f4132fd4a0fcc47be2574dacf41e011dffee8d0b3146776c377dae8af020f043328e4e874737a343f4
----------------------->comm_info_request
Backtrace:
In ice-9/boot-9.scm:
157: 8 [catch #t #<catch-closure 1191ba0> ...]
In unknown file:
?: 7 [apply-smob/1 #<catch-closure 1191ba0>]
In ice-9/boot-9.scm:
63: 6 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
432: 5 [eval # #]
In ice-9/boot-9.scm:
2401: 4 [save-module-excursion #<procedure 11ae9c0 at ice-9/boot-9.scm:4045:3 ()>]
4050: 3 [#<procedure 11ae9c0 at ice-9/boot-9.scm:4045:3 ()>]
In unknown file:
?: 2 [load-compiled/vm "/home/admin/.cache/guile/ccache/2.0-LE-8-2.0/home/admin/.local/share/jupyter/kernels/guile/main.scm.go"]
In /home/admin/.local/share/jupyter/kernels/guile/main.scm:
102: 1 [general-handler #<pointer 0xf0ccc0>]
In unknown file:
?: 0 [#f #<pointer 0xf0ccc0> "232a2f702a5f4def958afa5f0ba4a4a5" ...]
ERROR: In procedure #f:
ERROR: Wrong type to apply: #f
Writing a cell with:
(display "Hey!")
returns no output. Same happens when running from a console.
Equally, doing any successful operation, like (define x 42)
, does not return any output - however, (error "Fail!")
does work.
Hi,
Has anyone tested guile-charting
with guile-kernel
in a jupyter notebook
?
Using Guile 3.0.0, the following error comes up when trying to start a Guile kernel
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;; or pass the --no-auto-compile argument to disable.
;;; compiling /home/user/.local/share/jupyter/kernels/guile/guile-jupyter-kernel.scm
;;; WARNING: compilation of /home/user/.local/share/jupyter/kernels/guile/guile-jupyter-kernel.scm failed:
;;; attempt to include relative file name but could not determine base dir
Backtrace:
6 (primitive-load "/home/user/.local/share/jupyter/kernels/guil…")
In ice-9/eval.scm:
721:20 5 (primitive-eval (include "tools.scm"))
In ice-9/psyntax.scm:
1241:36 4 (expand-top-sequence ((include "tools.scm")) _ _ #f _ _ _)
1133:20 3 (parse _ (("placeholder" placeholder)) ((top) #(# # …)) …)
1354:32 2 (syntax-type (include "tools.scm") (("placeholder" #)) # …)
1565:32 1 (expand-macro #<procedure 7f1db6f8bae0 at ice-9/psynta…> …)
3254:24 0 (_ _ _ #:dirname _)
I'm using commit f25fb90 as built and installed by guix.
In a jupyter notebook with the guile kernel, add the following code to different cells:
(display "display function works")
(display "\u2013")
(display "hello")
Run all cells. The first cell produces the expected output, but the second and third cell don't produce output even though they show the output number. When all cells are run again, no cell produces any output, but the output count is shown.
The escaped unicode can be replaced with the actual en-dash character "–" for the same results.
I have not tried this with other 16-bit unicode character codes.
guile
itself can run all of the above code as expected.
This issue is not present in the python kernel. The code blocks:
print("print function works")
print("\u2013")
print("hello")
work as expected.
This is most likely a problem with how the guile kernel handles the jupyter protocol.
Attached is issue.ipynb.gz which replicates this issue with the guile code above.
Currently, the kernel code is manually installed by copying the contents of src
into $JUPYTER_PATH/kernels/guile
and replacing the absolute path of guile-jupyter-kernel.scm
inside kernel.json
. Ideally, a Jupyter kernel should be able to run without making any changes to the source code, thus the project should be refactored accordingly, providing a Makefile or some similar installation script.
The best choice imho would be providing the kernel script as a Guile module. Additionally, I have looked into including the Jupyter path relative variable into kernel.json
, but jupyter/jupyter_client provides no way to add in variables other than connection_file
. Perhaps looking into how guix-kernel
does it could be helpful?
Hi, has anyone tested this kernel with guile > 3.0 yet?
Similar to #11 but only happens in Jupyter Lab.
How can i increase BUF-SIZE in guile-simple-zmq?
appreciate if any one can give a procedure for doing that.
If I have a cell where the last line has some code with a comment at the end I get that kind of error:
read-error
(scm_i_lreadparen #<unknown port>:2:148: end of file () #f)
A notebook with this single cells crashes the kernel.
(define (my-func)(while #t (usleep 10)))
(call-with-new-thread my-func (lambda (key . args) #t))
Error log:
Backtrace:
6 (apply-smob/1 #<catch-closure 1ccbb80>)
In ice-9/boot-9.scm:
705:2 5 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
619:8 4 (_ #(#(#<directory (guile-user) 1d64140>)))
In ice-9/boot-9.scm:
2312:4 3 (save-module-excursion )
3822:12 2 ()
In /usr/local/share/jupyter/kernels/guile-kernel/src/guile-jupyter-kernel.scm:
105:18 1 (general-handler #<pointer 0x1bd55d0>)
In simple-zmq.scm:
418:20 0 (zmq-get-msg-parts-bytevector #<pointer 0x1bd55d0> _)
simple-zmq.scm:418:20: In procedure zmq-get-msg-parts-bytevector:
Throw to key zmq-error' with args
(4 "Interrupted system call")'.
Some deprecated features have been used. Set the environment
variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
program to get more information. Set it to "no" to suppress
this message.
When I try to start guile kernel I had the following error
Backtrace:
7 (apply-smob/1 #<catch-closure 7f6d9f6fbb80>)
In ice-9/boot-9.scm:
705:2 6 (call-with-prompt _ _ #<procedure default-prompt-handler (k proc)>)
In ice-9/eval.scm:
619:8 5 (_ #(#(#<directory (guile-user) 7f6d9f391140>)))
In ice-9/boot-9.scm:
2312:4 4 (save-module-excursion _)
3831:12 3 (_)
In /usr/share/jupyter/kernels/guile/guile-jupyter-kernel.scm:
50:23 2 (_)
44:96 1 (create-address #f)
In unknown file:
0 (number->string #f #<undefined>)
ERROR: In procedure number->string:
In procedure number->string: Wrong type argument in position 1: #f
system info
guile-2.2.4
gulie-json-0.6.0
jupyter core 4.5.0
zeromq-4.3.2
with gulie-simple-zmq
installed as instructed.
I am just starting to learn scheme so could not really help, but please let me know if you need more information. Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.