00:00:00 --- log: started forth/17.09.16 00:05:26 --- quit: dys (Ping timeout: 248 seconds) 00:14:53 --- join: dys (~dys@tmo-108-52.customers.d1-online.com) joined #forth 01:12:07 --- join: mnemnia (~mnemnion@2601:643:8102:7c95:fd32:afff:8881:1f72) joined #forth 01:15:29 --- quit: mnemnion (Ping timeout: 255 seconds) 02:06:57 --- quit: mnemnia (Remote host closed the connection) 02:07:34 --- join: mnemnion (~mnemnion@2601:643:8102:7c95:fd32:afff:8881:1f72) joined #forth 02:11:47 --- quit: mnemnion (Ping timeout: 246 seconds) 02:35:02 --- join: Philbywhizz (~Philbywhi@101.165.138.244) joined #forth 02:53:40 --- nick: koz__ -> koz_ 02:58:46 --- join: smokeink (~smoke@59.53.67.231) joined #forth 04:26:50 --- quit: leaverite (Read error: Connection reset by peer) 04:28:29 --- join: leaverite (~Thunderbi@freebsd/user/wa5qjh) joined #forth 04:35:26 --- quit: leaverite (Remote host closed the connection) 04:35:26 --- quit: wa5qjh (Remote host closed the connection) 04:36:06 --- quit: dys (Ping timeout: 264 seconds) 04:38:29 --- quit: smokeink (Ping timeout: 240 seconds) 04:47:50 --- quit: qwebirc76266 (Ping timeout: 260 seconds) 05:00:49 --- quit: bedah (Ping timeout: 240 seconds) 05:08:41 --- part: Philbywhizz left #forth 05:13:11 --- join: bedah (~bedah@2a02:810d:243f:f584:912c:cb75:d372:1a14) joined #forth 05:17:45 --- join: smokeink (~smoke@221.7.252.115) joined #forth 05:49:29 --- quit: karswell (Ping timeout: 240 seconds) 07:20:52 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 07:20:53 --- quit: mnemnion (Remote host closed the connection) 07:21:30 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 07:25:44 --- quit: mnemnion (Ping timeout: 240 seconds) 07:40:01 --- join: Uniju (~frog_styl@cpe-74-78-4-232.mass.res.rr.com) joined #forth 08:33:53 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 08:37:56 --- quit: mnemnion (Ping timeout: 248 seconds) 08:48:17 --- join: dys (~dys@tmo-099-7.customers.d1-online.com) joined #forth 09:26:56 --- quit: smokeink (Ping timeout: 240 seconds) 09:36:14 --- quit: johnmark_ (Quit: Leaving) 09:40:09 --- join: karswell (~user@24.92.199.146.dyn.plus.net) joined #forth 09:46:13 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 09:50:29 --- quit: mnemnion (Ping timeout: 248 seconds) 10:44:32 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 14:04:15 --- join: MrBismuth (~ArcMrBism@2602:306:8325:a300:c801:d7f:77e1:92be) joined #forth 14:05:09 --- join: wa5qjh (~Thunderbi@freebsd/user/wa5qjh) joined #forth 14:07:06 --- quit: MrBusiness (Ping timeout: 246 seconds) 14:08:46 I don't quite understand this difference between compile time and run time 14:08:52 isn't it really all runtime? 14:11:37 compile time is when the word goes into the dictionary 14:11:46 runtime is when the code for the word is executed 14:12:44 ie, are you inside or outside of a : ; pair 14:15:35 --- nick: wa5qjh -> wa5qjh_ 14:16:02 --- join: wa5qjh (~quassel@175.158.225.198) joined #forth 14:16:02 --- quit: wa5qjh (Changing host) 14:16:02 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 14:35:06 That's confusing to me only a little bit, because from what I understand : is just a word itself 14:35:10 and so isn't ; 14:35:46 : changes the interpreter to compile mode (actually it calls ] and that does it) 14:35:57 as for ; - enter immediate words 14:36:44 immediate words are words that have runtime semantics, even if they're used in compilation mode 14:37:41 yeah I jotted down a bunch of useful things to look at: 14:37:42 https://hastebin.com/tohizijete.4th 14:37:45 ] is in there 14:39:29 but I thought I read that [ starts compile time 14:39:34 I don't see [ in there though 14:41:09 neither do I 14:41:39 ] starts compile time, [ switches back to immediate mode 14:42:12 this is because you generally use these inside of a word body to temporarily escape out to immediate mode 14:42:46 like : foo [ bar 23 + ] literal ; or something 14:45:18 damn I saw how : is defined the other day 14:45:25 onb some website 14:48:06 I think it's probably on my google results on my other laptop, I can't find it anywhere 14:53:34 I also found this: http://wiki.c2.com/?ForthSimplicity 14:53:41 bit different 14:53:57 https://github.com/mark4th/x4/blob/master/src/kernel/compile.s#L241 14:55:17 so is that like: 14:55:32 , CALL ] EXIT 14:55:32 ? 14:55:58 it doesn't use create? 14:56:21 head, ccall nest ] exit 14:56:26 his doesn't user create 14:56:30 mine does 14:56:34 I see 14:57:07 also, I'm not a huge fan of the r> r> 2drop implementation of [ 14:57:28 I played around with stuff like that once and found it caused more problems and is no simpler than just using a state variable 14:57:55 it makes it so that your [ only works in specific scenarios; you can't reliably compile it into other words 14:59:36 I got the one that I pasted from starting forth 14:59:44 oh 15:00:17 most of those are from there, some from others which means they may not all work together, but I was just collecting them into one place just for reference idea examples 15:04:40 just be aware that different implementations may do things differently; so one forth's [ might not work with another forth's compiler loop 15:05:13 right 15:05:17 well I'm looking at writing my own 15:05:35 and the compiler vs interpreter part is just a bit confusing 15:09:22 Oh I did find this: https://github.com/AlexandreAbreu/jonesforth/blob/master/jonesforth.S#L1869 15:11:17 so I assume in this version word puts the size and some pointer to the word it found onto the stack. time to see where that goes.. 15:11:51 --- join: johnmark_ (~johnmark@d53-64-202-137.nap.wideopenwest.com) joined #forth 15:12:35 this implementation uses KEY rather than looking at the TIB directly 16:38:25 --- quit: mnemnion (Remote host closed the connection) 16:42:05 --- quit: johnmark_ (Quit: Leaving) 16:43:12 --- quit: dys (Ping timeout: 246 seconds) 17:54:02 --- join: ryoshu (~kamil@netbsd/developer/kamil) joined #forth 17:54:06 hi 17:54:47 Is Forth combinable with C bindings? If so, what version? 17:54:54 Without libffi 17:57:37 I'm thinking whether there is a replacement for Lua's case, which natively integrates with C. 19:47:14 ryoshu: Have you looked at sockpuppet? 19:47:55 looking 19:48:00 https://github.com/rbsexton/sockpuppet 19:49:18 --- join: johnmark_ (~johnmark@d53-64-121-247.nap.wideopenwest.com) joined #forth 19:50:21 ryoshu: It's for embedded MPE but it should be totally doable to use it with other Forths as well. Robert Sexton gave talks about it at SVFIG and other events. 19:51:25 He uses sockpuppet with MPE forth professionally. 19:51:43 (he works at Apple) 19:52:34 I'm more targetting a UNIX system.. but looks like a good start 19:56:28 ryoshu: Are you writing your own forth or selecting an existing one? 19:58:56 I'm researching options. We use Lua in the NetBSD kernel and we wanted to get it for basic scripting of system utilities... however Lua developers are mostly www or video-game programmers, and nothing happened beyond adding it to the base. 19:59:40 I'm tempted to see whether Forth could replace it. 20:01:27 There is an ongoing work to script our kernel debugger with Forth... so why not the other parts of the system. 20:02:54 Or whether this is just the wrong target, use-case for this language. 20:04:07 ryoshu: I guess you may have looked at the openfirmware ui? http://wiki.laptop.org/go/Forth_Lessons I find the debugging words, introspection words, and device trees very agreeable. 20:05:45 This site is new to me. 20:06:11 ryoshu: It should be no problem to call C functions from forth. You could look at how cforth does it. 20:07:10 and forth-functions from C? 20:08:34 ryoshu: Yes, just preserve the ABI/calling convention. 20:09:13 I see. 20:09:27 So, is this sane to have Forth as a scripting OS language? 20:10:00 I expect that more Forth devs write OS-level software than Lua ones... (even if there are more Lua ones in general) 20:12:48 also of interest to your use case: https://stackoverflow.com/questions/16313007/forth-as-an-interactive-c-program-tester 20:12:48 ryoshu: What would be an example use case of the OS scripting language? 20:13:36 http://www.netbsd.org/~lneto/eurobsdcon14.pdf 20:14:44 Additionally I find development in Lua myself bit more difficult.. like dynamic types that after a typo just evaluate into 'nil'.. 20:19:14 And it doesn't match my taste with the syntax (I'm not alone).. 20:20:09 ryoshu: So I'm using forth for a very similar use case to the one you gave (packet filtering) -- only it's not network packet filtering, but a logic analyzer device for analyzing spi, i2c, microsd, etc packets. 20:21:46 I think this npf filtering is one out of only two real-life use-cases.. however both are stagnant in development.. looking for the other one. 20:23:17 https://www.bsdcan.org/2017/schedule/attachments/431_smherwig-sandbox-bsdcan2017-slides.pdf 20:23:22 ryoshu: compile time execution make parsing simple as explained in this comment https://www.reddit.com/r/Forth/comments/55b8ta/what_makes_immediate_mode_the_key_to_everything/d8bs6bq/ 20:24:35 but... 20:28:30 I will keep learning generic Forth now and see later. 20:28:33 I've been using parser combinators in forth to parse packets etc. I'd steer clear of the traditional string parsing approach and just write some parser combinators. They're simpler, cleaner, and you can mix whatever code you want together with the parser combinators. 20:29:16 I see, sounds good. 20:32:20 Scripting deals with the ad-hoc, unplanned side of computing. If forth is to be used as a scripting language it must be good at parsing. That was my requirment for using forth. 20:33:47 I see, thanks! 20:53:08 --- quit: Bunny351 (Ping timeout: 252 seconds) 21:01:09 ryoshu calling from assembly into C is pretty easy... if you understand how your C compiler creates binaries, it shouldn't be hard for a low level forth implementation to just call C functions. 21:01:47 the C calling convention is simple and fairly the same accross most compilers 21:01:51 --- join: MrBusiness3 (~ArcMrBism@2602:306:8325:a300:11b7:9a32:2fe3:1e96) joined #forth 21:02:49 yes, just C calling convention is fine 21:04:03 it's even possible if it were ELF you could call functions by name.. 21:04:12 with some extra code 21:05:00 --- quit: MrBismuth (Ping timeout: 246 seconds) 21:05:04 meaning actually looking for where the functions are at runtime 21:05:18 dlsym(3).. but perhaps not in the kernel 21:05:38 there is that 21:05:51 all of this enters the non portable world though 21:06:17 dlsym may be in the standard but that means nothing .. 21:24:31 --- join: Bunny351 (~Bunny351@p4FD2ECBC.dip0.t-ipconnect.de) joined #forth 21:50:02 --- join: dys (~dys@tmo-107-26.customers.d1-online.com) joined #forth 23:20:09 --- join: smokeink (~smoke@221.7.252.115) joined #forth 23:33:40 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 23:36:13 --- quit: smokeink (Ping timeout: 260 seconds) 23:36:23 --- quit: mnemnion (Remote host closed the connection) 23:40:27 --- join: mnemnia (~mnemnion@2601:643:8102:7c95:3562:9e59:362b:f995) joined #forth 23:59:59 --- log: ended forth/17.09.16