phoe changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/>
<White_Flame> (ackchyually, 64-bit SBCL supports 63-bit fixnuns, which is kinda cool)
<mzan> ah sorry yes
<mzan> (max (integer-length most-positive-fixnum) (integer-length most-negative-fixnum))
<mzan> returns 62 bit. So 62 bit of content and 1 bit for the sign = 63 bit.
ski has joined #commonlisp
vats has joined #commonlisp
kevingal has quit [Remote host closed the connection]
Oladon has joined #commonlisp
djuber has quit [Remote host closed the connection]
perrierjouet has joined #commonlisp
gaqwas has joined #commonlisp
taiju has joined #commonlisp
perrierjouet has quit [Quit: WeeChat 3.4]
gaqwas has quit [Ping timeout: 240 seconds]
perrierjouet has joined #commonlisp
<moon-child> mzan: two's-complement is not sign-and-magnitude
<moon-child> NB. spec note sez: 'Regardless of the sign of integer, its value can be represented in signed binary two's-complement form in a field whose width in bits is no smaller than (+ (integer-length integer) 1).'
<Bike> yeah, but integer-length plus one should work anyway.
gaqwas has joined #commonlisp
waleee has quit [Ping timeout: 240 seconds]
waleee has joined #commonlisp
masinter has quit [Ping timeout: 256 seconds]
perrierjouet has quit [Quit: WeeChat 3.4]
perrierjouet has joined #commonlisp
azimut_ has joined #commonlisp
azimut has quit [Ping timeout: 276 seconds]
rotateq has quit [Quit: ERC (IRC client for Emacs 27.2)]
scymtym has quit [Ping timeout: 256 seconds]
gaqwas has quit [Ping timeout: 256 seconds]
occ has joined #commonlisp
waleee has quit [Ping timeout: 268 seconds]
Oladon has quit [Quit: Leaving.]
s-liao has joined #commonlisp
jeosol has quit [Quit: Client closed]
morganw has quit [Remote host closed the connection]
perrierjouet has quit [Quit: WeeChat 3.4]
perrierjouet has joined #commonlisp
perrierjouet has quit [Remote host closed the connection]
perrierjouet has joined #commonlisp
Guest74 has quit [Quit: Connection closed]
scymtym has joined #commonlisp
parjanya has joined #commonlisp
parjanya has quit [Read error: Connection reset by peer]
notzmv has joined #commonlisp
notzmv has quit [Read error: Connection reset by peer]
s-liao has quit [Quit: Client closed]
notzmv has joined #commonlisp
wyrd has quit [Ping timeout: 276 seconds]
Jing has joined #commonlisp
karlosz has joined #commonlisp
jpl01 has quit [Remote host closed the connection]
vats has quit [Ping timeout: 250 seconds]
jeosol has joined #commonlisp
random-nick has quit [Ping timeout: 256 seconds]
brettgilio has joined #commonlisp
Guest74 has joined #commonlisp
Jing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Catie has quit [Quit: Going home]
gko` has quit [Quit: ERC (IRC client for Emacs 27.2)]
lisp123 has joined #commonlisp
gko has joined #commonlisp
jeosol has quit [Ping timeout: 256 seconds]
<lisp123> beach: Congratulations on the latest paper (ELS) and also retirement! Hopefully many more new papers under the banner of 'Unaffiliated' ;)
occ has quit [Ping timeout: 256 seconds]
<lisp123> There were a few referring to the Draft Standards - here is a copy of the HTML https://mr.gy/ansi-common-lisp/
<beach> lisp123: The paper has not even been submitted yet, so congratulations in that domain shall have to wait until the referees have given their opinion.
<lisp123> beach: Ah sorry, it is early here so my brain is a bit fuzzy
aartaka has joined #commonlisp
pillton has joined #commonlisp
<beach> Oh, and.... Good morning everyone!
Algernon69 has joined #commonlisp
parjanya has joined #commonlisp
Algernon69 has quit [Ping timeout: 268 seconds]
parjanya has quit [Read error: Connection reset by peer]
<|smlckz|> how can i do biwise right shift?
<Bike> (ash whatever -howmuch)
<|smlckz|> :o how long did it take for you to type that?
<Bike> 1870 ms
aartaka has quit [Ping timeout: 250 seconds]
<|smlckz|> hmm, how else can i convert a number to a list of its digits in base 2 (e.g. 11 -> '(1 0 1 1)) in a way faster or simpler than converting to and from string?
<|smlckz|> s/faster or//
jealousmonk has quit [Quit: ERC (IRC client for Emacs 27.1)]
lisp123 has quit [Quit: Leaving...]
occ has joined #commonlisp
<dre> |smlckz|, that reminds me of aoc, let me check...
triffid has joined #commonlisp
copec has quit [Quit: checkity check out.]
copec has joined #commonlisp
tyson2 has quit [Read error: Connection reset by peer]
<dre> oh sorry that was other way around.. binary to number is just through (parse-integer :radix 2)
s-liao has joined #commonlisp
<EdLangley[m]> |smlckz|: I think there's a way to convert a number to a bit vector
<EdLangley[m]> Hmm, I might be thinking of the bit-smasher system
semz_ has joined #commonlisp
semz has quit [Ping timeout: 250 seconds]
masinter has joined #commonlisp
semz_ is now known as semz
<Bike> well, if you're consing up a list it's probably not going to be fast regardless, but the most straightforward way might be something like (loop for i below (integer-length num) collect (ldb (byte 1 i) num)))
<|smlckz|> is there list compare functions (like equal) for less than and greater than operations?
<Bike> if the lists are the same length, you can use cl:every
<Bike> (every #'< '(1 2 3) '(4 7 9)) => T
<moon-child> I was assuming lexicographic comparison
<Bike> if you're comparing lists of binary digits, you can do way faster, though
<moon-child> such that e.g. (1 1 2) is less than (1 1 3)
<Bike> if you have nonnegative integers a and b, and want to check that all binary digits of a are less than or equal to those of b, you can do (zerop (logandc2 a b))
Bike has quit [Quit: Lost terminal]
aartaka has joined #commonlisp
Guest1436 has joined #commonlisp
dec0d3r has quit [Quit: Leaving]
qeqeqw has joined #commonlisp
parjanya has joined #commonlisp
Jing has joined #commonlisp
Guest1436 is now known as spongebob
spongebob is now known as bobbybob
parjanya has quit [Read error: Connection reset by peer]
bobbybob has quit [Quit: Client closed]
iamFIREcracker has quit [Ping timeout: 256 seconds]
occ has quit [Read error: Connection reset by peer]
occ has joined #commonlisp
occ has quit [Ping timeout: 250 seconds]
s-liao has quit [Ping timeout: 256 seconds]
occ has joined #commonlisp
mgl has joined #commonlisp
Cymew has joined #commonlisp
foxfromabyss has joined #commonlisp
<frodef> 'morn
Algernon69 has joined #commonlisp
<beach> Hello frodef.
<beach> frodef: So have you completely given up on Movitz?
<beach> I am asking because you seem to be doing web stuff instead.
<frodef> beach: Well, given up in the sense that 32-bit is pretty much dead, yes.
<beach> Well, I was expecting a Movitz-64.
<frodef> beach: I haven't given up on that, but can't really prioritize it at the moment.
<beach> I see.
<ecraven> how do I best deal with binary data in CL? I'd like some way to read an entire file into an array, then access differently-sized integers at certain offsets (unsigned-16le, signed-32be, and so on). what functions should I look at here?
<phoe> lisp-binary comes to mind, and so does nibbles
<phoe> although lisp-binary reads into objects rather than just arrays
<phoe> so nibbles will be a better fit
frgo has quit [Ping timeout: 268 seconds]
simendsjo has joined #commonlisp
<foxfromabyss> Any advice on which websocket library should I use for a websocket client?
<foxfromabyss> I've managed to find `websocket-driver` which mysteriously gets a connection closed instantly and I am not sure how to debug that
<foxfromabyss> and `usocket`, where I would have to reimplement `wss` myself on top of TCP streams :(
frgo has joined #commonlisp
frgo has quit [Ping timeout: 240 seconds]
<mgl> About two years I got websocket-driver to work for some toy stuff.
<mzan> ecraven: I'm not an expert, but I would try with something like
<mzan> (let* ((file-size (...))
<mzan> (buffer (make-array file-size :adjustable nil :element-type 'bit)))
<mzan> (read-sequence buffer s))
<mzan>
<mzan> "s" is the input stream of the file
<ecraven> how would I then access data from that array?
shka has joined #commonlisp
<phoe> bit-smasher could help
<mzan> ecraven: I don't know. But I'm sure that "read-sequence" is very very fast, and that CL supports bitvectors in an efficient way.
<mzan> If you specify the element type, and that it is not adjustable, the array becomes something similar to a C array.
<mzan> (in case the element type has known fixed size)
gaqwas has joined #commonlisp
karlosz_ has joined #commonlisp
masinter has quit [Ping timeout: 240 seconds]
karlosz has quit [Ping timeout: 256 seconds]
karlosz_ is now known as karlosz
pve has joined #commonlisp
rotateq has joined #commonlisp
s-liao has joined #commonlisp
foxfromabyss3 has joined #commonlisp
parjanya has joined #commonlisp
cosimone has joined #commonlisp
foxfromabyss has quit [Ping timeout: 256 seconds]
<EdLangley[m]> foxfromabyss: I've been using websocket-driver for a couple years now without any issues
shinohai[m] has quit [Quit: You have been kicked for being idle]
<foxfromabyss3> I see, thanks
parjanya has quit [Read error: Connection reset by peer]
aartaka has quit [Ping timeout: 240 seconds]
aartaka has joined #commonlisp
amb007 has quit [Ping timeout: 250 seconds]
amb007 has joined #commonlisp
<jdz> mzan: Pretty sure operating with octets instead of bits is way more ergonomic in CL.
<jdz> Given an array.
foxfromabyss has joined #commonlisp
<jdz> Reduces the number of "operations" by a factor of 8.
<moon-child> there are bitarrays
<moon-child> and bignums
foxfromabyss3 has quit [Ping timeout: 256 seconds]
karlosz has quit [Quit: karlosz]
frgo has joined #commonlisp
s-liao has quit [Quit: Ping timeout (120 seconds)]
s-liao has joined #commonlisp
simendsjo has quit [Ping timeout: 256 seconds]
occ has quit [Ping timeout: 268 seconds]
MajorBiscuit has joined #commonlisp
frgo has quit [Remote host closed the connection]
dickbar__ has quit []
frgo has joined #commonlisp
nij- has joined #commonlisp
<nij-> I run `/usr/local/bin/sbcl` in root, eval (asdf:?), and gets the error "Package ASDF does not exist.". However, running the same sbcl as the normal user doesn't have this problem - asdf is loaded automatically. Why?..
<flip214> nij-: perhaps your user ~/.sbclrc has a (require :asdf)
<nij-> Oh. It seems quicklisp/setup.lisp does that favor for my user.
<nij-> Well, I don't want to have quicklisp for root. What's the minimal way for the sbcl to find where asdf is?
<nij-> I suppose on archlinux asdf comes with sbcl.
frgo has quit [Ping timeout: 240 seconds]
<flip214> nij-: SBCL has ASDF as a contrib - so the (require :asdf) should be enough to load ASDF.
<flip214> then you can use asdf:*central-registry* to define where to load systems from
<nij-> Indeed! Thanks :)
attila_lendvai has joined #commonlisp
rgherdt has joined #commonlisp
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #commonlisp
Posterdati has quit [Ping timeout: 250 seconds]
<EdLangley[m]> You can also load systems manually with (asdf:load-asd "/absolute/path/to/system.asd")
<EdLangley[m]> I do this a lot with systems I've cloned from git
Algernon69 has quit [Ping timeout: 240 seconds]
Algernon69 has joined #commonlisp
utis has quit [Remote host closed the connection]
Posterdati has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 256 seconds]
Lord_of_Life_ is now known as Lord_of_Life
qeqeqw has quit [Ping timeout: 250 seconds]
kevingal has joined #commonlisp
iamFIREcracker has joined #commonlisp
parjanya has joined #commonlisp
kevingal has quit [Ping timeout: 240 seconds]
kevingal has joined #commonlisp
parjanya has quit [Read error: Connection reset by peer]
<theothornhill> mzan: thanks :) Yes, this wasn't really about optimizing any code, I just like too peek inside the box.
foxfromabyss has quit [Ping timeout: 256 seconds]
Algernon91 has joined #commonlisp
pillton has quit [Remote host closed the connection]
Algernon69 has quit [Ping timeout: 268 seconds]
random-nick has joined #commonlisp
dre has quit [Ping timeout: 250 seconds]
dre has joined #commonlisp
Algernon91 has quit [Ping timeout: 268 seconds]
s-liao has quit [Ping timeout: 256 seconds]
Algernon91 has joined #commonlisp
triffid has quit [Ping timeout: 276 seconds]
triffid has joined #commonlisp
tyson2 has joined #commonlisp
<rotateq> Hm how about the capabilities of CL in dealing with floats at "low level"? At one point in TAoCP Knuth says most languages don't offer much. but may be also more implementation dependent
<rotateq> not that I'm a big fan of doing everything with floats :) symbolic computing benefits from having exact integers and realtions on them
<phoe> low level, as in?
<phoe> a sequence of bits?
<rotateq> yes I think he means that
<rotateq> or that maybe "floats" come mostly as kind of black boxes
<moon-child> rotateq: depending on your needs. INTEGER-DECODE-FLOAT may be sufficient. Or crap, in which case there is a portability librar
<moon-child> y
<rotateq> yes thanks moon-child, i've seen it lately, but didn't use it till now :)
<rotateq> trivial-floats
s-liao has joined #commonlisp
<rotateq> phoe: "The most programming languages nowadays don't give programmers much possibilities to manipulate floating point numbers."
<rotateq> in the end, an integer and a float can have same bits. the interpretation counts
gw1 has joined #commonlisp
<moon-child> I disagree
<rotateq> yes you like to disagree
<moon-child> 'integer' and 'float' are distinct objects interactible according to distinct interfaces
<moon-child> that they may be represented the same way is an implementation detail
<moon-child> rotateq: so sue me :)
<rotateq> i meant at hardware level
<moon-child> eh
<moon-child> float and int ops go to different execution ports
<rotateq> no moon-child, just an observation :)
<moon-child> in many cases also different registers
<rotateq> so then sue me, as I'm not wise enough with the topic yet and made such dumb comment ^^
<rotateq> but good to know, thank you :)
<rotateq> i meant it more on the level, a message with maybe the same containment, but differently interpreted in different contexts
<phoe> standard CL won't help you because floats and integers are of different types and the standard does not make any assumptions even whether IEEE-754 is used
<phoe> only implementation-dependent stuff is left for you
<rotateq> oki phoe :)
<rotateq> i think that's good that the standard enslaves itself not to IEEE (or does it at other points? .. now i look how old this IEEE thingy is)
<rotateq> as in, that a byte is just standardised at most hardware nowadays to 8bit, but that doesn't mean it's a must
<phoe> there's the question of standards versus de facto standards
<rotateq> yes
<phoe> hot take: all contemporary architectures that matter use 8-bit bytes and IEEE-754 floats and either 32 or 64 bits as machine word sizes
<rotateq> "oh, your standard doesn't have regexes or unicode defined?"
<phoe> cool take: it's possible to not care too much and have generic support for everything, and then have implementation-specific optimized code for fast paths
<rotateq> yes and that's okay, but also more special purpose then
<rotateq> :)
<rotateq> okay, IEEE is from 1963
<phoe> the latter is the CL way and also why arrays of (unsigned-byte 8) or (... 16) or (... 32) or (... 64) can get special treatment
<rotateq> but even this can make big mistakes in defining "standards"
<phoe> unlike e.g. arrays of (... 36) which would perhaps be optimizable on 6-bits-per-byte architectures
<rotateq> as in the MIX machine by Knuth :)
<rotateq> but okay, it's polyunsaturated
<Alfr> rotateq, ieee 754's first version was from 1985.
<rotateq> Alfr: okay yes for this 754, i looked up when they formed as an organization
<rotateq> so even 754 after CLtL1 :D
<Alfr> rotateq, and you should be able to test for it by checking for :ieee-floating-point in *FEATURES*.
<phoe> ;; latest CCL release has a bug in this regard
<rotateq> oh right, I've seen this one indirectly from time to time
<Alfr> phoe, they finally abandoned ieee754 for greener pastures? :)
<rotateq> yesterday i loaded sb-simd by heisig, now i just have to learn how to use when i need it ^^ and then i pushed of course :sb-simd to *features* too
<Alfr> rotateq, it's one of the few things in *FEATURES* the spec defines.
<phoe> Alfr: no, the feature is missing
<rotateq> okay can you show me where then?
<rotateq> oh hm.
<rotateq> in a nice talk by John Hughes about using property testing in automotive he has a funny line with "And with quickcheck we found 200 bugs in some of the applied IEEE standards."
<Alfr> phoe, CCL found bugs in the FP implementations on all supported platforms, thus don't claim conformance to 754 anymore. ;)
<Alfr> phoe, just kidding.
<rotateq> hm which keywords does the spec even clearly says must be in *features*? maybe :ansi-cl, :common-lisp, ...
<Alfr> clhs *features*
<Alfr> rotateq, ^
gamaliel has joined #commonlisp
gamaliel has quit [Client Quit]
occ has joined #commonlisp
jackson99 has joined #commonlisp
jackson99 has quit [Excess Flood]
occ has quit [Ping timeout: 240 seconds]
qeqeqw has joined #commonlisp
<rotateq> thanks Alfr :( [i was busy in kitchen cleaning]
<rotateq> okay, that was too obvious :D
occ has joined #commonlisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
dre has quit [Ping timeout: 250 seconds]
parjanya has joined #commonlisp
<rotateq> lel here's a presentation where they claim the ANSI CL standard is from 2004
parjanya has quit [Read error: Connection reset by peer]
dre has joined #commonlisp
Bike has joined #commonlisp
s-liao has quit [Quit: Client closed]
<rotateq> so i sent an email and requested an issue as it's a university course about robot programming :)
pranavats has left #commonlisp [Error from remote client]
pranavats has joined #commonlisp
nij- has quit [Quit: Using Circe, the loveliest of all IRC clients]
ec has joined #commonlisp
s-liao has joined #commonlisp
jealousmonk has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
frgo has joined #commonlisp
s-liao has joined #commonlisp
frgo has quit [Ping timeout: 268 seconds]
jealousmonk has quit [Remote host closed the connection]
jealousmonk has joined #commonlisp
s-liao has quit [Quit: Client closed]
dilated_dinosaur has quit [Remote host closed the connection]
dilated_dinosaur has joined #commonlisp
qeqeqw has left #commonlisp [Leaving]
frgo has joined #commonlisp
frgo has quit [Read error: Connection reset by peer]
frgo_ has joined #commonlisp
frgo_ has quit [Client Quit]
frgo has joined #commonlisp
dre has quit [Ping timeout: 240 seconds]
cage has joined #commonlisp
ec has quit [Ping timeout: 276 seconds]
ec has joined #commonlisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
gin has quit [Ping timeout: 256 seconds]
cosimone has quit [Remote host closed the connection]
gin has joined #commonlisp
cosimone has joined #commonlisp
cosimone has quit [Remote host closed the connection]
wheelsucker has joined #commonlisp
cosimone has joined #commonlisp
dre has joined #commonlisp
<mfiano> What would be a decent way to check if two lists of integers, both of length N, have every element approximately equal to each, with an absolute tolerance +/- M ?
<mfiano> I could write this a million ways, but just trying to get a second opinion.
<Bike> do you mean comparing elementwise, or something else? i'm not sure what "every approximately equal to each" means
<mfiano> Elementwise yes
<Bike> i would just do (every (lambda (n1 n2) (< (abs (- n1 n2)) m)) l1 l2)
<pjb> mfiano: sort both lists, and compare the sorted lists element by element.
<mfiano> Order is very important, and I'm not sure what sorting accomplishes here.
<pjb> so indeed: (every (lambda (n1 n2) (< (abs (- n1 n2)) m)) (sort l1 '<=) (sort l2 '<=))
<pjb> modulo every stops at the shortest list, and you want lists of the same length.
<mfiano> Umm
<pjb> Oh, elementwise. So no sorting.
<mfiano> Ok, let me see. I'm not yet sure if I want to use EVERY. It's unclear still if I need to find out the position they differ.
<mfiano> I will experiment with this though for now, thanks.
Jing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<semz> could use (not (some (lambda (n1 n2) (>= ...)))) instead, which is easily changeable to position-if
<Bike> if you need the position, (mismatch l1 l2 :test (lambda ...))
<mfiano> Yeah mismatch is one of my favorite least used functions :)
<Bike> i don't think i have ever used it.
<semz> I didn't know it existed lol
<mfiano> I have, like twice in 15 years, where it was perfect.
<mfiano> Hmm this won't do, and also is not quite correct somehow.
<Bike> what is incorrect?
<mfiano> I will make a paste, one moment
<mfiano> edited, small typo
<Bike> just as well, i don't really know what any of this means
<semz> it'd have to be <= not <, no?
<semz> I was under the impression that you're comparing integers
<mfiano> semz: Yes, with <= it works, and yes, integers.
<mfiano> However, when a failure occurs, I don't want to see NIL is not T...so some slight fiddling is needed still.
<mfiano> Oh, apparently, I'm dumb.
<mfiano> I don't need this tolerance testing after all, it seems.
<mfiano> But it will likely come in useful for some of the slightly lossy conversions to be tested later.
<mfiano> Apparently that TRUNCATE by #xFF is wrong.
<mfiano> #xFF and #x101 give off-by-one errors sometimes, but #x100 is always correct.
<mfiano> I guess I just don't know how to bit twiddle
spiaggia has joined #commonlisp
jealousmonk has quit [Remote host closed the connection]
Algernon91 has quit [Read error: Connection reset by peer]
masinter has joined #commonlisp
azimut_ has quit [Ping timeout: 276 seconds]
Cymew has quit [Ping timeout: 256 seconds]
Algernon91 has joined #commonlisp
Jing has joined #commonlisp
spiaggia has quit [Ping timeout: 256 seconds]
<Guest74> you're converting 16bit to 8bit?  for lossy just shift right?
<Guest74> truncate will also not get you correct rounding if you're trying to be correct.
<mfiano> Not entirely a bitwise conversion.
<Guest74> sorry, i dont understand what that means.
<White_Flame> truncating is probably more correct
waleee has joined #commonlisp
<White_Flame> ffff => ff.ff rounds to 100.00 which is out of range
cosimone has quit [Remote host closed the connection]
<Guest74> (truncate #xffef 257) gives 254 when should be 255
<White_Flame> yeah, a 257 divisor is probably not correct
<White_Flame> at least without rounding fixup
<mfiano> It should be 256
<White_Flame> no, you don't want 256
cosimone has joined #commonlisp
Algernon91 has quit [Ping timeout: 268 seconds]
<Guest74> 257 is pretty standard.
attila_lendvai has quit [Read error: Connection reset by peer]
<mfiano> 255 and 257 give an off-by-one error ocassionally for me. Just tried 1 million random colors with 256 and it always works :shrug:
attila_lendvai has joined #commonlisp
<White_Flame> I would do right shift by 8 and truncate the lower bits
<White_Flame> think about scaling up by multiplying by 257
<White_Flame> the lower bits are generate above 0.5 without rounding up the upper bits
<Guest74> (truncate #x100 256) gives 1, with 257 it gives 0.  You want integers between 0-255 or 1-256?
<White_Flame> eg, if #xf0 scales up to #xf0f0, then rounding to #xf1 is not correct
<mfiano> Why not?
<mfiano> (truncate (* #xf0 257) 256) ; => #xf0
<White_Flame> right, that's correct. although ash is "cheaper" and IMO more clear than truncate
<Guest74> ash will keep white but not black.
<White_Flame> what do you mean?
<Guest74> or maybe it's the other way around.  You will lose either pure white or pure black.
<White_Flame> I don't think so
<Guest74> trying to find my notes when I surveyed what most graphics packages were doing,
<White_Flame> this is going round trip from 8bit to 16bit back to 8bit
<White_Flame> since the lower 8 bits of the 16 bit values are constructed, they should only hit the high 8 bits if they actaully overflow into it, and rounding will add artificial change
<White_Flame> if you start with 16 bit values where the lower bits are meaningful, then that's another story
<Guest74> yeah, i work in 16bit for most things.
<Guest74> which is how it should be imo
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #commonlisp
<Guest74> round trip colour space conversions using 8bit with most formulae can lose upto 70% of your information depending on space you're converting to.
taiju has quit [Remote host closed the connection]
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #commonlisp
foxfromabyss has joined #commonlisp
Algernon91 has joined #commonlisp
<Guest74> mfiano: what are you working on now?  I seem to recall there was quite a good colourspace library out there.
Algernon666 has joined #commonlisp
attila_lendvai has quit [Read error: Connection reset by peer]
Algernon666 has quit [Read error: No route to host]
Algernon666 has joined #commonlisp
<mfiano> A private special purpose tool that requires some rather opinionated low-level choices.
<White_Flame> still porting from Go code?
attila_lendvai has joined #commonlisp
<mfiano> Not really porting. Used it as one of several sources.
Josh_2 has joined #commonlisp
<Josh_2> Hello
Algernon91 has quit [Ping timeout: 268 seconds]
Catie has joined #commonlisp
attila_lendvai has quit [Ping timeout: 240 seconds]
rotateq has quit [Quit: ERC (IRC client for Emacs 27.2)]
attila_lendvai has joined #commonlisp
Algernon91 has joined #commonlisp
Algernon666 has quit [Ping timeout: 268 seconds]
Jing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
spiaggia has joined #commonlisp
IPmonger has joined #commonlisp
IPmonger has quit [Remote host closed the connection]
tyson2 has quit [Remote host closed the connection]
amb007 has quit [Ping timeout: 250 seconds]
amb007 has joined #commonlisp
<Guest74> So I'm writing a surface protocol. surfaces being things that can be drawn/displayed to, so far have networked x11, renderx11, linux framebuffer, rasters.  And wondering if I should separate some things out into a separate protocol and what would it be called.  I have things like VISIBLE?,LOCATION and MOVE(or parent which i'm thinking of adding)
<Guest74> which don't really apply to things like pixmaps or textures. Should I separate those out or just specify what get's returned if a gf doesn't apply to that type of surface?
mgl has quit [Quit: Client closed]
MajorBiscuit has quit [Ping timeout: 256 seconds]
dre has quit [Ping timeout: 250 seconds]
varjagg has joined #commonlisp
<Josh_2> Maybe
dre has joined #commonlisp
karlosz has joined #commonlisp
<Guest74> though i guess surfaces like pdf can return a pathname for location.
ns12 has quit [Quit: bye]
varjagg is now known as varjag
ns12 has joined #commonlisp
Algernon91 has quit [Read error: Connection reset by peer]
spiaggia has quit [Ping timeout: 240 seconds]
amb007 has quit [Ping timeout: 256 seconds]
karlosz has quit [Quit: karlosz]
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
hineios has quit [Quit: The Lounge - https://thelounge.chat]
tyson2 has joined #commonlisp
alvaro121 has quit [Ping timeout: 250 seconds]
alvaro121 has joined #commonlisp
hineios has joined #commonlisp
jealousmonk has joined #commonlisp
kevingal has quit [Remote host closed the connection]
Algernon91 has joined #commonlisp
Algernon666 has joined #commonlisp
foxfromabyss has quit [Quit: Client closed]
jeosol has joined #commonlisp
<jeosol> Good morning all!
<jeosol> Looking into message queues. Has any one used the cl-rabbit or cl-bunny libraries (based on rabbitmq)
Algernon91 has quit [Ping timeout: 268 seconds]
Algernon666 has quit [Ping timeout: 268 seconds]
Guest74 has quit [Quit: Connection closed]
karlosz has joined #commonlisp
karlosz has quit [Client Quit]
foxfromabyss has joined #commonlisp
<foxfromabyss> how do I supply `or` as an argument to `reduce`? SBCL says it's a macro and not a function :/ do i have to create a wrapper function?
<phoe> foxfromabyss: #'some
<phoe> (list (some #'oddp '(0 2 4 6 8)) (some #'oddp '(0 2 5 6 8))) ;=> (NIL T)
<moon-child> that seems different though?
<moon-child> I would assume an or-reduction would return the first non-nil element of a list, or nil if there were none
<phoe> oh, so you want the first non-nil element
<yitzi> some can bail, but reduce can't
<phoe> (lambda (x y) (or x y)) should work, but what yitzi said
<phoe> (loop for x in list when x return x)
<foxfromabyss> I want to iterate over `(list t nil t nil..)`
<foxfromabyss> if that helps
<moon-child> phoe: (loop for x in list thereis x)
<EdLangley[m]> You technically can bail early from reduce
<phoe> moon-child: will that return X, or just a boolean?
<moon-child> return x
<phoe> TIL
<EdLangley[m]> Using THROW/CATCH or RETURN-FROM
<moon-child> (loop for x in '(nil 2 5) thereis x) #| --> 2 |#
<foxfromabyss> that's a lot of different solutions :D thanks!
<moon-child> :)
<yitzi> Well, technically you can bail from just about anything with that.
jealousm` has joined #commonlisp
jealousmonk has quit [Ping timeout: 268 seconds]
nature has joined #commonlisp
jealousm` is now known as jealousmonk
jealousmonk has quit [Quit: ERC (IRC client for Emacs 27.1)]
<phoe> here we go
jealousmonk has joined #commonlisp
gaqwas has quit [Remote host closed the connection]
<dbotton> If there a way given: (deftype text-direction-type () '(member :ltr :rtl :inherit)) - is there a way to get access to that member list given the type text-direction-type?
<Bike> not in the standard. some implementations provide something, like sb-ext:typexpand.
<jackdaniel> dbotton: alterntively you may write your macro (defenum …) that registers elements in a hash table keyed with the enum name
<jackdaniel> you may define a function to access the hash table if you want to be very fancy
<dbotton> In this case I still want the type to be a type, I just want to introspect for use in my builder and other places.
<jackdaniel> yes, the macro would expand to (progn (deftype …) (setf (gethash …) …))
<sm2n> phoe: s/"will be maintained/"will be maintained"/
<dbotton> thanks
<phoe> sm2n: thanks, fixing
jealousmonk has quit [Ping timeout: 268 seconds]
mepy has quit [Remote host closed the connection]
mepy has joined #commonlisp
jealousmonk has joined #commonlisp
<yitzi> phoe: In order have quicklisp take over distributing ASDF, clpm would have to also. I don't think it currently overwrites the distribution's ASDF since I see comments in the CLPM repo about dealing with ECL's ASDF fork.
<etimmons> yitzi: That's already on my "must have" list for the next version of CLPM
<phoe> yitzi: I guess that sounds doable - such a QL script would basically be "call to Drakma, put a file in the proper place on the filesystem, adjust the RC file"
<phoe> plus a bit of ASDF glue
<phoe> so I guess it is doable, especially if etimmons agrees
<etimmons> I saw the writing on the wall a while ago that we needed a better way to distribute ASDF
<yitzi> etimmons: Well, of course since CLPM is awesome. I have been running it on SBCL for about two months. Kudos.
<etimmons> I haven't thought about it from QL's perspective, but from what I've seen so far in phoe's post what he suggests seems reasonable
<etimmons> And I'd be happy to help support it from the ASDF side as much as I can
<etimmons> yitzi: Thanks :)
<phoe> I mean, I could try hacking together such a thing in a day I guess - just gimme a location where I can pull different versions of asdf.lisp from
<phoe> and that would run without ASDF or Quicklisp, just depend on (find-package :drakma) returning non-NIL
<phoe> possibly even that could be adaptable to use ql-http if we are crazy enough to propose adding it to quicklisp-client itself as a contrib
<phoe> but then, these are just ideas
<yitzi> Personally, I think the long term solution is CLPM since it is more modular. That is not to take a single thing away from the amazing accomplish of Xach, though.
<etimmons> phoe: We should probably add a request for a file listing all ASDF versions to the ASDF issue tracker. Maybe adding it to https://gitlab.common-lisp.net/asdf/asdf/-/issues/93
<EdLangley[m]> Does CLPM have a lisp interface I can use for installing libraries?
<phoe> etimmons: please do so, my brain is fried
<EdLangley[m]> without restarting my repl
<yitzi> Ed Langley: yes, and you can wire it into require if you want.
<etimmons> phoe: Another sticky point might be http(s)... AFAIK, the canonical place where ASDF is served from supports only https
<EdLangley[m]> Is it pure lisp, or does it have a FFI component?
<phoe> etimmons: fixable QL-style, grab a http-only host and sign the releases
<phoe> but that's already implementation details
<etimmons> EdLangley[m]: there are two parts to CLPM. One that lives in your dev image (if you want) and one that runs as a separate process
<etimmons> The separate process has some CFFI to deal with https
<etimmons> but the dev image piece is pure common lisp
<etimmons> and offloads most of the heavy work to the other process
<EdLangley[m]> Do I have to use the separate process?
<EdLangley[m]> I like how QL is entirely inside my lisp image
<etimmons> yes
<EdLangley[m]> Cool
<etimmons> It might be possible to make it all work in your lisp image, but that hasn't been my focus since I wanted to be able to freely use dependencies in that other process
<EdLangley[m]> My goal is to never have to use a unix shell when working on a lisp project
<EdLangley[m]> So, for example, I've been writing little utility functions to clone git repositories and list the systems they contain
<etimmons> CLPM wants to support that. Definitely some pain points in the process still, but I also do not want you to have to drop to the shell
<EdLangley[m]> One thing I really like is being able to dump an image with QL in it and still use it
<etimmons> I'm planning to give a Common Lisp Meeting about it at some point in the next couple months (ideally after I have v0.5 mostly ready, which will support versioning ASDF)
<phoe> *Online Lisp Meeting
<phoe> but, yes, gimme
<etimmons> d'oh. Thanks
<phoe> gimme precious video content
<EdLangley[m]> I also think the "you don't get to pick the version of your dependencies" part of QL is its best feature
<EdLangley[m]> I'm really tired of the dependency hell version bounds enables
euandreh has quit [Ping timeout: 240 seconds]
<etimmons> You can emulate that if you update frequently. If version bounds also become more widespread, I'd implement a CLPM feature to ignore them
<EdLangley[m]> The problem is hitting a critical mass of people who rely on their version bounds for correctness.
<etimmons> My typical way of working these days to pin my deps for development. Then my CI runs on a ~weekly basis to update everything, run the tests, and open an MR for me
<EdLangley[m]> I'm updating JS deps at work, ...
<etimmons> If there's a new failure, I can keep working with known good deps while I get a fix upstream or fix my code
<etimmons> But for the most part, there's no new failure and I just hit "merge"
euandreh has joined #commonlisp
<EdLangley[m]> Yeah, I think pinning for CI is good
<EdLangley[m]> The problem, for me, is specifying versions in the system definition
<EdLangley[m]> Anyways, I like languages that make breaking backwards-compatibility painful
<EdLangley[m]> And would rather people fork and rename their own projects rather than break compatibility
<EdLangley[m]> Because, then I have a fixed target if I want to fork it myself
<etimmons> I really like the idea of versioned packages to do that
<etimmons> (like what alexandria is doing)
<EdLangley[m]> Yeah
<EdLangley[m]> I think system versions are a bad idea because we have better ways of accomplishing this
rotateq has joined #commonlisp
karlosz has joined #commonlisp
<etimmons> If everyone did that, then system versions would for all intents and purposes be a lower bound, which is trivial to deal with and should cause any infeasibilities in dependency resolution
<etimmons> *system version constraints
<etimmons> - shouldn't cause
<phoe> stonks
<phoe> they can only go up
* phoe hides for using a terrible meme
dec0d3r has joined #commonlisp
* etimmons bonks phoe
<EdLangley[m]> Anyways, my objection is that letting people specify upper bounds enables bad ecosystem dynamics
<EdLangley[m]> Which is sort of at its worst in npm-land
<EdLangley[m]> But is also problematic in python, ruby and java to varying degrees
<EdLangley[m]> It's even bad in haskell
dec0d3r has quit [Remote host closed the connection]
<gabc> The good thing with npm is even how bad ASDF issues can be, we can always turn around and point at npm to laugh
<etimmons> You may not be a fan of ASDF 3.4 then... it's likely going to let people do that (but with a restart to say "nah, continue anyways", and potentially a variable you can set to auto invoke the restart)
mgl has joined #commonlisp
<phoe> do what? specify upper bounds?
<phoe> ;; or point at npm to laugh?
<etimmons> upper bounds
dec0d3r has joined #commonlisp
<phoe> oh, I see ; you got my hopes up for a second
<etimmons> haha
<etimmons> we can always point and laugh at npm any time we want
<phoe> (ql:quickload :laugh-at-npm)
pranavats has left #commonlisp [Error from remote client]
<yitzi> (require :npm-behavior) .... which results 47 copies of every single package.
<phoe> a separate asdf-modules subdirectory for every .asd file!
<yitzi> Plus huge package-lock file that magically protects you from yourself.
morganw has joined #commonlisp
<EdLangley[m]> So, if you think upper version bounds are ok, npm dos the right thing
<EdLangley[m]> Every system should get its own set of dependencies and they shouldn't interfere with each other.
<EdLangley[m]> I've wasted so much time in python and java trying to come up with a set of package versions that the version resolver will accept
pranavats has joined #commonlisp
<EdLangley[m]> And, we could probably use some of the SICL stuff to do this in CL
<EdLangley[m]> Create little sub-lisps to load each system and then bridge their external interfaces together
<yitzi> I rather just go burn a dozen SSDs in the backyard. I am suspicious that that is what npm is really doing.
<etimmons> This is all wishful thinking at this point, but after the next version of CLPM I'd really like to fully and in great detail document the files CLPM uses to describe environments. My hope is to document them in enough detail that someone else can come along and make something CLPM-like that makes different tradeoffs (like not needing a separate process)
<EdLangley[m]> The whole point of upper version bounds is to be confident about that the code you're getting is what you expect
<EdLangley[m]> s/about that/that/
jeosol has quit [Quit: Client closed]
<EdLangley[m]> This confidence is a lie if your dependency resolution algorithm just picks an arbitrary version (maven) and an annoyance if it means a user can't install arbitrary combinations of packages.
<EdLangley[m]> (pip)
kevingal has joined #commonlisp
foxfromabyss has quit [Quit: Client closed]
aartaka has quit [Ping timeout: 240 seconds]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
notzmv has quit [Ping timeout: 268 seconds]
ec has quit [Quit: ec]
ec has joined #commonlisp
cosimone has quit [Remote host closed the connection]
<_death> phoe: interesting post.. I think the slime update link is wrong.. and later on you call type specification errors type errors
masinter has quit [Ping timeout: 240 seconds]
<phoe> _death: it's possible
<phoe> I'll try to fix tomorrow
GreaseMonkey has quit [Quit: No Ping reply in 180 seconds.]
greaser|q has joined #commonlisp
cosimone has joined #commonlisp
karlosz has quit [Ping timeout: 250 seconds]
Posterdati has quit [Read error: Connection reset by peer]
pve has quit [Quit: leaving]
masinter has joined #commonlisp
rotateq has quit [Quit: tschav mit 'v']
Algernon69 has joined #commonlisp
Posterdati has joined #commonlisp
shka has quit [Ping timeout: 240 seconds]
Posterdati has quit [Client Quit]
Posterdati has joined #commonlisp
alvaro121 has quit [Ping timeout: 240 seconds]
alvaro121 has joined #commonlisp
rgherdt has quit [Ping timeout: 268 seconds]
alvaro121_ has joined #commonlisp
alvaro121 has quit [Ping timeout: 250 seconds]
easye has quit [Remote host closed the connection]
easye has joined #commonlisp
Noisytoot has quit [Ping timeout: 256 seconds]
easye has quit [Ping timeout: 268 seconds]
easye has joined #commonlisp
Noisytoot has joined #commonlisp
<Josh_2> phoe: the solution is a fight, each side picks a champion, the winner takes all.
<Josh_2> I nominate myself as a champion for whoever wants me.
cosimone has quit [Quit: ERC (IRC client for Emacs 27.1)]
<phoe> well I'm not a side but you can fight for me if you really want to
* phoe shushes before #lispcafe becomes a necessity though
Algernon69 has quit [Read error: Network is unreachable]
r3st` has joined #commonlisp
<r3st`> howdy all
<phoe> hey
<_death> 1. download quicklisp snapshot 2. create a dataset for asdf symbol usage by projects 3. write a spec covering at least 95% projects 4. create as many asdf implementations from scratch as you can
<r3st`> gotta say i love the logo
<Josh_2> The alien?
<phoe> the lizard?
<Josh_2> I prefer the alien
<phoe> well here's your chance to fight then
<phoe> r3st`: context: one thing with CL is that there's no "official" logo, there's at least four that are somewhat widely known though
<etimmons> I don't think the lizard is a chameleon (or is it?) and that seems like a missed opportunity to me
occ has quit [Ping timeout: 256 seconds]
<phoe> a lisp lizard by Manfred Spiller, a lisp alien from Land of Lisp, a LISP text stylized into some sort of retrofuturestuff, and either just a lambda or a pair of lambdas stylized in a yin-yang
<Josh_2> Where is the third?
<phoe> ;; if you take a look at https://github.com/phoe/the-elusive-language then you will be able to guess which team I personally cheer for
<Josh_2> Oh right I dont like that one
<Josh_2> Alien of yin-yang
<Josh_2> or8
<r3st`> The yin-yang one for sure
<phoe> and then there is the imposter logo, https://upload.wikimedia.org/wikipedia/commons/7/78/Lisp-logo.jpg
<r3st`> 'contains trace amounts of lisp' gets me everytime
<phoe> Wikipedia says, "A logo for the Location/ID Separation Protocol."
<Josh_2> Yes that is not right
amb007 has quit [Ping timeout: 240 seconds]
<r3st`> "a pair of lambdas stylized in a yin-yang"
<phoe> yes
* phoe needs to GC for tonight though
<phoe> good night
<r3st`> nighty night
<r3st`> don't let the code bugs bite
<phoe> ha, I like that one
<r3st`> What's the common lisp emacs environment called again? portcable?
<random-nick> portacle?
<theothornhill> yes, that or lem?
<r3st`> Yes! portacle, thank you
attila_lendvai has quit [Ping timeout: 240 seconds]
rotateq has joined #commonlisp
amb007 has joined #commonlisp
kevingal has quit [Remote host closed the connection]
notzmv has joined #commonlisp
Oladon has joined #commonlisp
varjag has quit [Ping timeout: 240 seconds]
z3t0 has joined #commonlisp
varjag has joined #commonlisp
mgl has quit [Quit: Client closed]
greaser|q has joined #commonlisp
greaser|q has quit [Changing host]
greaser|q is now known as GreaseMonkey
<Josh_2> Emacs + sly/slime