2021-12-21 04:47:52 veltas: Thanks, I read it in the crc's occasionally crashing logs. 2021-12-21 04:48:08 No problem 2021-12-21 04:48:18 There is a way of posting messages too but I can't be bothered lol 2021-12-21 04:48:37 potatoalienof13: About your question of using linked list. It's only relevant for the compile time speed. 2021-12-21 04:49:27 Just in case you might have overlooked it as I did when I first read about Forth, and was apalled of using a linked list to look up each word. 2021-12-21 04:50:12 Yeah there's memoserv but I think I have not registered my nickname on this server yet. 2021-12-21 04:53:02 After solving more Advent of Code with "modern" languages very fast and comfortably, now I feel like experimenting with making Forth similar to them in syntax and paradigm. 2021-12-21 04:53:29 I wonder how much of a similarity could be achieved in parsing a C-like language syntax. 2021-12-21 04:53:48 Without writing an AST and in-fix parser 2021-12-21 04:57:15 Locals get you pretty close 2021-12-21 04:57:43 You don't miss in-fix at all, you can write essentially postfix C code with just locals 2021-12-21 04:58:25 But you feel gross and all your methods are larger, sometimes it's valid though TBH, if you allow yourself 2021-12-21 04:58:32 It's definitely not very 'pure' 2021-12-21 04:59:04 And alternative that people probably used to use was putting stuff on return stack and accessing it via I, I', J (equiv of R@, R2@, R3@) 2021-12-21 04:59:36 No harm in playing around with it, but you'll come back. They all do! 2021-12-21 05:09:02 That was my first attempt in learning Forth. I basically wrote C without types. And indeed it did not feel right. 2021-12-21 05:10:13 I like the retro's approach though, but still I haven't yet enough enjoyed the traditional Forth to dissent much. 2021-12-21 05:12:55 There are a couple talks on Youtube about concatenative languages which are inspiring. I still want to be as fluent or more in Forth than I am with other languages. It takes practice for sure, but let's see. 2021-12-21 05:17:02 https://www.youtube.com/watch?v=TcveznrwYtk 2021-12-21 05:17:05 Hm, I had not seen this 2021-12-21 05:21:05 SectorLISP is now smaller than SectorFORTH https://justine.lol/sectorlisp2/ 2021-12-21 05:21:48 Lol indeed 2021-12-21 05:21:53 I wonder if it does a GC 2021-12-21 05:22:00 Yeah it has GC 2021-12-21 05:25:14 I think it might just be reference counting, not sure, but depending on how dumb the Lisp is that would be sufficient 2021-12-21 05:25:26 Well sufficient 90% of the time in a lisp that fits in one sector, anywya 2021-12-21 05:26:03 Looks like it's more usable than sectorFORTH too, not sure I'd want to write lisp anyway but most people probably would prefer that over FORTH 2021-12-21 06:55:53 i find it insulting! 2021-12-21 06:56:00 forth is clearly smaller than lisp :-) 2021-12-21 06:56:42 hopefully 2021-12-21 07:20:08 I wouldn't guess lisp was able to be smaller but right now they're ahead 2021-12-21 07:20:32 I guess we'll see if sectorforth catches up, or another contender enters the ring 2021-12-21 07:34:04 I suspect sectorforth could be made smaller, but is that necessary? 2021-12-21 07:35:05 given that an x86 boot sector is required to be 510+2 bytes, I'd only focus on shrinking it further if there was something else I could use the extra space for. 2021-12-21 07:52:38 Got plans to do something like this in FORTH at some point https://zig.news/xq/a-challenger-to-the-throne-of-vector-graphics-svg-is-dead-long-live-tinyvg-4on8 2021-12-21 07:53:03 crc: It's about being the smallest though, Justine's called the FORTH community out 2021-12-21 07:53:07 It means war!!! 2021-12-21 07:53:37 Just a bit of friendly competition really, I wonder what sectorforth can cdo 2021-12-21 07:53:56 I can't even wrap my head around how a FORTH or any interpreter can be that small! I'll have to read in more depth at some point 2021-12-21 07:57:00 I've done a couple of forth systems that fit in a boot sector back when I was into x86 coding 2021-12-21 07:57:31 you can't do a lot, but it's possible to squeeze an interpreter and basic compiler to fit 2021-12-21 08:09:06 stripping out some of the nicer backspace handling in output drops sectorforth to 470 bytes; not hiding definitions until ; saves another 10 bytes 2021-12-21 08:12:19 Maybe you should do a follow-up to that article then 2021-12-21 08:12:57 A bit of good humoured competition 2021-12-21 08:13:39 I might... 2021-12-21 08:14:01 The old vi text editor doesn't really handle backspace properly, it's pretty much baked into the POSIX standard for it 2021-12-21 08:14:32 Yeah go for it, will probably get some attention on HN 2021-12-21 08:18:31 this could be made much smaller. TIB, >IN, STATE are at fixed addresses, so can be defined at the interpreter. Removing these gets it down to 424 bytes, which is smaller than sectorlisp. 2021-12-21 08:38:04 Wasn't the sectorforth guy lurking here 2021-12-21 08:39:54 How can you define those at the interpreter if you don't have them? 2021-12-21 08:40:14 Surely those are needed for the interpreter to function 2021-12-21 08:40:51 they are at fixed positions in memory, so : tib 0 ; : state 4096 ; etc 2021-12-21 08:40:56 It's also important to stress that the rest of the Forth (like ANS Forth) can be built from that small core. When I was watching that sectorlisp video, the guy mentioned that as something unique to sectorlisp that you can compile the lisp 1.5 or something. I suppose you can do that same with sectorforth. 2021-12-21 08:42:08 veltas: they need to exist, but the names for them don't need to be in the initial dictionary 2021-12-21 08:50:48 how much bootstrapping is required for sectorforth compared to sectorlisp? 2021-12-21 08:58:34 crc: Oh right, of course 2021-12-21 08:58:58 potatoalienof13: I think a lot compared to sectorlisp which supposedly passes some lisp tests out the box 2021-12-21 08:59:22 But you'd have to see for yourself really 2021-12-21 09:03:11 Maybe space can be saved with a TOS register? 2021-12-21 09:03:43 Will change the bootstrapping code but would probably save some space 2021-12-21 09:04:44 Hmmm maybe that's not an option though, can't access TOS if it's in a register without another word, probably wastes more than it saves 2021-12-21 14:06:46 i share a tool i write for sharing docs: https://readonly.link 2021-12-21 14:24:01 xyh: does it only work with github? 2021-12-21 15:22:49 crc: I don't think so 2021-12-21 15:23:20 github.com is in the URL so I think you can put other hosts in there? 2021-12-21 15:24:15 xyh: Hey this is really nice https://readonly.link/articles/github.com/veltas/zenv/-/README.md 2021-12-21 15:24:24 That was a really basic README and it looks quite good in there 2021-12-21 15:24:55 xyh: What did you make that with? I'm guessing this has nothing to do with FORTH? 2021-12-21 15:26:36 Does it do pretty much all the work clientside? 2021-12-21 15:30:54 xyh: You need to make the navigation of books more obvious for dumb people like me 2021-12-21 15:31:08 Took me a while clicking around to figure out I needed to click on the title 2021-12-21 15:32:37 veltas: yes, i will support other hosts, such as gitlab & npm, and custom gitlab host. 2021-12-21 15:33:29 veltas: yes, i build it in typescript and vue, it is not about forth, i just want to share it. 2021-12-21 15:34:11 yes, it fetch files from github repo, and render it at runtime. 2021-12-21 15:35:06 I like it, but I wouldn't go sharing it in random channels like this 2021-12-21 15:35:25 i will improve it, if you want some new features, let me konw :) 2021-12-21 15:35:45 sorry, i was rude, i will not do it again. 2021-12-21 15:37:02 Looks good to me, maybe get someone to post it on hackernews. It's a bit slow on my laptop but if it's clientside that's why 2021-12-21 15:37:24 My laptop is quite old so probably not an issue 2021-12-21 15:38:16 i can improve the slow loading by not using github api but using CDN by default. 2021-12-21 15:39:44 I use git.sr.ht for git hosting; so will look at this more in the future when it supports more hosts. 2021-12-21 15:41:33 hi crc! 2021-12-21 15:41:37 long time no see 2021-12-21 15:42:22 i remember your retro 2021-12-21 15:50:54 i tried to render this: https://readonly.link/articles/github.com/crcx/retroforth/-/doc/RETRO-Book.md 2021-12-21 15:51:14 the rendering is really slow for big page 2021-12-21 15:54:30 a small page is cool :) https://readonly.link/articles/github.com/crcx/retroforth/-/doc/QuotesAndCombinators.md 2021-12-21 15:56:46 Looks good 2021-12-21 16:16:25 xyh: Have you tried profiling it? To see where you can make it faster? 2021-12-21 16:17:53 "xyh has become unresponsive, do you want to wait?" 2021-12-21 16:19:13 xyh: Have you tried profiling it? To see where you can make it faster? 2021-12-21 16:19:50 Hi I'm new-ish to forth, what to you all use forth for nowadays? It's certainly an interesting language, just wondering if it's used practically 2021-12-21 16:20:22 crc: ^ 2021-12-21 16:21:00 swissChili: I use it as a glorified desk calculator at work, although I'm hoping to get more tools working in forth 2021-12-21 16:21:40 It's highly portable, FORTH is on some systems where literally the only alternatives are assembly and C, but FORTHs tend to come with a REPL built-in which is quite cool 2021-12-21 16:21:48 So it has embedded uses 2021-12-21 16:22:39 swissChili: I do most of my programming in Forth. 2021-12-21 16:23:31 for work, I develop/maintain an in-house, browser based order management system and some related tools 2021-12-21 16:23:40 A big part of it is probably just being unfamiliar with the language, but I've had a lot of trouble dealing with any sort of complicated data (even just something tabular) in forth. That's been the main thing keeping me from making anything useful with it ;) 2021-12-21 16:24:03 It can't be overstated how important being tiny is. FORTHs are so small that you or any half-decent programmer can learn everything about them, if they want, in not that much time. 2021-12-21 16:24:17 crc: What forth dialect to you use? If that is in ANS forth consider me very impressed 2021-12-21 16:24:19 It makes business sense to me, I know my team can be their own support if they need to be 2021-12-21 16:24:31 swissChili: retroforth 2021-12-21 16:25:04 Do you think you could do your work in ANS forth instead crc? 2021-12-21 16:25:07 I'd like to think so 2021-12-21 16:25:32 Retro looks cool, I skimmed the docs for it a few months ago. It looks like it addresses a lot of the difficulties I was having with managing more complicated data in ANS forth 2021-12-21 16:26:00 I probably *could*, but I think what I end up with would be similar to retroforth after I define the words I want 2021-12-21 16:26:14 That's what I would expect yeah 2021-12-21 16:28:32 Do you use CGI or have you implemented an HTTP server in Forth? In case of the latter, how do you go about concurrency? Just curious 2021-12-21 16:30:42 for work, CGI. 2021-12-21 16:30:58 for static sites/pages, I use http://retroforth.org/examples/Casket-HTTP.retro.html 2021-12-21 16:31:37 (I have a version of casket with limited cgi support, but this isn't released yet) 2021-12-21 16:33:42 Cool stuff, thanks 2021-12-21 16:34:40 casket runs under inetd, so is basically uses a separate process for each connection. not massively scalable, but sufficient for my current needs 2021-12-21 16:39:18 A quick grep of handbook.txt reveals some multitasking support, so I guess a threaded web server could be possible as well 2021-12-21 16:40:10 maybe; I haven't worked on that though, so can't say for certain 2021-12-21 16:42:10 the multitasking stuff is very new (it's a port of the system used in new retro implementation for my new vm), and hasn't been tested or used extensively so far