IRC channel logs


back to list of logs

<rlb>wingo: hmm, interesting, I'll take a look, but wonder why it's not crashing anymore, even without moving my changes there. I'm rebasing the entire series, cleanup, etc. and just got to that point a day or two ago, and it's passing the tests. (Mabye I haven't gotten to the right commit, but I thought it was this one.) In any case, I assume I'll need to move the changes there -- thanks.
<wingo>rlb: perhaps i messed something up :)
<wingo>good morning civodul
<wingo>hey civodul i want a moment to talk about wasm things at some point
<janneke>spk121: yeah, it's difficult
<janneke>in a way, using [u]long_t where that is what is/was meant by the code looks nicer than [u]intptr_t
<janneke>otoh, it may not be obvious that sizeof(long_t) == sizeof(void *) and we would need an assert for that, which is not needed for intptr_t...
<wingo>rlb: more generally i think that with utf-8 strings, you want to remove the open-coding of string-ref in the compiler. instead define an intrinsic for string-ref; search language/cps and system/ for string-set! to see an example of how to wire this up
<wingo>(string-set! is via an intrinsic)
<spk121>janneke: yeah, I was just complaining. maxime found the patch unclear, so I've been pondering what could be improved.
<janneke>spk121: ok, good :)
<spk121>For example, several of uintptr_t are string hash values. uintptr_t doesn't really sound like a hash value, but, these hash values have to be 30 or 62 bits so they can fit in a fixnum, which makes uintptr_t logical.
<rlb>wingo: hmm, ok, I think I'd started having some suspicions vaguely in that direction. Given your suggestion I had a guess about how it might look, based on string-set! in the various modules/language files, but ended up with a crash in strings.test: ERROR: strings.test: string-ref: negative index (compile -O2) - arguments: ((misc-error #f "~A ~S" (bad-instruction (string-ref 1 1 0)) #f))
<rlb>Everything else passed.
<rlb>(but I suspect that might not mean much :) )
<wingo>hum :) i think that means that somehow your branch does not include the lower-primcalls pass
<wingo>my strings.test is working fine
<wingo>and when i compile string-ref i do indeed get "proper" lowering
<rlb>Here's what I ended up with from just a naive imitation of what it looked like string-set! was doing: That's what provoked the message above. Though definitely just a quick guess. I haven't learned cps, the vm, etc. much yet.
<rlb>i.e. I doubt my mechanical guess is right.
<rlb>(If it matters, I rebased recently, and am on current main.)
<rlb>Though I haven't fully bootstrapped after changing those files (also if it matters).
<rlb>...have to wander off soon, but will be back tomorrow.
<spk121>janneke: maxime's comments is why I started thinking I needed a typedef that means "an integer with the same number of bytes as a void *, but, which is really being used as an integer and doesn't hold a pointer".
<janneke>jpoiret: right
<janneke>oops... spk121: right
<wingo>rlb: you need to add a string-ref emitter, see assembler.scm:1544
<wingo>it needs to take one scm arg and one sz arg and produce a u32
<wingo>you need to define the intrinsic in intrinsics.[ch]
<wingo>rlb: annoyingly you might have to implement a new intrinsic kind
<dalepsmith>sneek: botsnack
<rlb>wingo: ahh, thanks again -- I'd wondered where emit-* came from (and figured I'd need one unless it was auto-expanded somehow).
<yarl>Hello guile.
<yarl>May I show you something and ask for help?
<yarl>When I eval the last line, I get : warning: possibly unbound variable `impl'.
<yarl>Indeed there is probably some hygiene here.
<yarl>What can I do about it?