jackdaniel 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/>
nij- has quit [Ping timeout: 240 seconds]
habamax has quit [Remote host closed the connection]
blackshuck has quit [Quit: Leaving]
l4q has quit [Read error: Connection reset by peer]
l4q has joined #commonlisp
jsomedon has joined #commonlisp
l4q has quit [Remote host closed the connection]
l4q has joined #commonlisp
thuna` has quit [Remote host closed the connection]
l4q has quit [Ping timeout: 246 seconds]
akoana has quit [Remote host closed the connection]
akoana has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
l4q has joined #commonlisp
l4q has quit [Ping timeout: 240 seconds]
l4q has joined #commonlisp
bilegeek has joined #commonlisp
nij- has joined #commonlisp
<nij-> Ah, shell interopt does the trick easily
<nij-> (mapcar #'probe-file (cl-ppcre:split "\\n" (with-output-to-string (s) (uiop:run-program "find . -name \"*\" " :output s :error-output *standard-output*))))
<|3b|> -print0 might give you more reliable splitting (if it doesn't confuse your external format)
<|3b|> and you should probably get in the habit of using list form of run-program if available (i think it is in uiop?) for similar reasons
akoana has quit [Quit: leaving]
<nij-> What is "list form of" run-program?
<|3b|> (run-program (list "find" "." "-name" "*") ...) or whatever the syntax is
<|3b|> arguments in separate strings instead of 1 string that the shell or whatever can fail to split the way you intended
l4q has quit [Ping timeout: 245 seconds]
goober has quit [Quit: Leaving]
goober has joined #commonlisp
l4q has joined #commonlisp
l4q has quit [Ping timeout: 246 seconds]
l4q has joined #commonlisp
<nij-> Oh good tip! I didn't know uiop:run-program supports that. Thanks 3b :)
<nij-> Hmm.. but then env var doesn't work.. e.g. "find $HOME -name \"*\" " works, but
<nij-> `("find" "$HOME" "-name" "*") doesn't cuz it doesn't expand HOME.
<|3b|> single string might make it go through shell. i think there is an option to tell it to use shell always that might make it work again, or you could query the env var yourself
nij- has quit [Ping timeout: 245 seconds]
jsomedon has quit [Quit: Connection closed for inactivity]
lucasta has quit [Quit: Leaving]
jhechjo has joined #commonlisp
jhechjo has quit [Quit: leaving]
habamax has joined #commonlisp
jhechjo has joined #commonlisp
jhechjo has left #commonlisp [#commonlisp]
AetherWind has joined #commonlisp
Lycurgus has joined #commonlisp
Lycurgus has quit [Quit: Tschüss]
copec has quit [Remote host closed the connection]
herjazz has joined #commonlisp
attila_lendvai has joined #commonlisp
shka has joined #commonlisp
attila_lendvai has quit [Ping timeout: 246 seconds]
yvm has joined #commonlisp
rtypo has quit [Ping timeout: 240 seconds]
Gleefre has joined #commonlisp
rgherdt has joined #commonlisp
azimut has quit [Ping timeout: 240 seconds]
attila_lendvai has joined #commonlisp
igemnace has joined #commonlisp
thollief has joined #commonlisp
pve has joined #commonlisp
bilegeek has quit [Quit: Leaving]
dino_tutter has joined #commonlisp
l4q has quit [Remote host closed the connection]
l4q has joined #commonlisp
l4q has quit [Ping timeout: 246 seconds]
l4q has joined #commonlisp
l4q has quit [Ping timeout: 245 seconds]
mgl has joined #commonlisp
l4q has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 245 seconds]
Lord_of_Life has joined #commonlisp
haoms has joined #commonlisp
l4q has quit [Ping timeout: 240 seconds]
ronald has joined #commonlisp
Posterdati has quit [Read error: Connection reset by peer]
Posterdati has joined #commonlisp
amb007 has quit [Ping timeout: 260 seconds]
amb007 has joined #commonlisp
habamax has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.1.50)]
attila_lendvai has quit [Quit: Leaving]
attila_lendvai has joined #commonlisp
scymtym has joined #commonlisp
AetherWind has quit [Quit: leaving]
tyson2 has joined #commonlisp
dino_tutter has quit [Ping timeout: 245 seconds]
igemnace has quit [Quit: WeeChat 4.0.2]
theBlackDragon has quit [Ping timeout: 246 seconds]
theBlackDragon has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
jonatack has quit [Read error: Connection reset by peer]
jonatack has joined #commonlisp
amb007 has quit [Ping timeout: 246 seconds]
amb007 has joined #commonlisp
cage has joined #commonlisp
habamax has joined #commonlisp
mgl has quit [Quit: Client closed]
amb007 has quit [Read error: Connection reset by peer]
tyson2 has quit [Remote host closed the connection]
amb007 has joined #commonlisp
alcor has joined #commonlisp
lucasta has joined #commonlisp
lucasta has quit [Remote host closed the connection]
lucasta has joined #commonlisp
AetherWind has joined #commonlisp
tyson2 has joined #commonlisp
tibfulv has quit [Remote host closed the connection]
tibfulv has joined #commonlisp
habamax has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.1.50)]
jmdaemon has quit [Ping timeout: 246 seconds]
tyson2 has quit [Remote host closed the connection]
herjazz has quit [Quit: leaving]
tyson2 has joined #commonlisp
thuna` has joined #commonlisp
AetherWind has quit [Quit: leaving]
haoms has left #commonlisp [#commonlisp]
igemnace has joined #commonlisp
morganw has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
waleee has joined #commonlisp
rtypo has joined #commonlisp
dra has joined #commonlisp
dra has joined #commonlisp
dra has quit [Changing host]
tyson2 has joined #commonlisp
mgl has joined #commonlisp
attila_lendvai has quit [Read error: Connection reset by peer]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
attila_lendvai has joined #commonlisp
<jcowan> I'm wondering why floor is the integer version and ffloor is the float version, as if the integer version were more basic. I also wonder if floor uses rational arithmetic; the spec is silent on that.
lucasta has quit [Quit: Leaving]
molson has joined #commonlisp
<beach> Does the phrase "The remainder is an integer if both x and y are integers, is a rational if both x and y are rationals, and is a float if either x or y is a float" not provide that information?
azimut has joined #commonlisp
shka has quit [Quit: Konversation terminated!]
tyson2 has quit [Remote host closed the connection]
azimut has quit [Ping timeout: 240 seconds]
shka has joined #commonlisp
mgl has quit [Quit: Client closed]
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
Oladon has joined #commonlisp
azimut has joined #commonlisp
lucasta has joined #commonlisp
lucasta has quit [Remote host closed the connection]
lucasta has joined #commonlisp
<jcowan> beach: No, it dictates only the result, not the method by which it is attained.
<jcowan> I created a very big bignum (500 digits), multiplied it by 3/2, and tested it with ffloor (overflow) and floor (no overflow). So that strongly suggests it is using rational arithmetic.
<bike> it's a rational computation, so it's not allowed to overflow (12.1.3.1)
<jcowan> True, although not all bignum packages support bignums as big as memory (e.g. if the bigit-count is "only" 32 bits)
<jcowan> When I interview people for programming jobs, I ask them for a method of computing the running median of a stream of 32-bit integers, so that you call a procedure passing it the next number and get back the median of all numbers already seen, to execute in O(1) time and space per call.
<gilberth> This doesn't make sense. Neither when FFLOOR first converts to floats, nor when it first does the computation using rationals here and then converts. It might overflow in both cases. There are bignums that are not representable as floats like ,(float (expt 10 500))
<ixelp> (float[...]) ERROR: FLOATING-POINT-OVERFLOW detected ↩ performing FLOAT on (1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 [...]
<jcowan> Is that sbcl? I don't have it installed on this POS laptop.
<mfiano> ,(lisp-implementation-type)
<ixelp> (lisp-implementation-type) => "Clozure Common Lisp"
<gilberth> ,(lisp-implementation-type)
<ixelp> (lisp-implementation-type) => "Clozure Common Lisp"
<gilberth> Raced.
<jcowan> Anyhow, this is a call on float, not ffloat, and float can use rational arithmetic.
<jcowan> Anyone care to think about the "running median" problem before I do the big reveal?
* jcowan counts down from $fixnum
<gilberth> jcowan: FFLOOR should return a float, no?
<jcowan> Yes, but my concern is the behavior of FLOAT
<gilberth> What's your trouble with FLOAT?
<jcowan> Whether it is allowed to report floating-point overflow. beach says no (and I agree), but evidently CCL does.
<jcowan> s/FLOAT/FLOOR/, stupid me
<gilberth> What should it return instead? PI? A random number?
<gilberth> I mean, you ask for the floor of some 333-and-a-bit-digit number [bignum] represented as a float, don't you? When such a float doesn't exist, what should it do?
<jcowan> FFLOOR should signal overflow, but FLOOR should not. However, this is not actually prescribed.
<jcowan> i.e. FLOOR can be implemented by using FFLOOR and converting to a rational representation at the last minute.
<mfiano> Floating point numbers are not mandated to be fixed IEEE sizes either. CCL for example has arbitrary-precision floats.
<gilberth> FLOOR of course works. ,(floor (* 2/3 (expt 10 500)))
<ixelp> (floor[...]) => 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666[...]
<mfiano> Or follow IEEE semantics
<gilberth> CLISP has that arbitrary precision floats. CCL has single and double floats, that's it.
<mfiano> I'm sorry, yes.
<gilberth> Question is what happens with ,(ffloor (expt 10 500) (expt 10 499))) ?
<ixelp> (ffloor (expt 10 500) (expt 10 499)) => 10.0; 0
l4q has joined #commonlisp
<bike> floor could only be implmeented with ffloor if floats had infinite precision. the standard definitely says floor can't signal overflow on rationals.
<bike> because then it's doing a rational computation, and rational computations never overflow
<jcowan> Anyway, CLISP's arbitrary-precision floats are really variable-precision floats. You can change EXT:LONG-FLOAT-DIGITS to get different precisions, but the precision doesn't vary during a computation. (If it did, such floats would be equivalent to rationals.)
<jcowan> There's an interesting remark in the CLISP docs:
<jcowan> Since the exponent of a LONG-FLOAT is a signed 32-bits integer, MOST-POSITIVE-LONG-FLOAT is about 2^2^31, which is much larger that the largest representable BIGNUM, which is less than 2^2^21. This, obviously, means that ROUND, TRUNCATE, FLOOR and CEILING SIGNALs an ERROR on large LONG-FLOATs. Less obviously, this means that (FORMAT NIL "~E" MOST-POSITIVE-LONG-FLOAT) also fails.
<jcowan> This is a legitimate situation, but it isn't what we tend to expect.
<mfiano> I don't like this area of CLISP as an example, because it is questionably non-conforming
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<mfiano> Mostly because a "constant variable" like PI no longer adheres to the standard glossary definition (despite PI being an 'implementation-dependent long float'
<mfiano> )
Oladon has quit [Quit: Leaving.]
Inline has joined #commonlisp
<mfiano> The definition of 'constant form' fully cements this due to 3.1.2.1.1
<mfiano> (a variable is also a form)
<mfiano> So while implementations can provide any precision for floats, they cannot be dynamic in a way that would affect the environment of other objects.
robin_ has joined #commonlisp
Lycurgus has joined #commonlisp
robin has quit [Ping timeout: 246 seconds]
<jcowan> Well, a aprogram referring to EXT:LONG-FLOAT-PRECISION is no longer strictly conforming. You are tweaking your implementation.
doyougnu- has joined #commonlisp
doyougnu has quit [Ping timeout: 260 seconds]
fitzsim has quit [Read error: Connection reset by peer]
fitzsim has joined #commonlisp
<mfiano> That is fair, indeed. Have at it: (= pi (progn <set precision> pi)) (or across some dynamic scope, heh)
* mfiano shudders from library code error thoughts
lucasta has quit [Ping timeout: 245 seconds]
waleee has quit [Ping timeout: 246 seconds]
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
blackshuck has joined #commonlisp
Lycurgus has quit [Quit: Tschüss]
molson has quit [Remote host closed the connection]
molson has joined #commonlisp
yvm has quit [Ping timeout: 246 seconds]
cage has quit [Quit: rcirc on GNU Emacs 28.2]
<jcowan> It's a curious (implicit) fact of SQL that its NUMBER type has to have a definite range and precision, though the standard does not say what it must be. Bignums are are not a legitimate SQL numeric type.
<jcowan> Unfortunately I forget the proof of this.
waleee has joined #commonlisp
igemnace has quit [Read error: Connection reset by peer]
tyson2 has joined #commonlisp
<fitzsim> mfiano: I'm thinking lispgames should maybe fork cl-autowrap
<fitzsim> separately, I'm having trouble testing (ql:quickload :sdl2)
<mfiano> If you are willing to fork c2ffi and make it work for the frequent newer clang/llvm combinations, then sure
<fitzsim> mfiano: OK, I'll think about it
l4q has quit [Ping timeout: 246 seconds]
<fitzsim> I have a version of SDL2.powerpc64le-pc-linux-gnu.spec that works perfectly with lem-sdl2
<fitzsim> but I don't remember how I generated it!
<fitzsim> I think I generated it by hand somehow
<fitzsim> but it seems like cl-autowrap autogenerates a bad one, which results in various issues loading :sdl2
<fitzsim> I don't even know how to "start clean" though
<mfiano> cl-autowrap and c2ffi are bad (the idea in general, imho)
<fitzsim> I guess create a new home directory
<fitzsim> then install quicklisp
<fitzsim> then link local-projects/cl-autowrap to mine
<fitzsim> then ql:quickload :sdl2
<fitzsim> that should then auto-generate SDL2.powerpc64le-pc-linux-gnu.spec under the cl-sdl2-2022...-git/src/specs directory
<fitzsim> the working SDL2.powerpc64le-pc-linux-gnu.spec from May is 3.5M
<fitzsim> the failing one that I'm generating today is only 1.8M
<fitzsim> I don't really know how to compare two .spec files; in particular c2ffi doesn't put a comment in there about what the command line invocation was
<fitzsim> maybe I should just forget all this, and petition lem to use the lower-level SDL2 bindings you mentioned before
igemnace has joined #commonlisp
<fitzsim> c2ffi/cl-autowrap seem really fragile, IME so far
<fitzsim> anyway, enough for now, ttyl
shka has quit [Read error: Connection reset by peer]
tyson2 has quit [Remote host closed the connection]
thollief has quit [Quit: Leaving]
<jcowan> Autowrapping is inherently very problematic, because the input isn't even necessarily valid C
<mfiano> It's less viable when the autowrapping tools were devised by someone years ago who no longer even uses Common Lisp (actually, they moved to the other side of the wrapping; C++)
blackshuck has quit [Remote host closed the connection]
<mfiano> I still stand by my suggestion to use the lower-level SDL2 bindings if you require foreign SDL2. There is one not very useful API that requires pass-by-value structs or something, that would need libffi to handle iirc
<mfiano> But you are unlikely to even need it
akoana has joined #commonlisp
rgherdt has quit [Read error: Connection reset by peer]
rgherdt_ has joined #commonlisp
<jcowan> https://github.com/CastXML is a pretty good tool that leverages the clang API to produce a generic representation.
<ixelp> CastXML · GitHub
dino_tutter has joined #commonlisp
Inline has quit [Ping timeout: 240 seconds]
rgherdt_ has quit [Remote host closed the connection]
attila_lendvai has quit [Ping timeout: 246 seconds]
attila_lendvai has joined #commonlisp
Oladon has joined #commonlisp
igemnace has quit [Quit: WeeChat 4.0.2]
jmd_ has joined #commonlisp
tyson2 has joined #commonlisp
azimut has quit [Remote host closed the connection]
euandreh has joined #commonlisp
alcor has quit [Remote host closed the connection]
azimut has joined #commonlisp
waleee has quit [Ping timeout: 246 seconds]
Oladon has quit [Quit: Leaving.]
micro has quit [Ping timeout: 245 seconds]
micro has joined #commonlisp
dino_tutter has quit [Ping timeout: 240 seconds]
dra has quit [Remote host closed the connection]
rtypo has quit [Ping timeout: 240 seconds]
lucasta has joined #commonlisp
morganw has quit [Remote host closed the connection]
pve has quit [Quit: leaving]
bilegeek has joined #commonlisp
flip214_ has joined #commonlisp
flip214 has quit [Read error: Connection reset by peer]
bilegeek has quit [Quit: Leaving]
cosimone has joined #commonlisp
gxt has quit [Remote host closed the connection]
habamax has joined #commonlisp
gxt has joined #commonlisp
habamax has quit [Remote host closed the connection]
ec has quit [Remote host closed the connection]
cosimone has quit [Ping timeout: 245 seconds]
tyson2 has quit [Remote host closed the connection]
bilegeek has joined #commonlisp