libera/#clasp - IRC Chatlog
Search
13:42:41
drmeister
Would there be a problem defining `!` (exclamation mark) as a reader macro in cando that would take everything to the next carriage return and invoke (ext:system "xxx")?
13:43:29
drmeister
So - within jupyterlab or slime: `! mkdir foo<cr>` would evaluate `(ext:system "mkdir foo")`
13:47:42
drmeister
I've got the ability to build spiroligomers now and I'm streamlining the workflow on the HPC to build the training molecules before I move on and forget all the complicated back and forth I did in the shell and submitting jobs to the HPC queue.
13:47:56
yitzi
I don't think it is a problem. Its basically like magic commands in the Python shell.
13:48:25
drmeister
If I could do everything from within a jupyter notebook then a jupyter notebook that submits jobs to the HPC queue becomes documentation for the next time I do it.
13:56:46
drmeister
Leap script allows: `foo = 1234`. I'd like to use `#@ foo = 1234` and `#@ foo = { 1 2\<cr> 3 4}`
13:59:31
drmeister
I assume I can't use a reader macro if there are symbols that contain the reader macro sequence.
14:00:17
yitzi
You make [ a dispatch reader macro that reads everything up to the next ]. It then feeds the string to leap-eval.
14:06:27
drmeister
Gah! We already have a `#!` reader macro in clasp . https://github.com/clasp-developers/clasp/blob/main/src/lisp/kernel/lsp/mislib.lisp#L267
14:07:33
drmeister
yitzi: If there is a `[` reader macro - doesn't that mean I can't edit source files that contain symbols like COMPILER:%T*[DUMMY]% ?
14:11:37
drmeister
That would work within a jupyter notebook and if I exported the jupyter input cells as a script it would work within Cando.
14:12:46
drmeister
We could still use: `foo = 1234` in jupyter input cells because that's what users will want - but that can't be exported to a script unless you go back and wrap each leap command in `#[` and `]` - right?
14:14:10
drmeister
yitzi: The current `#!` macro could be there to support the --script option of clasp - does that sound right?
14:20:38
yitzi
It was probably an early attempt to ignore shebangs. It added the --script option so shebangs will never be seen by the reader
14:23:20
yitzi
There are tools to do stuff like that, we could either make sure the tool wraps with #[] when needed or add a feature to Cando's REPL that emulates the Leap/Lisp pattern of Jupyter kernel
14:24:26
yitzi
There is also an ASDF system in common-lisp-jupyter that will convert a lisp file into a Jupyter notebook. Just fyi
14:35:06
yitzi
Well, to be fair Jupyter is it's own repl. It does all the usual repl stuff like binding /, //, etc. ;)
14:36:11
yitzi
The difference is that I compile the code and maintain source code references so you can actually debug step through a cell.
15:10:10
drmeister
So that doesn't sound too bad. I worry though about breaking the slime repl by adding leap script.
15:16:00
drmeister
I invoke a subshell to evaluate commands - that makes `cd` not work because the effect is lost after the cd.
15:17:34
yitzi
I think it would be weird for cd to propagate back to cando. That is not how shell scripts generally work
15:18:54
drmeister
That makes sense - so I should just live with this behavior - it's the best behavior.
15:51:17
drmeister
So `#! <bash-command>` launches a subshell that starts in the current working directory and you remain in that directory after each invocation.
16:01:07
drmeister
I have this thing where we can start a swank server from within cando `(cando-user:start-swank)`. It depended on you defining the SWANK_HOME environment variable for where to find slime.
16:02:00
drmeister
I'm adding another option to set `cando-user:*start-swank*` because I find it super annoying to have to shut down clasp, set the variable, and then start clasp again when I don't have SLIME_HOME set.
16:16:22
drmeister
I've had SLIME_HOME at... `~/.emacs.d/slime`, `~/Development/slime`, and now `~/.emacs.d/elpa/slime-20230131.1950/`
16:19:41
drmeister
yitzi: I made this change to the apptainer build - is it ok for me to push it. It adds some more libraries.
16:23:47
yitzi
On the llvm15 branch you said that it fails when it ClaspJIT_O fails to set the target. How did you determine that? I am currently getting a segmentation fault that I can't seem to trap in gdb