libera/#commonlisp - IRC Chatlog
Search
20:00:34
pve
Hey, are the internals of asdf documented somewhere? Or perhaps a tutorial on how to extend it?
20:10:53
pranavats
There are packages which extend it, such as literate-lisp which also document the extensions. You can take a look at those too.
20:12:18
pve
pranavats: I'm trying to make this work properly: https://github.com/pve1/alphabetical-asdf/blob/main/alphabetical-asdf.lisp
20:14:34
pve
I *can* load systems with it, but I need to make it behave like ":serial t" when modifying files
20:19:51
etimmons
pve: asdf handles :serial t by remembering the previous component and adding it to the :depends-on list for the component currently being processed
20:20:59
pve
etimmons: hmm right, I would have expected (make-instance 'module ... :serial t) to work but apparently it doesn't
20:26:08
pve
etimmons: I had a look at your extension, it looks like it could improve on package-inferred-systems
20:26:15
etimmons
You may have luck extending `asdf::compute-component-children` to define your implicit components and then call-next-method
20:27:05
etimmons
Just be warned that's not exported yet. We're planning to export it in ASDF 3.4.0, so it may change before then, but I doubt it
0:59:00
etimmons
Xach: No, Robert makes the releases. I've just been helping out with the development a lot recently
1:11:25
Xach
http://report.quicklisp.org/2021-07-07/failure-report/arrival.html#arrival - this is representative of a number of failures that all seem to fail in fare-utils
1:11:31
Xach
http://report.quicklisp.org/2021-07-07/failure-report.html has more, though not exclusive to that issue
1:23:23
etimmons
Huh. It kinda looks like it's using the `uiop:define-package` macro from uiop 3.3.5, but using the function `uiop:ensure-package` (which it expands to) from a previous uiop.
1:25:59
Xach
well, i load asdf 3.3.1 explicitly, because that's what comes with sbcl. but i also download UIOP as a project as well.
1:28:03
etimmons
Ah.. I have a theory. Do you reuse the fasl cache between builds of different systems?
1:28:39
etimmons
I think some system A that depends on fare-utils also declares an explicit dependency on uiop
1:29:12
etimmons
So when A was built, that latest uiop was loaded and the fasls for fare-utils include the 3.3.5 define-package expansion
1:30:13
etimmons
but fare-utils has no explicit dep on uiop and the chain starting from arrival doesn't have an explicit uiop dependncy or asdf schedules it after loading fare-utils
1:32:50
etimmons
yeah, that's tricky... uiop is such a useful library, but it's special relationship with asdf can be a pain point
1:33:34
etimmons
If you could convince everyone that uses uiop to explicitly declare it as a dep that'd solve it.
1:35:01
etimmons
I wonder what a world would look like where ASDF had a private copy UIOP with different package names.
1:35:52
etimmons
you just would have to explicitly declare it instead of assuming asdf would magically load it for you
1:36:57
Xach
I think UIOP does more than it needs to to support ASDF - some of it could be add-ons to ASDF, and some of it could be completely separated.
1:37:28
Xach
I remember thinking Quicklisp would be sooooo popular I could "fix" stuff in CL because it would be loaded all the time. I'm glad I didn't try doing that.
2:59:26
Josh_2
So I just made a list in a defparameter with '((nil nil nil) (nil nil nil) (nil nil nil)) then used (setf (elt (first <my list>) 0) <my val>) and it changed the val of pos 0 in all the lists, whats up with that? Doesn't do it when I use (list ..)
3:00:48
beach
Josh_2: The compiler coerced all the lists. They are literals so you are not allowed to modify them.
3:05:05
beach
To elaborate, QUOTE creates a "literal object", and the consequences are undefined if literal objects are modified.
3:09:45
Josh_2
I am trying to iterate over a list, if the list item is nil then output a space, otherwise output the item
3:13:53
aeth
whatever emacs uses internally for text isn't good with long lines... I haven't gotten crashes, but I have had it hang which is basically like crashing it
3:16:16
Josh_2
I used ~#[ .. ] within a ~{ ~} and I guess it wasn't consuming the argument as it just kept outputting to stdout
3:40:39
Josh_2
A lot harder than I thought it would be to conditionally display an element (format t "~{~:[ ~;~:*~A~]~^| ~}~%" row))
3:41:53
Josh_2
now if an element within ROW is non nil it is displayed, otherwise a space is displayed
5:46:00
susam
Most of the time I realize that my erroneous code is running in an infinite loop only when the computer's fan goes berserk. I don't realize it in SLIME REPL because the REPL prompt always returns successfully without any output. Do you have another way to realize that your code is running in an infinite loop?
5:46:33
susam
It takes a while to realize that no output + fan noise => infinite loop. It feels disorienting until that realization.
5:47:54
beach
You must be running the code in a separate thread if you get the prompt back. The solution, then, is to run it in the same thread as the REPL.
5:47:56
mfiano
I have stats for cpu and memory utilization visible at all times (on the bottom of my screen, and I'm trained to keep a constant eye on them)
5:50:33
susam
beach: I am not doing threads. For example, here is a simple test case to reproduce what I see. Type (loop) in a code buffer. Then C-c C-c to compile it. SLIME-REPL shows "; processing (LOOP)" with the "CL-USER>" prompt below it.
5:51:10
susam
Now it isn't a new "CL-USER>" prompt. It is the old prompt itself pushed below the "; processing (LOOP)" line.
5:53:31
susam
So the visual feedback for infinite loop is indistinguishable from that due to correct code.
5:54:10
susam
mfiano: Okay. Thanks for the tip. I will set up my environment to show CPU and memory usage too.
5:55:31
mfiano
When you C-c C-c, it is compiled on a background thread with results sent to the repl thread.
5:57:04
susam
pillton: It happens with your loop too but the "here" output gives a visual feedback that I am in an infinite loop, so no disorientation there. This is what the REPL looks like then: https://plaster.tymoon.eu/view/2543
5:57:33
susam
mfiano: Thanks. That makes sense. So that is consistent with what beach said too. The code is compiled in a background thread.
5:57:33
mfiano
This is important to realize, because if you have a continuous render/event loop or some such, you will need a thread-safe queue to process class redefinitions.
5:58:09
pillton
susam: I don't understand. C-c C-c compiles the "current toplevel form". It doesn't evaluate it.
6:01:29
susam
pillton: What happens if you C-c C-c this in your Lisp buffer: (dotimes (n 10) (print n)). Does it not end up printing 0 1 2 ... 10 in your REPL?
6:04:05
susam
pillton: Yes, that was a disconcerting for me too when I began learning CL with SLIME. But gradually got used to it. For example, C-c C-c is mapped to slime-compile-defun but it can compile any top-level form.
6:04:21
susam
To be fair to the doc, it does spell it out clearly. "The code for the region is executed after compilation. In principle, the command writes the region to a file, compiles that file, and loads the resulting code."
6:05:41
susam
I now realize I should ask more of these questions in this channel. Lot to learn. I have been coding like a caveman for so long.
6:07:31
susam
Interesting, it indeed does not. It probably should, otherwise the behaviour can be confusing. I quoted the documentation from here: https://common-lisp.net/project/slime/doc/html/Compilation.html