2021-12-28 00:37:26 in the implementation of s@, is it the stack pointer after the address is pushed onto the stack or before? 2021-12-28 00:49:02 @crc, your forth code is of a very high quality. Any pointers on how to get that good? 2021-12-28 01:32:27 joe9: i think it's before the push 2021-12-28 01:33:13 i found some code in FORTH-77.TXT: SP@ --- p Return the address of the top of the stack. (E.g. 1 2 SP@ @ . . . would type 2 2 1). 2021-12-28 01:33:43 1 2 SP@ @ gives 1 2 2 so SP@ would have been pointing at 2 2021-12-28 01:34:35 in other words, SP@ pushed the address of 2 2021-12-28 01:45:40 oh even better... from FORTH-79.TXT: SP@ -- addr 214 "s-p-fetch" Return the address of the top of the stack, just before SP@ was executed. 2021-12-28 06:35:58 I am noticing that forth programs are running a multiple of times faster than c userspace. 2021-12-28 06:36:52 joe9: crc is good because he's smart, has tons of experience, and reflects on his code. Guessing 2021-12-28 06:38:16 ASCII:HT s:tokenize 2021-12-28 06:38:23 are these gforth libraries? 2021-12-28 06:40:59 no; I'm not a gforth user 2021-12-28 06:41:27 ASCII:HT is the ascii code for a horizontal tab, s:tokenize is my string tokenizer word 2021-12-28 06:42:11 is the definition of your string tokenizer word hosted somewhere? 2021-12-28 06:42:35 This is the kind of programs that "thinking forth" talks about. 2021-12-28 06:42:45 http://forth.works/share/b0c1c349e8eafc89819fbbb559ca25ef 2021-12-28 06:42:53 instead of all the stack manipulation stuff that newbie forth programmers write. 2021-12-28 06:43:02 thanks. 2021-12-28 06:43:20 it's not ans; my forth is non-standard in a bunch of ways 2021-12-28 06:43:33 where is your forth hosted? 2021-12-28 06:43:52 I am writing a forth interpreter too and would love to check your implementation. 2021-12-28 06:43:55 if you do not mind. 2021-12-28 06:44:41 retroforth.org is the main site; there are downloads & pointers to fossil & git repos on it 2021-12-28 06:45:20 cool, thanks. 2021-12-28 06:46:09 re: code quality; it's just experience. I've been working with forth nearly daily for 20 years. 2021-12-28 06:46:33 when I try retroforth.org, it is very slow to load. 2021-12-28 06:46:36 Is the site up? 2021-12-28 06:46:46 do you code in forth exclusively? 2021-12-28 06:47:03 I am trying from dillo. 2021-12-28 06:47:09 and it is loading a word at a time. 2021-12-28 06:47:50 try reloading it; I just reset the inetd process 2021-12-28 06:48:25 that helped. thank.s 2021-12-28 06:50:11 I use Forth, C, and assembly mostly. I dabble with Python and JavaScript a little, and have worked with a bunch of others (lisp, scheme, smalltalk, perl, ruby, lua, factor, java, php, basic) on occasion 2021-12-28 06:51:10 (the server is written in retroforth, and runs under inetd; sometimes crawlers overload it and I have to kill them) 2021-12-28 07:08:08 hey 2021-12-28 07:08:44 anyone got a spare minute? i uploaded a web page i'm working on to ... https://paste.c-net.org/SpecimenCrates 2021-12-28 07:09:31 you have to save it as a html file ... does it work for you? 2021-12-28 07:09:39 joe9: crc: still here? 2021-12-28 07:09:47 joe9: yes 2021-12-28 07:11:20 i'm not strong with html and i'm a newbie javascript ... but i'm trying to make browserFORTH ... forth in the browser :-) 2021-12-28 07:12:14 dave0: after input it shows input: [...] in the top box and help works 2021-12-28 07:12:28 cool cool 2021-12-28 07:12:38 that counts as working :-) 2021-12-28 07:13:05 it is too hard to make a proper terminal in javascript 2021-12-28 07:13:30 crc: what browser are you using? 2021-12-28 07:14:15 currently chrome & edge 2021-12-28 07:14:26 cool thanks for that 2021-12-28 07:15:42 the code is simplistic but it took me a couple days to get it going 2021-12-28 07:16:05 i'm gonna try and do a token threaded forth in javascript 2021-12-28 07:48:39 joe9: I am normally here during the day (6:00 - 18:00, GMT-5), but mostly just watch the channel. 2021-12-28 09:14:43 joe9, interesting. what C thing did you find so much slower than forth? 2021-12-28 12:20:45 is 'starting forth' the best start for someone with some programming experience? 2021-12-28 12:20:59 I liked it 2021-12-28 12:21:01 Sort of related to performance: I've found that a large part of the reason why the C code I write is so much faster than the C++ I write (despite there being pretty much no difference in compiler optimization) is that C forces me to write simpler code. Copies are relatively difficult for example, so I end up having to think through how to minimize them and come up with better ways of moving data around. I have a feeling that any performance 2021-12-28 12:21:10 user51: I found Jonesforth to be a great way to learn 2021-12-28 12:21:17 first time I skipped chapter on implementation, bad mistake 2021-12-28 12:47:23 swissChili: that means reading the asm source? 2021-12-28 13:07:56 user51: The source is written with a huge amount of writing to explain how it works 2021-12-28 13:08:09 IMO Jonesforth is NOT a good start for someone new to FORTH 2021-12-28 13:08:20 Read Starting FORTH or something aimed at first-timres 2021-12-28 13:08:31 first-timers* 2021-12-28 13:21:01 Personally understanding Forth's implementation helped me approach it, although Starting Forth is probably more useful for a practical introduction to stack programming 2021-12-28 13:22:52 Thanks everyone. Different question: what's the wrong way to write Forth? 2021-12-28 13:24:06 mhhhh, I am not an expert but I suspect «long words» is part of it 2021-12-28 14:00:24 user51: The GForth tutorials are also a pretty good introduction to some slightly more advanced Forth features 2021-12-28 14:18:02 swissChili: this? https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Tutorial.html#Tutorial 2021-12-28 16:24:19 user51: this: https://gforth.org/manual/Tutorial.html, but I think that's the same thing 2021-12-28 16:24:52 You can also read it in Info if you have GForth installed 2021-12-28 16:26:23 Also, the POL book is good. 2021-12-28 16:38:30 re: wrong way to do forth; that would be to simply treat forth as if it were the same as other languages. You and your code will benefit by learning to leverage the stack and factoring code well. 2021-12-28 16:38:45 Was just about to say that with worse phrasing