00:43:21 --- log: started forth/19.03.11 00:43:21 --- quit: carc (Quit: QUIT) 01:14:52 --- join: xek (~xek@apn-37-248-138-83.dynamic.gprs.plus.pl) joined #forth 01:46:03 --- quit: rann (Ping timeout: 264 seconds) 01:48:28 --- join: rann (sid175221@gateway/web/irccloud.com/x-uuasydhczotksmyl) joined #forth 02:02:56 --- quit: ashirase (Ping timeout: 245 seconds) 02:09:37 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 03:01:03 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 04:06:23 --- quit: rpcope (Ping timeout: 272 seconds) 04:09:55 --- join: rpcope (~GOTZNC@muon.copesystems.com) joined #forth 04:56:33 Anyone tried using a hash table to speed up lookup times? 04:56:43 In the dictionary 04:57:34 A super simple hash algorithm that points to linked lists of words with the same hash 04:57:48 And it would be easy to adapt : to match 05:04:24 it's on my todo list, but not tried yet 05:29:39 I've considered using a hash table, but lookup times aren't really a problem in my experience 05:39:20 siraben, Trie (prefix tree) might be fast too. 05:39:56 presiden: that seems like a more natural solution 05:40:05 --- quit: DKordic (Remote host closed the connection) 05:40:11 The only issue is hardcoding it in assembly 05:40:21 For anything but a linked list 05:51:11 why in assembly? 05:53:26 was also consider a trie - they tend to be quite nice 05:53:58 the classic is a hash table 05:54:00 trivial 05:56:00 sure - but a trie is also pretty trivial - has more overhead than a hash table, but doesn't leave you dealing with non-unique hash values/buckets 05:56:20 you just use a linked list which you had before anyways 05:56:46 sure 06:05:41 --- join: DKordic (~user@178.220.204.203) joined #forth 06:23:04 Started working yesterday on an x64 assembler. Time to make my system able to recompile itself. 06:23:45 I'm not shooting for a 100% complete assembler - x64 is a monstrosity. 06:23:57 Just "a lot, and more than enough to do what I need to do." 06:41:40 --- quit: proteusguy (Remote host closed the connection) 06:44:32 Shoot, I didn't realize until just now that we sprung forward yesterday. 06:44:43 Didn't happen to look at any of the clocks that don't self-adjust. 06:44:53 I feel robbed - that was an hour of my week off, damn it. 06:46:47 daylight savings is the worst thing ever 06:47:28 I can think of a few things which are worse (the internet from a top of my head) 06:49:06 i used to live up north - always found it to be a good thing :) 06:49:17 nope. it is the worst 06:50:06 I like DST itself - I like the structure of the days when we're "on DST" better than when we're off. 06:50:15 So I wish we were just "on it" all the time. 06:50:33 In the winter there's not time to do ANYTHING after work before it's dark. 06:50:45 i wish we were not on it ever and you would just wake up earlier if you want to 06:50:55 ^ see above. 06:51:05 they could just shift by 30m and be done with it - everybody happy :p 06:51:09 get to work earlier and leave earlier 06:51:13 In the winter, I can leave the office at 5pm, and it's still daylight. But by the time I get home, it's pretty much dark. 06:51:27 Yeah, that would be great. 06:51:33 this is like voting for higher taxes. i don't get why for you to do what you want to do, you have to force me to do it also 06:51:37 But many days people stick meetings at 4pm and so on. 06:51:53 well don't go to them and tell them you get to work early and leave early 06:52:02 Hey, 9-5 is pretty much the world accepted work day standard. 06:52:22 I can do what you said on days when there are no meetings, but you can't tell a boss that schedules a 4pm meeting that he's done something wrong. 06:52:26 i'm in favour of higher taxes - as long as they don't apply to me, i'm good :) 06:52:28 what software dev is actually held to 9-5 06:52:29 If he scheduled it for 5pm I'd call him out. 06:52:50 :-) Let's not argue. I can see this is a pet peeve of yours. 06:53:06 what's even the point of me being here if i can't argue 06:53:19 Honestly, though, I think "on it all the time" and "off it all the time" are both "not having it." 06:53:24 It's the flipping back and forth that's bad. 06:53:36 fair enough 06:53:43 I read somewhere that statistics show that the number of heart attacks go up in the week right after we spring forward. 06:53:50 Apparently that one hour of sleep DOES matter. 06:54:10 there's also always a spike in car accidents and stuff 06:54:14 I saw a sleep scientist dude on Joe Rogan once. 06:54:19 Pretty fascinating stuff he had to share. 06:54:43 A school somewhere up north moved their start time from 7:35 to 8:35 once, and grades went up. 06:55:18 His point was that we act all tough and say "Nah, I can get by fine on little sleep." But we really don't - there are all kinds of negative effects of not getting at least seven hours a night. 06:55:38 one time i slept for an entire day and afterwards i could lift a car with my bare hands 06:55:51 did you? 06:55:56 no 06:55:59 ok 06:55:59 So I think the case could ABSOLUTELY be made that we shouldn't swtich back and forth. Which one we settle on would be a matter of taste and personal opinion. 06:56:02 i didn't want to show off 06:56:55 I just like being able to get home from work at 5:30-5:45 on those days and still have time for a jog before it's dark. 06:58:06 the problem is that days are just shorter in the winter. it doesn't matter how you shift the time, there's no getting around that 06:58:53 i shouldn't have to wake up when it's still dark outside 06:59:03 why not? 06:59:07 because it's hard 06:59:37 i think the problem is moving your bag of flesh to an office 06:59:42 at specific times 07:00:24 well to be fair, i generally don't 07:00:35 i often get to the office at like 10:00 and nobody cares 07:01:02 i don't get this whole office thing 07:01:05 very inefficient 07:01:18 well it looks like we'll be going that way soon 07:01:47 i hear in other offices they're taking away people's workstations and giving them laptops, and they have to VNC into a cloud VM to do their work 07:01:48 haven't worked in an office this century 07:02:01 couldn't go back to it now 07:02:04 if that comes here, i'll probably start working from home a lot 07:02:08 the_cuckoo: what do you do? 07:02:27 i write software - have my 'office' in the basement 07:03:07 consulting or remote work? 07:03:48 bit of a mix - officially consulting - but the main contract is 12 years in now 07:03:48 if i worked entirely from home i would become a complete recluse, though 07:03:55 wow nice 07:04:09 yeah - works for me :) 07:04:16 no commute, no fuss 07:04:18 yea i'm trying to get more contracts 07:04:31 (electronics & firmware development) 07:05:17 a mate of mine does that - he mostly works from home too 07:05:36 i don't quite know how to get to more contracts tho 07:05:43 word of mouth is slow 07:06:05 usually it's "we spent so much time and money, and didn't get anything, can you help us?" 07:06:22 yeah - i got lucky with that - had been pumping out open source video stuff for a while, and the work came in through that 07:07:05 ok, so work on PR 07:07:12 i wonder what i could show tho 07:07:22 also i don't like being on camera 07:07:42 nor do i - i just published source 07:07:50 ah! 07:08:38 niche area though - open source video stuff - there are always broadcasters looking to cut their costs :) 07:08:50 sure 07:12:29 I definitely think I'd become a recluse if I worked from home. It's already the case that this IRC stuff is my main source of social interactions. 07:12:44 so you're not a recluse 07:12:46 :) 07:13:09 zy]x[yz: on the reclusive thing... well, i think i was falling into that trap - but there are a couple of hacker groups around here and that's greatly increased my social interactions 07:13:14 I don't really have "friends" outside of my family. I have "acquaintances." 07:13:31 but why 07:15:08 my friends are scattered all over - seem to always hook up with people who want to leave the country.... if i were the paranoid type, i'd probably think that was my fault :D 07:16:42 you can always meet irc people irl 07:16:57 i don't want to meet you people. you're gross 07:17:05 * KipIngram snickers 07:17:15 see? 07:17:17 All of my IRC peeps are far off. 07:17:25 But yes, you're right - I always could do that. 07:17:33 :) 07:17:44 what do you mean with irl 07:17:52 in real life 07:17:54 this is not a fiction 07:18:03 i thought this was a roleplaying channel 07:18:08 aha! 07:18:09 meatspace is a better term :) 07:18:44 Sooner or later the feminists will take aim at that term. 07:18:53 who 07:18:53 They'll think it's all about them. 07:20:09 Rather, they'll interpret it as a demeaning reference to women, even though that isn't at all how we use it. 07:20:35 But our intent doesn't matter - if a twisted interpretation can be found, then it's Evil. 07:20:39 shocking 07:20:43 don't worry about offending the feminists. they'll be offended no matter what you do 07:20:52 So true. 07:20:57 My existence offends them. 07:21:50 I'm *precisely* the demographic that all those folks are hating on these days. Male, straight, VERY western European heritage, etc. 07:22:30 My ancestry.com DNA thing said I was like 85% British Isles and 10% Scandinavian. Just like almost no diversity at ALL. 07:22:59 --- join: mark4 (~mark4@148.80.255.161) joined #forth 07:23:02 My wife, on the other hand, is like from everywhere. 07:23:26 sounds like she gets around 07:23:35 --- quit: tabemann (Ping timeout: 252 seconds) 07:23:58 :-) Or her ancestors did, at least. 07:24:23 i find it interesting how heritage is so important in the US 07:24:54 it isn't unless you subscribe to the identitarian politics of the left 07:25:08 My wife is fully half Hispanic - her mom is 100% Hispanic. 07:25:17 KipIngram doesn't seem to, yet talks about heritage 07:25:27 But you'd never know it - in terms of her appearance she took totally after her Iowa farm people father. 07:25:32 i don't understand the hispanic concept 07:25:59 In college she showed up at a get-together of the Hispanic Student's Association, and had trouble getting accepted, because she didn't "look the part" enough. 07:26:30 some people take interest in their geneology as a hobby. nothing wrong with knowing your ancestry 07:26:47 Right - I was just curious. 07:26:51 i really couldn't care less about mine 07:27:12 i just know where my parents were born, then it ends 07:27:29 At some point I want to do one of the Y chromosome analyses - they say that those can show the exact regions your ancestors have lived in, like a "migration path." 07:27:34 I think that would be interesting. 07:28:02 KipIngram, i cant absolute BS on their ability to do that 07:28:09 yea i never really understood movement of peoples 07:28:10 make shit up, charge you for it 07:28:32 when, how many, what was the density, why? 07:28:38 That's definitely possible. But I can at least imagine how you'd go about that, provided you had a sufficiently large database. 07:29:04 But I feel like for it to be accurate it would have to be a *really* large amount of data, and I don't know if they have enough. 07:29:31 And even then it's still just a probabilistic guess. 07:30:16 brb rebooting, trying to get touchpad to work on new laptop 07:30:18 --- quit: mark4 (Remote host closed the connection) 07:33:32 siraben: what do you think about a lisp cpu? 07:36:00 So the first set of instructions I'm going for with this assembler is add, adc, sub, sbb, and, or, xor, mov, cmp, and xchg, with full support for all the different register sizes and addressing modes and immediate arguments. 07:36:11 That batch seems to observe a fairly consistent encoding pattern. 07:36:28 --- join: mark4 (~mark4@148.80.255.161) joined #forth 07:37:26 After that I need to do some kind of support for jumps, and at that point I think I'll have a usable subset. I don't know exactly how far I'll go after that - I'll figure it out later. 07:37:45 Probably will just add more things gradually over time then. 07:51:08 don't get the interest in geneology either - but then, i was the english kid brought up in scotland :) - it's not an environment that fosters pride or interest in your nationality :) - kids can be real ignorant little pricks :) (... and there was one teacher...) 07:51:26 Kids treat each other awfully. 07:52:09 yeah - was a real us and them thing going on when i was in the first few years of primary school - it dropped away by secondary school (mostly) 07:53:21 but with the clusterfuck that is brexit, any interest i had in england has now gone :) 07:53:38 how does one adjust the typematic rate for the grub menu? 07:53:52 on my old laptop i do cursonr down every 1 second max 07:55:01 Boys seem to mature up a little by high school, but in junior high they're frigging little monsters. I think they start to notice girls and decide to put their energy into that. 07:56:15 i was late at noticing the girls (by the standards of the others anyway) - 'twas all about computers :) 07:56:27 bah wrong channel lol 07:56:33 \o/ computers 07:56:48 :) 07:57:17 i thought about programming a snake game on my forth cpu / led panel 07:57:18 /g 13 07:57:21 Sorry 07:57:26 but that needs quite some memory 07:58:08 because i can't read from the frame buffer 07:59:43 hmm - there was a great 'space invaders' game using digits on my brothers calculator - numbers would randomly move in from the left and you had a number of the right which you could increment/decrement (using +/-) and when you match any number on the left they'd be removed - game over when the left gets to the right 08:00:29 think you had to hit = or something to 'fire' to remove the left hand numbers 08:01:07 was fun - should be simple to do on a single line of a panel 08:01:47 i guess fancy stuff would run on the esp32 08:02:16 --- join: nerfur (~nerfur@broadband-95-84-184-13.ip.moscow.rt.ru) joined #forth 08:04:59 yeah - probably the best approach - they have pretty reasonable specs i think 08:08:02 on my board i have a samd11 for usb/debug, a esp32 for wifi, and an fpga for driving the led panel (and now also with forth cpu inside) 08:08:41 the idea was to write forth in a web form and send it to the esp32 to execute it 08:08:50 but from that grew the idea to make a forth cpu 08:09:27 curious approach :) 08:09:48 makes sense though 08:10:55 why curious 08:12:52 i maybe misunderstanding but putting forth at that level - just see it as more of a software thing 08:13:50 can you elaborate? 08:14:55 maybe it would be better if you explain what you mean by the forth cpu :) - i'm probably picturing things incorrectly 08:15:22 the fpga drives the led panel from an integrated frame buffer 08:15:59 and now i created a cpu that can execute forth essentially straight up (instructions map directly to forth) 08:16:35 yeah - so you have an assembly level implementation of pick/drop/roll etc? 08:16:38 so code running on that cpu can draw to the frame buffer 08:16:52 well the cpu is a stack machine 08:17:13 i don't have roll or pick, i guess that would have to be programmed using the rstack 08:17:43 i see - so what instructions do you have? 08:18:28 https://github.com/corecode/forth-cpu-compiler/blob/master/compiler.py#L13 08:18:50 finding a few similar projects, but failing to find a well documented one at the moment :) 08:18:52 you could probably create some compound instructions by setting some bits 08:20:47 ah - that's what i was looking for - just the ops :) 08:20:50 thanks 08:21:13 i think i should map NOP to 0 08:21:40 it's funny - i implemented dup/swap in terms of pick/roll 08:21:54 sure 08:22:00 makes sense to do it your way at that level though 08:22:09 yea 08:28:12 nice - minimalist stuff :) 08:31:56 --- quit: mark4 (Remote host closed the connection) 08:36:15 low level minimalist, that's me 08:39:44 --- quit: nighty- (Quit: Disappears in a puff of smoke) 08:55:14 :) 08:55:28 high level bloat, that's me :) 08:56:27 (anything for the easy life :)) 10:19:42 --- quit: malyn (Quit: "") 10:19:53 --- join: malyn_ (~malyn@unaffiliated/malyn) joined #forth 10:20:17 --- nick: malyn_ -> malyn 10:25:16 * crc has done some profiling with a bloated dictionary. With 10,455 words, performing 20,000 lookups takes 103 seconds (1m, 43s) averaged over 26 test runs 10:25:46 * PoppaVic chuckles 10:46:00 Comparing to a simple hashed dictionary (a linked list of hashes and pointers to full entries), the hashed search results take 53s, assuming that there are no duplicate hashes 10:50:34 bah.. I've heard of hashing-saves-the-world and at least a dozen dictionary/words setups for decades 10:54:45 crc: why does it take so long? mostly parsing? 10:55:23 searching is a function of byte/word-compares and following links 10:55:43 yea, but not in a hash 10:55:58 oh what 10:56:03 a linked list of hashes 10:56:04 No, hashing adds another whole level. 10:56:05 oO 10:56:49 interesting approach 10:57:38 with a more normal data set (2500 words, 5000 lookups), the time is within 1s 10:58:30 yea, why would that kind of hashing help 10:58:55 only if you have a lot of words that start the same 11:01:16 i was thinking of a hash table 11:05:23 I thought the traditional string length compare and follow the next link setup was fast enough for most forths (those that use counted strings that is) 11:07:21 corecode: waiting for the test runs to complete on that 11:07:40 did you quickly write all kinds of dictionary lookups? 11:08:04 corecode: I write code to generate the headers and automate the tests 11:08:24 corecode: not likely, since the FIND is integral to the INSERT in most cases 11:09:02 yes of course 11:09:04 crc: working on a definitive test of dictionary/searching schemes? 11:09:10 Zarutian: even in my case, with NULL terminated strings, I've never found the performance to be problematic outside of tests 11:09:53 PoppaVic: not really. This is mostly for a possible key/value storage system 11:10:21 ahhhhhh - I love .ini files ;-) 11:11:25 and yes, I know what you mean: I support the discouraged dbopen(3) 11:11:47 goddamned gnomes and gnus 11:12:51 wa 11:12:56 generate forth! 11:13:05 full of CONSTANT 11:16:34 corecode: I generate anything that has a lot of redundancy. E.g., given a set of field names for a browser based application, I generate HTML forms, the server side code to read the fields, and the database queries to lookup, add, and update. 11:18:06 as it should be 12:07:04 --- quit: cheater (Quit: leaving) 12:13:18 how do you typically write short circuit boolean conditions? 12:16:06 afternoon 12:17:01 corecode: quite well, thanks - C loves them ;-P 12:18:27 and in forth? 12:19:30 corecode: well, kip has magic words I love - I wish I had them. You could invent an ?EXIT word and do each test followed by that. 12:22:00 yea but i don't want to exit 12:22:06 need to write it differently 12:22:25 ah 12:23:06 I fail to see why - his produces far cleaner code. 12:23:48 --- quit: xek (Remote host closed the connection) 12:24:17 --- join: xek (~xek@apn-37-248-138-83.dynamic.gprs.plus.pl) joined #forth 12:26:25 with an actual table of hashes instead of the linked list, 52s 12:27:16 that's surprising. does your hashtable actually have good distribution? 12:32:12 probably not; my hash algorithm is is basically djb2, but constrained due to lack of unsigned integers 12:43:39 --- quit: xek (Remote host closed the connection) 12:44:05 --- join: xek (~xek@apn-37-248-138-83.dynamic.gprs.plus.pl) joined #forth 12:48:55 Ok, this thing seems to be correctly encoding all 64 and 32 bit add or adc sbb and sub xor cmp and mov instructions. Reg/reg, reg/mem, and mem/reg, with and without offsets. 12:49:24 No immediate argument support yet (though I recognize them - just don't encode them yet), and my offsets are limited to -128 to 127. 12:49:41 I wish I had a good way to THOROUGHLY check it; there are a lot of cases here. 12:49:59 I've been spot checking against here: 12:50:02 https://defuse.ca/online-x86-assembler.htm#disassembly 12:50:37 sounds like a fun thing to write :) 12:53:28 Well, I assembled a bunch of stuff and started at it until patterns started to emerge, put some stuff together, and then sort of "smelled" my way to the finish line. 12:54:18 An syntax example might be this: rax 24 [rbp+] or; 12:55:27 that happens to produce 48 09 45 18 (hex values). 12:55:37 --- quit: gravicappa (Ping timeout: 255 seconds) 12:56:30 If you use rsp or r12 (I think it's r12) in an indirect way, an extra byte gets stuffed in, after the main bytes but before your offset if you have one. 12:56:33 It's 0x24. 12:56:51 ah - so the assembly is rpn based? 12:57:00 I don't know why it's there - if you take that byte out and disassemble you get nothing, so I don't know why they required it. 12:57:11 Yes, it's rpn. 12:57:17 cute :) 12:58:00 :-) Why wouldn't it be? It's Forth. 12:58:22 :) 12:58:28 Anyway, I'm going to leave the 16 and 8 bit stuff for later and go work on jump instructions. 12:58:51 Once I have that I can start working on moving toward "compiling myself." 12:59:23 I don't think you were around when I was talking about this before, but in my nasm source file I created a bunch of macros, and then wrote all of my primitives using them. 12:59:34 The idea was to produce a "portability layer" that would make porting to ARM easier. 12:59:42 Just implement those same macros, and the rest should come right over. 12:59:56 But I missed my target because I wasn't familiar enough with ARM. 13:00:24 In particular, I presumed that all operations would be able to use memory operands, and that's not right on ARM. You only have load and store, and everything else uses registers. 13:00:30 So my macros just weren't "right." 13:00:38 hmm 13:00:49 I'm going to try again, only this time I'm going to implement that "portability layer" using this Forth assembler. 13:01:20 forewarned is forearmed and all that :) 13:02:30 I don't want to lose any efficiency by doing that - I want that portability layer to be operations that I can build optimally in either x86 or ARM. 13:03:48 Yes, very true. I should have waited. 13:04:48 Anyway, I don't want that portability layer to prevent me from implementing a primitive in the best possible way on either processor. 13:04:57 I want it to be a "zero performance cost" layer. 13:05:15 Or at least so close to it that I can avoid fretting over the difference. 13:06:10 So, for example, if there is some operation that a primitive needs that it could do in one instruction on x86, there needs to be a "portable instruction" that does that, so that on the x86 that portable instruction can do it that way, with one line. 13:06:25 Whereas on ARM that portable instruction might use more than one instruction. 13:06:48 So it's a little different from trying to reduce the amount of code that needs re-writing for a port to the minimum. 13:06:51 Different target. 13:34:30 zy]x[yz: the performance is basically constrained by the number of instruction processed. Running under the execution tracer, an entry lookup in either the table or linked list use nearly the same number of instructions (9255 for one, 8933 for the other). I could probably improve both if I rewrote it in assembly, so I could pack things better, but it's not worth the effort at this point. I have two implementations that I can use when the data set 13:34:30 gets big enough, and I'll optimize for more performance later if I need to. 13:39:17 well that took much longer than necessary to write code to walk over a list 13:39:43 juggling addr, count, and pointer on the stack make it quite difficult 13:40:03 more variables? 13:53:04 return stack 13:53:16 use it for locals 13:53:57 yea that's what i did then 13:54:08 and one variable 13:54:16 let's see? 14:08:10 https://gist.github.com/7befb42f6e653c41e3ccb433b38e6a42 14:18:50 --- quit: xek (Ping timeout: 272 seconds) 14:38:11 corecode: https://forth-standard.org/standard/core/COUNT 14:38:42 pretty sure you could be abusing COUNT 14:39:10 yes 15:00:02 spank it more 15:08:02 --- join: cheater (~cheater@unaffiliated/cheater) joined #forth 15:14:03 --- quit: dne (Remote host closed the connection) 15:17:22 --- join: Keshl_ (~Purple@207.44.70.214.res-cmts.gld.ptd.net) joined #forth 15:17:39 --- join: dave0 (~dave0@223.072.dsl.syd.iprimus.net.au) joined #forth 15:17:41 --- quit: Keshl (Read error: Connection reset by peer) 15:18:37 hi 15:19:51 --- join: dne (~dne@jaune.mayonnaise.net) joined #forth 15:37:12 --- quit: ashirase (Quit: ZNC - http://znc.in) 15:53:55 : cmp-str ( a1 a2 n -- f) 0 do count rot count rot <> if swap unloop false exit then swap loop true ; 15:54:03 sorry thought i posted that earlier corecode 15:59:17 that is too dense for me 15:59:43 how so? 16:01:28 ( a1 a2) count rot count rot ( a2 a1 c1 c2) <> ( a2 a1 f) if..then swap ( a1 a2) 16:03:17 my cmp-str is longer than yours :-( 16:04:11 if it's any consolation dave mine would be worse if I used it, because I'd make it recursive and janky to accomodate that 16:06:39 wait, what the count does here? 16:06:58 ( a - a c) 16:07:12 ( a - a+1 c) 16:07:20 the latter 16:08:10 : count ( a - a c) dup c@ swap 1+ swap ; or something like that 16:09:00 ah, I see 16:09:22 and you use count to walk over the string 16:09:29 uh that is nasty 16:09:33 : count 1+ dup 1- c@ ; maybe 16:09:36 why is it nasty 16:09:48 semantically confusing 16:10:04 you mean because of the name of the word count? 16:10:09 yes 16:10:16 well, it's count abuse 16:10:20 :) 16:10:21 count is for cstrings lol 16:10:21 i think jonesforth did : count dup char+ swap c@ ; 16:10:25 I think it's similar to C's pointer ++ operation 16:11:07 yah *c++ 16:11:27 you could make "count" primitive 16:11:28 dave0: derp ofc : count dup 1+ swap c@ ; I guess 16:11:35 which I call c@+ 16:12:04 WilhelmVonWeiner: that's a better name :-) 16:12:34 yeh agreed 16:13:37 lol dave you just made me realise I've been redefining count as c@+ all this time wasting dictionary space 16:13:52 * PoppaVic chuckles 16:14:13 schoolboy error 16:16:47 --- join: nighty- (~nighty@b157153.ppp.asahi-net.or.jp) joined #forth 16:34:46 : 0?; ( n -- n| ) dup 0= if drop rdrop true then ; 16:34:48 : cmp-str ( a a n -- f) 0?; >r count rot count rot <> if false rdrop exit then r> 1- rdrop recurse ; 16:35:19 rushing to bed but I thought I'd take a couple minutes out to think about that 16:35:28 thanks 16:35:50 oh uh 16:35:58 rdrop recurse might actually break that 16:36:02 idk... 16:36:45 it would have to be (cmp-str) executed by another word : cmp-str (cmp-str) ; lole 16:43:39 :cmp-str (aan-f) TRUE swap [ [ dup-pair &fetch bi@ eq? ] dip and [ &n:inc bi@ ] dip ] times nip nip ; 16:43:49 (non-standard) 16:44:31 what is that 16:44:50 a cmp-str in my forth 16:47:42 i guess recurse doesn't do tail call optimization 16:48:37 that would be implementation specific 16:55:15 oooh branch less and hard to read... : to-lower-case dup 65 91 within 32 and + ; 16:56:02 forth is normally case-insensitive? 16:56:55 i think it is worth it to save a branch there, cos to-lower-case is in inner loops 17:00:08 is within branchless? 17:02:09 --- nick: Keshl_ -> Keshl 17:02:37 ah checking yes it is! i copied it from the standard... over - >r - r> u< 17:04:39 i named it >lower 17:09:08 also maybe factor it : ?lower 65 91 within ; : >lower dup ?lower 32 and + ; 17:09:15 : cmp-char c@+ rot c@+ rot = ; 17:09:15 : cmp-char-n >r cmp-char r> swap ; 17:09:16 : compare-string ( addr1 addr2 n -- f ) 17:09:18 begin dup if cmp-char-n else false then while 1- repeat 17:09:20 -rot 2drop 0= 17:09:22 ; 17:09:25 17:09:40 corecode: nice :-) 17:09:54 is that readable? 17:10:02 took a while to get to it 17:10:24 i seem to need short circuiting conditionals 17:11:29 brb 17:43:17 --- quit: john_cephalopoda (Ping timeout: 258 seconds) 17:55:41 --- join: john_cephalopoda (~john@unaffiliated/john-cephalopoda/x-6407167) joined #forth 18:45:29 corecode, shortcircuting in forth? so an immediate word that skip next part if something in the stack can determine the logical result of the expression? 18:53:56 so for example, : foo true short-or bar end-short-or ; will skip bar 19:17:51 --- join: jedb_ (~jedb@199.66.90.113) joined #forth 19:17:56 --- quit: jedb (Ping timeout: 245 seconds) 19:18:12 --- nick: jedb_ -> jedb 19:32:21 --- join: tabemann (~travisb@2600:1700:7990:24e0:6112:d47b:3dbc:b8d7) joined #forth 20:05:41 --- quit: dddddd (Remote host closed the connection) 20:40:44 --- join: gravicappa (~gravicapp@h83-174-240-100.dyn.bashtel.ru) joined #forth 21:27:50 How often can you do that at *compile* time? 21:27:58 If you can do that, why have you even written that code? 21:28:21 That sounds like something that should be a run-time optimization to me. 21:28:43 "I *might* need to run this, but not often - so if I don't need to I'll skip it." 21:28:55 But if you never need to run it, don't put it the hell in there. 21:29:10 You the programmer hold primary responsibility for this stuff. 21:31:40 --- quit: DKordic (Quit: ERC Version 5.3 (IRC client for Emacs)) 21:34:58 Jesus, I'm back in "screen staring mode" again. Just looking for things I can tune. 21:35:18 It's all in front of me - I can even see the ::wipe at the bottom. 21:38:06 * PoppaVic chuckles 21:44:30 --- join: [1]MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 21:47:32 --- quit: MrMobius (Ping timeout: 246 seconds) 21:47:33 --- nick: [1]MrMobius -> MrMobius 21:50:27 --- join: [1]MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 21:53:48 --- quit: MrMobius (Ping timeout: 255 seconds) 21:53:48 --- nick: [1]MrMobius -> MrMobius 22:00:34 Guys, I'm sorry - I spent the whole evening thinking I was in my PoppaVic private channel. If I've annoyed anyone my apologies. 22:02:19 I doubt anyone even noticed ;-> 22:24:38 --- quit: dave0 (Quit: dave's not here) 23:04:49 --- quit: cantstanya (Ping timeout: 256 seconds) 23:05:48 --- join: bluekelp_ (~bluekelp@bluekelp.com) joined #forth 23:07:43 --- quit: bluekelp (Ping timeout: 246 seconds) 23:08:09 --- join: cantstanya (~chatting@gateway/tor-sasl/cantstanya) joined #forth 23:10:22 --- quit: dgi (Ping timeout: 246 seconds) 23:10:36 --- join: dgi (~dg@s559515c3.adsl.online.nl) joined #forth 23:58:41 ummm - strcmp stuff - why not go the c route and create a word which returns an int instead of a forth true/false? ie: < 0, == 0 or > 0 for the 3 cases of less, equal, greater - call it str-diff - then your str-cmp is just str-diff 0= 23:59:59 --- log: ended forth/19.03.11