00:00:00 --- log: started forth/19.10.12 00:05:13 --- quit: WickedShell (Remote host closed the connection) 00:34:04 --- quit: cartwright (Remote host closed the connection) 00:37:47 --- join: cartwright joined #forth 02:10:53 --- join: xek_ joined #forth 02:17:45 --- join: dys joined #forth 02:18:21 --- join: inode joined #forth 02:40:48 --- quit: xek_ (Ping timeout: 276 seconds) 03:26:26 --- join: iyzsong joined #forth 04:16:21 --- quit: dys (Ping timeout: 276 seconds) 04:21:00 --- join: dys joined #forth 05:03:57 --- join: dddddd joined #forth 05:13:07 --- quit: dys (Ping timeout: 250 seconds) 06:04:49 --- quit: karswell (Read error: Connection reset by peer) 07:52:11 --- quit: iyzsong (Quit: ZNC 1.7.1 - https://znc.in) 09:07:13 --- quit: dave0 (Quit: dave's not here) 09:54:47 --- join: ryke joined #forth 11:22:02 --- quit: tabemann (Ping timeout: 264 seconds) 11:48:25 --- quit: ryke (Ping timeout: 240 seconds) 12:56:31 --- quit: inode (Quit: ) 13:06:25 --- quit: gravicappa (Ping timeout: 246 seconds) 14:01:19 --- join: inode joined #forth 15:02:35 --- join: tabemann joined #forth 15:55:42 --- nick: fiddlerwoaroof_ -> fiddlerwoaroof 15:57:07 --- nick: fiddlerwoaroof -> fiddlerwoaroof_ 15:57:24 --- nick: fiddlerwoaroof_ -> fiddlerwoaroof 16:42:04 --- join: X-Scale` joined #forth 16:42:25 --- quit: X-Scale (Ping timeout: 240 seconds) 16:42:36 --- nick: X-Scale` -> X-Scale 17:21:12 --- join: iyzsong joined #forth 18:05:20 --- quit: tabemann (Ping timeout: 268 seconds) 18:27:40 --- join: jedb joined #forth 18:29:35 --- quit: jedb__ (Ping timeout: 250 seconds) 18:37:59 --- join: tabemann joined #forth 19:39:13 --- join: dave0 joined #forth 20:15:51 --- join: rdrop-exit joined #forth 20:37:06 --- quit: dave0 (Quit: dave's not here) 21:53:12 --- join: lisbeths joined #forth 21:53:57 I'm experimenting with a way to parse integers quickly and I wonder how fast it would be on the low level. 21:54:34 --- join: gravicappa joined #forth 21:54:40 The # word pushes 0 onto the stack. The words 0 - 9 all pop the stack, multiply by 10, then add that number. So the word 5 pops the stack, multiplies it by 10, ads five, and pushes it onto the stack. 21:55:42 ( -- 123 ) : foo # 1 2 3 ; ( for example ) 22:20:52 --- join: dave0 joined #forth 22:24:19 If you have the base value on the stack during the process then you can handle arbitrary bases. 22:24:44 You're on the right track, but there are a lot of subtle nuances you can take on if you choose to. 22:25:10 Negative sign, decimal point if you want to support doubles or floats, etc. 22:26:42 I made mine so that I could specify a base with this format: 22:26:48 :. 22:26:59 So 0x1234 would be 16:1234. 22:27:32 So I started out with 10 in the "base slot" on the stack, and if I saw the : then I recognized that what I'd built so far was a base, so I swapped it in in place of the 10, reset the accumulator to 0, and continued. 22:28:27 When I parsed a digit, then the stack looked like this: 22:28:40 22:28:50 so the operation was to make the digit a proper integer value, then run > 22:28:53 Ooops 22:29:06 then run >R OVER * R> + 22:30:21 To handle negatives, I deteted the - at the beginning and flipped a flag that I also had on the stack. Then at the end I check that flag and negate if necessary. 22:30:54 I should mention that I have a non-standard mechanism for handling deep stack frames, so having all that state information on the stack was easier for me than it would be in a standard system. 22:32:59 Once you have four or five pieces of info you need mingled access to during some process standard Forth gets damn unwieldy. 22:33:30 The standard advice is "don't do that - never need more than a couple of things on the stack." And if you can achieve that it's the best way. But once in a while there's just no good way to avoid it. 22:34:16 Especially in a case like number conversion where the input format you have to handle is a fixed and agreed upon thing - you're not really able to change how you type numbers to simplify the code. 22:34:21 You could, but... 22:34:37 For example, for Forth it would be easier if the negative sign was at the end instead of the beginning. 22:34:54 Then you'd just negate the number, and wouldn't have to carry that flag through on the stack. 22:45:17 THe way I handle negative numbers is a negate word which is - 22:45:42 Ah, so it's not part of your number format. 22:45:42 so 45 - 45 => # 4 5 dup - + 22:46:08 Subtraction is more or less achieved with - + 22:46:31 - negates rather than subtracts 22:48:15 Currently my forth is a very small c file and I am approaching the level of minimalism where I can write it in assembler for the first time 22:48:17 I wanted floating point support in my system, so my word for all of this is fairly involved. It's well-factored, though - no definitions that exceed a line. 22:48:52 If I was going to do floating point I would only do it if my processor was optimized for floating point. And in that case I would do everythingin hex and then have a special word that displays floating point in base 10 for the user 22:48:57 Oh, good. The one I'm working on now is my first assembler Forth, except for one I wrote decades ago on a TRS-80 Color Computer. 22:49:19 I am only 25. I haven't had alot of opportunities to code in assembler 22:49:23 It was pretty bad - I didn't really know how to do Forth internals properly back then. 22:49:32 It "worked," but it was fugly inside. 22:49:49 I wish I could teleport back into the 80s and program in forth and meet other forth programmers 22:49:56 :-) 22:50:06 The 80's - that was a great time to be in tech. 22:50:15 have you ever heard of the jupiter ace? 22:50:21 Great "cowboy mentality" all over the place. 22:50:25 No, I haven't. 22:50:31 Do you know the zx spectrum? 22:51:12 https://www.youtube.com/watch?v=V9G8HutB4Xg 22:53:03 it was essentially the com 64 of the uk. Anyway when sinclair radionics dispanded the team who worked on the spectrum and made their own copycat called the Jupiter ace that ran forth instead of basic. 22:53:07 It was cheaper and also faster. 22:55:40 Cool. No, I wasn't familiar with that one. I never used a C64 either. 22:56:05 There was also the Setun in Moscow Univeristy which ran forth as it's operating system in the mid 1970s 22:56:33 I believe it worked alot like The Green Arrays Chip in that the hardware itself was the programming language. 23:00:07 Hardware that directly supports stack languages is cool. 23:00:32 I've played with that a fair bit, but only on paper - never got around to actually implementing anything. 23:00:43 That was really my core skill; digital logic design. 23:02:00 I have been in trouble in the forth community for a while because they harp on me for not knowing assembly and not being able to write my own forth in assembley. 23:02:20 They claim I can't know forth if I haven't written one in assembley which to an extent is true. 23:04:19 My goal is to get unix users programming in forth in order to make certain unix tasks simper and more minimal. 23:04:23 Maybe to a small extent. 23:04:45 I did one in C that was plenty "knowledge authentic." 23:05:09 gcc has an extension that lets you implement a proper indirect threaded inner interpreter. 23:05:33 The image looked exactly like what it would have looked like had it been written in assembly. 23:05:43 Compiled definitions the same, etc. 23:05:57 The primitives were snips of C code, but they all ended in a proper "NEXT" operation. 23:05:57 some would argue that true forths are only written directly in assembler 23:06:17 hi 23:06:21 Hi Dave. 23:06:25 hey KipIngram 23:06:40 lisbeths: forths should be written in forth ;^) 23:06:48 Well, I will grant them that as a valid opinion, but I don't think not having done so is a show-stopper for your knowledge. 23:07:31 Yes but what I mean is that the forth kernel itself is something that eludes me because I don't know assembler 23:08:08 I think if someone could take the true design of a forth kernel and write it in c then I could unerstand it and then write my own version and carry down my knowledge to asm 23:08:22 Yes, I understand. But I don't 100% agree. The "kernel is really just the inner interpreter, and it's only four or five instructions long. 23:08:29 There's not much there to understand. 23:08:52 yes but it is very difficult for me to understand it when it's written in assembler 23:09:31 Well, I'm sure you'll whip it in time. If you're interested and stay after it, you'll beat it. 23:09:43 I'm headed off to bed - nice meeting you lisbeths. 23:09:46 Night, Dave. 23:09:57 nite KipIngram ! 23:11:40 dave0 My current forth is base don gnu dc and it's a finite state machine implemented as a switch in a while loop. So each case in the switch is a single character and there is no dictionary. i inputs a character from stdin onto the stack. o outputs a character from the stack to stdout. + adds two items. - negates. Every single primitive in the 23:11:41 language is a single character long so there's no parse time. 23:11:42 lisbeths: it's not used as much as it used to 23:15:00 lisbeths: that's like "token threaded" 23:15:05 absolutely 23:15:21 To perform a function it just passes a c_string into it's own stdin 23:16:25 The problem i have is with memory allocation. For the type of environments I want my forth to run in the unix users want the memory to be garbage collected and for the arrays to be bounds checked. 23:18:06 Garbage collection goes very against the design philosophy of forth though. 23:18:51 i think you could add bounds checking 23:19:01 GC i don't know 23:20:00 Do you know if on linux the kernel will free any memory you did not free yourself when the program returns? 23:20:42 if you mean the exit syscall, yes linux reclaims the memory 23:22:11 that helps me alot thank you 23:23:55 i don't really like unix but it is everywhere 23:25:10 and they teach it in school 23:27:40 Well for the type of programming I do unix is absolutely necessary 23:27:54 This is *very* hard to explain to microcontroller programmers why this would be a thing for me 23:28:26 i didn't switch to linux until around 1998 23:28:36 before that i was an amiga fan 23:28:40 still am 23:50:44 I really really want to introduce forth into linux 23:59:59 --- log: ended forth/19.10.12