Post B62SHOltOLKxzLMHnU by lanodan@queer.hacktivis.me
 (DIR) More posts by lanodan@queer.hacktivis.me
 (DIR) Post #B62RYK06HaxiA1VfOq by ireneista@irenes.space
       0 likes, 0 repeats
       
       oh, oh wowwe found a bug in our Forthif a line ends with the word ~, which introduces a comment that lasts until the end of the line, the next line is commented
       
 (DIR) Post #B62RYKFLMv9gvIdq9w by ireneista@irenes.space
       0 likes, 0 repeats
       
       it is not clear what the best way to fix that is; it happens because the lexer consumes the whitespace that terminates the word (there's no "peek" feature)
       
 (DIR) Post #B62RYKN8tvOTJUI4Jc by ireneista@irenes.space
       0 likes, 0 repeats
       
       we should probably implement "peek", really. the only reason not to is that.... the semantics of what characters get consumed, when, are part of the user-facing API, because that's how Forth does things
       
 (DIR) Post #B62RYKVIPbupim6a1Y by ireneista@irenes.space
       0 likes, 0 repeats
       
       like it needs to interact well with user code that reads from the same input stream the internals do
       
 (DIR) Post #B62RYKerq1ZWCSaDwW by ireneista@irenes.space
       0 likes, 0 repeats
       
       ha, hm, should we call it "peek". hm. early microcomputers were very big on using the words "peek" and "poke" for an entirely different purpose, we don't know for sure but we assume that may have been true on minicomputers as well.
       
 (DIR) Post #B62RYKo5Hkwcf2taJE by ireneista@irenes.space
       0 likes, 0 repeats
       
       we've been calling the output routines variations on "emit", which is the historical Forth style, rather than "print" which is what every mainstream language created in our body's lifetime has used
       
 (DIR) Post #B62RYKxeiAbJ8jNEEC by ireneista@irenes.space
       0 likes, 0 repeats
       
       yeah we definitely don't need the names peek/poke for anything else, because those operations (arbitrary memory access) are @ and ! in Evocation, and more generally most Forths call them either that or fetch/store.also in the event we ever have users, it would only be confusing to people our exact age who had those childhood experiences, and most trans people our age are dead
       
 (DIR) Post #B62RYL4kHoGvUigtHM by ireneista@irenes.space
       0 likes, 0 repeats
       
       so we're gonna call it "peek"(the word that reads a character and properly consumes it is "key", by the way, also following historical Forth practice)
       
 (DIR) Post #B62RYLBTslexpbqGmG by ireneista@irenes.space
       0 likes, 0 repeats
       
       C avoids having a peek() operation by instead having ungetc()but that's terrible. we've always disliked that, it exposes too much implementation detail.
       
 (DIR) Post #B62RYLIDTj30AUzeHA by tomjennings@tldr.nettime.org
       1 likes, 0 repeats
       
       @ireneista Yeah, ungetc() sounds like a fix to someone's badly structured program. I think I've never used it, ever.
       
 (DIR) Post #B62SHOltOLKxzLMHnU by lanodan@queer.hacktivis.me
       0 likes, 0 repeats
       
       @tomjennings @ireneista Yeah, it's actually quite interesting that there doesn't seems to be a peek/fpeek among BSD/GNU/… extensions.That said most probably just store result to a temporary variable that gets reused later as a workaround.
       
 (DIR) Post #B62ZT0grRxO2SLUNgO by tomjennings@tldr.nettime.org
       1 likes, 0 repeats
       
       @lanodan peek and (gasp) poke absolute memory addresses?!(lol you may be amused to know that is in fact how system utilities access and set realtime kernel stuff in MP/M.)@ireneista
       
 (DIR) Post #B62Zqv0yCg3BnsIMmO by lanodan@queer.hacktivis.me
       0 likes, 0 repeats
       
       @tomjennings @ireneista Well… FILE * is an obscure type and so doesn't allows to directly access the memory address, it would need to be supported by the libc (which is the one managing the FILE *buffer contents in at least unix systems, so no shenanigans against kernel stuff ^^).
       
 (DIR) Post #B62ePLycrfuB5UsFlI by snowfox@tech.lgbt
       1 likes, 0 repeats
       
       @lanodan @ireneista @tomjennings Sockets have recv() with MSG_PEEK but I don't think that works on non-sockets (e.g. pipes, terminals). It's a shame, especially if you want to avoid reading one byte at a time so you don't consume too many (if you're going to pass the file descriptor to a subprocess or so, where unget() won't help).
       
 (DIR) Post #B62ePMAKABGLfmLazo by ireneista@irenes.space
       1 likes, 0 repeats
       
       @snowfox @lanodan @tomjennings yes, absolutely
       
 (DIR) Post #B62ex5v54U6D8JIxg8 by tomjennings@tldr.nettime.org
       1 likes, 0 repeats
       
       @snowfox OK got it. "Peek" meaning sampling of a character stream. There's a bunch of implicit loading of meaning by assumptions of effects of buffering (blocks) vs streams (chars) that are old and probably no longer so simple.unget is a trivial local char storage, and a test of it before calling getc. it surprises me it was put in the library. Its like no one wants to write code, and have libs do everything., I'm the opposite, I write to minimize external dependencies. But I'm not in a hurry and never write under time pressure. Increasingly I realize how not meaningful my experience and practices are, lol!@lanodan @ireneista
       
 (DIR) Post #B62gFqptTa1PoAO1Eu by lanodan@queer.hacktivis.me
       0 likes, 0 repeats
       
       @tomjennings @snowfox @ireneista Yeah on dependencies sometimes exercising caution on using them feels like a sort of conter-cultural thing, like maybe comparable to anti-consumerism.
       
 (DIR) Post #B62hjh6mJ8nqHQ4u5A by ireneista@irenes.space
       0 likes, 0 repeats
       
       @tomjennings @snowfox @lanodan you had precisely the misunderstanding that we were wondering if our naming scheme would fall into, heh
       
 (DIR) Post #B62hjhLfPmiF1b2nI0 by tomjennings@tldr.nettime.org
       1 likes, 0 repeats
       
       @ireneista @snowfox @lanodan lol yes. I recently had this same problem; needing to know what the next keyboard character is, without reading it, because the low level code "steals" some of the sequences -- there's a 'magic' shift character to be detected.In this case I made a new device that is the next character in the stream, that reading does not "take" the character.I named it "hint". To me (my personal trajectory) PEEK and POKE refer to old microprocessor direct reading of physical memory, which correspond to the physical metaphor.It is nice to be able to determine all the metaphors involved -- I mean that literally -- but not when it wasn't originally your own project.
       
 (DIR) Post #B62hoqPb92OwaAKwCm by ireneista@irenes.space
       0 likes, 0 repeats
       
       @lanodan @snowfox @tomjennings yeah for sure!
       
 (DIR) Post #B62hoqj5yXztYdSVay by tomjennings@tldr.nettime.org
       1 likes, 0 repeats
       
       @ireneista @lanodan @snowfox Absolutely true. Balanced against the genuine and deep value of shared culture and knowledge. Some libraries are truly amazing containers of accumulated knowledge. Some are buckets of shit.
       
 (DIR) Post #B62ji0D0WOTIqeJS4m by ireneista@irenes.space
       1 likes, 0 repeats
       
       @tomjennings @snowfox @lanodan ah yeah "hint" is a neat one. interesting.yeah, it's definitely nice, we are making sure to enjoy it since we have the opportunity :)
       
 (DIR) Post #B62kr9j6bW5OvYFs0W by tomjennings@tldr.nettime.org
       1 likes, 0 repeats
       
       @ireneista @snowfox @lanodan Thanks, but it wasn't completely satisfying; it's not a hint, it's the real thing itself! Echo? Ghost? Copy? Phantasm? Clone? The same item in a parallel universe? Basically I gave up because I had to make the code work, lol.
       
 (DIR) Post #B62krAJcPlIEknL1v6 by tomjennings@tldr.nettime.org
       0 likes, 0 repeats
       
       @ireneista @snowfox @lanodan But hint worked because elsewise, hints precede full knowledge.
       
 (DIR) Post #B63M6pqA0MfCBktW9A by ireneista@irenes.space
       0 likes, 0 repeats
       
       @tomjennings @snowfox @lanodan yeah, none of those are fully satisfying to us either
       
 (DIR) Post #B63M6qIAKF45abzsnY by riley@toot.cat
       1 likes, 0 repeats
       
       @ireneista If the visual 'peek' is problematic, there's always the olfactory 'sniff'. :blobcatfluffowo: @tomjennings @snowfox @lanodan