2023-07-31 06:46:42 next4th: How's it going? 2023-07-31 06:49:37 xelxebar: still compiling KDE now.. well, learn that REX.W is 48, haven't remember order of ADD ... CMP lol 2023-07-31 06:51:37 Dang. You're constantly hammering your machine with builds! 2023-07-31 06:52:07 Cool. 48 (REX.W) and 49 (REX.WB) show up a ton in this code. 2023-07-31 06:53:46 xed is indeed works better than rizin (which seems not complete) 2023-07-31 06:59:11 um, the xed -e is not working in the guix one.. 2023-07-31 07:01:51 next4th: Hrm... Keep getting "Bad register name"? 2023-07-31 07:02:41 xed -e push rax said: Could not enoced: push rax, GENERAL_ERROR 2023-07-31 07:03:14 -d 4850 work fine :) 2023-07-31 07:26:12 The encoder syntax seems to be xed-specific: https://intelxed.github.io/ref-manual/group__CMDLINE.html 2023-07-31 07:26:58 yes, i haven't learn it through 2023-07-31 07:44:02 Ugh. Internet is still down. What a pain. 2023-07-31 12:53:00 Yee haa! Service is back up. 2023-07-31 14:15:15 Welcome back to unbridled addiction^W^Wfast internet! 2023-07-31 14:15:34 Indeed. So nice to have it back. 2023-07-31 14:15:43 Guess it's ok to be reminded now and then how much I appreciate it. 2023-07-31 14:15:59 Easy to take for granted when it's always working. 2023-07-31 14:16:04 Yay! I finished hand-decompiling SmithForth! 2023-07-31 14:17:35 Hey, that sounds like a bit of an undertaking. You mean machine code to assembly? 2023-07-31 14:17:50 How big an undertaking was that? 2023-07-31 14:19:06 Yeah, spat the ELF executable into hex and then went at it. 2023-07-31 14:20:03 organic bespoke shade-compiled code 2023-07-31 14:21:05 Time-wise it wasn't terribly consuming. Took less than a week of poking at it consistently. 2023-07-31 14:22:00 It's something like ~400 instructions, so pretty tiny, too. 2023-07-31 14:23:02 By the end, I was mostly able to breeze through. The instruction boundaries become pretty obvious after a while, and about 50% of the 1-byte opcodes are easy to remember. 2023-07-31 14:23:42 So after a little bit of memorization, it was possible to get by with only infrequent consultations of the opcode reference. 2023-07-31 14:29:59 Anyway, SmithForth essentially bootstraps itself with a minimal dictionary format: 0x99 len ascii-word code. And the dictionary is literally just shoved at the end of the code section of the elf. 2023-07-31 14:31:00 One of the first words is Head, which sets up a dictionary header at the bespoke location. 2023-07-31 14:31:55 So SmithForth starts off literally just copying bytes into the data area. Then when it encounters byte 0x99 it runs Head and then continues copying bytes. 2023-07-31 14:32:47 Thus `0x99 len name ` ends up sort of "decompressing" into a dictionary entry with the normal header and at the right location. 2023-07-31 14:33:54 This little bootstrap dictionary is just enough to parse definition lines, so : LIT etc. 2023-07-31 14:34:44 If it encounters an unknown word, it just assumes that it's a hexadecimal number written in ascii and copies that value over. 2023-07-31 14:35:51 The raw opcode stuff ends with a definition, ti, for a text interpreter and then immediately runs it. 2023-07-31 14:36:13 At which point the input buffer just happens to point right after the last byte. 2023-07-31 14:36:19 Oh, wow - I went away for a minute. Catching up now. 2023-07-31 14:36:57 xelxebar: the source for smithforth is available on the website though 2023-07-31 14:37:11 the source for the hex binary anyways 2023-07-31 14:37:20 actually turning it into actual assembly 2023-07-31 14:37:26 oh wait, that's what you did 2023-07-31 14:37:36 And right after that last byte you just append a text blob of this primoridial SmithForth code and it just runs. 2023-07-31 14:37:52 can you publish the conversion somewhere? 2023-07-31 14:37:56 That sounds great, man. I may have to go through that little exercise myself. 2023-07-31 14:38:07 drakonis: Yeah, the website code has comments and stuff, but I essentially stripped all that out. 2023-07-31 14:38:22 I think it's fantastic - terrific learning endeavor. 2023-07-31 14:38:43 And now you've "seen little tricks" that you might want to utilize at some point. 2023-07-31 14:38:56 I literally build the ELF according to the website's instructions, then shoved the executable through `xxd -g 1 -p` to get a big rectangular blob of hex. 2023-07-31 14:39:30 i should get back to converting it to human readable assembly 2023-07-31 14:39:48 KipIngram: Yeah! Word design tricks, asm tricks, encoding tricks. I'm still absorbing all the details. 2023-07-31 14:40:29 Very cool. 2023-07-31 14:41:13 Next step is to read through the text dictionary to bootstrap all the way up to a normal Forth. 2023-07-31 14:41:29 Yes. 2023-07-31 14:41:58 drakonis: I do have a plan to write up something about this on my blog. 2023-07-31 14:42:08 We discussed a little project a few months ago - I can't remember it's name, but someone here will. The thing started out reading characters from standard input, finding them in a dictionary of one-letter names, and executing them. 2023-07-31 14:42:14 All "typable" character. 2023-07-31 14:42:25 Here's the source as it stands right now: http://ix.io/4BZe 2023-07-31 14:42:28 And using those it gradually built up a full Forth. 2023-07-31 14:42:43 First achievement was to add ( to the dictionary, so that comments were allowed. 2023-07-31 14:43:05 It was really interesting watching the input source evolve from this complete gibberish into a tractable language. 2023-07-31 14:43:54 I think it was like a 1kB executable. Around the same time we were looking at sectorForth - I spent a day or so trying to combine those ideas into a one-sector version of the first thing I described. 2023-07-31 14:43:56 That sounds exactly like what SmithForth does. It's initial dictionary-search word just matches on the first character. 2023-07-31 14:44:36 The idea was that it would boot a system, use a BIOS call to read in a bit of hard disk, and that's where the gibberish -> language stream would be. 2023-07-31 14:44:44 http://homepage.ntlworld.com/edmund.grimley-evans/bcompiler.html 2023-07-31 14:44:48 Stripped of the text dictionary, the initial bootstrapper ELF comes out just under 1000 bytes. 2023-07-31 14:44:52 So a bootloader that ran off of purely text input. 2023-07-31 14:45:08 Anyone remember the name of that project? 2023-07-31 14:45:55 So the built-in dictionary search utility ASSUMED one-word names. That simplified the search process. So that would need to get replaced later on. 2023-07-31 14:46:53 And it was all 16-bit code. I figured if I went seriously forward with it I'd use that to boot a system, bootstrap that up into a basic 16-bit Forth that I put in a transient RAM region, and then use that to bring up a serious 64-bit Forth, that was intended to be the long-term system. 2023-07-31 14:48:18 Gotta run to the store - back shortly. 2023-07-31 14:49:34 https://github.com/certik/bcompiler https://github.com/kragen/stoneknifeforth 2023-07-31 14:53:40 drakonis: BTW, in code linked above, I'm mostly using AT&T syntax but didn't write the operand-size suffix on the mnemonics because I didn't really understand what I was doing in the beginning. 2023-07-31 14:54:47 fair. 2023-07-31 14:55:04 hm, i wonder if smithforth will ever be updated 2023-07-31 14:55:08 I should go back through and clean that up. There are almost certainly blatant mistakes, too. Here and there I screwed up register translation when REX.B is enabled. 2023-07-31 15:07:33 Anyway. Time to sleep. 2023-07-31 15:41:59 Rest well. 2023-07-31 15:42:26 No one could remember that project that started out with just a char stream and built up? 2023-07-31 16:00:10 PlanckForth 2023-07-31 16:00:37 https://github.com/nineties/planckforth 2023-07-31 16:23:01 On a 64b sys We might as well use to 8 chars. 2023-07-31 16:24:01 anyone have a favorite newer take on concatenative style languages? e.g. retroforth, factor, cognate... 2023-07-31 16:25:51 Cognate? URL? 2023-07-31 16:26:35 ACTION is biased towards retroforth & konilo 2023-07-31 16:27:01 DKordic: https://cognate-lang.github.io 2023-07-31 16:31:25 andyandybobandy: there are a number of interesting concatenative languages, though many (most?) I've looked at many are quite different from forth 2023-07-31 16:33:57 ripen (https://felix.plesoianu.ro/languages/forth/ripen/index.html) and guava (https://eli.li/2021/12/19/introducing-guava & http://guava.mirrors.retroforth.org) were two I found interesting to look at a few years back 2023-07-31 16:35:53 CoSy is a weird Forth/APL hybrid. (http://cosy.com) 2023-07-31 16:36:41 Wow - planckforth just works right off the bat. Nice little project. 2023-07-31 16:45:38 What I like about it is that you can make it with almost no tools. 2023-07-31 16:45:43 Just that xxd program. 2023-07-31 16:46:35 Just open that planck.xxd file and take a look. 2023-07-31 17:06:18 Thanks! I'll take a look at all these. I'm not coming from a Forth background, just slowly realized that bits of concatenative style have appealed to me here and there over the years and want to get into something that really capitalizes on it, ideally with modern support such as a LSP and clever syntax sugar 2023-07-31 17:09:28 Careful - Forth has a tendency to be addictive. 2023-07-31 22:08:30 Random question: does anyone here know of an accessible archive of FORML proceedings in PDF, PS, or similar form? I last went looking a couple of years back and didn't find anything like this, unlike say the collections/archives of Forth Dimensions or Forthwrite, for instance. 2023-07-31 23:18:38 So looks to me like SmithForth and PlanckForth are sort of cousins, at least insofar as how they're brought up. 2023-07-31 23:19:14 dnm: If you find that definitely let us know here. I also had run across hte Forth Dimensions (great name, btw). 2023-07-31 23:21:11 Well, just finished re-watching season 1-5 of Supernatural. 2023-07-31 23:21:26 I think I'm stopping there - I always felt like that was the "end of the original story." 2023-07-31 23:21:42 I think the money guys were the ones who sent them back for more. 2023-07-31 23:22:10 KipIngram: Oh, nice. PlanckForth does look cool. 2023-07-31 23:22:22 There's even a character in season 5 who's a writer, and in the last scene of the last episode you see his computer screen, and the letters THE END typed out. 2023-07-31 23:22:42 Yeah, I like that bootstrapping concept - the starting off with the one-char words and building. 2023-07-31 23:25:18 And I'm now a big xxd fan. :-) 2023-07-31 23:38:10 dnm: IIRC: pointfree was asking for help in scanning them. 2023-07-31 23:39:00 oh another forth, another.. read from FD that old folks all input their forth by hands from newspapers, and they're costly. how lucky we're now! 2023-07-31 23:52:11 Hehe. Trivia, but xxd is part of the vim codebase :) 2023-07-31 23:52:31 Looks like PlankForth is 32-bit, so there's room to try your hand at a 64-bit version! 2023-07-31 23:52:31 there's nothing od about that codebase