00:00:00 --- log: started forth/19.03.05 00:02:48 --- nick: Keshl_ -> Keshl 00:51:34 --- join: jedb_ (~jedb@176.113.74.187) joined #forth 00:51:52 --- quit: jedb (Ping timeout: 255 seconds) 00:52:04 --- nick: jedb_ -> jedb 01:00:54 --- join: [1]MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 01:04:30 --- quit: MrMobius (Ping timeout: 268 seconds) 01:04:30 --- nick: [1]MrMobius -> MrMobius 01:34:10 --- quit: gravicappa (Ping timeout: 255 seconds) 02:03:05 --- quit: ashirase (Ping timeout: 250 seconds) 02:22:57 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 02:50:29 Good evening Forthwrights :) 03:01:39 --- join: newuser|9980 (9eb5789b@gateway/web/cgi-irc/kiwiirc.com/ip.158.181.120.155) joined #forth 03:07:28 --- join: gravicappa (~gravicapp@h109-187-217-49.dyn.bashtel.ru) joined #forth 03:11:49 --- quit: newuser|9980 (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) 03:11:59 --- join: newuser|9980 (9eb5789b@gateway/web/cgi-irc/kiwiirc.com/ip.158.181.120.155) joined #forth 03:12:59 --- quit: newuser|9980 (Client Quit) 04:04:30 bit late but hey mate 04:08:23 Hi Wilhelm 04:10:44 how are ya 04:11:36 Ok, been packing for a trip. 04:12:16 Yourself? 04:13:42 i'm alright, trying to figure out good posture and optimise my keybinds 04:14:02 I can feel some kind of rsi developing 04:14:25 Ouch, I've been lucky so far on that front. 04:14:54 working on designing a programmatic solution to reducing finger travel. 04:15:10 inspired by colorforth. 04:15:39 think i might stop using the shift key too often too. 04:16:18 Cool, there's that alternative to Dvorak, forgot the name. 04:18:28 <`presiden> WilhelmVonWeiner, maybe try new keyboard? 04:19:40 i am 04:20:03 i've bought two split keyboards trying one out at work right now 04:20:18 Unfortunately my host Forth assumes a plain vanilla terminal so I don't have much flexibility keyboard-wise 04:21:57 hopefully whatever i end up writing will work through xorg, so it's invisible to programs 04:23:48 I shouldn't say "unfortunately" since I designed it that way 04:25:14 https://www.keyboardco.com/keyboard/ergo-pro-quiet-pc-ergonomic-keyboards.asp 04:25:30 what i'm using at the moment 04:27:10 --- quit: djinni_ (Quit: Leaving) 04:27:54 --- join: xek (~xek@public-gprs409034.centertel.pl) joined #forth 04:30:51 --- join: djinni (~djinni@68.ip-149-56-14.net) joined #forth 04:31:21 --- quit: proteusguy (Remote host closed the connection) 04:31:41 Split keyboards feel awkward to me. 04:33:08 bit weird to get used to so far... 04:36:12 I'd like to try an ortholinear next, but I'm betting that won't work for me either. 04:37:37 brb, lunch. 04:37:56 Bon appetit 04:39:42 --- join: proteusguy (~proteusgu@cm-58-10-208-131.revip7.asianet.co.th) joined #forth 04:39:42 --- mode: ChanServ set +v proteusguy 04:42:49 --- quit: proteusguy (Remote host closed the connection) 04:44:02 Good Noon Tide to yo all Forthknights! 04:45:46 Hi Zarutian 05:25:00 --- quit: cantstanya (Remote host closed the connection) 05:31:15 --- join: cantstanya (~chatting@gateway/tor-sasl/cantstanya) joined #forth 05:42:18 --- join: newuser|9980 (9eb5789b@gateway/web/cgi-irc/kiwiirc.com/ip.158.181.120.155) joined #forth 05:47:50 --- quit: rdrop-exit (Quit: Lost terminal) 05:53:18 --- quit: newuser|9980 (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) 06:49:08 * Zarutian sees the news about that Intel SPOILER cpu thing. 06:49:40 new intel cpus give away that snape kills dumbledore? 07:05:21 hum? 07:05:30 none of this is surprising, is it? 07:14:51 <`presiden> New Intel CPU actually Luke's father? 07:16:30 --- quit: tabemann (Ping timeout: 240 seconds) 07:20:39 --- quit: nighty- (Quit: Disappears in a puff of smoke) 07:59:25 --- quit: xek (Read error: Connection reset by peer) 07:59:35 --- join: xek (~xek@public-gprs409034.centertel.pl) joined #forth 09:09:03 one of the best things i bought last year was my thread ripper - a couple of weeks before thread ripper 2 was announced :( - still, awesome box and worth every penny (i screwed up and ordered a case which is a bit of a monster :)) 09:10:33 --- join: xek_ (~xek@user-94-254-224-236.play-internet.pl) joined #forth 09:10:40 crazy specs though - 16 cores/32 threads, 64GB and a fairly high spec'd nvidia gpu - should keep me going for a while 09:12:57 --- quit: xek (Ping timeout: 250 seconds) 09:42:42 --- quit: xek_ (Remote host closed the connection) 09:43:11 --- join: xek_ (~xek@user-94-254-224-236.play-internet.pl) joined #forth 09:56:35 --- join: bandrami (~weldon@wsip-70-183-4-70.dc.dc.cox.net) joined #forth 09:57:10 --- quit: PoppaVic (Ping timeout: 240 seconds) 09:58:49 Editor seems pretty much complete - it works very nicely. I do need to connect keystrokes to my cut, copy, and paste operation, but the operations themselves are already coded in. 10:09:34 --- join: PoppaVic (~PoppaVic@unaffiliated/poppavic) joined #forth 10:17:49 --- quit: bandrami (Quit: Leaving) 10:34:54 --- quit: xek_ (Remote host closed the connection) 10:35:27 hm, how do i design this metacompiler 10:36:07 --- join: xek (~xek@user-94-254-224-236.play-internet.pl) joined #forth 10:40:19 haphazardly 10:45:51 i want it to be written in python, for ease of use 10:46:11 how does the language dictate the ease of use? 10:53:56 because it is meant to be integrated in other programs 10:54:05 python programs 10:54:10 o 10:54:23 so carrying a dependency on gforth would be not so good 10:54:41 carrying a dependency on gforth is never good 10:56:55 so i could either compile to my target code, and interpret it when i execute words during parsing 10:57:31 or i could compile it to python datastructures and later translate the threads to my target architecture 11:07:55 --- quit: gravicappa (Ping timeout: 245 seconds) 11:53:31 corecode: it's quite easy to write native bindings for python (i've done this in the past for c++, but i'd guess it'd probably be somewhat easy to do in c too) 11:55:10 i used boost::python for my c++ stuff - was suprisingly nice - very low maintenance 11:55:40 --- join: groovy2shoes (~groovy2sh@unaffiliated/groovebot) joined #forth 11:58:05 rdrop-exit: Maybe Colemak? I use a TypeMatrix 2030 with a Workman layout http://www.typematrix.com/ https://workmanlayout.org/ The Workman layout is particularly good for non-staggered matrix keyboards. 12:03:47 --- quit: xek (Remote host closed the connection) 12:03:58 --- join: xek (~xek@user-94-254-224-236.play-internet.pl) joined #forth 12:50:45 I'm averse to workman simply because I have a friend who uses it and I ridiculed him for even trying 12:51:33 between friends, but I'm far too prideful nonetheless 12:59:41 * crc likes dvorak 13:03:37 dvorak is for grandpas 13:03:41 * WilhelmVonWeiner rollerskates away 13:05:29 haha 13:10:03 I use a keyboard layout that is AZERTY, but the whole layout is mirrored and the top and middle row are swapped. 13:10:35 a what 13:10:49 buncha hipsters 13:10:50 Just kidding, that would be unusable. :D 13:11:04 I am using a standard QWERTZ (German) keyboard. 13:11:25 with a stupid enter key? 13:12:15 I use simplified dvorak, and a modified one at work (using autohotkey to let me reduce some combinations by autoshifting when I hold a key and using space+htns for arrows) 13:12:21 ISO enter key is a godsend 13:12:50 ah what 13:12:52 why? 13:13:25 far easier to hit and allows you to move a key tucked underneath it 13:13:41 interesting that you find it easier 13:13:44 less finger stretching 13:13:56 kids nowadays... 13:14:09 you're saying the european enter has less finger stretching? 13:14:22 interesting. for me it is exactly the opposite 13:14:31 hands eh 13:14:49 no, but the key that would be above ANSI enter is now closer to the home row 13:15:00 maybe euro's got longer fingers.. Feels like it some days ;-) 13:15:01 ah for that key 13:15:12 I use ctrl-j instead of enter when I can 13:15:12 backslash 13:15:31 hm that doesn't work here 13:15:47 but i'll try using 13:15:49 tilde actually 13:15:54 heh c-m 13:15:55 tilde and pound 13:16:27 haha, a frequently used key :) 13:16:38 # is pretty common 13:16:42 oh that 13:16:47 the pound, yes 13:16:51 not british pound 13:16:57 £ the pound or sterling sign 13:17:02 octatherpe 13:17:04 ...I see your confusion 13:17:43 so, now back to my metacompiler 13:17:50 or is it just a compiler? 13:18:00 does it compile itself? 13:18:05 it does not 13:18:09 it's nothing until you write it 13:18:10 just a compiler then 13:18:15 it also doesn't compile a compiler 13:18:38 but it has to execute words to compile 13:20:05 does it compile a compiler or interpreter 13:20:43 --- join: dave0 (~dave0@223.072.dsl.syd.iprimus.net.au) joined #forth 13:21:21 neither, it just produces code that is then loaded into an embedded cpu 13:22:12 just a compiler then imo 13:22:18 okay 13:22:26 now that we've settled the nomenclature 13:22:50 hi 13:23:01 how do i build this compiler 13:24:37 write an assembler, then a forth kernel in the assembler, then build from there? 13:24:53 corecode: So you basically want to create bytecode? 13:25:03 (For use in a VM) 13:25:20 for use by an actual cpu 13:25:48 john_cephalopoda, he has a forth cpu in verilog 13:26:27 Ah. Yeah, what crc said. 13:26:31 i think i need to write a forth interpreter in python so that i can use it to write a forth compiler 13:26:37 oh my recursion 13:26:38 Assembler, forth kernel, build from there. 13:26:58 nono, i only want bytecode 13:27:04 no compiling on the target 13:27:07 yeah 13:27:26 then write a Forth that spits out your machine code 13:27:29 it is the assembler 13:27:35 forth-like 13:27:40 yes 13:28:23 quite complicated really to discuss since it depends a lot on how your assembler is structured 13:28:36 opcodes are forth instructions 13:28:40 does it need interactivity or to be compiled as a batch process? 13:28:43 primitives 13:28:49 no interactivity 13:29:20 i want to use this to include easy to write code (=forth) in python applications that then gets uploaded to the cpu 13:29:44 so that you can tightly couple what runs on the cpu and the host side code 13:30:44 hm, i guess i need a way to switch the forth from host compilation to target compile 13:31:14 special word that switches the wordlist and target output 13:31:40 i feel i'm overengineering 13:40:02 nope 13:40:10 that's how Chuck's cmForth worked 13:40:23 https://github.com/ForthHub/cmFORTH/blob/combined/cmforth.fth 13:47:05 --- quit: xek (Ping timeout: 245 seconds) 13:50:28 wait, \ ignores until EOL but not ; ? 13:50:38 He's redefined \ here 13:50:54 but also no 13:51:14 ; doesn't ignore until eol, why would it 13:51:40 "\ compiles a following compiler directive (that would normally be executed). Named [COMPILE] in FORTH-83." 13:52:18 no, i mean \ 13:52:35 the stuff on the right in that .fth are from shadow blocks, no? it's not syntaxtically correct to parse the whole line - just the left half - as forth code 13:52:46 well obviously :) 13:53:00 ok i thought that's what you were asking 13:53:22 line 19 and 20 are odd 13:54:04 or line 21/22 13:57:46 this is unreadable code 13:58:39 i'm not entirely convinced cm has ever actually written anything that executes without modification 14:01:25 and it being parsed out of sequence is also confusing 14:01:41 i mean, i can understand why 14:05:32 zy]x[yz: what do you mean? 14:06:42 corecode: it's fairly readable, but it's also relatively low level 14:06:59 if that is readable, maybe i shouldn't do forth 14:07:30 what parts aren't? 14:08:16 : { dA @ HERE H' 2@ H ! dA ! H' 2! ; : } { ; 14:08:19 stuff like around line 84 or 98 I agree aren't easy to parse at a glance though 14:08:24 people made fun of perl 14:08:52 That's just a bunch of stores?... 14:08:57 there seems to be zero locality for words, because they are being loaded out of sequence 14:09:13 yea but what does it do? 14:09:59 "{ } switches between host and target dictionary by exchanging pointers and relocation offsets." 14:10:07 yes, there is a comment 14:10:12 but let's say there is a bug 14:10:17 that comment doesn't help me then 14:10:28 Well, it tells you what the code is supposed to do 14:10:32 yea 14:11:17 ...so make it do that 14:12:32 so i'd have to write the word from scratch 14:12:46 because i can't understand it 14:12:54 that's what i mean by unreadable 14:13:06 corecode: you have the ability to modify the code and add diagnostics if you need them - you can insert anything between the individual operators to examine the stack and variables - but i do think you're right - the code isn't clear - but it's the magic numbers which pop up arbitrarily which confuse me 14:13:29 that's the instruction set 14:13:31 the magic numbers are what I'd call unreadable, but I can understand why they're in the code 14:13:51 they should be defined 14:14:11 they only need a name 14:14:16 i think the non-linear loading of blocks is really throwing me off 14:15:03 it's all linear afaik unless I'm missing something major 14:15:10 not at all 14:15:17 it starts by 4 LOAD 5 LOAD 6 LOAD 14:15:21 oh derp yeah 14:15:24 and in 4 it does a 7 100 THRU 14:15:32 7 11* 14:15:52 I thought you meant like execution jumps around backwards and stuff lol 14:16:10 3 does 2 LOAD 14:16:11 etc. 14:16:43 I can understand your confusion now 14:18:36 if it helps, each block opens with a comment (and maybe OCTAL, HEX etc) explaining the content of that block alone on a line 14:22:08 this is incredibly dense code 14:22:23 I have a feeling executing a program in Forth-83 was simply executing one block and LOADing the rest... 14:22:44 "demise of the metacompiler in cmforth" https://www.pdf-archive.com/2015/01/10/cmforth/cmforth.pdf 14:22:53 : DIGIT ( n - n) DUP 9 > 7 AND + 48 + ; <- i do like this :) - but come on... 14:23:56 look ma, no branches 14:23:57 i think you have to have quite a bit of understanding to get it 14:24:28 tricky use of a flag :-) 14:24:51 code like cmForth is peak Chuck going super saiyan 14:26:53 pointfree: thanks for that PDF, I thought I understood the { line and that confirmed it 14:29:40 the code is clever, but it's like 'how much can i condense' - sometimes verbosity helps - say defining ascii-0 to replace 48 for example - at least that way you have a half a chance of connecting the dots (the numbers appear, but it's difficult to recognise them as their use is sensitive to surrounding context) 14:30:31 I think that kind of indirection is just bloat 14:30:38 the number 48 is literally used once 14:31:03 48 instead of [char] 0 ? 14:31:05 of course it is - but you are not the computer and that is the computers job :) 14:31:19 $0 maybe, like Forths that allow chars 14:31:38 the_cuckoo: move your optimisations from runtime to compile time, then compile time to edit time 14:32:07 anything which makes it clear, yes - 48 isn't exactly unambiguous on a scan of the code 14:32:41 in context you got it though, right? and with the shadow block 14:33:23 dave0: [char] wasn't in forth 83 14:33:40 hmm - perhaps, but you have a lot of reading to do - most of will gravitate to scanning the code - we'll look for patterns we recognise or can understand on first encounter 14:33:50 most of us that is 14:33:57 you know what cuckoo i do mostly agree 14:34:04 thanks 14:34:20 just in this case, it's supposed to a super optimised optimising compiler 14:34:25 so I just can't blame the guy 14:34:35 yeah - and for that it works :) 14:34:38 Something about the phrase "code should not be clever" doesn't sit well with me. Sounds like HN clickbait. 14:34:48 like i said, i like it - but it's tricksie 14:35:08 pointfree: nah - i didn't say that 14:35:13 sounds like that "premature optimisation" quote 14:35:15 code can be very clever 14:35:44 how is it optimizing? 14:36:33 how do you mean? if you're defining a constant, it's just the compiler which has to do what it needs to do - run time is just the constant 14:36:34 "DUP? compacts preceeding DUP with current instruction. Used to redefine I! and PUSH (previously >R )." 14:37:05 the_cuckoo: You did not. I was just making a general comment about coder zeitgeist. 14:37:38 ah - good :) - you had me worried i had said something i did not intend :) 14:40:37 "I was curious and apprehensive about how far out of touch I had gotten after spending twenty years with Forth. Imagine my relief in learning that nothing had changed." - Chuck Moore 14:40:43 kekeke 14:41:04 WilhelmVonWeiner: lol 14:41:29 i think he's kinda missing the bigger picture there :) - but then, i probably would :) 14:42:12 the quote goes on to describe some differences like fortran->pascal etc 14:42:31 and graphics. I agree (a little) with him. 14:43:09 it's at the end of the pdf pointfree linked just a bit up 14:43:15 only two pages - worth a read 14:44:09 re: metacompilers or rewriting a forth from within itself - what I never understood is that in most forths once a word is compiled it remains using the original definition of words it calls. 14:44:34 so do you need to recompile all words or is it common to overwrite the definition of words "in place" to change them? 14:44:34 oh - my system does that 14:44:43 I just think has maps hadn't been discovered at that point kekeke 14:44:48 *hash maps 14:45:24 i mean the forths within forths thing 14:45:32 it's kinda funny 14:46:53 Hm maybe : { dA @ HERE H' 2@ H ! dA ! H' 2! ; : } { ; is the answer to my redefinition verbosity problems with the psoc5lp hyperstatic place & route. ...and I wouldn't even need a different dictionary header format if it works. https://www.reddit.com/r/Forth/comments/au1i5m/gelforth_place_route_by_hyperstatic_scope_pdf/ 15:18:00 ...except that { deals with compilation, not dictionary search/scoping. 15:25:10 i look at the slides, and i don't understand anything 15:26:25 DUP 9 > 7 AND + <- i didn't mention this - can i mention this? 15:27:18 what about it 15:28:12 in fact 15:28:16 no nothing 15:28:27 it's lovely - as a word which takes a number as an input and covnverts it to a number between 0 and 15 inclusive - but maybe, it'd be nice to say that? 15:29:30 the code can be verbose with no loss to performance - esp. if you indicate that such things are inline 15:30:07 "DIGIT converts a digit (0-F) into an ASCII character." 15:30:18 there you go 15:30:29 it's in the shadow block 15:30:38 doing it inline is not helpful 15:31:04 wtf are you talking about 15:31:31 I must be misunderstanding your aversion to it 15:31:52 i mean defining it as an inline function rather than writing it inline make it understandable 15:32:08 but it's 6 words of an 8 word definition 15:32:17 yes - and? 15:32:32 is it reused elsewhere? 15:32:35 you write code for others to understand 15:32:50 Yeah, and the shadow block is very explicit about it 15:32:56 "DIGIT converts a digit (0-F) into an ASCII character." 15:33:13 If you can't understand the process run it in your interpreter 15:33:20 * crc writes code for himself to understand... 15:34:15 the only thing i've read of yours crc that I struggled with a bit was the code for anonymous quotations 15:34:21 &Q and that 15:35:59 corecode: What part in particular? Some people understand my talks and others don't. I guess I need to include more of the back-story in the future. 15:36:09 heh - no worries guys - you're probably right :) 15:36:11 the & prefix? 15:37:09 i'd got it in my head it was part of something else - my apologies - i stand with the opinion that 48 is jarring though 15:37:30 not the prefix itself, the way it was being used was a bit meta 15:38:40 also, i think the assumption that the result of a conditional check is -1 is probably a point that escaped me 15:38:57 I think that's not just an assumption but standard 15:39:29 WilhelmVonWeiner: I can expand documentation and examples of this :) 15:39:39 hmm - my true is what c++ returns :) 15:39:40 oh it's alright, I eventually grokked it 15:39:43 --- quit: dddddd (Read error: Connection reset by peer) 15:39:52 wouldn't be able to rattle it off the top of my head though 15:40:05 pointfree: well, i only have the slides and not the talk 15:49:18 often in forth 0 is true and -1 is false so that all bits are set. this is maybe just idiomatic stuff you should know. 15:49:52 other way around 15:50:07 haha. probably! 15:50:43 sure - am aware of the forth convention - but 0 == 0 is 1 in c/c++ - the -1 convention is not 'standard', but i suspect i can honour that convention pretty trivially - it certainly has massive advantages 15:52:11 this is forth- _nothing_ is "standard" except ANS which many prefer to ignore 15:52:19 :D 15:52:30 :D 15:52:31 the usual idea, which works in forth AND c is that 0 == false and everything else == true 15:52:47 indeed 15:53:02 but the results of a comparison can do the -1 thing 15:54:46 in retro, true is -1 and false is zero. other values are not valid. 15:54:46 and you'll see them - ==, <=, <, >=, > - and you'll know you always get -1 or 0 - and that's great - if/while/whatever can either be 0 or non 0 15:57:16 ... and in the process you get to unambiguosly pop in == 7 AND 15:58:34 either way, point being that my implementation of those words will honour that contract - it makes sense 16:03:02 --- quit: dave9 (Read error: No route to host) 16:03:55 corecode: Well the psoc5lp chip contains a cpld/fpga with a large configurable routing fabric. Routes are defined with forth words containing the memory mapped registers' addresses of the switches on the psoc5lp... 16:03:55 Placement and routing between Boolean logic expressions is a challenge because logic must be placed in such a way that you can connect chunks of logic with routes that do not get in each others way. 16:03:55 If a route blocks another route or if a segment of routing must follow another segment of routing, this is a lot like redefinitions of words blocking words with the same name in a dictionary. 16:03:55 I use this feature of the dictionary to only expose accessible routes in the routing fabric to the user and to neighboring segments of routing fabric. 16:03:55 How do we know if a route must follow ( and block ) another route? If the segments of the route are directly connected. 16:03:55 In that case we redefine them with the same name. This should remind us of the union-find algorithm, an algorithm which renames connected nodes in a graph with the same name. The union-find algorithm is used to check that nodes in graph are connected. 16:05:11 why do you use words to describe the routing? 16:05:39 isn't that something that should work automatically? 16:05:49 instead of manually 16:10:06 corecode: You may want to configure routes between some combination of multiple different chunks of Boolean logic in different locations. 16:11:09 but why do i want to configure the route explicitly? 16:13:00 corecode: How else would you do it? You need to define which gpios you want to connect to your Boolean logic expression for instance. 16:14:08 It would be ambiguous otherwise 16:14:50 yes, i want to define what is connected, but not how 16:16:06 That's why a place and route tool is needed such as this one. 16:16:30 i still don't understand 16:16:36 why do the routes have names 16:16:50 i guess i need to see the code to understand 16:22:12 The nodes of the routes have register addresses. The registers are set to enable/disable the nodes to form routes. They have addresses because the routes are configurable in contrast to a cpu. But the intermediate routing, other than input and output, is done automatically or implicitly with a proper place & route tool. 16:25:25 corecode: Only the terminals of the routes are exposed with unique word names, because they are the only nodes of the routing fabric that need to be accessible to the user. 16:25:51 ok 16:25:58 so normal ports 16:28:52 --- join: proteusguy (~proteusgu@210.160.217.69) joined #forth 16:28:52 --- mode: ChanServ set +v proteusguy 16:30:37 Yeah, like gpios and peripherals. The routing fabric has a repetitive pattern. PLDs are also repetitive so those can be hidden to the user with redefinitions as well. This takes explicit placement of expressions out of the user's responsibilities as well. 16:34:07 A small footprint of exposed route terminals, but relocatable throughout the fabric because it's a repeating pattern. 16:47:44 --- join: TheCephalopod (~john@unaffiliated/john-cephalopoda/x-6407167) joined #forth 16:49:50 --- quit: john_cephalopoda (Ping timeout: 240 seconds) 16:55:26 --- nick: TheCephalopod -> john_cephalopoda 17:13:44 --- quit: proteusguy (Ping timeout: 252 seconds) 17:17:58 --- join: dave9 (~dave@223.072.dsl.syd.iprimus.net.au) joined #forth 17:21:54 --- join: tabemann (~travisb@rrcs-162-155-170-75.central.biz.rr.com) joined #forth 17:27:21 --- join: rdrop-exit (~markwilli@112.201.168.172) joined #forth 17:34:48 hey 17:34:59 Hi Tabemann 17:37:46 --- join: nighty- (~nighty@b157153.ppp.asahi-net.or.jp) joined #forth 17:39:35 the_cuckoo: Here's an alternative definition of DIGIT that works up to base 40. 17:39:49 5 17:39:49 6 digit Convert an integer digit of up to base 40 to the 17:39:49 7 corresponding ASCII digit character (i.e 0..9, a..~). 17:39:49 8 17:39:59 3 17:39:59 4 : digit ( 0..39 -- c ) 17:39:59 5 dup 9 > ascii 0 ascii a 10 - \mux + ;inline 17:39:59 6 17:41:17 you could get higher bases by using both uppercase and lowercase letters separately 17:41:39 base 62 17:41:44 Yes, I only use lowercase for hex and higher bases 17:42:27 I have somewhere an old routine that uses all display characters 17:43:25 for base 95 17:44:24 : DIGIT DUP < 10 IF [CHAR] 0 + ELSE DUP < 36 IF 10 - [CHAR] a + ELSE 36 - [CHAR] A + THEN THEN ; 17:45:31 Control flow is kinda unecessary for such translations 17:47:13 Here's the other direction: 17:47:14 1 17:47:14 2 rebase Convert an ASCII digit character of up to base 40 17:47:14 3 (i.e 0..9, a..~) to an integer. 17:47:14 4 17:47:24 1 17:47:24 2 : rebase ( c -- u ) 17:47:24 3 dup ascii 9 > ascii 0 ascii a 10 - \mux - ;inline 17:47:24 4 17:48:05 that's because you've got something named \mux in there 17:48:41 you're not getting rid of control flow, you're just hiding it behind a function that packages it up neatly 17:49:09 Yes it's a primitive, or int the case of a VM an opcode. 17:49:26 But even that has no control flow. 17:50:38 in the sense that predicative instructions in pre-64-bit ARM aren't control flow 17:51:11 It's a cell-wide 2-1 mux, I have two versions MUX and \MUX 17:51:40 mux ( x1 x2 mask -- x ) 17:51:49 \mux ( mask x1 x2 -- x ) 17:52:45 In C language they would be coded as: "x=(~mask&x1)|(mask&x2)" 17:55:28 No control flow in the sense that there's no control flow. 17:56:44 when compiled to machine code or when implemented in silico it is cheap 17:57:23 however in a VM a branch might be cheaper, when VM instructions are more expensive individually 17:57:46 it might make sense to make this a primitive 17:57:56 as it is the kind of thing that would be very cheap as a primitive 17:59:48 Test it and see 18:01:37 my main question is is this premature optimization to add new VM primitives just for this 18:02:39 but then hashforth in its current incarnation is slow - a simple counted loop in hashforth is roughly half the speed of one in Python, and Python is slow, and this is when using BEGIN WHILE REPEAT - ?DO LOOP is even slower 18:02:55 but theh hashforth is a proof of concept 18:03:01 it doesn't really matter if it is slow 18:03:15 a serious implementation would probably compile tokens to machine code 18:04:51 okay, I need to get going - will be on later 18:06:22 I don't see how it would be premature optimization on a VM to have a mux instruction 18:06:47 It's such a generally useful instruction to have 18:07:54 Especially if you're VM is bytecoded, you have 256 slots to play with 18:10:00 --- quit: tabemann (Ping timeout: 245 seconds) 18:13:08 * "your" not "you're" 18:15:26 Anyway, I've always found mux instructions a natural fit for stack machines, whether real or virtual. 18:31:09 1 18:31:09 2 >offset Replace low 10 bits of with low 10 bits from 18:31:09 3 . 18:31:09 4 18:31:24 1 18:31:24 2 : >offset ( u offset -- u' ) 1023 mux ;inline 18:31:24 3 18:34:41 * crc implements /mux and mux in retro: http://forth.works/f5b4bd83ce1ad36406d4a639743cfa48 18:35:52 Cool 18:49:56 bbiab 19:42:36 --- join: tabemann (~travisb@172-13-49-137.lightspeed.milwwi.sbcglobal.net) joined #forth 19:49:09 --- quit: dave0 (Quit: dave's not here) 19:52:22 --- join: gravicappa (~gravicapp@h109-187-217-49.dyn.bashtel.ru) joined #forth 20:00:30 --- quit: rdrop-exit (Ping timeout: 240 seconds) 20:45:07 crc: In your mux definition, how do I tell what's on the stack at run time vs. compile time? Looks like you're doing a little compile time dance there... 20:45:34 Or do you use [ and ] in a different way? 20:46:23 What's dip do? 20:58:51 --- join: rdrop-exit (~markwilli@112.201.168.172) joined #forth 21:36:38 --- join: dave0 (~dave0@223.072.dsl.syd.iprimus.net.au) joined #forth 21:37:42 re 22:00:50 --- quit: gravicappa (Ping timeout: 240 seconds) 22:34:45 hi dav0 22:34:49 dave0 22:36:55 hi KipIngram 22:37:00 how's it going? 22:37:50 --- quit: MrMobius (Ping timeout: 240 seconds) 22:38:34 Good. 22:38:46 Fell asleep on the sofa this afternoon, though, and slept 5 hours. 22:38:51 lol 22:38:53 So not much hope of sleeping tonight. 22:38:59 love a good nap :-) 22:39:04 It was a good one. 22:39:08 Editor's all done. 22:46:31 I been napping everyday of late. 22:47:23 --- join: MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 22:50:07 --- join: gravicappa (~gravicapp@85.26.165.116) joined #forth 22:58:35 --- quit: gravicappa (Ping timeout: 252 seconds) 23:12:57 Very unusual for me. But allergies have caused me some poor sleep lately, so I guess I was behind and my body seized the opportunity. 23:14:59 it's been cold and ugly for days, plus - yes, allergies - somehow we got pollen issues, and certainly dust from the hotair/furnace 23:24:43 It's 90 F here, too hot outside right now 23:29:41 It's probably going to freeze here tonight. 23:29:56 rdrop-exit: yeah - i prefer that definition of DIGIT somewhat :) 23:30:57 Glad you like it :) 23:31:19 :) 23:59:59 --- log: ended forth/19.03.05