2023-01-01 10:28:55 happy new year! 2023-01-01 10:36:11 happy new year indeed! 2023-01-01 10:36:39 ACTION reads through https://users.ece.cmu.edu/~koopman/stack_computers/sec4_5.html 2023-01-01 12:38:26 Happy New Year gordonjcp! And everyone! 2023-01-01 12:38:43 My DM41X has shipped. 2023-01-01 12:39:11 hehe enjoy 2023-01-01 12:39:29 I'm sure it will be fun. :-) 2023-01-01 12:40:50 2 2 + 2023-01-01 12:41:08 It'll be right at home here. 2023-01-01 12:48:31 the HP41 stuff is a fascinating rabbit hole 2023-01-01 12:48:52 a guy was making FPGA-based memory cards for a while 2023-01-01 12:55:19 Yeah, it can become a hobby in its own right. 2023-01-01 12:55:35 I'm interested in seeing if any keyboard muscle memory comes back. 2023-01-01 12:56:10 Computer keyboards got largely "standardized," but boy howdy, calculator keyboards sure didn't. 2023-01-01 12:57:33 heh ya 2023-01-01 12:58:41 But I really did "type" on that HP-41 keyboard. 2023-01-01 12:59:00 One handed, of course, but I used several fingers. 2023-01-01 12:59:10 Can't really remember if it was three or four; might have been either. 2023-01-01 12:59:22 thats wild. ive always used both thumbs 2023-01-01 12:59:33 And I can't really remember if I used my thumb or not. If I did it was quite a lot less than the other fingers. 2023-01-01 12:59:57 Ah. Just pinned down how to initialize Verilog RAM contents. 2023-01-01 13:00:09 So my simulation will actually be able to execute a program. 2023-01-01 13:01:07 KipIngram: how is it done in Verilog? init’ing a RAM with data. 2023-01-01 13:03:34 Um, when you write a test bench there is a section using the word "initial": 2023-01-01 13:03:37 initial 2023-01-01 13:03:39 begin 2023-01-01 13:03:42 ... 2023-01-01 13:03:44 end 2023-01-01 13:03:56 oh, right. 2023-01-01 13:04:01 You add such a section to your ram verilog file and you can read data in from a file. 2023-01-01 13:04:17 And the filename can be a parameter, for generality. 2023-01-01 13:04:40 So if I can write modules that "emulate" character input and output, I could in theory actually simulate a Forth running on it. 2023-01-01 13:04:54 Um... eventually. 2023-01-01 13:05:42 I've got such a section in my main processor file that asserts reset for a few clock cycles and then fires off some number of clock cycles for the simulation. 2023-01-01 13:06:11 A processor is largely a "closed system" rather than a circuit with prominent inputs and outputs, so it's almost its own test bench. 2023-01-01 13:06:39 I'd need something else if I wanted to simulate external itnerrupts and so on. 2023-01-01 13:07:33 I'm sure I can hock up something that will feed a series of characters into it somehow, even if that involves explicit UART simulation. 2023-01-01 13:07:41 That would really be the "thorough" way of doing it. 2023-01-01 13:07:44 you can start with a timer. Even just a simple count down register driven by the same clock 2023-01-01 13:08:09 There'd be an "initial" section somewhere that read a Forth source file and fed it into the hardware in a suitable way. 2023-01-01 13:08:40 Yeah, I've never really been a Verilog hotshot (we used schematics when I did this stuff), so I had to learn a good bit to get this project going. 2023-01-01 13:08:49 So I ran through a bunch of those simple exercises the other day. 2023-01-01 13:09:05 I prefer schematics myself 2023-01-01 13:09:07 I'm pleased with Icarus Verilog. 2023-01-01 13:09:30 Well, they both get the job done, but I think schematics allow the "shapes" of circuits to convey information to you in a way that blocks of text don't. 2023-01-01 13:09:32 this is why I recommend Logisim Evolution which iirc provides verilog output 2023-01-01 13:10:34 I once put my finger on a bug in another guy's FPGA design by having my attention grabbed by a circuit topology shape on one of his schematic pages. 2023-01-01 13:11:48 I really had no right to find it - I didn't really "see it in detail" until I stopped and studied it for a couple of minutes - it was a race condition. 2023-01-01 13:12:01 But that "shape" just prompted me to slow down and study there. 2023-01-01 13:12:07 right brain sense... tingling... 2023-01-01 13:12:22 It was reconvergent fanout - it's easy to get race conditions in that. 2023-01-01 13:12:28 Yeah - that's a good way of putting it thrig. 2023-01-01 13:12:38 It really is a "sensation" more than a concrete thought. 2023-01-01 13:12:55 And you can't really "teach it"; I think it's just an experience thing. 2023-01-01 13:13:06 Things like that, that is. 2023-01-01 16:59:50 Happy New Years frothies 2023-01-01 18:16:46 Happy New Year! 2023-01-01 18:17:07 this month in addition to Jamuary, I will also finish that bloody space game 2023-01-01 18:30:20 Ken Thompson got distracted from Space Travel 2023-01-01 18:55:10 thrig: this was a thing on Reddit, apparently the first space strategy games, written in Forth for the Apple II 2023-01-01 20:09:53 I want to add a way to interpolate html into a string, but I'm not sure how 2023-01-01 20:10:12 I have already string interpolation with items from the stack and also execution of code 2023-01-01 20:10:21 but I'd like to do a similar thing for html 2023-01-01 20:11:03 ~a inserts an item from the stack and ~(some code) executes the code and inserts the last value 2023-01-01 20:11:22 I have tag generators which create words, so I could just use that 2023-01-01 20:11:36 " some text with a newline~(br)" ~ for example 2023-01-01 20:12:09 but I'd like a special way for html stuff being able to add attributes and alike 2023-01-01 20:13:47 I have ~% for newlines, so I could just make the other way to put a
instead of \n 2023-01-01 20:14:08 but no idea how I should be able to add random tags with attributes 2023-01-01 20:14:59 and also some stuff like {color:red text} and create a text 2023-01-01 20:16:23 I suppose {tag name attribute:value content} could be good enough 2023-01-01 20:16:39 but some attributes take more than one word 2023-01-01 20:17:05 {tag [attribute value1 value2] content} 2023-01-01 20:23:18 What does "interpolate" mean, exactly, in that usage? The only meaning of "interpolate" I know about is finding function values in a table, in between indepedent values that actually appear in the table. 2023-01-01 20:24:19 1 2 3 " three:~a two:~a one:~a" ~ 2023-01-01 20:24:36 returns: three:3 two:2 one:1 2023-01-01 20:24:38 "cat\r\n" -> 0x63,0x61,0x74,0xD,0xA 2023-01-01 20:25:15 also " three:~(1 2 3) two:~a one:~a" ~ 2023-01-01 20:25:50 but now I want to do a similar thing for html generation 2023-01-01 20:26:40 interpolation can also mean "foo$$" -> "foo68379" 2023-01-01 20:27:32 KipIngram: it's similar to %s of printf 2023-01-01 20:27:35 Ok, so it's like parameter replacement. 2023-01-01 20:27:43 actually the ~a comes from lisp's format 2023-01-01 20:27:51 yeah 2023-01-01 20:27:52 /conversion 2023-01-01 20:28:07 it just takes elements from the stack and inserts there 2023-01-01 20:28:16 I get it now. 2023-01-01 20:28:31 I did that with a byte code interpreter in my last Forth. 2023-01-01 20:28:56 if they're a list will use the separator word to join the elements or just concatenate them with no spaces 2023-01-01 20:29:01 The bytes of the format field got interpreted by it; their actions were designed to get a printf-like effect. 2023-01-01 20:29:15 Each field consumed a stack element. 2023-01-01 20:29:18 : separator ', ; [ 1 2 3 ] " ~a" . prints 1,2,3 2023-01-01 20:29:47 oh it's broken xd 2023-01-01 20:31:14 now, fixed 2023-01-01 20:31:38 still now I'd like to do a similar thing for html 2023-01-01 20:31:57 for example newlines could be translated to
2023-01-01 20:32:09 and a way to specify a color 2023-01-01 20:32:22
2023-01-01 20:32:29 KipIngram: how's the syntax of your format 2023-01-01 20:32:35 haha 2023-01-01 20:32:50 the nicest newline 2023-01-01 20:33:21 "what is the color of a BR element?" "oh no we're trapped in a zen monestary" 2023-01-01 20:34:26 {red some random text} 2023-01-01 20:34:50 could be like that and generate a some random text 2023-01-01 20:35:02 but they should also be able to nest 2023-01-01 20:36:39 it could also use some words the user defined for it 2023-01-01 20:40:03 Um, I'd have to look it up. It's VERY similar to printf, and does what I regarded as the most important subset of functions. 2023-01-01 20:40:24 I only have ~a and ~% 2023-01-01 20:40:26 My way of entering arbitrary radix numbers was to say : 2023-01-01 20:40:37 ~a just inserts an element and ~% is a newline 2023-01-01 20:40:48 still the " word can accept newlines 2023-01-01 20:40:51 So I had a way of putting : in the format field to set arbitrary output base. 2023-01-01 20:41:03 well and ~(code) 2023-01-01 20:41:10 Then I could also do decimal with d, hex with x, octal with o, and binary with b, as extra sugar. 2023-01-01 20:41:19 but no way to print decimals in a fancy format or alike 2023-01-01 20:41:24 And there were numbers in there to specify field widths. 2023-01-01 20:41:39 % kicked off a format field, just like in C. 2023-01-01 20:42:09 I had a word PRINT that was just like TYPE, except could contain format fields. So 2023-01-01 20:42:26 ...
PRINT 2023-01-01 20:42:59 It would print out that string at
, replacing each format field with a formatted value taken from ... 2023-01-01 20:43:22 how do you delimit the args 2023-01-01 20:43:45 With periods between them. 2023-01-01 20:44:06 The word used my stack frames, and in one cell of the stack frame it kept a "byte wide stack" (so it could hold up to eight values). 2023-01-01 20:44:10 That was enough. 2023-01-01 20:44:31 So a . in the format field would push 0 onto that byte stack. 2023-01-01 20:44:47 Further digits did 48 - 10 * + 2023-01-01 20:45:19 So when I finally "printed," the bytes of that stack cell contained all the parameters. The last character in the format field was a "command" character. 2023-01-01 20:45:21 I prefer to not print it directly but like sprintf 2023-01-01 20:45:35 so I can store it or whatever 2023-01-01 20:45:49 Yeah, I like that capability too. Never got around to implementing it, though. 2023-01-01 20:46:32 but this html thing, no idea on how I want it 2023-01-01 20:46:52 I suppose I can make a test like if it existed yet and I was using it 2023-01-01 20:47:20 lispers/schemers call this wishful thinking xD 2023-01-01 20:47:35 to assume something already exists 2023-01-01 20:50:06 Kind of like getting a time machine by having your future self bring it back to you. 2023-01-01 20:50:34 All you have to do to make that perfectly consistent is to take it back to yourself when the time comes. 2023-01-01 20:50:39 This is {red some random red text} 2023-01-01 20:50:39 This is
2023-01-01 20:51:06 There's nothing wrong with that from a logical consistency standpoint, which I think you resolve by recognizing that it's just not possible to start with. 2023-01-01 20:51:19 Because if it was possible we COULD get it that way. 2023-01-01 20:51:35 well it helps to realize if you wanted it that way 2023-01-01 20:51:51 sometimes you implement something and then realize it sucks 2023-01-01 20:52:06 this way you use it like it existed so you can realize it faster 2023-01-01 20:52:07 xD 2023-01-01 20:52:18 but also helps in the same way to form a shape 2023-01-01 20:53:00 still it will end similar to that example 2023-01-01 20:53:02 Yes sure - it's a perfectly fine evaluation method. 2023-01-01 20:53:22 after all is straightforward, I need a way to add attributes and some custom stuff like the {red } 2023-01-01 20:55:02 I think I'll just do it like that, but with a ~ before 2023-01-01 20:55:42 so I'll have ~a ~% ~(code) ~{custom something} and ~ 2023-01-01 20:56:26 well idk if make the normal string interpolation handle this, or a special word 2023-01-01 20:56:38 the special word could translate newlines to br 2023-01-01 20:56:46 the normal interpolation should not 2023-01-01 20:57:24 but it's nice cause the ~{ could be directives made for the user 2023-01-01 20:57:45 I just need to push the list of elements in the stack and execute the word the user has defined for it 2023-01-01 20:58:14 so it's not only for ~{red stuff} but for whatever the user decides 2023-01-01 20:59:37 also I shouldn't always translate newlines for
even with a special html word 2023-01-01 21:01:54 haha ty, I was able to decide just by talking about 2023-01-01 21:02:14 I usually come to ask stuff just to talk alone and answer myself :D 2023-01-01 21:02:34 no, but it helps me to reason about 2023-01-01 21:02:40 also sometimes I get nice feedback 2023-01-01 21:43:26 hmm it sucks 2023-01-01 21:43:54 " ~
" ~ . 2023-01-01 21:44:10 prints:
oh my cat>
2023-01-01 21:44:15 but it's almost the same xd 2023-01-01 21:44:33 and the implementation makes me cry 2023-01-01 21:45:04 and it's wrong lol 2023-01-01 21:45:12 there's an extra > 2023-01-01 21:48:58 now it's fine, but not sure if I really win something with that 2023-01-01 21:49:20 I think I'll remove it all xd 2023-01-01 22:07:34 I removed that shit, but I have the ~{ directive 2023-01-01 22:07:58 you set a directive with a name and gets added to a hash table 2023-01-01 22:08:41 if you " ~{name content}" the 'content' gets pushed on the stack and your directive executed, whatever returns it's added to the string instead 2023-01-01 22:09:12 it's almost the same as ~(code) but pushing the rest of text inside ~{ } 2023-01-01 22:09:35 if only is ~{name} nothing is pushed 2023-01-01 22:49:59 I'll use curses instead of fucking escape sequences + termios 2023-01-01 22:50:33 Escape sequences and termios really aren't that bad. 2023-01-01 22:50:43 And they carry a lot less baggage than curses. 2023-01-01 22:51:07 KipIngram: how do I read the control key? 2023-01-01 22:51:50 Ok, so I got the processor so it will start by fetchiing RAM address 0 after reset. I put 32 bit value 0x1000 there. That should be a call to address 0x1000, and at that address there is 0, which should have it call back. 2023-01-01 22:52:03 So it's at least fetching back and forth between those two addresses. 2023-01-01 22:52:21 So much of this has just been me learning Verilog well enough to use it for sophisticated stuff. 2023-01-01 22:54:13 You dont read it by itself - it modifies what ASCII codes the other keys send back to you. 2023-01-01 22:54:20 You read ctrl-a, ctrl-b, etc. 2023-01-01 22:54:39 You can turn off the "break" function of ctrl-c. 2023-01-01 22:54:57 I have mine set up so all 26 keys ctrl-a through ctrl-z send me ascii codes 1-26. 2023-01-01 22:55:23 Escape is 27. 2023-01-01 22:55:42 and ctrl-{ is also 27. 2023-01-01 22:56:17 sad 2023-01-01 22:56:40 I'm sorry, I mean ctrl-[ is 27 too. 2023-01-01 22:56:47 escape is 27 2023-01-01 22:56:52 ctrl-] is 29 2023-01-01 22:56:59 Yes, but ctrl-[ is too. 2023-01-01 22:57:09 but also sends escape with other stuff for example when you press the arrow key 2023-01-01 22:57:15 sends escape [ A 2023-01-01 22:57:22 On my computer ctrl-space actually RETURNS an ascii 0. 2023-01-01 22:57:28 xd 2023-01-01 22:57:51 ctrl-\ is 28. 2023-01-01 22:58:02 yeah but to get the difference between escape keypress and an arrow key you have to peek the stdin 2023-01-01 22:58:09 or unget the chars 2023-01-01 22:58:25 Yes, that is harder. 2023-01-01 22:58:33 not hard, but sad 2023-01-01 22:58:58 still that's the drawback of a standard 2023-01-01 22:59:10 you get stuck to what it was decided then 2023-01-01 22:59:36 there's no actual reason to have a terminal emulatior actually 2023-01-01 22:59:42 emulator* 2023-01-01 22:59:44 I just use ctrl-h ctrl-l for horizontal cursor and ctrl-j ctrlk for vertical. 2023-01-01 22:59:58 That's better than the arrow keys because I don't have to move my fingers out of home position. 2023-01-01 23:00:03 Much faster. 2023-01-01 23:00:15 I haven't supported the multi-byte keys yet. 2023-01-01 23:00:40 But when I do so I intend to do it by returning escape if no follow-up key comes within a certain window of time. 2023-01-01 23:00:52 Which means my keyboard support will have to become non-blocking. 2023-01-01 23:00:59 I think I'll just use curses 2023-01-01 23:01:00 I know exactly how I'll do it; I just haven't yet. 2023-01-01 23:01:17 Well, it's your system. 2023-01-01 23:01:23 I'm just not willing to carry the baggage. 2023-01-01 23:01:35 yeah, but meh 2023-01-01 23:01:47 after all the only user of my lang is m 2023-01-01 23:01:48 me 2023-01-01 23:02:04 and I already have curses installed xD 2023-01-01 23:02:07 Yep. You get to do it exactly how you like. 2023-01-01 23:02:15 I expect i do as well. 2023-01-01 23:02:23 But it's not... in my binary. :-| 2023-01-01 23:02:40 I try to not add dependencies so you can just take a perl script and type 'perl script.pl' and the lang works 2023-01-01 23:02:50 but no one will use my lang except me 2023-01-01 23:03:14 and anyways I'm already putting dependencies as separate files 2023-01-01 23:03:22 I have a 'require' word for loading them 2023-01-01 23:04:52 with the js version is fun cause I can just give you an url and you get the code I wrote executing in your machine 2023-01-01 23:05:20 if I make even to download a script and type 'perl script.pl' it's harder to make you do that