***rekado_ is now known as rekado
***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
<lampilelo>so i hope everyone will transition or i'll miss out <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 <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 <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>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>better to have a comprehensive flow-based analysis <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 <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... :-) <dsmith>civodul: Hmm. I haven't noticed anything. ***apteryx_ is now known as apteryx
<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: Specifically, in error_wrong_num_args in intrinsics.c <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>ruffni: a lone backslash at the end of a regexp is a regexp syntax error I believe <RhodiumToad>if you want to match a literal backslash you need "\\\\" anyway <ruffni>yeah, got it :) (make-regex "\\\\") works <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>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>I'm suspicious that the frame is not constructed properly becuse the differnet number of args. <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! <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 <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 <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: 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 *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 ? ***taylan2 is now known as taylan
<dsmith-work>sneek: later tell wingo What's the difference betwen an OPn and a DOPn ? ***RhodiumToad is now known as RhodiumToad_
<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. <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
<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
<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