IRC channel logs

2021-05-21.log

back to list of logs

<dsmith>sneek: botsnack
<dsmith>sneek: botsnack
<dsmith>sneek: botsnack
<sneek>:)
<dsmith>goodbot
<dsmith>sneek: botsnack
<sneek>:)
<dsmith>sneek: logs?
<sneek>Someone once said logs is http://logs.guix.gnu.org/guile/
***rekado_ is now known as rekado
<manumanumanu>So, this channel is actually happening.
***ChanServ sets mode: +o wingo
***wingo changes topic to 'Welcome to #guile. See https://gnu.org/s/guile for more information. Guile 3.0.7 is out! <https://gnu.org/software/guile/news/gnu-guile-307-released.html>. This channel is logged, see <http://logs.guix.gnu.org/guile/>. Bug database at <https://bugs.gnu.org/guile>.'
***wingo sets mode: -o wingo
<civodul>hi! :-)
<lampilelo>hello
<lampilelo>i removed freenode from my config already
<lampilelo>so i hope everyone will transition or i'll miss out
<civodul>yeah
<civodul>wingo: i looked a bit at peval of (let ((x (list 1 2))) (car x))
<civodul>i'm not sure whether/how to fix it without also breaking (let ((x (list 1 2))) (lambda () x))
<wingo>sneek: later tell taylan thanks for grabbing the channel! i adjusted the flags so it is me and civodul now, but don't hesitate to ask if you need anything
<sneek>Got it.
<wingo>civodul: yeah we certainly can't break (let ((x (list 1))) (lambda () x))
<wingo>civodul: fwiw CPS optimization does manage to punch through it
<wingo>hum interestingly it doesn't manage to fold the "string?" but it does punch through the caar
<manumanumanu>now, I might be admitting to being an idiot, but why can't this be inlined to (lambda () (list 1)) ??? Does it have to be a closure?
<civodul>manumanumanu: because of pointer identity
<manumanumanu>ah
<manumanumanu>of course.
<civodul>wingo: if CPS gets it, maybe that's enough
<civodul>the assembly still looks like more than just emitting an immediate though
<wingo>the assembly shows that it effectively emits (string? "x")
<wingo>instead of #t
<wingo>i mean in your initial test from yesterday
<wingo>right, paging this back in. the issue with inlining (car x) when x is bound to (list 1) is that someone could set-car! on x
<wingo>to know whether that happens or not, you need flow analysis, which isn't what peval does
<wingo>there are obviously some patterns that peval could recognize if useful, e.g. transform (let ((x V)) (f x)) to (f V)
<wingo>but in the case you were looking at, already it was getting more complicated because it was (let ((x V)) (if (pred x) ... ...))
<wingo>was even (if (string? (car (car x))) ...)
<wingo>so... tricky and ad-hoc
<wingo>better to have a comprehensive flow-based analysis
<wingo>sometimes i think we should have an SROA pass early in CPS (https://llvm.org/doxygen/SROA_8h_source.html#l00065)
<civodul>wingo: i see; it was surprising to me that peval would be stopped by a mere 'let', but i see it's probably not the right level to do these things
<taylan>tohoyn: heya
<sneek>Welcome back taylan, you have 1 message!
<sneek>taylan, wingo says: thanks for grabbing the channel! i adjusted the flags so it is me and civodul now, but don't hesitate to ask if you need anything
<taylan>wingo: perfect like this, the less responsibility I have the better ;-)
<dsmith>civodul: erc is working for me with both #guile's
<civodul>dsmith: you think it's working, but you'll see... :-)
<civodul>it'll start behaving strangely
<civodul>bandali confirmed yesterday
<dsmith>civodul: Hmm. I haven't noticed anything.
***apteryx_ is now known as apteryx
<dsmith-work>Happy Friday, Guilers!!
<dsmith-work>sneek: botsnack
<sneek>:)
*sneek wags
<dsmith-work>wingo: Some of us were looking at https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42757 yesterday.
<dsmith-work>wingo: There is a comment before scm_c_frame_closure in frames.c
<dsmith-work>wingo: Sepcifically, "If you want the procedure, look it up from the IP."
<dsmith-work>wingo: Any hints on how to do that?
<dsmith-work>wingo: Specifically, in error_wrong_num_args in intrinsics.c
<dsmith-work>(And I'm considered cheating by asking.)
<taylan>dsmith-work: I think I figured it out, by following the definitions of: frame-procedure-name in frames.c -> (@@ (system vm frame) frame-procedure-name) -> primitive-code-name
<taylan>I made a corresponding patch, but in our pathological case it just ends up saying "#f" instead of naming the procedure, even though the disassembly contains the name, so evidently it still misses an opportunity to find the name
***maximed is now known as maximed-test
***maximed-test is now known as maximed
<ruffni>it seems impossible to (make-regex "asdf \\") (Trailing backslash). is this a bug or a feature? is it best practice to also include a (hopefully) following whitespace or newline character?
<taylan>here's the current state of my patch: http://paste.debian.net/1198345/
<taylan>ruffni: a lone backslash at the end of a regexp is a regexp syntax error I believe
<RhodiumToad>exactly
<RhodiumToad>if you want to match a literal backslash you need "\\\\" anyway
<ruffni>yeah, got it :) (make-regex "\\\\") works
<ruffni>thanks!
<RhodiumToad>one level of \-escaping is processed by the "..." literal, and another level by the regex compiler
<dsmith-work>taylan: Probably becuse scm_i_primitive_code_p() in programs.c:scm_primitive_code_name returns false.
<taylan>dsmith-work: yes
<taylan>I have no idea what the IP actually points to in our case
<taylan>what I also noticed is that (@@ (system vm frame) frame-procedure-name) takes an optional "info" argument from which it can get the name, and we might perhaps get a hold of such an "info" object somehow
<dsmith-work>taylan: How about a different approach. Instead of a warning when outer is defined, make that an error?
<taylan>dsmith-work: you mean a compile-time error? not sure if the compiler can be 100% sure about it... hmm, in this case I suppose it could, since it's an internal definition.
<taylan>I can imagine that the mechanism for detecting wrong number of args in the compiler is implemented in a generic way so it's also used for top-levels though, which can change at runtime
<dsmith-work>Yeah.
<dsmith-work>I'm suspicious that the frame is not constructed properly becuse the differnet number of args.
<dsmith-work>I really don't know. Just wonderng..
<taylan>I wish I could understand what "DOP1 (X8_S8_ZI16)" means :D
<dsmith-work>Why *obviously* it makes a 16 bit value from an 8 bit immediate!
<dsmith-work>;^}
<taylan>dsmith-work: are you serious or did you just make that up? :P
<dsmith-work>taylan: Only half serious. Look at line 1643 in vm-engine.c
<dsmith-work>Don't know what X8 means. Maybe size of the opcode?
<taylan>what's also confusing me right now is that that argument to the VM_DEFINE_OP macro doesn't actually seem to be used anyway
<dsmith-work>The S8 and ZI16 are prob source and destination?
<taylan>there are two possible definitions of VM_DEFINE_OP (based on whether one is using a compiler that supports &&label to get the address of a goto label) but neither use that argument
<dsmith-work>taylan: There is some Makefile magic that might use it.
<dsmith-work>taylan: See the contents of vm-operations.h
<dsmith-work>taylan: And the FOR_EACH_VM_OPERATION is used is many places.
<taylan>dsmith-work: oh I see, vm-operations.h is autogenerated from vm-engine.c via sed :D
<Noisytoot>sneek: botsnack
<sneek>:)
<lfam>Hello sneek
*taylan abandons Freenode entirely as all the channels he cares about officially migrated to Libera :P
***Server sets mode: +ntz
***u_l-lap is now known as unknown_lamer
***dsmith-w` is now known as dsmith-work
<dsmith-work>taylan2: If you look at the places FOR_EACH_VM_OPERAION is used, sometimes that "meta" *is* used. And it's named "arity" in some places.
<dsmith-work>wingo: What's the difference betwen an OPn and a DOPn ?
<dsmith-work>Destructive? Destination?
***taylan2 is now known as taylan
<dsmith-work>sneek: later tell wingo What's the difference betwen an OPn and a DOPn ?
<sneek>Got it.
***RhodiumToad is now known as RhodiumToad_
<taylan>aww netsplit
<dsmith-work>I imagine there will be some growing pains.
<taylan>dsmith-work: you still here? I'm 99% sure that the DOP/DST stands for destination. all but one of the VM ops defined with DOPn declare a uintN_t dst; first thing in their body, and that seems to be used as a destination address.
<dsmith-work>Ok.
<taylan>not sure why that's special-cased, probably just because it's extremely common
<taylan>from what I can tell it seems one could have also defined another "word type" say DST and every OP<n> (...) as OP<n+1> (DST, ...)
<dsmith-work>One (only?) difference is when printing. The "D"'s have "<-". Non-D's have "!"
***Noisytoot_ is now known as Noisytoot
<dsmith-work>In parse_instruction in instructions.c
<taylan>interesting. I guess the arrow means "puts something there" and the bang means "does something in-place" or so
<dsmith-work>tail = scm_cons ((meta & OP_DST) ? sym_left_arrow : sym_bang, tail);
<dsmith-work>As fas as I can tell, that's the only palce OP_DST is used.
<taylan>one thing I'm wondering is, why those cryptic identifiers like Xn_Cn_...
<dsmith-work>Mnemonics. Shorter to write and fit on screen. IF you origianly wrote the code. ;^}
***taylan is now known as Guest6817
***taylan2 is now known as taylan
<taylan>in case my last messages didn't make it: I'm wondering why the "instruction word types" have cryptic names like Xn_Cn_...
***Server sets mode: +ntz
<taylan>I like it how at the end of vm-engine.c there's a piece of Elisp code to auto-update the opcodes for you :D
<bjoli>taylan: better than visual studio!
***Noisytoot_ is now known as Noisytoot
<dsmith-work>taylan: Ya, that's pretty sweet.
<ArneBab>taylan: nice!
<sneek>ArneBab, you have 1 message!
<sneek>ArneBab, leoprikler says: should it be possible to read a Wisp sexp from the middle of a file assuming proper indentation?
*taylan is starting to get the hang of how the VM works