2025-03-17 05:09:10 hey xentrac 2025-03-17 05:10:52 can you remind me how to browse pavnotes without cloning it? 2025-03-17 05:11:32 I'm working on a little UI in uxn for my self-hosted compiler, which is also written in itself. 2025-03-17 05:11:35 https://assets.merveilles.town/media_attachments/files/114/175/793/414/222/895/original/4aa43c14781d97e5.mp4 2025-03-17 05:12:01 lots of self-modification going on there ^__^ 2025-03-17 05:51:33 neauoire: well, in theory you could carry out the operations the Git client would carry out 2025-03-17 05:52:15 GET http://canonical.org/~kragen/sw/pavnotes2.git/HEAD which points to refs/heads/master 2025-03-17 05:52:43 GET http://canonical.org/~kragen/sw/pavnotes2.git/refs/heads/master which points to 91b4629a560b5656a5b760c1ded688db88db8317 2025-03-17 05:53:38 GET http://canonical.org/~kragen/sw/pavnotes2.git/objects/91/b4629a560b5656a5b760c1ded688db88db8317 (since it's a loose object) 2025-03-17 05:56:45 in e.g. Python zlib.decompress(open('b4629a560b5656a5b760c1ded688db88db8317', 'rb').read()) 2025-03-17 05:57:08 which says tree 2fe2dbf439e9a0ac5492d6fb88031a12990995e6 among other things 2025-03-17 05:57:48 GET http://canonical.org/~kragen/sw/pavnotes2.git/objects/2f/e2dbf439e9a0ac5492d6fb88031a12990995e6 2025-03-17 05:59:30 zlib.decompress(open('e2dbf439e9a0ac5492d6fb88031a12990995e6', 'rb').read()) gives you filenames and hashes 2025-03-17 06:01:30 if you store it in a bytestring s, for example s[s.index(b' gsais-pong.md\0'):][:40] gives you b' gsais-pong.md\x00\xd64\x90\x16F"\xd9\xd7\xd13x\xf9nTh;\xa5p\xa3\xa910064' 2025-03-17 06:02:50 and s[s.index(b' gsais-pong.md\0'):][15:35] gives you the hash, though in an inconveniently binary form 2025-03-17 06:04:04 fixable with ''.join('{:02x}'.format(b) for b in s[s.index(b' gsais-pong.md\0'):][15:35]) 2025-03-17 06:04:26 which helpfully says d63490164622d9d7d13378f96e54683ba570a3a9 2025-03-17 06:04:59 so you can GET http://canonical.org/~kragen/sw/pavnotes2.git/objects/d6/3490164622d9d7d13378f96e54683ba570a3a9 2025-03-17 06:06:03 and then zlib.decompress(open('3490164622d9d7d13378f96e54683ba570a3a9', 'rb').read()) gives you the actual text of the document in question 2025-03-17 06:06:36 so you *can* browse pavnotes2 without cloning it 2025-03-17 06:07:18 but it might be more practical to clone it 2025-03-17 06:09:24 the compiler dialog box looks very maccy, but I'd think the ideal UI for a compiler would usually be that you attempt to run your program and it either produces compile errors or runs 2025-03-17 06:12:06 so the compiler as such is as invisible as the BIOS or the keyboard controller except when something goes wrong 2025-03-17 06:19:19 your tastes may differ, of course 2025-03-17 06:21:59 there may be advantages to not requiring the deployment environment to have the compiler, for example, or you might want to guarantee rapid startup 2025-03-17 14:12:49 In a lot of 8-bit code if you have some machine code in RAM and there's a small number of 8-bit globals it relies on, then you just use immediate values and overwrite the immediates within the instruction, instead of using separate globals 2025-03-17 14:13:34 I'm sure that's used in demos, but it's really just a useful way of managing many kinds of globals in 8-bit, probably seems hacky now 2025-03-17 14:14:16 In x86 I've seen reports that this is a lot slower, so I wouldn't do it on a modern CPU 2025-03-17 14:14:52 I think I remember hearing that gforth until not even that long ago was doing this for certain kinds of globals, and obviously had never profiled it 2025-03-17 14:20:43 veltas: yeah, that's what the pong code is doing. it only needs to run 2025-03-17 14:21:30 uh, 2025-03-17 14:24:05 it only needs to run about 160 instructions per screen frame, if I'm counting right 2025-03-17 14:24:44 the rest of the time it's busywaiting on the VBI 2025-03-17 14:25:05 so it is okay if it is a lot slower 2025-03-17 14:27:00 it's a common technique also on neauoire's uxn virtual stack machine, where they *do* use it for speed, because uxn is invariably interpreted and so it doesn't invalidate any caches or anything 2025-03-17 14:27:49 120 of those instructions are erasing and redrawing the paddles 2025-03-17 14:29:33 the instruction that updates the ball position is lea si, [bx+si+0x2] 2025-03-17 14:30:58 bx is the vertical movement, the 2 is the horizontal movement, and the immediate 2 gets modified when the ball bounces left or right 2025-03-17 14:31:51 so you get two additions in a single instruction 2025-03-17 14:49:39 Interesting stuff 2025-03-17 15:38:18 I was sort of disappointed to find that the winning entry seemed to be almost entirely micro-optimization tricks rather than conceptual insights, but maybe I'll look through one of the larger entrants to see what kind of conceptual overcomplications he avoided 2025-03-17 15:39:29 like, using the same code with a different color argument to draw the paddles and to erase them might be a thing that other entrants didn't think of 2025-03-17 15:39:58 or using XOR to draw and erase the ball so the draw and erase code is the same 2025-03-17 15:40:47 the rules for some reason prohibited clearing the screen every frame 2025-03-17 15:42:20 contest context: https://www.hugi.scene.org/compo/compoold.htm#compo3 2025-03-17 16:15:46 for things like flipping the orientation of a ball going back and forth across a field 2025-03-17 16:16:17 it's pretty nifty to change the instruction on collision instead of checking for direction every frame 2025-03-17 16:16:40 in a DVD screensaver thingy 2025-03-17 16:16:40 https://git.sr.ht/~rabbits/uxn/tree/main/item/projects/examples/demos/dvd.tal 2025-03-17 16:17:46 *instead of loading the direction register on every frame