libera/#commonlisp - IRC Chatlog
Search
8:48:52
beach
Is it just me, or is it the case that the ANSI test suite does not build in a very nice way?
8:57:10
beach
Also, I wish it were easier to run the tests on a bunch of "extrinsic" operators. By that I mean that I have a library that defines standard operators, but not in the CL package, so that it can be loaded into an existing implementation without clobbering the existing operators, and I would like to run the ANSI tests on the operators defined in that library.
9:00:12
beach
I guess if each function had a single entry point associated with it, and that entry point were passed the function as an argument, that might work.
9:10:55
jackdaniel
beach: you may discuss that with yitzi, he is very active recently on ansi-test repository
9:11:23
jackdaniel
as of the loading - it is based on makefile and bare calls to load, because when you test an incomplete common lisp implementation you can't sanely assume that asdf system will work
9:14:43
jackdaniel
it is also important to note that while we maintain ansi-test repository on common-lisp.net, pfdietz works on his own version that contains random testers and other goods - that's something I'd very much like to backport at some point if time and energy permits
9:15:45
jackdaniel
(and in a matter of fact pfdietz should be in charge of "our" ansi-test suite but I don't recall him expressing any interest in that)
9:16:07
jackdaniel
c.f: https://gitlab.common-lisp.net/ansi-test/ansi-test/ ; https://github.com/pfdietz/ansi-test/
10:44:41
pjb
beach: if you want to run ansi-tests, without modifying it, you may have some luck by redefining cl-user::defpackage and cl-user::in-package. Have a look at Image Based Development http://informatimago.free.fr/i/develop/lisp/com/informatimago/small-cl-pgms/ibcl/index.html and https://gitlab.com/com-informatimago/com-informatimago/-/tree/master/small-cl-pgms/ibcl
10:46:13
pjb
Well, actually only defpackage. https://gitlab.com/com-informatimago/com-informatimago/-/blob/master/small-cl-pgms/ibcl/ibcl.lisp#L307
10:46:43
pjb
However if ansi-tests uses qualified symbols eg. CL:CAR, then you may need to use a reader macro instead.
10:47:30
pjb
But in the context of sicl and in general of tools for implementation writters, ansi-tests should be written with that level of indirection, so a big patch would be in order, if it doesn't already have it (which I doubt).
12:20:32
random-jellyfish
does the use of (values ...) to return multiple values affect the execution speed of an inlined function?
12:21:08
random-jellyfish
I noticed that inlining some functions makes them much faster, in sbcl at least
12:21:59
jackdaniel
inlining is like the single best optimization compilers can make (if they can of course)
12:39:26
beach
I would expect the amount of work the function does to be more significant than whether it uses multiple values.
12:43:31
random-jellyfish
this is the function, it saves the least significant n bits of an integer and zeroes out the rest
12:43:57
jackdaniel
why does it return two values if the second value is the identity of the second argument? (just curious)
12:44:22
beach
For a fixnum, that's a very small amount of work, so the call overhead would be significant.
12:45:13
random-jellyfish
I have an entire library of bit level operations and I'm thinking of also returning the bit width of the result because in some cases it's not equal to one of the arguments
12:45:26
pjb
you could abstract it into a structure: (defstruct word width bits) (defun to-unsigned-bit (x n) (make-word :width n :bits (logand x (1- (ash 1 n))))) (to-unsigned-bit 42 16) #| --> #S(word :width 16 :bits 42) |#
12:45:33
random-jellyfish
for example when I want to concatenate the bits of two integers into a bigger integers
12:46:29
random-jellyfish
it's a lot of work to do this change to all the functions and I was wondering if you guys have an intuition about the performance impact it might have
12:47:57
pjb
For optimization sake, you may want to avoid the multiple values, since you already know the width in the caller.
12:48:40
pjb
But you may have operations that compute a new width. Eg, (multiply a wa b wb) --> a*b wa+wb
12:52:04
jackdaniel
random-jellyfish: if the function is inlined, the the compiler should figure out how to handle multiple values here without much issue
13:13:28
phoe
beach: PCS license is complicated? how? it's public license for the code + BSD for tests copied from ANSI-TEST
13:15:06
phoe
oh, maybe you mean the CC0 license; yes, it's full of legalspeak, but basically it means that this code is public domain
13:16:50
beach
Good to know. Thanks! I may not use very much code anyway, but if I do, I'll make sure to indicate its origin.
16:13:57
beach
phoe: I asked a question the other day about associating a restart with a condition, and bike answered that I was write in assuming that the association must be distinct from the restart. However, in your code, a restart contains a list of associated conditions. What makes you think that will work?
16:27:18
beach
phoe: Never mind. I think I see. You kind of implement the logic of special variables yourself by using an UNWIND-PROTECT and popping off the conditions when the dynamic environment is no longer established.
16:28:13
beach
phoe: So let me ask you this instead: Why did you decide to do it this way, rather than with a special variable as (apparently) KMP does.
18:53:34
piethesailor
I am trying to use "clx" an running into an issue. Anyone familiar? looking for a tip.
18:55:14
piethesailor
So far I've (ql:quickload :clx) and tried to run (xlib:open-display "localhost:0") and im getting an: `Name service error in "getaddrinfo": -2 (Name or service not known)` error
18:55:50
Nilby
splittist: Here's some hackish lines I had in my .lisprc to start LEM without roswell. I haven't tested it recently. https://plaster.tymoon.eu/view/3812#3812
18:55:50
piethesailor
I've also tried using various ip address found with1 ip addr show | grep 'inet '
18:58:01
Nilby
piethesailor: maybe (open-display "localhost" :display 0) or even (open-display "" :display 0)
18:59:28
piethesailor
Nilby: Ah! your second suggestion returned a display object! Much appreciated!
18:59:29
gilberth
These days there also is (XLIB:OPEN-DEFAULT-DISPLAY) which may be more reliable. And are we sure that the X11 listens on a TCP/IP socket and not on a UNIX domain socket only?
19:01:00
piethesailor
I am not sure which it runs on, must be worth knowing. I am running ubuntu through windows subsystem. So that might muddy things..
19:02:39
piethesailor
and that makes sense now that I think about it Nilby. I am trying to get this code to work https://gist.github.com/wiedzmin/4653b830fd351b69dacb21b6108f4809
19:03:41
gilberth
What does "echo $DISPLAY" or (XLIB::GETENV "DISPLAY") say? Anyhow, this OPEN-DEFAULT-DISPLAY should do the right thing.
19:12:26
piethesailor
[Condition of type XLIB:MATCH-ERROR]. Ill post the code I am trying to run in a paste bin here in a sec
19:15:54
piethesailor
This might be a more in depth issue, could be too much for discussion here, but I'll try my luck
19:25:09
Nilby
piethesailor: This might not be the best way, but it works for me if I change line 16 to: :image-data (xlib::image-x-data image)
19:29:48
Nilby
I used to get match errors on older version of CLX, but that doesn't seem happen much anymore.
19:31:05
gilberth
The code also assumes a certain pixel format and visual class. Bound to break. One of the most tedious parts of the X11 protocol. I wish they would have designed the X11 protocol in a device independent fashion.
19:31:45
adeht
https://github.com/VitoVan/cl-dino has some clx code (cl-autogui) I found useful, including an x-snapshot function
19:35:54
piethesailor
Interesting.. Appreciate all the input so far. I am getting the match error when running (take-screenshot) so that would be before I even get to saving the screen shot as png
19:43:05
Nilby
piethesailor: I think the error usually means the default visual for the display different than the root window, which could happen with multiple monitors, gpu cards, or even the desktop environment / window manager.
19:44:45
Nilby
the "xpdyinfo" command can show the visuals and you can compare to what you're getting. But maybe also make sure your CLX is up to date.
19:45:41
piethesailor
is xpdyinfo supposed to be run in term? I am getting cammand not found in the eshell
19:47:00
piethesailor
and I ql:quickloaded CLX just a day or two ago. so I think I am good on that front
19:49:42
piethesailor
gilberth: I am seeing a lot of class: TrueColor Depth: 24 planes items when I run xdpyinfo
19:50:41
pve
Hi, is there a page that lists which macros or special operators, when they are top-level forms, also process their "inner forms" as top-level forms?
19:53:27
gilberth
This is curious. The GetImage X11 protocol request doesn't need a depth or visual. It rather returns that information. The protocol spec says that a match error occurs when the rectangle asked is not viewable (not considering inferiors or siblings). So are we sure that this is an CLX or programming issue and not a server issue. Perhaps some of the modern compositing or even wayland getting into the way?
19:53:28
specbot
Processing of Top Level Forms: http://www.lispworks.com/reference/HyperSpec/Body/03_bca.htm
19:54:21
gilberth
Hence suspecting a wrong visual or depth being chosen is a red herring as far as I can see.
19:56:57
gilberth
So I would first test with an "xwd -root > out.wd" command to see if this is supposed to work at all.