2023-12-14 08:57:29 Are there guidelines for naming words? I've occasionally used a question mark to imply a word that gives information but does not consume its arguments. Example: : negative? dup 0 < ; 2023-12-14 09:28:41 I think formulating your own guidelines is a good policy, but I'm not aware of any sort of "official" guidelines. I think it's primarily up to you. 2023-12-14 09:30:27 I have the ability to do a "double return" in my system - various primitives that do the equivlent of rdrop exit as part of their operation. Often when I write a definition that may do this (sometimes a word might exit via a single return or a double return, depending on things), I'll put a ; at the end of the words name to remind me of that. 2023-12-14 09:30:40 And yes, I also do various things with ? when a word has some conditional behavior. 2023-12-14 09:31:30 Not always, though - I don't have ?'s in my conditional return words. Return if TOS=0, for example, is just 0=; 2023-12-14 09:31:59 I decided that the 0= was enough to convey the conditionality. 2023-12-14 09:32:27 But if you liked ?0=; better for such a word, then that would be fine too of course. 2023-12-14 09:33:36 holy wars have been fought over namings 2023-12-14 09:33:53 Yeah, people seem to like holy wars. 2023-12-14 09:34:24 But I just feel pretty strongly that part of Forth itself is "build what you want to build." 2023-12-14 09:35:40 Even in other languages I'm not a fan of "too much" enforced coding style. 2023-12-14 09:36:00 I'm kind of anti-conformist on most fronts, though. 2023-12-14 09:37:58 yeah 2023-12-14 09:38:22 I mean, I love how people bleat about spaces and indentation in Python like it's the end of the fucking world that their code has to look tidy to work 2023-12-14 09:38:43 what does their C/Java/whatever else Algol-y code look like? 2023-12-14 09:38:49 I certainly understand the desire within a coding team to have a somewhat uniform style; I just think it's the sort of thing that can easily get taken too far / become too detailed. 2023-12-14 09:39:31 more brackets lying around all over the place than the shelving section of B&Q after a terrible tragic forklift accident usually 2023-12-14 09:39:46 It's just like how I feel about our whole server security process at work. Sure - we want our network to be secure, and that is going to bring some requirements. But those guys have just gone totally wild. 2023-12-14 09:40:18 yeah 2023-12-14 09:40:31 It's become a completely onerous process that can sop up big fractions of your time. 2023-12-14 09:40:32 we have stuff like that at work, the pentest guys losing their shit over SNMPv2 2023-12-14 09:40:54 sure, it's not encrypted and passes the community string in cleartext 2023-12-14 09:41:07 the community string is usually public or community anyway 2023-12-14 09:41:08 We've got a database with an entry for every server, and I mean there are THOUSANDS of data items in there for each one. 2023-12-14 09:41:19 It's like a total biography of each server. 2023-12-14 09:41:40 like who gives a monkeys if some random attacker can sniff SNMPv2 traffic, and determine that the microwave link is at 32 degrees C just now 2023-12-14 09:41:44 KipIngram: aha 2023-12-14 09:41:51 KipIngram: have you seen Netbox? 2023-12-14 09:41:59 No, don't think so. 2023-12-14 09:42:18 IPAM and DCIM database 2023-12-14 09:42:39 uses Django web frame work so all nice standard Pythony webby stuff 2023-12-14 09:43:06 you can do nice diagrams of your racks, there's a plugin to plot out interconnects 2023-12-14 09:43:24 Oh, and what they've just pulled now is that a few days ago, like a week before everyone's going to disappear for a couple of weeks for the holidays, we get an email announcing that they've detected that many servers haven't been registered into this database, and that on January 4th such servers will be blocked from the network. 2023-12-14 09:43:40 "We're going zero tolerance on you one day after you return from holiday." 2023-12-14 09:43:48 And they tell us this one week before holiday. 2023-12-14 09:44:03 if you add a DeviceType from a library, it will not only have stuff like its rack dimensions and interfaces, but it'll usually have stuff like its power consumption defined in 2023-12-14 09:44:06 so 2023-12-14 09:44:13 That is just GUARANTEED to create a terrible situation come January. 2023-12-14 09:44:20 if you populate your racks into it properly it'll do stuff like estimate phase load per rack 2023-12-14 09:44:29 As in people not able to get work done. 2023-12-14 09:44:55 KipIngram: sounds like the security team have just given you a couple of weeks extra holiday then 2023-12-14 09:44:58 Yeah, we've got a system like that too, called RackTables. 2023-12-14 09:45:09 :-) 2023-12-14 09:45:14 That's a great way of looking at it. 2023-12-14 09:45:50 yeah, I looked at RackTables, it seems pretty good 2023-12-14 09:45:59 Netbox looks a bit less "designed by engineers" though ;-) 2023-12-14 09:46:09 It's a nice place to go find out things you need to know sometimes. 2023-12-14 09:46:27 Like, if you need to power cycle a server, it will tell you wHat PDUs are associated with it. 2023-12-14 09:46:30 we're supposed to be bringing it in "properly" at work 2023-12-14 09:46:32 That kind of thing. 2023-12-14 09:46:49 currently it's on one of my servers because the install I have is my "notebook" 2023-12-14 09:46:50 Problem is that it's never fully up to date. 2023-12-14 09:47:06 yeah you need to be a bit of a hardass when it comes to change requests 2023-12-14 09:53:58 Well, that's the problem - such changes aren't controlled. Everyone goes into the lab and tinkers with their own racks, and then they're expected to update RackTables to match. 2023-12-14 09:54:12 The tinkering gets done - the updating gets postponed, and you know where that leads. 2023-12-14 09:54:20 I'm as guilty of it as anyone. 2023-12-14 09:54:42 Because usually someone is breathing down my neck for some test results, and updating RackTables doesn't move me toward getting those. 2023-12-14 09:55:27 Earlier this year I got and set up two new test stands, and when this email hit the other day I still hadn't registered those in the security system. 2023-12-14 09:55:33 So that was my main hoop to jump. 2023-12-14 09:55:44 I got it done though - my whole list of systems is fully compliant now. 2023-12-14 09:56:09 For the time being - they'll come around in a few months with a new subset of those thousands of entries that they've moved from "optional" to "required." 2023-12-14 09:56:34 so even when a system is compliant, it's only a matter of time until it's not. 2023-12-14 09:58:31 But hopefully now I'll just be an "observer" of the Jan 4 train wreck and not a casualty. 2023-12-14 10:22:07 KipIngram: just as long as you document that it's going to be a tyre fire 2023-12-14 10:22:54 I live to document. :-\ 2023-12-14 10:25:02 there's probably a goldilocks zone between too much and servers getting walled off in some old room 2023-12-14 10:25:23 So next two weeks are holiday for me. But this weekend I've got to go do a "family trip" that just got totally planned with more or less zero input from me. I've known about it for months, but I just "found out" one day that it was happening. At least I got to insist that it be at the beginning of my holiday instead of the end. 2023-12-14 10:25:46 Yes, you know there is. But organizations like this aren't very good at finding goldilocks zones. 2023-12-14 10:26:24 In fact, very early in my days at IBM a fairly senior guy told me "IBM can make anything better. But IBM doesn't know what's 'good enough'." 2023-12-14 10:26:31 He turns out to be exactly right. 2023-12-14 10:28:16 Anyway re: this trip, I suppose that since my father-in-law passed away I'm who you would regard as the "patriarch" of the family, but I rarely get consulted on stuff like this. No one bothered to ask me if I WANTED to spend several of my holidays out of town. 2023-12-14 10:29:10 I love seeing my kids, none of whom actually live here anymore. but my preference is for them to visit me HERE. 2023-12-14 10:30:04 I understand I need to share that burden to some extent and go see THEM from time to time, but in this case no one is getting to stay at home. 2023-12-14 10:31:25 My theory on the security stuff is that it's primarily driven by the security team wanting to show their own bosses what a fantastic job they're doing. 2023-12-14 10:31:45 Which means being able to show a mountain of data and statistics demonstrating "forward motion." 2023-12-14 10:32:05 I.e., my productivity is in no way connected to their agenda. 2023-12-14 10:33:44 The same thing happens in capital acquisitions - there's a group that's clearly been tasked with ensuring we don't waste money. And my productivity doesn't matter to them either - only how little money I spend. 2023-12-14 10:37:58 This is something I see as a disadvantage of large companies. A small outfit can focus in on a goal like a laser. Big companies inevitably wind up carved up into chunks each of which has its own agenda. 2023-12-14 13:40:08 Ugh. We use Trello and Box at work. I store my results in Box, and put links to that in Trello items. Now they've decided to sunset Trello and replace it with "monday.com." I started looking into that this morning and was happy to see an "import from Trello" function. I ran it and got monday items for all my Trello items. But... empty. No links. Turns out the import doesn't support that yet. 2023-12-14 13:40:14 That's... worthless. 2023-12-14 13:40:57 I'm just baffled at how they arrive at decisions like this. 2023-12-14 13:45:15 whatever.com saves them a few bucks, or they read about it in whatever managers are reading these days 2023-12-14 13:46:06 But what about what it costs in terms of us handling the transition? 2023-12-14 13:46:18 never thought off 2023-12-14 13:49:00 If they think there is no cost because we're salaried, they're deluded. 2023-12-14 13:49:06 It shows up somehow. 2023-12-14 13:49:36 But probably in a way that can be blamed on someone else. 2023-12-14 14:00:15 Is there a way to print words during execution? I'm hoping for something like this http://0x0.st/HYHQ.txt 2023-12-14 14:02:22 Oh, that's interesting. 2023-12-14 14:03:18 You might be able to redefine : 2023-12-14 14:03:19 There's not a standard way - I'm trying to imagine if there's a way you could "hook that in." You'd need to hook both "next" in order to print out sequences of primitives, and also "docol" and "return" to get the nesting. 2023-12-14 14:03:38 I remember something that redefined : to keep a count of times the word was executed 2023-12-14 14:03:52 And of course if you're running a subroutine threaded system then docol and return are hardware call and return instructions, so there would be no hooking them. 2023-12-14 14:04:24 GeDaMo: Yeah, I'm planning to be able to have an optional profiling capability that would work somewhat like that. 2023-12-14 14:05:21 user51: In an old-school indirect threaded system docol and next, at least, would be specific bits of code that you could potentially hijack. 2023-12-14 14:05:36 If you happen to have a system that jumps to a single instance of next you could hook it too. 2023-12-14 14:05:51 But if each primitive has next tacked onto the end of it, you're got an uphill climb. 2023-12-14 14:06:46 In any case, you're talking about modifying the very deepest, most "guts level" code in your Forth system to do this. 2023-12-14 14:07:48 And if you wrote a system to make this kind of hooking "easy" then that would likely have at least a little performance impact, even when you weren't doing it. 2023-12-14 14:08:43 I'm trying to think if you could do this by hooking only next, and having the code you replaced it with inspect the instruction pointer and the return stack. 2023-12-14 14:08:48 That could probably be made to work. 2023-12-14 14:09:13 Do you know what I mean when I say "next"? 2023-12-14 14:09:38 It's the code that runs when a primitive finishes doing its actual work - it navigates you to the next primitive to execute. 2023-12-14 14:10:07 I was reading jonesforth yesterday, so I think I do :) 2023-12-14 14:10:46 Cool. :-) 2023-12-14 14:11:23 I usually have a register point to next and get at it with a jmp at the end of each primitive. I'm thinking about dropping that this time, though, and just inlining a copy of next onto each primitive bit. 2023-12-14 14:11:54 Would your forth have locals? 2023-12-14 14:13:19 Wait a sec, should I have said 'will' or 'would'? 2023-12-14 14:14:06 I hope my English isn't getting worse. Well, at least my Forth is getting better :D 2023-12-14 14:15:33 :-) 2023-12-14 14:15:43 I've got ones I've written and one I'm thinking about writing. 2023-12-14 14:16:17 I have given myself a mechanism to index into the stack, which is a hair like locals, but I don't have a full-blown locals facility, no. 2023-12-14 14:16:51 I can set a "frame pointer" whenever I want to to use for that indexing, so that the indices of various quantities don't vary all over the place as the stack pointer moves. 2023-12-14 14:17:22 Basically { saves the existing frame pointer on the return stack and sets frame pointer = stack pointer, and } undoes that. 2023-12-14 14:17:31 So within I can index off of the fp. 2023-12-14 14:18:17 If I moved the stack pointer some when doing that, I could then use negative indices to access what you might call "locals," whereas positive indices would target stuff you'd more likely call "parameters.' 2023-12-14 14:18:54 It would be easy for me to modify it to allow { to make space for locals. 2023-12-14 14:20:08 A week ago or so I gave a little thought to a mechanism that would let me establish a named local storage frame on the return stack; it wouldn't be per-word - you'd activate and deactivate those explicitly. But I think I'm unlikely to implement it. 2023-12-14 14:21:08 I asked because it seems like people have some.. strong opinions on locals in Forth. 2023-12-14 14:21:21 Basically activating such a frame would move the return stack pointer to make space, target it with a register, and push an associated vocabularly onto the search path to support the names. 2023-12-14 14:21:30 Yes, it's one of those topics. 2023-12-14 14:21:59 There are many many "locals implementations" floating around out there, but none of them are terribly clean by Forth standards and yes - some people object strongly to the idea. 2023-12-14 14:22:41 I tried different ways to write words, sometimes with stack operations only, other times with variables, other times with values 2023-12-14 14:22:55 I think it just always winds up getting a little involved compared to how simple most things in Forth are. 2023-12-14 14:23:20 Well, that's how you get better - by just trying things out. 2023-12-14 14:23:34 And what winds up working well for you might not be the same things that work for someone else. 2023-12-14 14:25:14 Yeah, there's tradeoffs. Stack ops can be a bit shorter but requires getting the right order. Variables work but sometimes I ended up having to write NAME @ @ or cluttering a word with NAME @ a few times. VALUE is nice but TO doesn't sit right with me. 2023-12-14 14:25:43 Yeah, I'm not personally a fan of VALUE, but... it's fine. 2023-12-14 14:27:00 This locals frame idea I had would let me define a frame - say I called it foo{{ - and then I'd be able to say foo{{ ...code... }} and ...code... would be able to use the names associated with foo{{ just like variables. 2023-12-14 14:27:18 }} would drop back to the previous frame and pop the vocabulary off of the path. 2023-12-14 14:27:38 Which seems about as clean as anything I've seen, but I just don't know if I'd really need it very often. 2023-12-14 14:29:02 It seemed like a semi-pretty idea, but it's not clear to me what I'd actually be doing with it. 2023-12-14 15:00:06 user51: https://ideone.com/SqY9ex 2023-12-14 15:09:13 GeDaMo: Looks neat. Thanks. I'm not a bit more convinced to write my own Forth. 2023-12-14 15:10:24 If anyone has spare language bug spray... gimme a good buzz :) 2023-12-14 17:23:23 To me the appeal of writing a Forth (even though I've done it to date under the sway of an OS) is that with Forth one can do the total job of controlling a computer. No reliance on artifacts supplied by others, or by your tool, or whatever. So I squeeze that OS dependence into the smallest box and can squeeze it into and... well, just live with it, while doing all the rest in a fully stand-alone independent 2023-12-14 17:23:24 way. 2023-12-14 17:23:36 The way Forth makes it possible for one person to do this is what impresses me. 2023-12-14 17:23:53 While still having "pretty good" performance, strong extensibility, etc. 2023-12-14 17:24:33 Kennedy said we were going to the moon because it was there; I write Forths because I can. 2023-12-14 20:23:53 isn't it surprising that dup>r isn't a standard word? 2023-12-14 21:08:00 I've never really felt a need to write a dup>r (I do have a word that acts like dup >r execute r> though) 2023-12-14 21:10:16 crc: factor calls that keep 2023-12-14 21:11:41 i've found myself writing "dup >r" every so often. i implemented keep, too, but it feels wasteful for something so trivial