libera/#commonlisp - IRC Chatlog
Search
17:40:26
sm2n
alpine doesn't make all the dependencies for ecl necessary for building as necessary dependencies by default
17:41:56
sm2n
(Also, the only reason I used ecl is because I was running it on a very old raspberry pi short on ram, feel free to try another implementation, everything but the build scripts should be portable, and I developed on sbcl)
17:47:16
sm2n
something like (progn (ql:quickload :scanner) (save-lisp-and-die "scanner" :toplevel #'scanner:main :executable t)) I think
17:50:45
yottabyte
how can I check if every element in a list is in another list? I know I can iterate over the list and do find, but I imagine there's a simpler way
17:52:49
sm2n
yeah, try replacing the #'scanner:main with (lambda () (scanner:main) (mapcar #'bt:join-thread (bt:all-threads)))
17:56:48
artchad
"Unhandled SB-THREAD:JOIN-THREAD-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING"
18:01:03
Bike
besides the fact that trying to join all threads might be weird if some library you don't expect made threads, this isn't totally safe, since it's possible another thread gets created just after all-threads returns.
18:02:45
phoe
attempting to join threads that you don't manage yourself sounds like a recipe for hanging forever
18:12:41
sm2n
the directory is changed in the scan command usually, but that failed because you didn't have scanimage
18:19:51
artchad
now I just need to get sane working in the terminal and then everything should be great.
18:37:28
artchad
ok, getting the correct driver is apparently non-trivial on Alpine. On Devuan it worked.
18:57:39
fe[nl]ix
sm2n: see the note in https://sionescu.github.io/bordeaux-threads/threads/join-thread/
18:59:18
sm2n
fe[nl]ix: What would you suggest? (It does seem to work in this case, but hunchentoot uses bordeaux-threads under the hood and it's the only thing running, so that may be why)
19:02:42
sm2n
yeah, the usecase is that an executable is produced, and it only has hunchentoot in it, but the hunchentoot event loop isn't on the main thread, so without some way of blocking, the application just immediately closes
19:05:06
lisp123
Is there a standard function to write association lists like this: (make-alist key datum key datum key datum)?
19:06:43
White_Flame
lisp123: there is (mapcar #'cons '(k1 k2 k3) '(v1 v2 v3)) => ((K1 . V1) (K2 . V2) (K3 . V3))
19:08:39
Josh_2
sm2n: there is also a means for exiting correctly, on sbcl I believe its a list @ sb-ext:*exit-hooks*
19:12:13
sm2n
I'm not saying it doesn't work, I'm just saying I don't think that's theoretically clean in all cases either
19:13:07
Josh_2
the executable shutting down immediately is solved by searching for a thread named hunchentoot and joining it
19:15:13
White_Flame
I noticed that plist-alist does nreverse at the end. I like how COLLECT avoids that
19:15:49
White_Flame
right, for (k v) traverses 2 elements in, and then by #'cddr re-traverses 2 elements redundantly
19:15:52
lisp123
I'm anti-alexandria, everyone should write their own functions (or copy from others on IRC :D)
19:24:25
dlowe[x]
I have a question about lparallel on sbcl - let's say I set up a bunch of tasks (> number of workes) each calling cl:read-line on a socket stream. Can it successfully negotiate all the I/O or is it going to block weirdly?
19:35:24
jasom
phoe: A new static-let that I *think* is more efficient, and also lets you specify the type. Modifying it to instead parse declarations for the &body form to set the type is an exercise left up to the reader: https://plaster.tymoon.eu/view/2908#2908
19:53:20
yottabyte
suddenly, I'm getting these errors in emacs: Debugger entered--Lisp error: (void-function ql:quickload), any idea what's going on?
19:55:00
Bike
yottabyte: that is the error you would get if you tried to evaluate (ql:quickload whatever) in elisp.
19:56:05
yottabyte
up until now, whenever I opened a .lisp file, it was using slime-mode and sbcl, etc.
20:03:32
Guest74
EdLangley[m]: That doesn't work for me. I don't want to load every colour library in existence just to provide support for the one colour library the user is using.
20:10:06
Guest74
hm, all the scanner talk has reminded me I haven't submitted my networked sane lib to quicklisp.
20:12:00
Guest74
Xach: What's the procedure to submit a library? The quicklisp.org website's front page hasn't been updated since 2016.
20:13:35
EdLangley[m]
Guest74: yes, and my suggestions all involved defining multiple systems, each of which only depends on one colour library
20:14:11
Guest74
lagash: sm2n: it's a backend for scanning over the network. I use it to scan on my local scanner so I don't have to touch foreign stuff, it's all lisp.
20:15:03
Xach
EdLangley[m]: asdf-system-connections introduces problems also, at least for quicklisp
20:15:05
Guest74
Ed: you said so that one library would load them all, Perhaps I misinterpreted. Anyways, I hate slashes in package names.
20:19:01
Guest74
sm2n: I should mention it's only the implementation of the protocol. My frontend for it isn't in a finished state. Works fine at the repl though.
20:22:07
Guest74
https://github.com/JMC-design/nsane I should probably add links to how to actually get sane to serve a scanner over the network. I swear that was the hardest part of writing it.
20:25:25
Guest74
Xach: so issue under quicklisp-client? I ask because I don't see any such issues, i guess you delete them? I wonder why this isn't written anywhere.
20:26:02
Bike
i linked you where you should file the issue: https://github.com/quicklisp/quicklisp-projects/issues
20:51:10
_death
etimmons: I guess because it uses asdf to load the system, rather than quicklisp, so if the project is not yet installed you'd get an error
20:56:30
_death
etimmons: thinking about it some more, I think the case could be that you have A and B that are installed (as well as their dependencies), and you load project C.. C notices A and B are loaded and tries to load C-AB, but then C-AB depends on D which may not be installed.. if that's the issue quicklisp could probably know about C-AB and install the dependencies, but then it assumes A, B, and C-AB will be used, which is not certain
20:57:24
phoe
quicklisp could work around it by assuming that A, B, and C-AB *might* be used, and downloading all of them
20:59:19
etimmons
That all makes sense. I'd also be interested if there any any specific issues that crop up when building the dist (i.e., figuring out what triggers C-AB to be loaded)
20:59:48
phoe
I don't think Quicklisp has that sort of information, or can easily get it without also parsing system-connections stuff
21:00:45
etimmons
I ask partly because this issue comes up fairly regularly and the existing solution is rather nasty. So I wonder what a nice way of doing it would look like
21:00:47
phoe
so that it automatically augments the loaded systems' depends-on? or uses ASDF's kinda-deprecated :weakly-depends-on?
21:01:29
EdLangley[m]
Asdf-system-connections works, iirc, by adding a system and an :after method to operate
21:02:14
EdLangley[m]
When a system is loaded, the after method checks if the prerequisites of any connections are met and then loads the system in the connection.
21:02:32
Guest74
Which all makes it so much easier to tell the user if you want to use colours from some-library just load mylibrary-some-library first. Just kick that responsibility down the road.
21:05:38
EdLangley[m]
I sort of prototyped a solution that involved adding an emacs-like hook feature to ASDF
21:06:31
EdLangley[m]
ASDF, in general, is annoyingly opaque when it comes to introspection: a lot of the classes and operations it defines contain no information about the operation being performed.
21:09:16
jeosol
Could use some brainstorming and get some advice. I have e functions I call in sequence fa() - prepare input file, fb() - run simulation, fb() - read results. fa() and fb() are very fast, but fb() is compute intensive can take 3 seconds, 30mins, 1 hour depend on input.
21:10:08
jeosol
I am trying to run everything on remote machine when need to get some progress back. If I run everything in blocking mode, it works fine, but I don't know what stage fb() is at.
21:11:07
jeosol
I have now instrumented the code to run fb() in background and then I send request to check the status of the log file which reports back the progress of the computation (e.g., time step in finite difference simulation)
21:12:28
jeosol
My setup up works, then craps out for long jobs (socket closed, etc) - trying to rethink if there is a less problematic and cleaner way to set this up.
21:34:27
phoe
welp, yes! (mapcar #'bt:thread-name (bt:all-threads)) ;=> (SI:SIGNAL-SERVICING SI:TOP-LEVEL)
21:39:06
jeosol
It's a mess, I got a setup that works but it seems connection closing seems to be the issue
21:40:03
Josh_2
jeosol: You are connecting to the remote image with slime or some other means? There is a key arg :dont-close to create-server?
21:41:16
jeosol
I have a mix of problems, small one (runs in 3 seconds) and large ones (1 min, 10 mins)
21:42:42
jeosol
I am trying to make it fault tolerant with variant inputs, sometimes changing equality to >= due to round off errors -- real pain
21:43:32
jeosol
I try to run from other clients - python notebook making request to remote CL worker
21:48:22
Bike
search looks for a subsequence. :test #'string= only makes sense if you're dealing with sequences of string designators.
21:57:57
Josh_2
(find "hunchentoot.." (bt:all-threads) :key #'bt:thread-name :test #'string=) .. something like that
22:29:31
Josh_2
I dont know how to help you with your problem :( Sounds like a lot of information about the system is required to find the solution
22:51:04
fe[nl]ix
sm2n: thanks, I committed https://github.com/sionescu/bordeaux-threads/commit/d5692d93ab8185fa74a378360276c996186273bb
0:54:03
Guest74
For those who use multiple desktops/workspaces any thoughts on strings vs keywords for naming them? Finally reworking my window manager.
0:55:47
Guest74
I'm thinking mainly of my repl use. But I'm sure many others don't care about manipulating their wm from the repl.
0:57:54
Guest74
The only hesitance I have with keywords is how do I display them in gui tools. As a keyword? or as the symbol-name? keyword might look weird, a symbol-name might be misleading. Or once again i'm overthinking it.
2:25:13
sm2n
I'm writing a (s-exp based of course) DSL, and trying to understand different approaches. One way to do it would be to just have a macro that expands out the entire thing, but another approach I was considering was to basically write a simple interpreter that has a compiler macro, which could be expanded recursively.
2:26:09
White_Flame
it all depends on the complexity you want. macroexpansion is fine for literal expansion with no further analysis
2:26:51
White_Flame
but really, any analysis you perform could either be done at compile time or at evaluation time, all depends on where the function calls are made
2:28:06
White_Flame
but once your macro reaches a certain size, it's certainly helpful to break out a bunch of functions to handle the various subclauses. these functions can either be called by the macroexpander, or by the expanded code, or externally if your macro just generates a datastructure
2:35:20
Josh_2
if you have a macro that expands out the entire thing then it should be trivial to add a compiler macro
3:33:03
White_Flame
sm2n: oh sorry, didn't read that as "compiler macro" originally. I haven't done that approach
5:04:21
yottabyte
either one. I was trying to use remove-if/delete-if but yeah. I could do what mfiano is saying
5:06:47
Bike
the remove/delete-if incantation would be something like (remove-if (constantly t) sequence :start n :count 1), i guess
5:20:17
mfiano
I'd use them all in different parts of the code, to please and displease everyone all at once.
5:22:31
mfiano
My original solution was to do it without walking twice. I'm not sure how remove-if/delete-if is usually implemented, but that is certainly more readable, if not more efficient than that one ^
5:23:38
White_Flame
if you walk once, you're going to be allocating as you go, and tail share the rest. if the element is not found, then those copies are redundant
5:24:49
White_Flame
also, if you're removing the first element, that's a special case as it's not the CDR of anything
5:27:23
White_Flame
you can (let ((temp-list (cons nil list))) ...setf cdr stuff... (cdr temp-list)) to operate in full cdr mode without special case for removing the head