00:00:00 --- log: started forth/18.12.01 00:10:17 --- quit: pierpal (Read error: Connection reset by peer) 00:10:32 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 00:11:23 --- quit: pierpal (Read error: Connection reset by peer) 00:11:44 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 00:16:06 --- join: jedb (jedb@gateway/vpn/mullvad/x-cpmdeqrwxmyalhll) joined #forth 00:16:49 --- quit: pierpal (Ping timeout: 268 seconds) 00:55:00 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 01:02:27 --- quit: pierpal (Ping timeout: 268 seconds) 01:13:17 --- join: john_cephalopoda (~john@unaffiliated/john-cephalopoda/x-6407167) joined #forth 01:14:21 --- quit: wa5qjh (Remote host closed the connection) 01:16:17 --- join: wa5qjh (~quassel@175.158.225.207) joined #forth 01:16:17 --- quit: wa5qjh (Changing host) 01:16:17 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 01:17:21 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 01:21:22 --- quit: pierpal (Ping timeout: 244 seconds) 01:27:28 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 01:31:58 --- quit: pierpal (Ping timeout: 250 seconds) 01:33:55 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 01:38:13 --- quit: pierpal (Ping timeout: 246 seconds) 01:40:46 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 01:44:52 --- quit: pierpal (Ping timeout: 246 seconds) 01:56:17 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 02:03:36 --- quit: ashirase (Ping timeout: 250 seconds) 02:14:49 --- quit: pierpal (Ping timeout: 240 seconds) 02:17:08 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 02:21:40 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 02:28:23 --- quit: pierpal (Ping timeout: 246 seconds) 02:30:38 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 02:37:49 --- quit: clog (Ping timeout: 240 seconds) 02:37:49 --- log: stopped forth/18.12.01 02:37:55 --- log: started forth/18.12.01 02:37:55 --- join: clog (~nef@bespin.org) joined #forth 02:37:55 --- topic: 'Forth Programming | logged by clog at http://bit.ly/91toWN | If you have two (or more) stacks and speak RPN then you're welcome here! | https://github.com/mark4th' 02:37:55 --- topic: set by proteusguy!~proteus-g@cm-134-196-84-89.revip18.asianet.co.th on [Sun Mar 18 08:48:16 2018] 02:37:55 --- names: list (clog pierpal ashirase wa5qjh john_cephalopoda jedb MrMobius tabemann X-Scale rdrop-exit mark4 dave0 dys @crc dave9 carc WilhelmVonWeiner rann libertas jackdaniel groovy2shoes Guest13462 Zarutian jimt[m] pointfree[m] siraben bb010g nighty- Keshl Lord_Nightmare amuck lonjil nerfur reepca moony rpcope Heretic sigjuice ttmrichter phadthai cratuki +KipIngram dne zy]x[yz jhei ovf diginet2 irsol FatalNIX jn__ malyn Labu lchvdlch djinni izabera cheater mstevens) 02:37:55 --- names: list (pointfree catern APic ecraven +bluekelp vxe yunfan rprimus C-Keen newcup koisoke dzho) 02:40:30 --- join: [1]MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 02:43:28 --- quit: MrMobius (Ping timeout: 250 seconds) 02:43:29 --- nick: [1]MrMobius -> MrMobius 03:13:35 --- quit: pierpal (Read error: Connection reset by peer) 04:05:26 Good evening Forthwrights :) 04:16:47 Just downloaded the manuals for the Hector HRX (1984), hope my French is still up to it 04:28:41 --- join: leaverite (~quassel@freebsd/user/wa5qjh) joined #forth 04:29:22 --- quit: wa5qjh (Remote host closed the connection) 04:38:32 One of the user manuals is a 270 page Forth book, pretty cool. 04:50:28 --- quit: leaverite (Remote host closed the connection) 05:03:36 siraben: very cool 05:04:08 Chuck describes a really simple line editor in his first book 05:05:32 Also, you could have TITLE take (c-addr n --) so you can replace the body of DELETE-TITLE with `S" ---- DELETE ----" 16 TITLE` 05:05:45 then the output ." just becomes TYPE 05:38:26 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 06:16:56 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 06:58:34 --- quit: rdrop-exit (Quit: Lost terminal) 08:50:04 Yeah I need to work on my faceting 08:50:09 Factoring 08:50:20 Insert mode is a little tricky 09:05:52 why's that? 09:05:58 I would imagine it as a KEY loop 09:13:57 --- quit: dave0 (Quit: dave's not here) 10:05:17 --- quit: phadthai (Read error: Connection reset by peer) 10:19:24 --- join: [1]MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 10:23:00 --- quit: MrMobius (Ping timeout: 268 seconds) 10:23:00 --- nick: [1]MrMobius -> MrMobius 10:56:18 --- quit: pierpal (Ping timeout: 268 seconds) 11:03:13 hey guys 11:04:10 * tabemann has implemented string escapes in Forth 11:16:37 tabemann: you mean the \x00 and such stuff? 11:16:52 yes 11:17:20 they're optional, though - you have to use s\" c\" .\" .\( to get them 11:18:02 so you support \xXX \uXXXX \oOO \n \b and all that jazz? 11:18:27 not \uXXXX or \oOOO at the moment 11:18:31 (never seen the octal one used anywhere) 11:18:59 but \xXX and a pile of different things like \a \b \t \n \r and so on 11:19:26 I take that you have a jump-table/switch somewhere in there that makes it relatively easy to add, no? 11:19:34 yes 11:19:39 a big case statement 11:20:28 you publish this code somewhere? 11:20:38 it's on github 11:20:46 search for attoforth on google, you'll find it 11:21:29 (it's not really a small forth, but I named it attoforth because nothing else out there, according to google, used that name) 11:22:21 the escape code is under src/forth/escape.fs 11:37:15 hmm 11:37:32 I should implement a sockets API for attoforth 12:08:56 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 12:27:29 --- quit: pierpal (Quit: Poof) 12:27:48 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 13:00:21 tabemann: Oh, that sounds nice. Also a graphics API. 13:00:31 Gotta have games in attoforth :D 13:07:08 --- join: ncv (~neceve@2a00:23c5:341b:d800:e144:9e2b:a867:7791) joined #forth 13:07:09 --- quit: ncv (Changing host) 13:07:09 --- join: ncv (~neceve@unaffiliated/neceve) joined #forth 13:18:09 --- join: wa5qjh (~quassel@175.158.225.202) joined #forth 13:18:10 --- quit: wa5qjh (Changing host) 13:18:10 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 13:33:32 tabemann: Have you got documentation for attoforth somewhere? Most functions look ANS, but the stuff in src/forth and examples/ is totally uncommented and I couldn't find out what most of it is doing yet.. 14:05:51 tabemann: Also, why are you freeing all kinds of structs when af_global_init() fails, when you call abort() afterward anyway? 14:09:15 back 14:09:54 the reason for freeing everything in af_global_init() fails is that, theoretically, this could be controlled by some other program, and it'd fail in some fashion other than calling abort() 14:10:20 that's why I've got that big af_global_t that gets passed around rather than just making th ose things globals 14:11:52 the stuff in src/forth is stuff like condition variables, channels, bounded channels, escaped strings, a lighter-weight tracer than the main builtin tracer, a profiler, some development tools to dump compiled words and a list of words 14:12:15 and no, there's no documentation - I should write some 14:12:38 there's a lot of non-ANS stuff in there 14:12:47 such as the multitasking system and IO system 14:13:18 brb - gonna head over to my local coffee shop before the street gets blocked off for the parade 14:17:52 --- quit: tabemann (Ping timeout: 268 seconds) 14:25:37 --- join: tabemann (~tabemann@24.196.100.126) joined #forth 14:25:40 back 14:29:43 * Zarutian notes that it is the one hundred year aniversary of the independence of Iceland today. 14:32:02 I wonder what the best way to write documentation on Github is - random .md files, or a full github.io site? 14:34:37 docs folder with .txt or .md files in it 14:35:05 but yeah, I've got a lot of stuff to document 14:35:11 much of it is basically Forth 2012 14:35:23 but there's a lot of stuff that is completely nonstandard 14:39:03 x4 is not ans 14:39:08 or the arm port t4 14:41:55 attoforth is neither a superset nor a subset of ANS 14:42:00 tabemann: I think when people look at attoforth, they probably already know the basics of forth. 14:42:21 the stuff I'd document is the very nonstandard stuff 14:42:30 the ans forth standard does not describe the forth language but a language of the same name. 14:42:36 - chuck moore 14:42:53 Explaining what functions exist, what they do and what parameters they take would be enough. 14:43:16 You could even generate docs automatically by adding source comments in a standard format. 14:43:21 yeah, that's what I was thinking 14:44:29 except there'd have to be comments in standalone source files, comments in the embedded forth source code (which is one big C string), and comments in the prim.c file (because there's stuff in there that'd need documentation, like the IO system) 14:45:38 I'll start with the standalone source files 14:45:41 tabemann: Is there no way to make the embedded forth a separate file and generate a C source file from it? 14:45:55 john_cephalopoda: that is a possibility 14:46:14 Then only prim.c would need documentation in some form. 14:46:24 The rest could be automatically generated from source. 14:46:58 a lot of the IO system stuff is not stuff that most people would need anyways 14:47:20 but rather it provides primitives for building IO functions that the user'd actually use 14:47:50 there is a problem, though 14:48:12 when the embedded source code starts executing, comments are not allowed 14:48:31 because comments are only implemented witin the embedded source code 14:50:36 (at the time the embedded source code starts executing, attoforth is really not a functioning source system - hence why the embedded source code is embedded - rather it needs the embedded source code to bootstrap itself into a functioning state) 14:50:57 s/source/Forth 14:51:44 I'll start with writing docs for the stuff in src/forth 14:52:36 --- quit: mark4 (Quit: Leaving) 15:12:27 --- join: phadthai (mmondor@ginseng.pulsar-zone.net) joined #forth 15:17:29 --- quit: ashirase (Quit: ZNC - http://znc.in) 15:59:05 --- quit: wa5qjh (Remote host closed the connection) 16:03:31 mark4: LOL 16:04:01 LOL LOL LOL 16:04:21 Love yourself to the same degree Chuck hates ANS, and you'll be eternally happy 16:05:23 --- join: TheCephalopod (~john@unaffiliated/john-cephalopoda/x-6407167) joined #forth 16:07:18 --- quit: tabemann (Ping timeout: 250 seconds) 16:09:26 --- quit: john_cephalopoda (Ping timeout: 272 seconds) 16:14:13 --- join: rdrop-exit (~markwilli@112.201.164.82) joined #forth 16:26:51 --- quit: jedb (Ping timeout: 246 seconds) 16:28:32 --- join: tabemann (~tabemann@rrcs-162-155-170-75.central.biz.rr.com) joined #forth 16:28:33 --- join: [1]MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 16:31:46 --- quit: MrMobius (Ping timeout: 268 seconds) 16:31:46 --- nick: [1]MrMobius -> MrMobius 16:39:01 I've created some documentation for Attoforth 16:39:10 could someone take a look at it 16:48:25 --- join: jedb (jedb@gateway/vpn/mullvad/x-itikerpkzwcvjtgi) joined #forth 16:51:56 --- quit: crc (Remote host closed the connection) 17:19:23 --- join: crc (~crc@li782-252.members.linode.com) joined #forth 17:19:34 --- mode: ChanServ set +v crc 17:19:41 --- mode: ChanServ set +o crc 17:35:17 --- quit: tabemann (Ping timeout: 268 seconds) 17:43:23 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 17:43:45 --- quit: TheCephalopod (Quit: Trees can see into your soul.) 17:44:25 --- quit: wa5qjh (Remote host closed the connection) 17:57:22 --- quit: Zarutian (Ping timeout: 250 seconds) 18:00:39 --- join: Zarutian (~zarutian@173-133-17-89.fiber.hringdu.is) joined #forth 18:07:58 --- join: tabemann (~tabemann@2602:30a:c0d3:1890:e076:b2ce:d7a5:84d9) joined #forth 18:12:32 --- quit: Zarutian (Ping timeout: 250 seconds) 18:21:41 --- quit: ncv (Remote host closed the connection) 18:31:47 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 18:47:40 --- quit: irsol (Ping timeout: 252 seconds) 18:48:56 --- join: irsol (~irsol@unaffiliated/contempt) joined #forth 18:54:59 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 18:56:35 --- quit: ashirase (Client Quit) 19:11:42 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 19:34:50 --- quit: ashirase (Quit: ZNC - http://znc.in) 20:17:37 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 20:30:03 --- quit: ashirase (Quit: ZNC - http://znc.in) 21:22:02 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 21:27:55 --- quit: pierpal (Quit: Poof) 21:28:13 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 21:29:39 okay, now my Forth is a bit more documented 21:29:46 --- join: dave0 (~dave0@47.44-27-211.dynamic.dsl.syd.iprimus.net.au) joined #forth 21:29:52 hey dave 21:30:05 hi tabemann 21:31:16 take a look at the documentation for attoforth - does it have a sufficient amount of detail (note that it is still very incomplete - I still need to document IO)?: https://github.com/tabemann/attoforth/blob/master/doc 21:45:25 tabemann: which file should i start with? 21:45:50 probably the most extensive one is task.md 21:46:58 toilet break 21:49:25 --- quit: pierpal (Read error: Connection reset by peer) 22:00:47 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 22:04:49 --- quit: pierpal (Ping timeout: 240 seconds) 22:10:27 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 22:17:33 --- quit: MrMobius (Ping timeout: 246 seconds) 22:21:19 --- quit: pierpal (Read error: Connection reset by peer) 22:21:37 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 22:22:18 is attoforth a bare-metal forth? 22:23:00 did you write all that task code?? looks like a lot of work 22:23:49 --- quit: pierpal (Read error: Connection reset by peer) 22:30:32 it looks like it's all there 22:31:07 maybe you could put in a line or two about How you profile or trace a task 22:31:29 like "increment a counter on every ENTER or EXIT" or something 22:35:10 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 22:42:23 back 22:42:44 attoforth isn't a bare-metal forth 22:42:51 it's a forth for posix systems 22:43:50 currently it only supports 64-bit, but it's designed so it could be easily modified to support 32-bit systems 22:45:22 tasks themselves are pretty simple, it's all just round robin based on a per-word-executed countdown timer, along with some support for saving cycles when a task is put to sleep so waiting for locks and like doesn't hurt a task's overall performance 22:45:52 the hard part was implementing things like locks and condition variables 22:46:10 which are necessary because it's preemptive rather than cooperative 22:49:21 tabemann: did you build it on top of pthreads ? 22:52:36 also does the 64 bit version support double numbers? like 128 bit? 22:55:04 i thought 128 bit numbers are a bit excessive and complicated 23:03:22 yes 23:03:39 i'm looking through the code :-) 23:03:42 dave0: it uses two pthreads - one for the main thread, one for the IO manager 23:03:52 but the tasks themselves don't use pthreads 23:04:01 but are all multiplexed on top of the main pthread 23:04:37 the reason for using pthreads at all is so that I can use poll() to manage IO, and that requires having one pthread for IO all to itself 23:05:19 oh - I just put up documentation for the IO manager 23:05:59 ok i'll look 23:06:04 there's some stuff in there that's weird - for instance, getting the (monotonic) time and sleeping are actually linked in with the IO manager 23:06:28 there is a SLEEP word under task.md, but that actually uses IO-GET-MONOTONIC-TIME and IO-SLEEP to do the dirty work 23:07:11 for some reason I haven't felt the need to implement code to get the time-on-the-clock time, hence why I haven't implemented it yet 23:08:03 cool you use async io 23:08:20 note that as for double numbers, the real reason why I implemented them is because I'm planning on scaling down to 32-bit, where double numbers will be more important 23:08:44 however I probably wouldn't've implemented them all in 64-bit were it not for gcc having native support for 128-bit numbers 23:10:49 I did implement the basic Forth 2012 IO words, I should note - most of the time one isn't going to be using primitive IO for things like accessing files 23:11:13 as it is far too low level for most purposes 23:11:26 oh 23:12:54 however, primitive IO would be useful for implementing things like KEY?, where nonblocking operations are needed 23:15:32 also, at some point I should implement sockets, which would mean extending primitive IO 23:15:34 i wrote KEY? in c, it uses some state and it's tricky to follow 23:16:35 KEY? and KEY interact 23:17:01 what I'd do is call IO-READ-NONBLOCK to fetch a character, and if a character is fetched, put it in a queue so it can be read with KEY 23:17:49 currently I don't have KEY? 23:17:57 that sounds similar to what i coded except the "queue" is only 1 character long 23:18:24 tabemann: POSIX has termios that makes it easier to do non-blocking 23:19:00 yeah, I'm using termios to control the terminal, so I can use it at a more primitive level than the default 23:19:42 I'd probably use a bounded channel for KEY?/KEY 23:20:32 wait no 23:21:02 because I'd want it to throw away values after a certain point, without blocking on enqueueing 23:21:23 I'd probably just use a circular buffer with blocking only on dequeueing 23:21:34 it's surprisingly tricky heh 23:22:24 the thing is neither channels nor bounded channels, as I've implemented them, are suitable is that neither throw away values when the buffer becomes too full 23:22:54 rather channels expand forever until you run out of RAM and bounded channels block until you remove items from them 23:24:32 tabemann: check out: http://termbin.com/446s 23:25:06 IOpoll => key? IOgetc => key IOputc => emit 23:25:26 it's at the bottom 23:25:48 it's basically a 1 character queue 23:26:10 the state is tricky to follow 23:27:57 oh I get it 23:28:40 you're using C standard library calls 23:29:00 i tried hard to minimize the number of system calls 23:29:54 * tabemann uses C standard library calls in the core of attoforth for things like parsing and print floating point numbers, but within the forth portion of attoforth most of those things get replaced with forth implementations 23:30:00 yep, that's to interface with the OS 23:30:44 probably the only thing I don't replace are the floating point parse/print calls, just because I don't know enough about parsing or printing floating point numbers 23:31:05 yeah, I interface with the OS solely through POSIX calls 23:31:46 tabemann: jonesforth, which i followed, used linux system calls directly, so it doesn't work on NetBSD 23:32:13 yeah, I rather use the libc calls 23:32:26 yep i decided to link with libc 23:32:44 KipIngram disagrees :-) 23:32:49 and I don't use anything non-POSIX 23:33:17 so it, as written, should work on any 64-bit POSIX systems that use gcc (because of the 128-bit numbers) 23:33:20 tabemann: feel free to use that code i pasted 23:33:52 which means it might not work under FreeBSD since FreeBSD IIRC no longer uses gcc 23:33:58 tabemann: the signal stuff is very machine dependent, but i wanted to catch exceptions to do a backtrace in forth 23:34:06 oh it doesn't ? 23:34:23 IIRC it now uses clang 23:34:38 i thought clang was gcc-compatible 23:35:16 oh, I checked 23:35:25 clang does support __int128 23:35:32 ah cool 23:37:08 I thought of trapping SIGSEGV etc, but decided against it because in most cases the runtime would be in an essentially unusable state, such that it'd probably just crash again shortly after recovering 23:37:53 tabemann: gforth catches exceptions and prints a backtrace in forth 23:38:49 so i copied it :-) 23:38:59 what I implemented is a global tracer, such that if it crashes, I can run attoforth in debug mode with the tracer on, and execute the offending code again, and see everything that happens right up until the moment that it crashes 23:39:10 which has proved to be very useful when debugging 23:39:22 aaahh 23:39:41 yeah the more help debugging the nicer it is 23:40:03 i think Forth does it way better than c 23:40:08 it's only available in debug mode, which needs to be turned on by recompiling first, because just being available incurs a performance hit 23:41:13 i'm too much of a Forth newbie.. most of my crashes are from getting ! backwards... instead of n addr ! i have addr n ! and it crashes 23:41:47 i expect that will change as i practise writing more code 23:42:03 in normal mode there is another tracer available, but it has to be specifically enabled, and then only instruments words following its being enabled, but it doesn't have as much of a performance hit (because it only selectively traces things and it isn't baked into the core runtime such that it executes extra code for each individual word executed) 23:43:43 also, you have to be careful when using the global tracer, because if you enable it at the wrong time, say when you're parsing and compiling forth code, you'll just get insane amounts of output that is worthless, and it will take forever because it literally outputs a single line for every single forth word executed 23:45:17 does it work like trace ? 23:45:19 also, the global tracer renders terminal input useless, so you have to write code to turn it off automatically, unless you know attoforth will crash and you're just trying to find the point where it crashes 23:45:38 no, it's like: true global-trace 23:45:50 ah 23:45:53 or if you want to only trace in the current task: true this-task task-trace 23:47:12 ok i'm going to read your doc/primitive_io.md now 23:47:51 async io is so nice 23:47:59 unix really doesn't do it right 23:48:28 in unix you have to build your whole program around select() or poll() or otherwise use pthreads 23:48:29 brb 23:51:50 or do what I did and put your main code in one or more pthreads, and then have a dedicated pthread that handles IO using select() or poll() 23:59:59 --- log: ended forth/18.12.01