00:00:00 --- log: started forth/19.01.29 00:47:14 hahahaha 00:47:34 --- quit: pierpal (Quit: Poof) 00:47:50 --- join: pierpal (~pierpal@host53-189-dynamic.17-79-r.retail.telecomitalia.it) joined #forth 00:49:31 siraben, the last one is quite fitting for you, eh? ;-) 01:12:26 morning forth squad 01:19:34 morning forthniter 01:23:07 Good afternoon Forthwrights 01:29:01 --- join: mtsd (~mtsd@94-137-100-130.customers.ownit.se) joined #forth 02:03:43 --- quit: ashirase (Ping timeout: 272 seconds) 02:18:03 proteusguy: No doubt. 02:33:06 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 02:46:14 5:45p here WilhelmVonWeiner but I'm sure it's morning somewhere. :-) 02:48:24 --- quit: mtsd (Quit: WeeChat 1.6) 02:59:53 --- join: `presiden (~presiden@unaffiliated/matematikaadit) joined #forth 03:07:00 <`presiden> so, what you need to implement first so that you can have loop, while, etc. in pure forth? 03:07:00 --- quit: pierpal (Read error: Connection reset by peer) 03:09:02 The primitives that those words lay down, most commonly one or more conditional branches and an unconditional branch. 03:11:35 You can also have more specialized primitives for the looping words, depends on the Forth. 03:13:05 Basically words control flow words like while, loop, if, etc... are compiler directives that lay down runtime actions. 03:19:09 --- join: pierpal (~pierpal@host53-189-dynamic.17-79-r.retail.telecomitalia.it) joined #forth 03:25:29 --- quit: pierpal (Ping timeout: 246 seconds) 03:26:50 --- join: pierpal (~pierpal@host53-189-dynamic.17-79-r.retail.telecomitalia.it) joined #forth 03:26:53 --- quit: proteusguy (Remote host closed the connection) 04:03:23 : ?: ( altern conseq cond -- conseq | altern ) SKZ SWAP DROP ; 04:03:44 : BRZ R> DUP @ SWAP 1+ ROT ?: >R ; 04:04:15 : JMP R> @ >R ; 04:07:31 : IF COMPILE BRZ HERE 0 , ; IMMEDIATE 04:08:32 and so Forth 04:21:12 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 04:27:01 `presiden: the ANS FORTH standard has a section on primitives to build flow control 04:27:25 BEGIN AHEAD AGAIN etc 04:27:42 it's a nice formalism that works well 04:36:12 --- quit: pierpal (Quit: Poof) 04:36:31 --- join: pierpal (~pierpal@host53-189-dynamic.17-79-r.retail.telecomitalia.it) joined #forth 04:49:10 --- quit: pierpal (Ping timeout: 245 seconds) 04:52:51 `presiden: Usually the control flow primitives are in the assembly language of the processor rather than in high level code. 04:53:30 The directives that lay them down though are in high level code. 04:55:43 `presiden: https://github.com/nornagon/jonesforth/blob/master/jonesforth.S 04:56:31 --- join: proteusguy (~proteusgu@cm-58-10-154-147.revip7.asianet.co.th) joined #forth 04:56:31 --- mode: ChanServ set +v proteusguy 05:11:42 --- join: xek (~xek@apn-31-0-23-81.dynamic.gprs.plus.pl) joined #forth 05:47:27 --- quit: rdrop-exit (Quit: Lost terminal) 06:19:29 --- quit: smokeink (Remote host closed the connection) 06:19:55 --- join: smokeink (~smokeink@118.131.144.142) joined #forth 06:50:34 --- quit: smokeink (Quit: Leaving) 07:16:28 just got a job with some ITSP (voip telco) 07:16:51 Boss, old school hacker type, hadnt even heard of Forth 07:17:17 Said it sounded pretty low level and I'm there going "yeah, but no, but yeah, but no" 07:17:17 my boss has never heard of forth either 07:17:40 and he loves blabbing on and on about the days before c 07:20:25 tell him to put a sock in it grandpa 07:20:42 we're using parametric polymorphism over here mate 07:28:51 --- quit: tabemann (Ping timeout: 250 seconds) 07:45:01 --- join: darithorn (~darithorn@75.174.231.56) joined #forth 07:51:31 he also really knows his stuff but god he writes terrible code 08:32:54 --- join: john_cephalopoda (~john@unaffiliated/john-cephalopoda/x-6407167) joined #forth 08:33:02 Hey 08:41:53 Hmm, how do I best do stuff with the stack in reverse order? Is there some clever way to get ( n0 n1 n2 n3 ... ni ) and get them out with n0 first? 08:51:06 DEPTH 0 DO >R LOOP 08:51:53 -1 PICK? I think PICK works like that in some systems 09:22:37 WilhelmVonWeiner: I thought about using >R, but then I'll have to get all those elements back again from the return stack. 09:24:46 you can always store your main routine's return address in a variable, reset the return stack to clear it, and push the main routine 09:25:17 but it sounds like if you're not going to use all these elements, are you sure you need to do what you're doing 09:25:33 you could also use a word like Retro's `dip` 09:26:16 something like `: DIP: ( --) >R ' execute R> ;` 09:26:37 --- quit: proteusguy (Remote host closed the connection) 09:26:48 so a call to DEPTH in a DIPped word would be accurate relative to how much you dip 09:27:02 and when they return your rstack is cleared 09:27:58 Maybe I should just write a forth to assembly compiler in forth... 09:28:52 --- join: proteusguy (~proteusgu@cm-58-10-154-147.revip7.asianet.co.th) joined #forth 09:28:52 --- mode: ChanServ set +v proteusguy 09:29:11 what is the problem you're trying to solve 09:29:25 Situation is: I am writing a compiler that compiles forth to bytecode. I got something like "23 43 SWAP 32 22 DUP" and want to generate bytecode from that. 09:30:31 SWAP will be defined, so it writes "CALL SWAP" to the bytecode. DUP likewise. 09:30:47 Wait, I'll give you some code... 09:30:58 check out cmForth, chuck's Forth compiler for the Novix 09:31:13 or krue's `avr` http://krue.net/avr/ 09:31:59 https://bpaste.net/show/86e56e1face2 09:33:36 Hrm, hard to explain... 09:34:26 define SWAP to write SWAP's machine code to stdout, doing bitwise manipulations with stack items as needed 09:35:31 I defined SWAP to write "CALL SWAP" (in machine code) to my file. 09:36:05 The problem is: How do I handle "23"? How do I make sure that that one actually lands on the stack? 09:36:44 Maybe I should just write a Forth compiler in Forthified assembly and keep the code in memory... 09:37:08 john_cephalopoda: this is gforth specific, but try: : reverse-stack here >r depth dup >r 0 do , loop r> r@ swap 0 do dup i cells + @ swap loop drop r> dp ! ; 09:37:53 Chuck uses { and } in cmForth to switch between the host and target dictionary with cmForth, when compiling 09:38:46 in a similar sense, you could define a word to make the interpreter take numbers and write the bytecode to push that number on your chip 09:49:53 Yeah... I think I'll just ship a tiny core written in assembly and in-memory plaintext Forth that I compile at boot time. 09:50:12 crc: Thanks 09:51:36 I used to do that in retro (asm core & compile most source on startup) 09:52:20 Mmh. Probably the most elegant solution. 09:54:55 --- join: pierpal (~pierpal@host53-189-dynamic.17-79-r.retail.telecomitalia.it) joined #forth 09:58:22 --- quit: pierpal (Read error: Connection reset by peer) 10:05:18 --- join: pierpal (~pierpal@host53-189-dynamic.17-79-r.retail.telecomitalia.it) joined #forth 10:12:33 --- quit: pierpal (Ping timeout: 268 seconds) 10:17:01 --- join: pierpal (~pierpal@host53-189-dynamic.17-79-r.retail.telecomitalia.it) joined #forth 11:14:15 --- join: dave0 (~dave0@193.060.dsl.syd.iprimus.net.au) joined #forth 11:14:33 ahoy 11:17:17 Hi dave 11:18:07 hi john_cephalopoda 11:27:54 --- quit: pierpal (Quit: Poof) 11:28:12 --- join: pierpal (~pierpal@host53-189-dynamic.17-79-r.retail.telecomitalia.it) joined #forth 11:35:46 hey dave 11:35:48 what's good 11:36:45 hi WilhelmVonWeiner 11:37:17 just looking over lbForth source code 11:37:27 that's a seriously well written Forth 11:37:52 lbForth is? 11:41:08 I'm thinking about parser generators in forth 11:41:12 like if you wanted to parse C code 11:44:42 --- join: dys (~dys@tmo-100-189.customers.d1-online.com) joined #forth 11:45:46 could use vocabs 11:46:05 a c-parser vocab that can run on straight up c code 11:47:19 what's that? 11:49:00 WilhelmVonWeiner: I doubt that this is doable with reasonable effort. 11:50:03 Not only because Forth is pretty bad at parsing, but also because C isn't a really good language for parsing. 11:50:06 Full of ambiguities. 11:50:25 nobody ever said it would be easy 11:50:34 Don't see how Forth is "bad at parsing" though 11:51:05 String handling in Forth is no fun. 11:51:46 Even creating a temporary string is a task that can't be easily accomplished. 11:53:15 Building RPN assembly compilers, on the other hand, is trivial :D 11:53:33 I don't see your problem with temporary strings 11:53:39 As in 11:53:56 I can't at all grok what you mean by "can't easily be accomplished" 11:55:07 you have an input buffer, you have the flat memory of cells 11:55:27 you also have PAD 11:55:51 You'll have to hand-manage memory if you want to have a string only temporarily. 11:56:35 i kinda like the <# # #> stuff to format numbers, it's pretty cool 11:56:48 there are "string libraries" for gforth and such - monstrous grotesques 12:01:18 --- quit: gravicappa (Ping timeout: 240 seconds) 12:23:20 john_cephalopoda: or write something to handle temporary strings (e.g., I have a pool of memory for temporal strings, with the newest ones overwriting earlier ones as I rotate through it) 12:35:19 well, i've written my first rpany application - it's a video editor 12:37:06 (command line and script file based, but basically all i wanted from it) 12:41:01 where can i read a simple regex engine in forth? 12:48:08 crc: Hmm, S" but with a ringbuffer... might work. 12:55:18 --- quit: xek (Ping timeout: 240 seconds) 13:04:56 --- quit: cantstanya (Ping timeout: 256 seconds) 13:08:38 --- join: cantstanya (~chatting@gateway/tor-sasl/cantstanya) joined #forth 13:10:23 --- quit: darithorn (Quit: Leaving) 13:50:58 the_cuckoo: very cool, link? 13:51:28 rain1: http://excamera.com/files/docforth/docforth/regex.html 13:51:45 thanks 13:51:57 the download link doesnt work 13:52:40 WilhelmVonWeiner: massive word of warning :) - the editor relies on a library which i haven't published recently :) - it's quite a big library of course :) - but the interface to it is simple, and this stuff is just the graph building at the moment... 13:53:23 there is new version of it pending though - latest ffmpeg and cmake - maybe this week or next... 13:54:04 https://gitlab.com/lilo_booter/vml-batch/blob/master/src/main.cpp <- this is the command line tool which parses and constructs video graphs 13:54:48 http://excamera.com/files/docforth/docforth/regex.fth.html 13:54:51 rain1: 13:55:04 aha! 13:55:09 i can provide usage docs based on the old tool which this replaces - http://vml.hopto.org/pug/~charlie/docs/aml.html - usage will just be better though 13:55:17 the_cuckoo: I shan't build it but I shall read your source 13:55:56 what's rpany 13:55:58 yup - figured that would be more to your interest - obviously, there's a massive leap in the dark 13:56:32 corecode: my pet project - a c++ header file library which provides a forth-like environment 13:56:42 haha 13:56:49 rpn and boost::any :) 13:57:04 oh so you use a library to do the actual editing, you're not editing the files with a program written in rpany? 13:57:49 yes - i have a fairly comprehensive library to use - all i want is a flexible tool to allow me to construct and play and encode graphs 13:58:04 i have one - but it's fugly :) 13:58:36 vmlbatch is a replacement for that 13:59:20 with this approach, i get scripting for free - and a bloody rpn calculator when i need one :D 14:00:00 posix dc is also an rpn calculator 14:00:32 corecode: sorry - url is https://gitlab.com/lilo_booter/rpany 14:00:41 WilhelmVonWeiner: yeah :) - i hate it 14:01:25 and with this approach, where i need it is both in the c++ code and outside 14:01:48 or rather, where i have it 14:03:50 i'll avoid the template madness, thanks 14:04:16 me too :D 14:08:05 kidding - i have some in there, but it's mostly for casting as stuff comes of the stack (and some vocabs use them to save on the boilerplate) - but this is of course for c++ coders 14:08:49 not expecting much interest here, but i find there's a lot of overlap in the conversation 15:47:38 https://bernd-paysan.de/dragon/ 15:50:29 --- quit: cantstanya (Remote host closed the connection) 15:52:48 --- join: cantstanya (~chatting@gateway/tor-sasl/cantstanya) joined #forth 15:57:19 Oh, wow http://www.bradrodriguez.com/papers/bnfparse.htm 15:57:45 Look up "one screen of forth" somewhere on Brad's site 15:57:50 or maybe Bernd's 15:58:00 this is one of the examples, really cool stuff 15:58:24 I know, I found it via that :D 16:06:18 --- quit: john_cephalopoda (Ping timeout: 240 seconds) 16:08:06 --- join: john_cephalopoda (~john@unaffiliated/john-cephalopoda/x-6407167) joined #forth 16:16:48 --- quit: cantstanya (Remote host closed the connection) 16:21:53 so now i just need to implement memory access, then the forth cpu is sort of complete 16:22:17 i think next would be a 8 bit forth 16:24:34 --- join: cantstanya (~chatting@gateway/tor-sasl/cantstanya) joined #forth 16:27:18 --- quit: Croran (Ping timeout: 240 seconds) 16:30:12 --- join: Croran (~quassel@2601:601:1801:6dde::4276) joined #forth 16:37:49 --- quit: reepca (Ping timeout: 240 seconds) 17:14:48 --- join: reepca (~user@208.89.170.3) joined #forth 17:15:47 <`presiden> corecode, ah, nice 17:16:22 --- join: reepca` (~user@208.89.170.37) joined #forth 17:16:23 <`presiden> smokeink, thanks for the link. really helps 17:19:32 --- quit: reepca (Ping timeout: 246 seconds) 17:33:53 --- quit: dave0 (Quit: dave's not here) 17:34:10 --- join: travisb (~travisb@rrcs-162-155-170-75.central.biz.rr.com) joined #forth 17:39:17 --- nick: travisb -> tabemann 18:46:59 --- join: nighty- (~nighty@b157153.ppp.asahi-net.or.jp) joined #forth 18:54:52 --- quit: tabemann (Ping timeout: 268 seconds) 19:00:57 --- join: rdrop-exit (~markwilli@112.201.168.172) joined #forth 19:02:33 Good morning Forthwrights :) 19:03:40 Good evening rdrop-exit 19:06:12 Hi crc 19:07:26 I was going to check the channel's log to see what I've missed, but the site seems to be down. 19:07:45 yey, memory works as well 19:07:51 cpu done! 19:09:25 I have a mirror of the logs, but it's not been able to sync for a few hours 19:09:33 http://forthworks.com/forth/irc-logs 19:09:46 Thanks 19:10:10 that TOS input mux is crazy large tho 19:13:10 Catching up on the logs, bbiab 19:14:05 rdrop-exit: I was just able to manually run the sync, so the log should be current now 19:15:35 Thank you very much crc, I'm all caught up now. :) 19:17:57 Although I'm sure I've missed a lot over the past weeks, I need to get in the habit of catching up before logging in. 19:39:40 re: forth & parsing. it can be credibly argued that forth is poor at parsing. but that's missing the point. forth is an excellent language for building a small DSL that is great at parsing! all good forth programs are small DSLs. 19:41:04 --- quit: proteusguy (Remote host closed the connection) 19:41:21 Agree, Forth proves that sophisticated parsing techniques are not required to make a DSL. 19:42:10 --- join: proteusguy (~proteusgu@cm-58-10-154-147.revip7.asianet.co.th) joined #forth 19:42:10 --- mode: ChanServ set +v proteusguy 19:42:17 --- join: tabemann (~travisb@2600:1700:7990:24e0:1911:446f:51c:ef65) joined #forth 19:42:18 Those who implement sophisticated parsing on top of Forth don't get the point. 19:45:25 hey guys 19:45:38 Hi tabemann 19:45:45 if sophisticated parsing techniques are not required, can you point to a forth with a regex enegine? 19:45:49 for attoforth I just had to implement a whole readline-style line editor 19:46:11 isn't regex sophisticated? 19:46:26 There are many regex implementations for Forth, but that's besides the point 19:47:12 and there are better ways of doing things than regexes 19:47:18 some people, when they see a parsing problem say "I can solve that with a regex!". Now they have two problems. :-D 19:47:26 look at parsec/attoparsec/megaparsec in haskell 19:47:28 Just read an interesting porblem on clf, sorting the top 4 items on the stack. 19:48:04 * tabemann loves that quote 19:48:35 Although, I don't see why I'd ever need to sort 4 items on the stack. 19:49:20 I think this would work, will test it later: 19:49:24 sorting items on the stack is easy - write them to an array, apply quicksort to that array, read the contents of the array onto the stack 19:49:28 : sort4 ( n1 n2 n3 n4 -- lowest lower high highest ) 19:49:29 pivot push pivot push pivot pop pivot pop pivot ; 19:50:10 Anyway, I doubt I would ever have a practical need for it. 19:50:58 Here's a live coding example of text parsing in forth: https://www.youtube.com/watch?v=mvrE2ZGe-rs&t=9s 19:53:23 Long video, will watch it another day. 19:57:40 * crc is doing tests on the last piece needed to be able to compile a new image file using an existing retro image, rather than needing external tools 19:58:13 You mean a metacompiler? 19:58:31 essentially, yes 19:59:00 Cool, every decent Forth should have a metacompiler. 19:59:06 crc is tired of writing asm ;-) 19:59:11 two parts: an assembler for building the initial kernel, then a second piece that compiles in the standard library 20:00:02 PoppaVic: not really. My kernel remains in assembler, for my VM instruction set, and I have a tiny runtime assembler for manual optimizations 20:01:10 crc: I was kidding, since I know you don't much care for C or asm outside forth. Although, i4 really hated it ;-) 20:01:19 The standard has really de-emphasized metacompilation, cross-compilation, and multitasking as essential features of a Forth system in newbie's mind. 20:01:40 * newbies' minds 20:01:45 Can't say as I blame anyone, as I find the damned linker-jive to be hair-pulling 20:01:55 They just see Forth as another language to be parsed. 20:02:20 I don't much care for metacompiling - always crosses my damned eyes. 20:03:14 :) 20:04:17 I noticed there's a bigt fight on Wikipedia about Forth and Metacompilation 20:04:33 still? yet? again? now what? 20:04:53 https://en.wikipedia.org/wiki/Talk:Metacompilation 20:05:16 Hey it's gone 20:05:54 Ah found it: 20:05:56 https://en.wikipedia.org/wiki/Talk:Compiler-compiler 20:07:10 good - cuz what I was seeing made no sense ;-) 20:08:39 Actually I'm not even sure that was it, I have it archived somewhere on disk, lots of vitriol. 20:10:20 Yeah. I am not seeing much of that - mostly just nitpicking terms 20:18:08 Here it is: 20:18:10 https://en.wikipedia.org/w/index.php?title=Talk:Metacompiler&oldid=835211456 20:18:24 I plan on making hashforth be self-hosting in the near future 20:18:49 "Damon I am very sorry to inform you that forth is dead. Quit digging forth references up. Leave them buried." 20:19:30 "I am most interested in getting rid of this ignorant idea that a meta compiler must compile it's self. It is unfounded in real computer science literature. FORTH is a dead fringe language. Bury it where the sun don't shine!! The only legit definition of metacompiler in the ACM archive is from 1970 given above. That is the first and only definition in ACM publications. Do you not recognize the ACM?" 20:20:38 This guy really hates Forth :)) 20:21:34 haters bleed nice. 20:21:50 Need coffee brb 20:29:02 back 20:57:07 dammit why am I getting a bad file descriptor error 20:57:31 OPEN is returning a file descriptor of 3, which is what is expected 20:57:52 but when I try to read from it, it gives me "Bad file descriptor" 20:59:21 Is it open for reading? 20:59:50 type of open, I'd suspect 20:59:56 EBADF fd is not a valid file descriptor or is not open for reading. 21:00:19 --- join: gravicappa (~gravicapp@h109-187-37-22.dyn.bashtel.ru) joined #forth 21:02:17 POSIX read(): http://pubs.opengroup.org/onlinepubs/9699919799/ 21:03:02 [EBADF] The fildes argument is not a valid file descriptor open for reading. 21:05:12 bbiab 21:09:07 --- quit: gravicappa (Ping timeout: 250 seconds) 21:19:10 --- quit: rdrop-exit (Ping timeout: 245 seconds) 21:22:37 --- quit: dddddd (Remote host closed the connection) 21:23:13 --- join: gravicappa (~gravicapp@h109-187-44-245.dyn.bashtel.ru) joined #forth 21:24:53 Anyone notice that bespin.org (which logs this channel) is down? 21:27:05 --- quit: proteusguy (Remote host closed the connection) 21:32:37 --- join: rdrop-exit (~markwilli@112.201.168.172) joined #forth 21:35:12 --- join: dave0 (~dave0@193.060.dsl.syd.iprimus.net.au) joined #forth 21:41:35 --- join: darithorn (~darithorn@75.174.231.56) joined #forth 21:42:30 --- join: proteusguy (~proteusgu@mx-ll-180.183.128-61.dynamic.3bb.co.th) joined #forth 21:42:30 --- mode: ChanServ set +v proteusguy 21:42:59 finally - fixed those damn bugs 21:43:27 ah the mythical "last bug" 21:43:37 :-) 21:43:40 lol 21:44:02 well now I can load source files from the REPL without having hashforth crash 21:48:09 proteusguy: I have a mirror at http://forthworks.com/forth/irc-logs (should update about once an hour) 21:54:50 crc, thanx - something you wrote in forth or just a tool you deployed? ;-) 21:55:17 --- quit: pierpal (Quit: Poof) 21:55:43 --- join: pierpal (~pierpal@host53-189-dynamic.17-79-r.retail.telecomitalia.it) joined #forth 21:56:35 proteusguy: rsync to the grab the actual files, some python to generate the gophermap, and a gopher/http server in forth 21:57:19 I'll hopefully replace the python bits with forth code later this year 21:58:34 --- quit: darithorn (Remote host closed the connection) 22:08:09 :-) where are you rsync'ing from? 22:11:29 proteusguy: I've been having the same problem with the logs since yesterday 22:27:17 who runs bespin do we know? 22:27:32 I don't 23:23:01 --- quit: `presiden (Ping timeout: 268 seconds) 23:48:27 --- quit: pierpal (Quit: Poof) 23:48:46 --- join: pierpal (~pierpal@host53-189-dynamic.17-79-r.retail.telecomitalia.it) joined #forth 23:56:18 --- quit: dys (Ping timeout: 240 seconds) 23:59:59 --- log: ended forth/19.01.29