00:00:00 --- log: started forth/21.03.27 00:03:46 --- quit: dave0 (Quit: dave's not here) 01:32:47 --- quit: proteusguy (Remote host closed the connection) 02:07:53 nice concept veltas 02:11:44 Currently I'm "okay" with redefining same words across different files, but it's not safe, i.e. it leads to bugs if it's mixed up. But I think when I start using vocabularies or wordlists there won't be a problem? I still haven't looked much into them. Maybe even they are not a solution for hiding words across different files. 02:12:35 mark4: Why? 02:12:44 Ah, finally started using the return stack and it basically eliminated the need for variables in many places without making the code any harder to read. 02:12:57 Nice 02:13:16 I just use return stack where it makes code simpler, I know some people try to avoid it entirely 02:13:32 I think they're concerned about messing up backtraces or optimisation 02:15:11 inode: thanks 02:15:50 And the code to implement it is here, if you haven't seen it already https://raw.githubusercontent.com/Veltas/forth-lib/master/forth-lib/namespace.fs 02:16:08 Nothing too surprising there 02:16:55 Nice, I'll have a look. The use of CREATE...DOES> is still something I haven't looked into. 02:16:57 i've been playing with it a bit 02:17:49 the only thing i've noticed is that LOCAL: X in interpret mode doesn't give me 5 :) 02:19:31 inode: No of course not :P 02:19:42 Well I could fix that probably but I don't like state-aware stuff 02:21:42 just for fun i went down a rabbit hole of adding LOCAL:: as a NS-PREFIX2 to see what would happen, but i ended up factoring out NS-VOCAB's DOES> phrase into a PUSH-WORDLIST and then realised i needed a ?PUSH-WORDLIST to detect if the wl was already at the top of the search order, so i stopped 02:24:25 If I had a normal module I would probably define two namespaces, one named after the module and one in the module called LOCAL 02:26:03 so LOCAL:: did end up working, and worked in place of LOCAL: too, but i didn't like that any words out of the namespace were still accessable as, LOCAL:: "name", because the DOES> phrase was something like @ ?PUSH-WORDLIST PARSE-NAME EVALUATE 02:27:01 Oh PUSH-WORDLIST adds a wordlist to search order? 02:27:16 heh only if you make it yourself 02:27:36 I made a word once called FIRST-ORDER , thought I was being pretty funny too :P 02:28:41 i declared https://github.com/Veltas/forth-lib/blob/master/forth-lib/namespace.fs#L12 to #L17 (without the leading @) as PUSH-WORDLIST 02:32:00 inode: I have updated the files to make the prefix state-aware 02:32:12 i.e. you can see in example I can do LOCAL: X at interpreter 02:32:56 ah i see your STATE @ IF COMPILE, EXIT THEN now 02:33:45 I want to write a bigger example to demonstrate the power of this fully armed and operational library 02:35:05 inode: I don't fully understand what you're saying but can I guess that you've made it so you can just type "LOCAL" to push its wordlist onto search order? 02:35:19 So you just use e.g. LOCAL .... PREVIOUS ? 02:38:04 redid what i was trying to describe @ https://pastebin.com/3u97Ry7e 02:40:02 inode: Line 12, why not just SET-ORDER RDROP 02:41:50 didn't think of that, just wanted to get rid of what was there already 02:42:13 Okay inode I see what you're doing but I don't want to find stuff that's not in the namespace when I use the prefix 02:42:19 I would consider that a defect 02:43:04 that's EXACLTY why i said: 'i didn't like that any words out of the namespace were still accessable as, LOCAL:: "name","' 02:43:17 Oh right 02:43:42 Sorry I think I switch off when I get confused sometimes :P 02:43:56 I want this to act like an alternative of naming your words with an actual prefix in the name, that lets you just use the name with the right 'scope' 02:43:59 no problem, i have the same problem :) 02:44:42 You didn't suggest it but I actually like the idea that it pushes the wordlist 02:45:24 I've changed it to do that so I can just use "LOCAL ... PREVIOUS" to use the namespace without prefix 02:47:31 And pushed 02:47:34 the update to git 02:50:29 --- join: dave0 joined #forth 03:27:10 inode: It's time to upgrade your gforth 03:35:01 is there a 0.7.4 or 0.8 finally available? 03:36:23 i've seen the many daily snapshots of 0.7.9 03:36:40 but afaik 0.7.3 (now almost 7 years old) is the last "stable" release? 03:37:23 Hmm the Forth for Amstrad CPC doesn't have the word VALUE. I'll try to define it myself, but asking here first. 03:37:51 inode: https://www.complang.tuwien.ac.at/forth/gforth/Snapshots/ 03:38:26 I don't know about which was last 'stable' but they've done *loads* of work since the one that's on their website 03:38:39 They have only been doing recent releases on git and uploading them to that directory 03:39:07 I don't know why they don't advertise these new releases on their website, it's like they don't care if anyone uses gforth 03:40:41 neuro_sys: Probably not, it's a more recent word 03:40:57 Try to define it yourself and post the results, it's a good exercise 03:42:25 You'll probably need to add stuff like single-quote character literals too 03:45:35 i see the description of "Snapshots" is "Beta versions" 03:46:04 i guess they aren't comfortable enough to say they're ready to ship 03:47:23 At this point the core of the new releases are probably more stable than the last 'stable' release 03:47:26 which forth are you using, veltas? 03:47:42 I currently use gforth, SwiftForth, and pForth 03:47:45 --- quit: gravicappa (Ping timeout: 265 seconds) 03:48:11 SwiftForth demo anyway, which is very good, although it's missing some standard words 03:49:08 is that one of the limitations of the trial version? 03:50:08 I don't think so 03:50:34 As far as I know most of the words are available except the OOP stuff (who cares lol) 04:36:57 --- join: tech_exorcist joined #forth 05:12:12 --- join: f-a joined #forth 05:32:58 I wonder what 3DO used Forth for 05:35:26 did they use it? nice 05:38:54 I was wondering where I had heard "3DO" from and it seems they made published the later Might and Magic games 05:39:09 For anyone here who's heard of that series 05:40:08 --- quit: f-a (Ping timeout: 240 seconds) 05:40:42 they had a CD-ROM based console that i wished to find, but only ever saw in magazines 05:42:18 --- join: f-a joined #forth 05:45:58 i wonder if disassembling code from any 3DO ROM dumps would yield threaded code? 05:47:09 --- quit: mark4 (Remote host closed the connection) 05:47:27 http://www.softsynth.com/pforth/pf_ref.php#what-is 05:47:39 Under "The Origins of pForth" 05:47:58 "PForth began as a JSR threaded 68000 Forth called HForth that was used to support HMSL, the Hierarchical Music Specification Language. HMSL was a music experimentation language developed by Phil Burk, Larry Polansky and David Rosenboom while working at the Mills College Center for Contemporary Music." 05:48:09 "Phil moved from Mills to the 3DO Company where he ported the Forth kernel to 'C'. It was used extensively at 3DO as a tool for verifying ASIC design and for bringing up new hardware platforms. At 3DO, the Forth had to run on many systems including SUN, SGI, Macintosh, PC, Amiga, the 3DO ARM based Opera system, and the 3DO PowerPC based M2 system." 06:05:27 does pForth have something like CODE for writing words in assembly? 06:05:59 I don't think so, but it has the ability to use link external C functions easily, so you can get assembly in there too 06:06:40 It's an acceptable tradeoff, I think C forths are legitimate, I am incline to write one myself (pForth lacks a lot of core Forth features like doubles) 06:08:05 i agree, they have their place. i'm not very fond of gforth's c-library/c-function approach to C FFI though 06:08:38 I'm not fond of a lot in gforth other than it exists and has successfully implemented most of Forth200x 06:08:49 And also it has very good performance 06:12:15 i wanted to make syscalls lately (for SYS{_read,_write,_close,_socket,_connect,...}) and instead of calling them via a C library i felt it made more sense to call them directly instead, as gforth doesn't seem to expose syscall(2) 06:38:21 --- quit: dave0 (Quit: dave's not here) 06:38:30 I think you can call them directly with syscall, you'd have to look up how to call external C functions in gforth 06:38:53 Well I'm not sure, I just know I don't like how it works in gforth, seems way too complicated 07:01:58 --- join: mint_ joined #forth 07:02:08 --- nick: mint_ -> mark4 07:02:15 --- mode: ChanServ set +v mark4 07:12:49 --- join: nihilazo joined #forth 07:13:19 --- join: gravicappa joined #forth 08:38:05 --- quit: cmtptr (Quit: leaving) 08:47:16 --- join: cmtptr joined #forth 09:22:46 --- quit: mark4 (Remote host closed the connection) 09:39:48 --- quit: f-a (Ping timeout: 240 seconds) 09:40:09 Upgrading gforth to 0.7.9 somehow broke some calculations and numbers are all wrong now, but it doesn't crash. I'm curious to find out what strange assumption my code was making. :P It must be the hastily written fixed point math. 09:41:55 --- join: f-a joined #forth 09:42:07 Hmmm that's annoying 09:42:16 Hopefully you can track it down 10:02:20 --- join: mint_ joined #forth 10:02:44 --- nick: mint_ -> mark4 10:07:51 --- quit: mark4 (Remote host closed the connection) 10:20:03 --- quit: gravicappa (Ping timeout: 246 seconds) 10:22:37 --- join: gravicappa joined #forth 10:26:08 --- quit: MrMobius (Ping timeout: 245 seconds) 10:27:02 --- join: MrMobius joined #forth 10:27:49 maybe right-shifting signed values 10:32:16 --- join: Zarutian_HTC joined #forth 11:07:20 --- quit: nihilazo (Ping timeout: 240 seconds) 11:25:29 --- join: nihilazo joined #forth 11:28:57 --- quit: f-a (Remote host closed the connection) 11:30:31 --- quit: jess () 11:31:18 --- join: f-a joined #forth 11:34:50 Why fixed point? Doesn't that severely limit the range of values you can express? 11:35:12 FP, if you are aware of ulps and representation and approximation, seems quite predictable. 11:36:48 --- quit: f-a (Ping timeout: 240 seconds) 11:37:00 --- join: f-a joined #forth 11:46:21 are there any standard means of detecting endianness? something besides storing a multi-byte value and then fetching the first byte at the storage location to check whether it's the most significant or least significant byte maybe? 11:47:52 s/a multi-byte value/an integer value that is greater than 256/ 11:48:25 ^ 255 :( 11:51:48 also i'm not concerned about mixed endianness 11:59:10 what's wrong with that method? 12:00:01 siraben, fixed point can express more values in the same number of bits 12:01:20 cmtptr: I was referring to range 12:01:32 cmtptr: it works, but i'm wondering if there's any standard word i've missed that would do it for me instead 12:02:18 you have representatives evenly on a range of the reals, sure, but I like that in FP the representatives get spaces out more as you go away from 0 12:02:52 i'd need to study numerical analysis to really judge, I guess 12:04:00 siraben, in some applications that is undesirable 12:04:19 in fact (we've had this discussion a few times in this channel now), i actually can't think of any application where that would be desirable 12:04:56 but anyway, usually the reason to use fixed-point is because the platform doesn't have an fpu or fixed point is just faster 12:06:01 cmtptr: undesirable to lose accuracy as you go further out? 12:06:07 yeah 12:07:03 otherwise to be endianness-agnostic i guess i need to generate integer values in network-byte order (big endian) so maybe i should slice off bytes from most significant (assuming 32 bits, number 24 RSHIFT $FF AND) to least significant (number $FF AND) and write them out to variable storage in that order 12:08:50 inode, you know the endianness of your target platform at compile time. deliver the appropriate implementation then 12:11:27 cmtptr: it's to implement htons/htonl in forth, i'm hoping to avoid detecting endianness if possible 12:11:59 --- part: f-a left #forth 12:12:05 i know, and i'm saying you don't need to detect endianness because you know what platform you're targetting 12:12:36 c htons/htonl don't detect at runtime 12:16:59 well let's say i write a port number out to a field that equates to sockaddr_in.sin_port, if i'm on a little endian system like i386 i need to reverse the byte order for the kernel to accept it when i pass it to SYS_connect - if i'm on a big endian system no conversion is necessary - if i write a word to retrieve each byt eof the integer from most to least significant and write it in that order to the 12:17:05 appropriate address, it'll work on both systems without being explicitly told which order is required 12:19:43 first, yes i know what hton does. second, if you're just passing a value to the kernel, then that's in memory and you can write it in native order and the kernel will read it in native order - you only need to care about endianness when you're putting values on some medium that might be read by another cpu, like on disk or the network. third, you still haven't acknowledged the fact that in c, hton does 12:19:49 not detect endianness 12:27:29 i'm calling total bullshit on that 12:28:05 on a little endian system, pass the value of sin_port or sin_addr in the native byte order 12:28:10 it doesn't work 12:29:05 if this was the case, you wouldn't need hton{s,l} at all 12:30:55 hton is not for talking to your kernel 12:30:59 sorry you're confused about that 12:31:10 i'm passing values directly to a sycall 12:31:13 syscall* 12:31:30 i HAVE to generate sockaddr_in appropriately 12:31:50 i've literally just confirmed if i don't use network byte order then it doesn't work 12:33:41 from htons BSD man page: 12:33:44 On machines which have a byte order which is the same as the network 12:33:44 order, these routines are defined as macros that expand to the value of 12:33:44 their argument. 12:34:36 so a noop on big-endian 13:06:17 sorry, connect syscall does expect for the sin_port field to be in network order. i forgot about that 13:07:51 guessing because historically the unix kernel would just blindly copy it into a buffer without any manipulation, and so the abi just stuck 13:08:56 it's not because the kernel reads memory in network order (in fact if you look at the linux implementation of connect you'll see that when it needs to do something with the port number, it turns it back into host order with ntoh) 13:14:03 --- quit: gravicappa (Ping timeout: 260 seconds) 13:16:08 and sorry for that sort of response, i do agree that you usually don't have to care about adjusting the byte order and agreed about libc hton*() doing-the-right thing at run time because of how they were expanded by the preprocessor 13:18:21 now let's kiss and make up 13:19:33 heh 13:39:26 tell me something. If miss aligned cell fetching causes delay or traps then why have byte addressed memory? 13:46:46 To save memory storing stuff that isn't a word? 13:47:29 --- join: f-a joined #forth 13:47:54 You could make all bytes bitfields and that's effectively how they act in the way CPUs are built today, with special instructions to handle "8-bit aligned bitfields" we call bytes 13:48:04 And the addresses may as well be for a word offset rather than a byte offset 13:48:08 It's all conventiob 13:48:10 convention* 13:48:12 there was an isa that cheaply extracted any sized bitfield from any offset into a cell 13:48:25 PowerPC can do it nicely 13:48:31 I'm sure others can too 13:48:54 --- part: f-a left #forth 13:49:26 It's quite arbitrary, it's all convention. Once upon a time we really did care about bytes or bytes were all that could be loaded at a time. These days the cache can be designed to optimise for any size and RAM sends like 64 bytes at a time 13:52:31 ram is the new disk while cache is the new wram 13:53:08 We just have way more levels than we used to 13:54:10 We used to have exactly 3: register, RAM, storage. Now registers aren't even real, even RISC CPUs have multiple copies of each register for pipelining. X86 is secretly using a different arch under the hood and optimising your code 13:54:27 one isa feature I have not seen in todays isas is the tlb cam being mapped into kernel memory address space 13:55:24 Whether it's in memory or accessed via an SPR is kind of irrelevant IMO 13:55:33 was on some sort of m68k variant 13:55:49 That's probably because the TLB was on a separate chip 13:56:43 it meant that process switching did not incurr the usual tlb flush and page table rewalk penalty 13:57:41 the process control block got a big bigger though 13:59:15 upon process context switch the tlb state got blitted out and the next process tlb got blitted in 14:02:37 the blitter was used as an dma accellerator 14:02:39 --- quit: tech_exorcist (Remote host closed the connection) 14:02:57 --- join: tech_exorcist joined #forth 15:00:01 Somehow I resisted getting involved in the fixed/float argument today 15:00:19 Whatever floats your boat :P 15:00:44 Just make sure it's fixed before you release :P 15:41:25 https://gist.githubusercontent.com/neuro-sys/7512e1179b95db34c8d6431f2e0f5558/raw/7ab4417d5d3461a77dad0351fbc87e89fdc957e6/gforth-floats.txt 15:41:56 I was using a non standard (and undocumented alias?) word: fmod which seems to behave differently across the two versions of gforth. 16:06:14 I fixed my code, and 0.7.9 runs _significantly_ faster 16:14:50 Nice 16:15:30 neuro_sys: You'd never guess that the gforth devs want anyone else to use that new code though 17:15:35 --- join: j joined #forth 17:20:50 --- nick: j -> jess 17:34:38 --- quit: inode () 17:47:07 --- quit: tech_exorcist (Quit: tech_exorcist) 18:00:05 --- quit: Zarutian_HTC (Remote host closed the connection) 18:01:37 --- join: Zarutian_HTC joined #forth 18:41:51 --- quit: proteus-guy (Remote host closed the connection) 18:48:46 --- join: dave0 joined #forth 18:50:07 --- join: boru` joined #forth 18:50:10 --- quit: boru (Disconnected by services) 18:50:12 --- nick: boru` -> boru 18:54:21 --- join: mark4 joined #forth 19:28:00 --- quit: nihilazo (Ping timeout: 240 seconds) 19:55:48 --- quit: sts-q (Ping timeout: 240 seconds) 19:55:48 --- quit: Zarutian_HTC (Read error: Connection reset by peer) 19:55:53 --- join: Zarutian_HTC1 joined #forth 20:06:55 --- join: sts-q joined #forth 20:46:54 --- quit: dave0 (Quit: dave's not here) 20:57:47 mark4: do you use vocabularies? If so, how do you cope with markers / forgetting when a lot of vocabularly activity is involved? Do you store the current state of every vocabulary in the marker in some way? 22:58:04 --- log: started forth/21.03.27 22:58:04 --- join: clog joined #forth 22:58:04 --- topic: 'Forth Programming | do drop >in | logged by clog at http://bit.ly/91toWN backup at http://forthworks.com/forth/irc-logs/ | If you have two (or more) stacks and speak RPN then you're welcome here! | https://github.com/mark4th' 22:58:04 --- topic: set by mark4!~mark4@cpe-75-191-74-68.triad.res.rr.com on [Sun Feb 28 11:55:01 2021] 22:58:04 --- names: list (clog gravicappa sts-q Zarutian_HTC1 mark4 boru jess MrMobius cmtptr Keshl rixard lispmacs klys crest_ jedb djinni Lord_Nightmare Kumool cp- shmorgle rprimus X-Scale lispmacs[work] dys jimt[m] patrickg siraben dddddd jyf ecraven pareidolia xybre bluekelp veltas phadthai joe9 cantstanya rann ovf dnm lonjil2 astrid krjt mstevens a3f jn__ fiddlerwoaroof _whitelogger +KipIngram kiedtl @crc tolja tabemann mjl nitrix koisoke_ APic rpcope Vedran neuro_sys dzho spoofer) 22:58:04 --- names: list (TangentDelta remexre guan xek_ wineroots ornxka) 23:52:56 --- join: dave0 joined #forth 23:59:59 --- log: ended forth/21.03.27