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/>
rkazak has quit [Ping timeout: 256 seconds]
skeemer has quit [Ping timeout: 272 seconds]
istewart has quit [Quit: Konversation terminated!]
molson has joined #commonlisp
istewart has joined #commonlisp
veqq1 has joined #commonlisp
veqq has quit [Ping timeout: 255 seconds]
veqq1 is now known as veqq
molson has quit [Quit: Leaving]
rkazak has joined #commonlisp
jonatack has joined #commonlisp
jon_atack has quit [Ping timeout: 272 seconds]
wohonajax has joined #commonlisp
rkazak has quit [Ping timeout: 244 seconds]
Ruby has quit [Quit: ZNC - https://znc.in]
rkazak has joined #commonlisp
Ruby has joined #commonlisp
rkazak has quit [Ping timeout: 255 seconds]
lusciouslover has quit [Remote host closed the connection]
lusciouslover has joined #commonlisp
admich1 has quit [Ping timeout: 252 seconds]
leeb_ has quit [Ping timeout: 260 seconds]
rkazak has joined #commonlisp
leeb has joined #commonlisp
bpanthi977 has joined #commonlisp
zwr has quit [Quit: leaving]
zwr has joined #commonlisp
random-nick has quit [Ping timeout: 260 seconds]
rkazak has quit [Ping timeout: 244 seconds]
mwnaylor has quit [Ping timeout: 276 seconds]
jon_atack has joined #commonlisp
jonatack has quit [Ping timeout: 248 seconds]
jon_atack has quit [Ping timeout: 244 seconds]
rkazak has joined #commonlisp
jonatack has joined #commonlisp
rkazak has quit [Ping timeout: 248 seconds]
jon_atack has joined #commonlisp
stanrifkin_ has joined #commonlisp
jonatack has quit [Ping timeout: 244 seconds]
stanrifkin has quit [Ping timeout: 255 seconds]
jonatack has joined #commonlisp
jon_atack has quit [Ping timeout: 244 seconds]
jon_atack has joined #commonlisp
jonatack has quit [Ping timeout: 272 seconds]
jonatack has joined #commonlisp
stanrifkin_ has quit [Remote host closed the connection]
stanrifkin_ has joined #commonlisp
jon_atack has quit [Ping timeout: 244 seconds]
rkazak has joined #commonlisp
triffid has quit [Quit: triffid]
Pixel_Outlaw has joined #commonlisp
rkazak has quit [Ping timeout: 245 seconds]
admich1 has joined #commonlisp
akoana has joined #commonlisp
jonatack has quit [Ping timeout: 244 seconds]
rkazak has joined #commonlisp
triffid has joined #commonlisp
rkazak has quit [Ping timeout: 244 seconds]
JosephFerano has joined #commonlisp
Lycurgus has joined #commonlisp
JosephFerano has left #commonlisp [ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.1.90)]
admich1 has quit [Ping timeout: 252 seconds]
decweb has quit [Quit: Konversation terminated!]
admich1 has joined #commonlisp
rkazak has joined #commonlisp
admich1 has quit [Read error: Connection reset by peer]
admich1 has joined #commonlisp
rkazak has quit [Ping timeout: 256 seconds]
<jackdaniel>
<jackdaniel>
akoana has quit [Quit: leaving]
Lycurgus has quit [Quit: alsoknownas.renjuan.org ( juan@acm.org )]
edgar-rft has joined #commonlisp
parjanya has joined #commonlisp
rkazak has joined #commonlisp
edgar-rft` has quit [Ping timeout: 260 seconds]
rkazak has quit [Ping timeout: 256 seconds]
istewart has quit [Quit: Konversation terminated!]
wohonajax has quit [Quit: leaving]
mwnaylor has joined #commonlisp
Pixel_Outlaw has quit [Quit: Leaving]
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 244 seconds]
admich1 has quit [Ping timeout: 260 seconds]
admich1 has joined #commonlisp
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 252 seconds]
rkazak has joined #commonlisp
zwr has quit [Read error: Connection reset by peer]
rkazak has quit [Ping timeout: 244 seconds]
zwr has joined #commonlisp
mgl has joined #commonlisp
rkazak has joined #commonlisp
rgherdt has joined #commonlisp
rkazak has quit [Ping timeout: 256 seconds]
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
ingeniot has joined #commonlisp
jrm has quit [Quit: ciao]
jrm has joined #commonlisp
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 256 seconds]
<admich1> Can you confirm that today (on a 64bit machine) using double-float instead of single-float does not have performances penalities?
pve has joined #commonlisp
<aeth> You have to take care not to box (heap allocate) them and that's going to be implementation-specific
<aeth> In general, what you want is for the double floats themselves not to leave function scope. So mutable arrays are fine, but you have to watch out because e.g. (setf (aref a 0) 42d0) will implicitly return 42d0, so if that's the last thing in a function, it will box and heap allocate 42d0.
<aeth> admich1: However, SBCL in particular has been making optimizations around double-float.
<aeth> e.g. in 2.4.10, https://www.sbcl.org/all-news.html#2.4.10
<ixelp> All News - Steel Bank Common Lisp
<aeth> > enhancement: on arm64 and x86-64, specialized entry points for functions known to take or return fixed numbers of double floats are generated and can be automatically called without boxing intermediate floats.
<aeth> So my example doesn't even necessarily box anymore!
ingeniot has quit [Ping timeout: 244 seconds]
rkazak has joined #commonlisp
<aeth> In other words, developers of implementations hang out on IRC sometimes, and sometimes they read my examples that I've been giving out for years, and they fix them, so I have to think up new examples. Clever.
<beach> I wonder how that works. Suppose you define a function F that takes a double-float argument and returns a double float. Then you define a function G that calls F, taking advantage of the special entry point. Then you redefine F so that it no longer takes or returns a double float. Now what happens when G calls the new F?
<admich1> The heap allocation of a double float compared to a single float is worst only in space or also in time?
<beach> admich1: Both.
<beach> admich1: Allocating a heap object is fairly costly.
<beach> Maybe it works only if F and G are in the same compilation unit. Or if F is a system function that can't be redefined.
<aeth> beach: Maybe they only do it under two circumstances: (1) same compilation-unit (usually file; C-c C-c can conformingly break when other functions in the same file make assumptions about that function), (2) the ftype is DECLAREd
<aeth> oh we thought of the same one and two different ones, so I guess there are at least 3 circumstances where it works
<aeth> There's also the possibility that the special entry point is somehow allowed to fail and fall back if the function is redefined if it's really sophisticated, but I don't think it is.
<semz> On a somewhat related note, is it possible to rescind type declamations? Short of uninterning the affected symbols and replacing them, that is.
<aeth> ah, right, it's DECLAIM most of the time for ftype
<semz> I think the general term is proclamation anyway, so we're likely both wrong on that front
mgl has quit []
skeemer has joined #commonlisp
<aeth> beach: It could be a win on certain system functions if the function itself isn't inlined, but the call to the type-specific one is inlined when the type is known to be a double-float (and in turn, probably also known to return a double-float).
admich1 has quit [Ping timeout: 245 seconds]
<beach> Maybe so.
wacki has joined #commonlisp
rkazak has quit [Ping timeout: 245 seconds]
<jackdaniel> admich1: double float takes 64 bits while single float takes 32 bits (if we take ieee interpretation which is the most common)
<jackdaniel> that means that on 64bit arch single float may be an immediate type
<jackdaniel> while double float, unless you use nan-boxing (uncommon in cl), requires a pointer indirection
<jackdaniel> s/immediate type/immediate object/
<jackdaniel> so single floats may be much faster than double floats for that very reason
bpanthi977 has quit [Ping timeout: 256 seconds]
<aeth> Unless the compiler optimizes them, but the only optimization you can assume to be common (there can be uncommon edge cases) is same-function doubles not heap-boxing if they're known to be doubles at compilation time.
<aeth> Especially in constant folding like (+ 1d0 2d0)
<aeth> I think this probably makes doubles the biggest performance win with type declarations and the like, although the implementation doesn't have to do anything with the information and doesn't have to respect DECLARE/DECLAIM.
<aeth> Oh, similar reasoning means that inlining can also probably make a big difference with doubles
<aeth> A fun one is a struct that has a slot that has a :type that has a (simple-array double-float (*))... I think an implementation could (but is not required to) be able to infer (aref (foo-array foo) 0) is a double-float without any explicit type information because foo-array will either fail (because foo is not a foo) or return the appropriate array, which then has an obvious return value of double-float.
admich1 has joined #commonlisp
rkazak has joined #commonlisp
treflip has joined #commonlisp
lcn_ has joined #commonlisp
mgl has joined #commonlisp
rkazak has quit [Ping timeout: 244 seconds]
mala has quit [Ping timeout: 252 seconds]
mala has joined #commonlisp
rkazak has joined #commonlisp
treflip has quit [Ping timeout: 244 seconds]
rkazak has quit [Ping timeout: 256 seconds]
random-nick has joined #commonlisp
treflip has joined #commonlisp
rkazak has joined #commonlisp
dra has joined #commonlisp
treflip has quit [Ping timeout: 260 seconds]
rkazak has quit [Ping timeout: 245 seconds]
cercopith has quit [Ping timeout: 252 seconds]
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 252 seconds]
Lord_of_Life_ is now known as Lord_of_Life
rtypo has joined #commonlisp
cercopith has joined #commonlisp
cage has joined #commonlisp
rkazak has joined #commonlisp
mgl has quit []
shawnw has quit [Ping timeout: 255 seconds]
kyuvi has joined #commonlisp
rkazak has quit [Ping timeout: 244 seconds]
ia___ has joined #commonlisp
saturn2 has quit [Ping timeout: 252 seconds]
treflip has joined #commonlisp
puke has quit [Ping timeout: 248 seconds]
puke has joined #commonlisp
mgl has joined #commonlisp
rkazak has joined #commonlisp
decweb has joined #commonlisp
rkazak has quit [Ping timeout: 252 seconds]
ingeniot has joined #commonlisp
cercopith_ has joined #commonlisp
cercopith has quit [Read error: Connection reset by peer]
ingeniot has quit [Ping timeout: 272 seconds]
cercopith__ has joined #commonlisp
cercopith_ has quit [Ping timeout: 272 seconds]
jonatack has joined #commonlisp
cage has quit [Remote host closed the connection]
jonatack has quit [Ping timeout: 244 seconds]
cage has joined #commonlisp
rtypo has quit [Quit: WeeChat 4.7.0]
clone_of_saturn has joined #commonlisp
clone_of_saturn is now known as saturn2
Alfr has quit [Quit: Leaving]
Alfr has joined #commonlisp
rkazak has joined #commonlisp
rtypo has joined #commonlisp
Thermoriax has quit [Remote host closed the connection]
rkazak has quit [Ping timeout: 252 seconds]
lusciouslover has quit [Remote host closed the connection]
lusciouslover has joined #commonlisp
uhuh has joined #commonlisp
uhuh has quit [Changing host]
uhuh has joined #commonlisp
attila_lendvai has joined #commonlisp
rkazak has joined #commonlisp
bpanthi977 has joined #commonlisp
cracauer has quit [Server closed connection]
cracauer has joined #commonlisp
rkazak has quit [Ping timeout: 256 seconds]
kyuvi has quit [Ping timeout: 250 seconds]
shwouchk has quit [Quit: WeeChat 4.5.2]
rkazak has joined #commonlisp
bpanthi977 has quit [Ping timeout: 256 seconds]
rkazak has quit [Ping timeout: 255 seconds]
ingeniot has joined #commonlisp
bpanthi977 has joined #commonlisp
rkazak has joined #commonlisp
<attila_lendvai> is there a json library that supports parsing with a visitor function?
* attila_lendvai has found json-stream and json-streams (doh!)
rkazak has quit [Ping timeout: 256 seconds]
cercopith__ has quit [Remote host closed the connection]
chomwitt has joined #commonlisp
ingeniot has quit [Ping timeout: 260 seconds]
admich1 has quit [Ping timeout: 244 seconds]
kyuvi has joined #commonlisp
rgherdt has quit [Remote host closed the connection]
rgherdt has joined #commonlisp
pranav has joined #commonlisp
rkazak has joined #commonlisp
admich1 has joined #commonlisp
<attila_lendvai> damn... all i want is a simple json parser that calls a callback for keys and values while parsing a stream. and it's a struggle in CL...
uhuh has quit [Remote host closed the connection]
<inline> a parser is just a parser
<inline> seems you want more
<inline> maybe it exists in some form in some system as a utility, but it might not be a packaged thing on quicklisp to find etc.
<inline> or make your own... if possible
<attila_lendvai> yeah, like, trivially more...
<attila_lendvai> this make-your-own impulse is one of the main problems of the CL community
<inline> hmmm
<attila_lendvai> this is a side-quest of a side-quest. i don't want to anything make-my-own while i'm parsing a 300 MB json file
<attila_lendvai> a 4 GB heap blows up on me
<inline> tried njson ?
<attila_lendvai> wasn't in the 5 i already looked it. i'll take a look, thanks!
<ixelp> Review of CL JSON Libraries UPDATED 15 May 2023
<inline> it's from last year but recent enough i think
rkazak has quit [Ping timeout: 244 seconds]
<attila_lendvai> njson doesn't seem to have a streaming api
<inline> 12 are listed
<inline> hmm
<attila_lendvai> i think i can make do with jsown:do-json-keys
<attila_lendvai> 12 json libs is a clear sign of the utter lack of coordination in the community... there should be, let's say, about 2 obsolete ones, and 3 for the different API's/use-cases. but not 12!
<attila_lendvai> bah, do-json-keys is just a trivial util... back to square one.
<attila_lendvai> and the review of the 12 json libs doesn't say a word about streaming support
<inline> it mentions json-streams and it saiz the API supports streaming
<attila_lendvai> ok, i take that back. the summary doesn't say anything about streaming.
<inline> ah ok
<attila_lendvai> json-streams is just a tokenizer. it returns a stream of tokens
<inline> it mentions yason::with-output macro as making a streaming context
<inline> hmmm
treflip has quit [Ping timeout: 244 seconds]
rkazak has joined #commonlisp
cercopith has joined #commonlisp
<jasom> I use yason now because it's both fast enough and sufficiently customizable for me to do what I want (e.g. streaming, lists as arrays &c.)
<inline> ok
<jasom> attila_lendvai: It's also a sign of how easy it is to write a JSON library.
<jackdaniel> testing frameworks!
jonatack has joined #commonlisp
rkazak has quit [Ping timeout: 255 seconds]
admich1 has quit [Ping timeout: 245 seconds]
tux0r has quit [Server closed connection]
tux0r has joined #commonlisp
<attila_lendvai> i'm guilty of writing testing framework n+1 (stefil, aka fiasco now), but that's a different story. there are only so many ways to parse a json file...
ia___ has quit [Ping timeout: 252 seconds]
zwr has quit [Read error: Connection reset by peer]
ia_ has joined #commonlisp
zwr has joined #commonlisp
Lycurgus has joined #commonlisp
admich1 has joined #commonlisp
jon_atack has joined #commonlisp
jonatack has quit [Ping timeout: 248 seconds]
jonatack1 has joined #commonlisp
Lycurgus has quit [Quit: alsoknownas.renjuan.org ( juan@acm.org )]
rkazak has joined #commonlisp
jon_atack has quit [Ping timeout: 245 seconds]
mgl has quit []
jonatack has joined #commonlisp
jonatack1 has quit [Ping timeout: 252 seconds]
mgl has joined #commonlisp
jon_atack has joined #commonlisp
jonatack has quit [Ping timeout: 244 seconds]
wohonajax has joined #commonlisp
mgl has quit [Client Quit]
gorignak has quit [Quit: quit]
rkazak has quit [Ping timeout: 245 seconds]
jonatack has joined #commonlisp
jon_atack has quit [Ping timeout: 252 seconds]
<jasom> attila_lendvai: just from the "decoding" tables in sabra's page I count roughly 8 bits of entropy, which is enough for 256 ways, and doesn't include encoding.
<jasom> ~2 bits: which of string, octet-vector, byte-stream, character-stream are supported. True decodes to T or :true 1 bit (and 2 more bits for null and false). arrays decode as lists, arrays or something else (1.5 bits). objects decode as lists, hash-tables or something else (1.5 bits)
luna-is-here has quit []
luna-is-here has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 30.1]
<jasom> IMO there are a much smaller number of good ways (e.g. I think that the decoding should be biijective, which greatly reduces the options). My personal preference is to preserve lisp booleans, which fixes false->nil and prohibits decoding JS arrays as lists; yason can be configured to do this, most other decoders cannot. Until I realized yason could do this I was about to write an n+1 decoder.
<jasom> And I *did* have to redefine a single method to get yason to encode nil->false; making it configurable with a special and submitting the patch upstream is on my TODO list
mgl has joined #commonlisp
Ruby has quit [Ping timeout: 244 seconds]
Ruby2 has joined #commonlisp
mgl has quit [Client Quit]
rkazak has joined #commonlisp
jon_atack has joined #commonlisp
jonatack has quit [Ping timeout: 272 seconds]
rkazak has quit [Ping timeout: 256 seconds]
shka has quit [Quit: Konversation terminated!]
shka has joined #commonlisp
rkazak has joined #commonlisp
mgl has joined #commonlisp
shka has quit [Quit: Konversation terminated!]
shka has joined #commonlisp
shka has quit [Client Quit]
shka has joined #commonlisp
rkazak has quit [Ping timeout: 244 seconds]
shawnw has joined #commonlisp
shka has quit [Quit: Konversation terminated!]
shka has joined #commonlisp
jonatack has joined #commonlisp
jon_atack has quit [Ping timeout: 244 seconds]
Fade has quit [Quit: Lost terminal]
Fade has joined #commonlisp
Fade has quit [Changing host]
Fade has joined #commonlisp
rgherdt has quit [Remote host closed the connection]
rgherdt has joined #commonlisp
istewart has joined #commonlisp
wohonajax has quit [Ping timeout: 244 seconds]
jon_atack has joined #commonlisp
pve has quit [Quit: leaving]
jonatack has quit [Ping timeout: 252 seconds]
Fade has quit [Remote host closed the connection]
rkazak has joined #commonlisp
mgl has quit []
wohonajax has joined #commonlisp
Fade has joined #commonlisp
Fade has quit [Changing host]
Fade has joined #commonlisp
rgherdt has quit [Remote host closed the connection]
rgherdt has joined #commonlisp
Thermoriax has joined #commonlisp
jon_atack has quit [Read error: Connection reset by peer]
jonatack has joined #commonlisp
rkazak has quit [Ping timeout: 252 seconds]
attila_lendvai has quit [Ping timeout: 244 seconds]
jon_atack has joined #commonlisp
jonatack has quit [Ping timeout: 252 seconds]
wacki has quit [Quit: Leaving.]
jonatack has joined #commonlisp
jon_atack has quit [Ping timeout: 244 seconds]
rkazak has joined #commonlisp
jon_atack has joined #commonlisp
jonatack has quit [Ping timeout: 244 seconds]
jonatack has joined #commonlisp
rkazak has quit [Ping timeout: 244 seconds]
jon_atack has quit [Ping timeout: 255 seconds]
dra has quit [Ping timeout: 245 seconds]
fosskers has joined #commonlisp
jonatack has quit [Ping timeout: 244 seconds]
jonatack has joined #commonlisp
lcn_ has quit [Remote host closed the connection]
gooba has quit [Remote host closed the connection]
gooba has joined #commonlisp
jon_atack has joined #commonlisp
rkazak has joined #commonlisp
jonatack has quit [Ping timeout: 248 seconds]
inline has quit [Quit: Leaving]
rgherdt has quit [Remote host closed the connection]
danieli has quit [Server closed connection]
danieli has joined #commonlisp
fosskers has quit [Remote host closed the connection]
rkazak has quit [Ping timeout: 256 seconds]
coat has quit [Server closed connection]
skeemer has quit [Ping timeout: 244 seconds]
inline has joined #commonlisp
coat has joined #commonlisp
stanrifkin_ has quit [Quit: Leaving]
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 272 seconds]