libera/#commonlisp - IRC Chatlog
Search
12:58:07
Duuqnd
Now I'm really tempted to print out a DESCRIBE output of an error object and start tossing it around.
13:04:27
moon-child
phoe: considering you wrote the common lisp condition system book, I think you have way more right to say that than I do :P
13:13:59
yitzi
I'm off to go teach. Thanks phoe, moon-child and edgar-rft for making me laugh so early here. Cheers!
13:15:49
madnificent
Any clues on where to find documentation regarding woo? (and I suspect dexador)
13:16:22
madnificent
phoe: I don't know where that is. Is that a new tool? I've seen the name before so it must be very popular! ^_^
13:17:24
madnificent
that's very exact documentation on the behaviour, but sadly any change would become a breaking change. must lean towards browser version numbers.
13:30:26
Krystof
beach: oh boy it's too long since I've talked about, let alone written, proper Lisp code
13:41:00
heisig
jackdaniel: Brilliant! I think I will explicitly allow this declaration in my loop optimization library :)
13:50:45
jackdaniel
technically correct speak is means towards the end of making the communication easier. in a spirit of this definition the fact that in common lisp conditions are "signaled" and code is organized in "packages" is very unfortunate - it is a barrier for efficient communication with people not immersed in common lisp
13:54:48
Xach
this draft RFC always made me really mad: https://datatracker.ietf.org/doc/html/draft-meyer-lisp-cons-04
13:59:33
phoe
I wonder if there could be a Lisp bot that figures out which system needs the dependency, opens its ASD file, inserts the dependency, and automatically files a quicklisp PR
14:01:41
heisig
I think I should just add extra CI jobs that load each system independently, and not just all of them in the 'usual' order.
14:01:51
jackdaniel
wasn't that we have too many 80% correct solutions and too little complete ones? at least that's what a blog post I see every 1,5 year on hackernews says
14:02:10
jackdaniel
I suppose that the curse is that I have to see it every 1,5 year, and lisp is only accidental
14:02:24
phoe
a bot that automatically files PRs for missing dependencies would be good enough I guess
14:02:55
phoe
Xach: would you accept anything like that into your workflow, or is that a silly and/or unnecessary idea?
14:03:39
phoe
jackdaniel: yes - if it can't reliably insert a dependency or make it build after inserting it, it should just file an issue IMO
14:04:34
jackdaniel
I was joking - you've said that "bot (...) files PRs, (...)it sometimes will fail to do the right thing"
14:05:48
Xach
phoe: i don't really want to automatically file PRs. i have code that automatically formats PRs for me, but I submit them "manually" to some degree.
14:10:41
rotateq
so taking a step back and proving some more critical things and let other things ripe out maybe?
14:14:33
moon-child
would be cool if you could take a parameter in the function namespace. (defun f (#'x y) (x y)). But it would make for inconsistencies w/destructuring lambda lists
14:29:56
mfiano
(subtypep foo-instance 'foo) is an error, but (subtypep foo-instance foo-instance) ;=> T,T
14:33:31
moon-child
(typep #1=#.(make-instance 'foo) #1#) gives 'bad thing to be a type specifier: #<COMMON-LISP-USER::FOO {10047D88F3}>'
14:36:39
_death
ok.. so now you're passing something that's not a type specifier, and so violates constraints in the Arguments and Values section
14:39:05
specbot
The ``Arguments and Values'' Section of a Dictionary Entry: http://www.lispworks.com/reference/HyperSpec/Body/01_ddc.htm
14:39:36
Bike
the instance is not a type specifier. as such, subtypep has been called incorrectly and the behavior is undefined.
14:39:39
phoe
but in case of (defclass foo () ()), (make-instance 'foo) is not a valid argument to SUBTYPEP
14:40:06
phoe
sbcl could possibly signal an error, something like a type-error because the argument is not of type (or symbol cons class)
14:45:51
mfiano
Thanks all, I haven't been Lisping for some months (unfortunately missed the 2-5 years), and made a mistake when I really wanted (eq (class-name (class-of instance)) type-specifier).
15:14:58
mfiano
Stupid question, but is there a library that mimics "interfaces" from other languages. What I mean, is I'd like it to be an error if the user forgets to implement a method for all of a set of generic functions for some given class/classes/etc specializers (that the library author decides on)
15:18:06
mfiano
When dealing with very composable APIs with lots of mixins etc, it can be difficult to remember to specialize them all. I could just say "their problem" when they inherit the wrong behaviors, but it would be nice to issue a warning. I know the semantics aren't exactly clear here, and that is why I'd like to look at if some libraries ever attempted to solve it, excluding some DSL/statically
15:19:33
mfiano
Maybe runtime on each invocation. I don't want to sacrifice the dynamism of Lisp for a mere correctness check.
15:32:12
mfiano
Unrelated: Just stumbled upon this, which seems, umm, interesting: https://github.com/tfeb/conduit-packages
16:43:29
madnificent
mfiano: I also work with (check-xyz) but it's for configuration files rather than classes. We want something similar in software related to our lisp code too. But very much ad-hoc.
17:00:54
madnificent
Anyone know if it's intentional that #'woo:run does not yield? it runs forever (the webserver works though)
17:03:28
etimmons
I've never used woo, but I imagine it's intentional and the thread that calls run becomes the thread in charge of the event loop
17:05:54
madnificent
etimmons: could be, though there's a stop-server command and that expects some input.
18:16:09
luis
etimmons: I'd rather "merge" osicat pull requests using rebase as I find the history is much more readable that way, but you're the one doing actual work so if you prefer to work that way that's fine too
18:18:24
jackdaniel
oh oh, I've came with a saying: "technically correct to real world is what matematically equal is to floats"
18:19:48
etimmons
luis: I agree. I don't normally use GitHub (and have all my Gitlab projects set up for linear history) so I totally forgot to check what would happen when hitting the merge button
18:23:10
jackdaniel
I have a strong impression I saw this question not that long ago from you (with answers!)
18:23:51
pjb
nij-: http://groups.google.com/group/comp.lang.lisp/msg/1bab4b5bae1fdca3 http://groups.google.com/group/comp.lang.lisp/msg/190d771c0e033a1c
18:24:25
nij-
jackdaniel: I also had this impression! But it must be at least a few months ago.. (haven't touched CL between Sept and December).
18:27:43
jackdaniel
https://irclog.tymoon.eu/libera/%23commonlisp?around=1633606249#1633606249 this, not sure whether it is the same thing
18:29:13
nij-
I found it. May 02, 2021: https://irclog.tymoon.eu/libera/%23commonlisp?around=1620039128#1620039128
18:43:49
remexre
if I have an end-user print method and a developer print method, what variable am I supposed to branch on in PRINT-OBJECT such that the latter gets used in ~s and error messages, but the former gets used in ~a?
19:44:13
phoe
ACTION looks around for people to instigat^Woffer a slot for the next Online Lisp Meeting
21:08:58
yitzi
Bike: beach: Figured out to capture the source code references by abusing the stream style stuff I came up with.
21:36:32
Josh_2
Drakma also supports reusing a connection, pretty sure thats how Dex gets the edge on it in the benchmarks
21:37:19
Josh_2
I think I will just abstract away the differences so I can swap from drakma to dex if I want
21:39:20
etimmons
Josh_2: Good question. I think in the Dex presentation I saw floating around, it claimed there was.
21:40:36
phoe
I have a possibly cyclic graph data structure that I would like to get a modified copy of, where "modified copy" means that I'd like some of the nodes to be different, and also that I want not to mutate the original, and also that I want to maximize structure sharing wherever possible. Is anyone aware of any Lisp code that will help me do that?
21:41:06
etimmons
I can't work on it for a bit, but I've got a connection pool built on top of drakma. I'm working to get it pulled out into a sensible library and also married with schannel for TLS on Windows
21:41:28
phoe
a simple example of what I'd like to do is turning (1 2 3 . #1=(4 5)) into (1 2 :three . #1#)
21:41:47
etimmons
When it's in a clean-ish state, I'm planning to reach out to see if it should be incorporated into drakma itself or live as a wrapper around it
21:41:55
Josh_2
In this case there is a serious chance that I will be making a lot of HTTP requests (webhooks) to listeners
21:42:01
phoe
a slightly more involved one is turning #1=(1 2 3 4 5 . #1#) into #2=(1 2 :three 4 5 . #2#) because then everything needs to be copied due to a cycle
21:42:31
phoe
theothornhill: yes, except the catch is, I'd like to use standard Lisp data structures for the nodes - conses, vectors, standard objects
21:44:04
etimmons
Josh_2: This is the presentation I was thinking of. https://www.slideshare.net/fukamachi/dexador-rises starts on slide 49
21:44:06
phoe
if there's no code, is anyone aware of already existing algorithms that I can try to implement for doing that?
21:53:14
Josh_2
I think I will use Snooze instead of Carlyle. If I was to modify Carlyle it would just end up like Snooze anyway
21:55:28
Josh_2
Carlyle works great for less complex applications, but the one I have to build now is going to end up exceptionally complicated I think
22:00:24
citizenandrew
Josh_2: If you really want to use Dexador and have a working connection pool, you could try https://github.com/ajberkley/dexador ... Fukamachi isn't answering pull requests...
22:00:28
_death
phoe: I think it depends on how you actually want to "modify" it.. if it's a kind of sublis that works on graphs, that's one thing.. if you want to substitute for a specific element not necessarily based on its value, it's another..
22:03:25
phoe
part one: I want to make a part of the whole graph "fresh", where the part involves making a shallow copy of everything between some root vertex of the graph and one or more "target" vertices that I want to mutate in part two
22:04:06
phoe
because of cycles, such copying also involves copying everything that refers to any of the copied vertices, because otherwise they'd refer to the "old" version
22:09:07
Josh_2
For now I will just use normal dex with :use-connection-pool nil and later if a PR is accepted or a permanent fork is made I will change this
22:10:15
_death
not sure I understand.. since each node can presumably refer to its children, when you replace a child what do you think should happen?
22:11:40
phoe
a simple example of what I'd like to do is turning (1 2 3 . #1=(4 5)) into (1 2 :three . #1#)
22:12:52
citizenandrew
Josh_2: also make sure if you do not explicitly set :keep-alive nil, beware that you should close the streams that are returned to you... there is no auto-closing / finalizing.
22:14:26
citizenandrew
Josh_2: yes... that's me. I made the changes because I saw some complaints on irc or reddit about dexador being broken so I figured it was worth fixing... but now I've got a bad taste in my mouth because there's no response to my PR.
22:14:55
Josh_2
I see, I left a comment on your PR, I think if it is not accepted than you should hard fork and rename honestly
22:17:22
phoe
I need to figure out which part of the structure to copy, then do the copying while making the modifications, then return the modified version
22:21:37
_death
phoe: in both of these you need to recreate the whole structure, correct? and #1=(1 #3=(a b) #1# 4 5) => #2=(1 #3# #2# 4 5)? but #1=(1 #3=(a b #1#) #1# 4 5) => #2=(1 (a b #2#) #2# 4 5)?
22:38:11
_death
so you need to determine whether any of the descendants refer to the parents, and if so, replace those parents and so on
22:46:43
_death
maybe a search can result in a ready made algorithm, but otherwise I'd just try to work it out on paper
23:16:37
sveit_
Hi. I saw a statement that "displaced arrays perform poorly" here: https://stackoverflow.com/questions/40810796/displaced-multidimensional-arrays-in-common-lisp#comment68846900_40810796 . Is someone here familiar with why this would be true?
23:17:30
sveit_
The reason I ask is that it is of course fairly simple to just implement an additional object that can store information on the "view" I'd like to provide on a flat array (as suggested in that comment) but why would my user-space implementation be better than what is in the compiler?
23:18:30
sveit_
(in case it's not claer, that link is directly to the comment by someone named Dan Robertson that has the statement i'm confused about)
23:19:15
Bike
so the problem is, say we have (aref a ...) in the code. if the compiler knows a is NOT displaced, that's pretty straightforward - bounds check and a memory read
23:19:36
Bike
but if it could be displaced, it has to compile in a check for that, and then code to loop through displacements to get the underlying array
23:20:01
Bike
with what the comment describes, you'd have one simple vector which can be accessed quickly, and then you just briefly compute the index you actually want
23:21:03
sveit_
Bike: i think you have revealed that I don't understand what array displacement means :) I thought it was exactly what you described in your last statement: a backing vector and some new procedure for computing indices
23:22:52
sveit_
Bike: sure, but doesn't the procedure "close" on itself? meaning if A0 is the original array, A1 is displaced to A0, and A2 is displaced to A1, can't the implementation just treat A2 as displaced to A0?
23:23:43
Bike
and, for example, if A1 is adjusted, A2 needs to reflect that adjustment, even if A0 itself has not changed
23:27:10
Bike
think the standards committee should have put a little more thought into this thing, honestly
23:30:22
Catie
Adjusting a displaced array is something they actually put a decent bit of thought into, there's an issue writeup about it
23:34:36
Bike
no, i mean instead of having displaced arrays like they exist, having a more limited construct that can't get recursive
23:47:35
aeth
there's no incentive to optimize displaced arrays because nobody uses displaced arrays... because they're not optimized
23:48:10
aeth
the idiomatic way of thinking is start/end indices and almost everything in the standard library has it, as well as any well-written third-party library
23:55:02
Bike
given that, in general, you have this indefinite-length chain of displacements to navigate
23:56:13
aeth
if the problem is the function ARRAY-DISPLACEMENT, and someone really wanted to optimize displaced arrays, couldn't they just optimize them if ARRAY-DISPLACEMENT cannot possibly show up in the program?
23:57:53
_death
Bike: what about keeping both the immediate displacement and the farthest one possible, and recomputing the latter when needed
23:58:13
Bike
yeah i guess you could have each array maintain weak backpointers to every array that's displaced to it
0:01:11
Bike
aeth: and for the record, it's more or less impossible (in general, actually impossible, for computability reasons) for a compiler to determine that some function will never be called, in a world where any function could be redefined to do (eval (read))
0:02:41
aeth
Bike: you do something like what JITs do... you are prepared to deoptimize if necessary. Easier task than JITs because you'd only need to do it on the equivalent of C-c C-c or C-c C-k