2021-12-14 04:13:27 is it just me, or does it seem kinda really annoying to implement CATCH with a top-of-return-stack register? 2021-12-14 05:26:56 Where can I find the definition of T{ and }T also used in forth-standard.org pages? 2021-12-14 05:27:19 Nevermind, I found it: https://forth-standard.org/standard/testsuite 2021-12-14 05:30:17 i found an interesting bug in my forth... when evaluating a string with line endings in it, if you put the comment word \ at the end of the line, it skips the newline as whitespace, and then drops the characters to the end of the next line... so \ at the end of the previous line actually comments out the *next* line aswell! 2021-12-14 05:31:50 doesn't happen interactively because there's only 1 line, and it strips the return when inputting 2021-12-14 05:32:05 I had a similar bug too. Not sure if I fixed it. But it was an off by one issue with PARSE I suppose. 2021-12-14 05:32:24 I had defined \ as : \ refill drop ; though 2021-12-14 05:33:26 i did : \ 13 parse 2drop ; 2021-12-14 05:34:08 Was it so that on linux, line endings are only 10, and on windows it's 10 and 13? 2021-12-14 05:34:35 I'm developing on linux at the moment, and only check for 10, 13 is pretty much ignored. 2021-12-14 05:34:40 ah no, my parse stops at 10 or 13 so both line endings from linux & windows work 2021-12-14 05:35:16 words just considers 10 and 13 as whitespace 2021-12-14 05:35:20 word 2021-12-14 05:35:49 parse-name to use the standard name 2021-12-14 05:36:15 there was a long discussion on the forth standard page about refill 2021-12-14 05:36:30 someone wanted to slurp a whole file into memory and just evaluate it 2021-12-14 05:38:05 neuro_sys_: i think your method is the correct way 2021-12-14 05:38:30 I haven't given it much thought yet, I'll have to come back to "white space" problem at some point. 2021-12-14 05:39:37 i spent some time to make it robust against reading outside of the terminal buffer 2021-12-14 05:40:30 i come from c where buffer overruns are endemic 2021-12-14 05:41:37 I have no memory protection whatsoever, but yeah buffer overruns and off-by-ones are always tricky. 2021-12-14 05:42:07 oy off-by-one .. don't get me started lol 2021-12-14 05:42:23 When working on the algorithm, drawing on paper with little boxes designating the memory helps a lot. 2021-12-14 05:43:06 With this Forth, I somehow ended up writing code mostly on paper as it turned out to be more efficient 2021-12-14 05:43:18 cool 2021-12-14 05:43:32 when i get stuck i like to draw a picture 2021-12-14 05:43:56 Yesterday I wrote do loop on my little notebook on the tram. 2021-12-14 05:44:06 When I got home and typed it in, it just worked 2021-12-14 05:44:40 I'm hesitating if I should add support for I, J and K though, as the standard requires it. 2021-12-14 05:45:18 i saw some code where it used I as an index in an array 2021-12-14 05:45:25 in a do loop 2021-12-14 05:47:13 I really dislike DO LOOP now, it's unnecessarily complex. I'll possibly add FOR NEXT and just keep using it. Actually most of the time I just use BEGIN/WHILE/RPEAT/UNTIL. 2021-12-14 05:48:00 this is why forth is good :-) 2021-12-14 05:49:59 It is so much fun 2021-12-14 06:11:16 The output of WORDS: https://pastebin.com/raw/tuBQmmEJ 2021-12-14 06:12:08 Anything after close-file was defined in a separate ascii source file, but before that is in assembler mixed with hand coded Forth. 2021-12-14 06:21:55 which cpu? 2021-12-14 06:22:51 x86 for now 2021-12-14 06:23:07 Ultimately I'd like to port it to z80 2021-12-14 06:23:39 cool 2021-12-14 06:30:18 javascript forth: https://github.com/eatonphil/jsforth 2021-12-14 06:31:25 i don't know javascript but i fumbled my way through a simple program 2021-12-14 06:32:00 i was gonna try and get something that resembles a terminal in the browser 2021-12-14 06:32:24 which that javascript forth has 2021-12-14 06:57:24 Just in case, there may be already one that's written by someone else as a library, considering it's JavaScript. 2021-12-14 06:57:40 There's a library for everything :) 2021-12-14 07:38:36 It seems core.fr and tester.fr contains the ANS Forth test suite: https://github.com/gerryjackson/forth2012-test-suite/tree/master/src 2021-12-14 14:34:19 This video is fun: https://www.youtube.com/watch?v=1XdgUK1NbpI 2021-12-14 14:34:41 The guy seems to have coded his recent commercial game in his own Forth 2021-12-14 14:36:09 This is the game written in Forth: https://www.youtube.com/watch?v=IgDfaBmV3TY 2021-12-14 14:46:43 neuro_sys_, looks like that's written in C with scripting in Forth 2021-12-14 14:50:57 I thought it was all Forth. 2021-12-14 14:59:31 https://webcache.googleusercontent.com/search?q=cache:B1Er_N6-ky4J:https://twitter.com/rocketcatgames/status/800093625547767808+&cd=21&hl=en&ct=clnk&gl=us 2021-12-14 15:06:24 MrMobius: Ah good find 2021-12-14 15:08:12 I think Forth is good for game scripting subsystems. I heard Lua is very popular due to ease with interfacing with C/C++ I guess. I suppose Forth would outrun Lua in terms of execution speed. 2021-12-14 15:10:53 hmm, maybe. what makes you say that? 2021-12-14 15:11:23 forth for a scripting language has the advantage of being very easy to implement. i dont think its about speed 2021-12-14 15:13:09 It's dynamically typed, but maybe that's also important for ease of development. 2021-12-14 15:15:00 As for speed, considering many real time games update the world state very often, they'd benefit from speed 2021-12-14 15:18:58 games are one of those things where extra speed doesnt really helpas long as your making the timings 2021-12-14 15:19:10 at least for game state updates 2021-12-14 17:31:36 Serverless FORTH when? 2021-12-14 17:33:57 Almost certainly LuaJIT would be faster than any FORTH you can embed, unless maybe gforth can be embedded? But then I don't think you could sell the game right? 2021-12-14 17:34:18 Well I mean keep source code proprietary, no rule against 'selling' in GPL per se 2021-12-14 17:34:39 Guys when are we going to get serverless forth? 2021-12-14 18:59:05 what does that mean? 2021-12-14 19:10:58 CGI 2021-12-14 19:11:12 CGI in the cloud* 2021-12-14 19:16:53 I write web apps using a Forth backend; does that count? 2021-12-14 19:25:58 veltas: you can do it on lambda. 2021-12-14 19:27:09 AWS lambda, rather.