dinomug has quit [Read error: Connection reset by peer]
rkazak has joined #commonlisp
akoana has quit [Quit: leaving]
<screwlisp>
stylewarning++
screwlisp has quit [Remote host closed the connection]
chomwitt has quit [Quit: WeeChat 3.8]
rkazak has quit [Ping timeout: 246 seconds]
rkazak has joined #commonlisp
<shmorg83>
can someone recommend a JSON parsing library for SBCL? is there one that is actively maintained? I am trying to use cl-json, but am having difficulty figuring out how to tell it to give me a deeply nested result
vardhan_ has quit [Read error: Connection reset by peer]
vardhan_ has joined #commonlisp
dra has quit [Ping timeout: 260 seconds]
vardhan_ has quit [Read error: Connection reset by peer]
rkazak has quit [Ping timeout: 272 seconds]
random-nick has quit [Ping timeout: 244 seconds]
<gilberth>
shmorg83: I'm curious. What kind of maintenance do you expect a JSON library would need?
rkazak has joined #commonlisp
<JoshYoshi>
shmorg83: jzon or shasht
<JoshYoshi>
st-json has a real wacky interface
<shmorg83>
well the cl-json page has a link to a mailing list, but when I click on the link it is dead
<shmorg83>
was trying to find some more examples
<shmorg83>
the thing I am trying to get at is "data.1.quote.USD.price" in terms of the JSON tree
<stylewarning>
JoshYoshi: stjson has a based interface
<shmorg83>
(format t "The price: ~D ~%" *data.1.quote.USD.price )
<shmorg83>
(format t "Time/Date: ~A ~%" *data.1.quote.USD.last_updated )
<shmorg83>
))
<JoshYoshi>
you never heard of a paste?
<JoshYoshi>
there is plaster or dpaste etc
<shmorg83>
The above is the snippet where I have gotten stuff into *json-stream*
<shmorg83>
yeah I should use it, sorry
<stylewarning>
JoshYoshi: :)
<JoshYoshi>
I like shasht
szkl has quit [Quit: Connection closed for inactivity]
rkazak has quit [Ping timeout: 252 seconds]
semz has quit [Quit: ZNC 1.8.2+deb2ubuntu0.1 - https://znc.in]
decweb has quit [Ping timeout: 265 seconds]
<gilberth>
shmorg83: Ok. So it's not about maintenance but about a mailing list or something. I was just curious because I don't expect ECMA-404 or ANSI-CL change any time soon.
<shmorg83>
yeah I am just trying to figure out what others are using
<gilberth>
The nice thing about JSON libraries is that there are so many to choose from as no two people agree on what a good Lisp representation of JSON would be.
<gilberth>
... And hence everyone has their own. :-)
semz has joined #commonlisp
<stylewarning>
gilberth: i disagree
<gilberth>
We have too few libraries?
<stylewarning>
all the JSON libraries are wildly inconsistent in their quality and compliance
<stylewarning>
it's not a matter of opinion of interface
<gilberth>
It partially is. I for one demand that when I read JSON and write it out again I get the same JSON [Under the assumption that double floats suffice, which is a reasonable assumption as there is "JS" in JSON.]
<stylewarning>
sure
<gilberth>
And this implies that all of [], {}, null, and false have distinct internal representations.
<stylewarning>
yes
<gilberth>
This rules out a lot of the libraries.
<stylewarning>
yes
<gilberth>
Order of keys should be preserved as well and duplicate keys should be fine. Rules out even more.
<gilberth>
And then this funky UTF-16 in strings should be decoded correctly.
<stylewarning>
sounds like JSON should be implemented in coalton
<gilberth>
Why? Just plain ANSI-CL does not suffice?
<stylewarning>
correct
<stylewarning>
who knows about string types
<stylewarning>
and the polymorphism of the functions involved
<gilberth>
What? What has this to do with JS' idea to use UTF-16 internally while [most] Common Lisp implementations have it that CHAR-CODE is the Unicode code point?
<gilberth>
Anyhow, that was another weak spot that I spotted with JSON libraries. Often they would not decode that UTF-16 made from two \uhhhh escapes encoding surrogates in strings.
<stylewarning>
gilberth: think about it
<gilberth>
I don't get the issue. Common Lisp has strings. And most of the time they have it that CHAR-CODE is an Unicode code point. Simple enough. So what's the issue?
<stylewarning>
gilberth: what is a common lisp STRING?
<stylewarning>
can you define it
<aeth>
(array character (*))
<gilberth>
A string in CL is a vector with an element type that is a subtype of CHARACTER. Easy enough. What has this to do with reading JSON correctly?
<gilberth>
aeth: Not in SBCL.
rkazak has joined #commonlisp
<gilberth>
For SBCL chose to have two concrete string types. For whatever reason.
<stylewarning>
gilberth: would you agree that means anything processing STRING is going to be slow
<gilberth>
Why should it be slow? Slow compared to what?
<stylewarning>
think about it
<stylewarning>
slow compared to the best
<aeth>
the best what
<gilberth>
How else would you represent a JSON string object?
<aeth>
do you mean slower than keeping it in UTF-8 if you're reading from UTF-8 and writing to UTF-8?
<stylewarning>
the best a programmer in their right mind would expect
<stylewarning>
a programmer who knows their computer
shawnw has quit [Ping timeout: 260 seconds]
<stylewarning>
or a programmer who knows what a SIMPLE-STRING is
<gilberth>
aeth: Terrific idea. Faster when inhaling some binary stream? Perhaps. But I would still need to decode that UTF-16. And perhaps validate the saneness of the UTF-8 that I see. And what if my input comes from a Common Lisp character input stream. Not very modular.
<aeth>
gilberth: I'd suppose the person focused on performance and supporting multiple encodings would use macros to generate functions for each separate encoding instead of turning them into one (probably UTF-32) implementation internal coding in the middle
<aeth>
sounds like it could easily introduce bugs, though
<stylewarning>
whoever uses macros to generate functions is holding ugly non-extensible code
<stylewarning>
harboring bad practice
<stylewarning>
(unless you're an SBCL developer)
<gilberth>
And talking about speed. I would use CLEX to do the lexical analysis. Expect like 7 \tau per char scanning speed. Then I would intern my damn keys and not cons them all the time. And once you face JSON with lots of numbers in it, you would burn most cycles turning those into floats anyway.
<gilberth>
But I'm too old to really care about performance. Being correct, robust, and modular is more important. Caring for performance is for the young who think they have plenty of time [left].
<stylewarning>
lol
<stylewarning>
if u say so
<gilberth>
In this context I was just dropping that when I looked at some JSON libraries, I found that this UTF-16 issue was a thing often missed.
mzan has joined #commonlisp
rkazak has quit [Ping timeout: 272 seconds]
notzmv has quit [Ping timeout: 265 seconds]
rkazak has joined #commonlisp
notzmv has joined #commonlisp
decweb has joined #commonlisp
rkazak has quit [Ping timeout: 276 seconds]
decweb has quit [Ping timeout: 265 seconds]
gooba has quit [Read error: Connection reset by peer]
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 265 seconds]
notzmv has quit [Ping timeout: 265 seconds]
rkazak has joined #commonlisp
<JoshYoshi>
I like shasht. There is a comparison of json cl json libraries around somewhere
rkazak has quit [Ping timeout: 245 seconds]
<aeth>
These days, performance doesn't matter until it does. But it usually doesn't.
<aeth>
Best fight the battles where it matters.
<aeth>
I suppose if someone's misusing a JSON API (probably more common than it should be), then it may matter for JSON
<aeth>
But I think the two mistakes (on opposite ends) that people make are focusing too much on performance when it doesn't (yet) matter and focusing too much on extensibility that's never used.
<stylewarning>
"these days perf doesn't matter" is not a useful rule of thumb imho
<stylewarning>
unless your metric is "web services written in php"
<stylewarning>
json is very frequently a bottleneck at an i/o boundary for perf
<stylewarning>
saying it "doesn't matter" and subsequently having no way to optimize it is a p bad situation in many circumstances
<stylewarning>
also approx. why so many lisp libraries are dog slow
<stylewarning>
"doesn't matter" (and no way to optimize without wholesale rewrite)
shawnw has joined #commonlisp
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 245 seconds]
<aeth>
The rule of thumb is benchmark meaningful bottlenecks.
<aeth>
And if JSON is your meaningful bottleneck, you probably need to write yet another JSON library.
gorignak has quit [Quit: quit]
<aeth>
As for "wholesale rewrite", there are ways to architecture code so that it's optimizable without spending time actually optimizing it.
rkazak has joined #commonlisp
AetherWind has joined #commonlisp
rkazak has quit [Ping timeout: 252 seconds]
mgl has joined #commonlisp
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 265 seconds]
pkal has quit [Read error: Connection reset by peer]
pkal has joined #commonlisp
dnhester26 has joined #commonlisp
rkazak has joined #commonlisp
dino_tutter has joined #commonlisp
rkazak has quit [Ping timeout: 272 seconds]
wacki has joined #commonlisp
zxcvz has joined #commonlisp
amb007 has quit [Ping timeout: 265 seconds]
edgar-rft` has joined #commonlisp
edgar-rft_ has quit [Ping timeout: 260 seconds]
zxcvz has quit [Quit: zxcvz]
rkazak has joined #commonlisp
attila_lendvai has joined #commonlisp
rkazak has quit [Ping timeout: 252 seconds]
dnhester26 has quit []
attila_lendvai has quit [Ping timeout: 265 seconds]
rkazak has joined #commonlisp
attila_lendvai has joined #commonlisp
AetherWind has quit [Quit: leaving]
shka has joined #commonlisp
AetherWind has joined #commonlisp
attila_lendvai has quit [Remote host closed the connection]
zxcvz has joined #commonlisp
attila_lendvai has joined #commonlisp
rkazak has quit [Ping timeout: 265 seconds]
AetherWind has quit [Ping timeout: 252 seconds]
rkazak has joined #commonlisp
cage has joined #commonlisp
cage has quit [Excess Flood]
cage has joined #commonlisp
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #commonlisp
green_ has joined #commonlisp
<green_>
Merry Christmas to those who celebrate! Anyone know where ASDF upstream went to? I just get a 404 now: https://asdf.common-lisp.dev/
rkazak has quit [Ping timeout: 248 seconds]
<edgar-rft`>
green_: reading #common-lisp.net I know that major backup and upgrade works currently are going on, maybe in a few hours it works again? i case of dsoubt /join #common-lisp.net and ask there
mwnaylor has quit [Ping timeout: 272 seconds]
<edgar-rft`>
dsoubt? in case of doubt of course :-)
<green_>
thanks!
zxcvz has quit [Quit: zxcvz]
JuanDaugherty has joined #commonlisp
rkazak has joined #commonlisp
amb007 has joined #commonlisp
rkazak has quit [Ping timeout: 260 seconds]
amb007 has quit [Read error: Connection reset by peer]
JuanDaugherty has quit [Quit: JuanDaugherty]
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 272 seconds]
spdegabrielle has joined #commonlisp
decweb has joined #commonlisp
wacki has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rkazak has joined #commonlisp
random-nick has joined #commonlisp
rkazak has quit [Ping timeout: 276 seconds]
AetherWind has joined #commonlisp
wacki has joined #commonlisp
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
McParen has joined #commonlisp
rkazak has joined #commonlisp
brokkoli_origin has quit [Remote host closed the connection]
rkazak has quit [Ping timeout: 265 seconds]
nani has quit [Remote host closed the connection]
nani has joined #commonlisp
rainthree has joined #commonlisp
rkazak has joined #commonlisp
toch_ has quit [Quit: WeeChat 4.5.0]
toch has joined #commonlisp
rainthree has quit [Ping timeout: 265 seconds]
zwr has quit [Read error: Connection reset by peer]
attila_lendvai has quit [Ping timeout: 252 seconds]
McParen has left #commonlisp [#commonlisp]
attila_lendvai has joined #commonlisp
zwr has joined #commonlisp
brokkoli_origin has joined #commonlisp
AetherWind has quit [Quit: leaving]
rkazak has quit [Ping timeout: 272 seconds]
wacki has quit [Read error: Connection reset by peer]
wacki has joined #commonlisp
rkazak has joined #commonlisp
wacki has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
attila_lendvai has quit [Ping timeout: 252 seconds]
attila_lendvai has joined #commonlisp
wacki has joined #commonlisp
rkazak has quit [Ping timeout: 276 seconds]
attila_lendvai_ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 244 seconds]
mishoo has joined #commonlisp
attila_lendvai_ has quit [Ping timeout: 244 seconds]
toch has quit [K-Lined]
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 272 seconds]
Odin- has joined #commonlisp
rkazak has joined #commonlisp
notzmv has joined #commonlisp
attila_lendvai has joined #commonlisp
JuanDaugherty has joined #commonlisp
rkazak has quit [Ping timeout: 246 seconds]
dnhester26 has joined #commonlisp
dnhester26 has quit [Remote host closed the connection]
dnhester26 has joined #commonlisp
green_ has quit [Quit: Leaving]
dnhester26 has quit [Client Quit]
zxcvz has joined #commonlisp
attila_lendvai has quit [Ping timeout: 245 seconds]
attila_lendvai has joined #commonlisp
mishoo has quit [Ping timeout: 265 seconds]
rkazak has joined #commonlisp
wacki has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rkazak has quit [Ping timeout: 248 seconds]
zyni-moe has joined #commonlisp
rainthree has joined #commonlisp
zyni-moe has quit [Quit: died]
rkazak has joined #commonlisp
attila_lendvai has quit [Ping timeout: 245 seconds]
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
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
attila_lendvai has joined #commonlisp
rkazak has quit [Ping timeout: 260 seconds]
attila_lendvai has quit [Ping timeout: 276 seconds]
JuanDaugherty has quit [Quit: JuanDaugherty]
wacki has joined #commonlisp
zwr has quit [Read error: Connection reset by peer]
<ixelp>
loop | Common Lisp (New) Language Reference
<dnhester26>
s/loop for statement/loop for form
<jackdaniel>
shouldn't WITH be above FOR ? I may recall incorrectly
<jackdaniel>
merry christmas btw
<dnhester26>
happy holidays
<dnhester26>
thanks for the answer, I have no idea, it compiled without a warning in SBCL, but that's not a proof of anything since apparently no implementation's lisp actually conforms to the spec
<dnhester26>
is that equivalent to the let form below?
<dnhester26>
I recall reading in reddit recently (last couple of months) about some issues with how loop binds variables and it being different that `let` and because of that behavior is different than what people expect
<ixelp>
I'll never trust the variable initialize form of LOOP macro anymore 😂 : Common_Lisp
<dnhester26>
3 months, not two, my bad
attila_lendvai has joined #commonlisp
<reb>
dnhester26: I think one difference is that in (loop for a = ... for b = ... ) if A and B occur in "..." it's undefined whether that means the A or B set up for the loop or the A or B in a lexically enclosing scope.
<dnhester26>
what does this mean "the A or B set up for the loop"?
rkazak has joined #commonlisp
attila_lendvai_ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 248 seconds]
attila_lendvai_ has quit [Ping timeout: 248 seconds]
lispx has joined #commonlisp
attila_lendvai has joined #commonlisp
lispx has quit [Remote host closed the connection]
rkazak has quit [Ping timeout: 272 seconds]
attila_lendvai_ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 265 seconds]
attila_lendvai_ has quit [Read error: Connection reset by peer]
notzmv has quit [Ping timeout: 265 seconds]
attila_lendvai_ has joined #commonlisp
attila_lendvai_ has quit [Read error: Connection reset by peer]
attila_lendvai_ has joined #commonlisp
mishoo has joined #commonlisp
<NotThatRPG>
Naive question about SBCL: I'm getting errors when I try WRITE-STRING to an FD-STREAM (created from a socket). #<SB-SYS:FD-STREAM for "socket 127.0.0.1:52772, peer: 127.0.0.1:10002" {10077D9333}> is not a character output stream.
<NotThatRPG>
Is there some tutorial about SB sockets and how to use them? I'm looking at the code, but failing to extract the Big Picture.
<shawnw>
How did you make the stream?
<shawnw>
And what does (stream-element-type your-stream-variable) give?
rkazak has joined #commonlisp
lispx has joined #commonlisp
lispx has quit [Remote host closed the connection]
lispx has joined #commonlisp
<NotThatRPG>
shawnw: I made it with socket-make-stream and ... I wish the backtrace gave more information about the resulting FD-STREAM...
rodrigo-` has joined #commonlisp
<NotThatRPG>
I will have to rerun a complicated piece of multi-process code to get more information. All SBCL prints is ERROR: Encountered serious-condition: #<SB-SYS:FD-STREAM for "socket 127.0.0.1:52772, peer: 127.0.0.1:10002" {10077D9333}> is not a character output stream.
<NotThatRPG>
Looking at SO it looks like that means it could be "not a character stream," "not an output stream" or both of the above
wacki has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<NotThatRPG>
(this is low quality code, that must run in a container, so debugging it is horrible...)
<shawnw>
If you used socket-make-stream, did you provide an :element-type? It's supposed to default to character, but if you changed it to an integer type, then yeah, the character i/o functions probably won't work.
alfiee has joined #commonlisp
<NotThatRPG>
This should be bivalent (write chars or binary data) so the element type I believe will be `unsigned-byte`
<NotThatRPG>
(this is low quality code layered on portableaserve which .... is also LQC)
<shawnw>
(I have no first hand experience about how well that works; just going by what the manual says)
<shawnw>
Ooops, gotta run. Christmas stuff.
<NotThatRPG>
Thanks again!
varjag has joined #commonlisp
shawnw has quit [Ping timeout: 265 seconds]
alfiee has quit [Quit: WeeChat 4.5.0]
rkazak has quit [Ping timeout: 248 seconds]
alfiee has joined #commonlisp
zxcvz has quit [Quit: zxcvz]
<reb>
dnhester26: I meant the A and B FOR loop variables in the LOOP form.
alendvai__ has joined #commonlisp
mwnaylor has joined #commonlisp
<dnhester26>
reb: ah thanks, now I understand what you meant. Interesting observation, I would have just assumed that by having `for a = ` would declare a new binding at least in that scope and not try to set a variable already declared
zwr has quit [Read error: Connection reset by peer]
attila_lendvai_ has quit [Ping timeout: 265 seconds]
Everything has joined #commonlisp
alendvai__ has quit [Remote host closed the connection]
attila_lendvai_ has joined #commonlisp
zwr has joined #commonlisp
attila_lendvai has joined #commonlisp
attila_lendvai_ has quit [Read error: Connection reset by peer]
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #commonlisp
wacki has joined #commonlisp
<reb>
dnhester26: New bindings are definitely created. What's strange is that mentions of the LOOP FOR variables on the right hand side of equals signs might refer to LOOP-bound variables or variables in a lexical scope that encloses the loop.
<dnhester26>
reb: got it, thanks for the explanation. very strange indeed.
<reb>
It depends for instance on whether the LOOP macro creates nested LET bindings or one big LETREC ...
attila_lendvai_ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 260 seconds]
akoana has joined #commonlisp
mishoo has quit [Ping timeout: 260 seconds]
rkazak has joined #commonlisp
<phoe>
afair it's implementation-dependent if the variable is bound once and then mutated or if it's bound anew on each iteration
<phoe>
so closing over a loop iteration variable is unspecified
dra has joined #commonlisp
dajole has joined #commonlisp
dra has quit [Remote host closed the connection]
dra has joined #commonlisp
<dnhester26>
phoe: reb: jackdaniel: so is basically the best practice just to wrap loop forms in let forms to avoid all these ambiguities?
dnhester26 has quit [Remote host closed the connection]
<jackdaniel>
yolo, maybe you'll capture the right variable, maybe not ,)
<jackdaniel>
more seriously though, if you need to capture the variable, then rebind it and capture that new variable
<jackdaniel>
n.b that applies also to dolist and dotimes, as discussed the other week
rkazak has quit [Ping timeout: 260 seconds]
dra has quit [Remote host closed the connection]
alendvai__ has joined #commonlisp
dra has joined #commonlisp
<jackdaniel>
and anyway, use DO :)
<jackdaniel>
and tagbody
attila_lendvai_ has quit [Ping timeout: 276 seconds]
cage has quit [Quit: rcirc on GNU Emacs 29.4]
McParen has left #commonlisp [#commonlisp]
notzmv has joined #commonlisp
alendvai__ has quit [Ping timeout: 265 seconds]
rkazak has joined #commonlisp
rkazak has quit [Ping timeout: 260 seconds]
dnhester26 has joined #commonlisp
attila_lendvai has joined #commonlisp
rkazak has joined #commonlisp
mgl has quit [Ping timeout: 265 seconds]
rkazak has quit [Ping timeout: 252 seconds]
dnhester26 has quit [Ping timeout: 252 seconds]
dnhester26 has joined #commonlisp
<dnhester26>
are you serious with do and tagbody or is that a joke?
spdegabrielle has quit [Quit: Connection closed for inactivity]
zwr has quit [Read error: Connection reset by peer]
dra has quit [Quit: Leaving]
zwr has joined #commonlisp
amb007 has quit [Remote host closed the connection]
amb007 has joined #commonlisp
attila_lendvai has quit [Ping timeout: 252 seconds]
varjag has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.2)]