2024-10-25 00:14:57 aha 2024-10-25 00:27:00 I was sleeping 2024-10-25 00:27:34 veltas yyes, actually I was looking at the zx and some emulators because it would be quite cool to play with something like that 2024-10-25 00:27:58 actually I'm particularly interested in something where I can draw pixels by using memory 2024-10-25 00:28:08 but I'm limited to android since I have no computer 2024-10-25 00:28:42 xentrac mainly while I struggle with the stack, my main problem for now is to learn how to organize data and create structuress 2024-10-25 00:29:09 what I usually try is to use memory and then make accessors that increment a memory address 2024-10-25 00:29:28 but I do not feel comfortable with it and I wonder if it's the best way to do it 2024-10-25 00:31:23 for example: CREATE OH C, C, C, : X ; : Y 1+ ; : Z 2+ ; 2024-10-25 00:31:23 I kind of like it, but maybe there is a better way 2024-10-25 00:31:39 also I should get used to DOES> because I know what it does, but never used it except to test it's behavior 2024-10-25 00:33:30 and there are lots of things to learn yet, I think I'm missing a lot of dictionary manipulation words, and I have to get used to manage memory 2024-10-25 00:33:56 I got used to garbage collectors that collect my shitty code 2024-10-25 00:36:29 still I know it's just a matter of time as long as I keep being focused on forth, which seems I will do for a while 2024-10-25 00:37:33 I like it, but also feel overwhelmed by it. anyways I do not mind that and I appreciate that is teaching me 2024-10-25 00:38:02 I do not fear complexity as long as something gets my interest 2024-10-25 00:38:29 which is contradictory since forth is all about simplicity xd 2024-10-25 00:38:36 but I find it extremely hard to use 2024-10-25 00:52:13 and about abusing variables, I wonder if chuck will punch my face if I do 2024-10-25 00:52:59 but I know they are discouraged for a novice because you need to develop skills, and since I understand why they are discouraged I will try to obey 2024-10-25 00:53:13 vms14: oh, well, the alternative way to store multiple attributes of a single entity, other than creating a record, is to use parallel arrays 2024-10-25 00:53:29 one array for each attribute, one array index for each entity 2024-10-25 00:53:51 it's true that since I'm a novice and I will feel handicapped with the stack I could temporarily abuse them to at least get at some place and be able to do something 2024-10-25 00:54:13 the difficulty with parallel arrays is mostly deallocating things 2024-10-25 00:54:42 Adam Rosenberg wrote this great book about how to use parallel arrays: http://www.the-adam.com/adam/rantrave/st02.pdf 2024-10-25 00:55:45 also veltas is a good idea for me to start looking at forth code and get used to read other's forth code 2024-10-25 00:55:55 what Chuck Moore says about using variables is that you should never have more than two things on the operand stack and you should use variables a lot 2024-10-25 00:56:28 so if you guys know some code that is good for me to read I will bookmark it and look at it at several times 2024-10-25 00:56:33 (I think he means two things that a particular word cares about) 2024-10-25 01:10:54 yeah I might be confusing the discouragement with local variables 2024-10-25 01:11:17 but still I suppose I'm expected to not abuse them, use them when they make sense 2024-10-25 01:11:51 still the stack manipulation while hard, is not my main problem with forth 2024-10-25 01:12:06 the problem is I do not know how to do anything xd 2024-10-25 01:12:52 it's like I'm starting to learn programming for the first time, which I guess it's good because it means I'm learning new things 2024-10-25 01:13:04 had this feeling with lisp too, but in forth is much stronger 2024-10-25 01:13:17 the forth is strong with this one 2024-10-25 01:14:18 I fail to express my ideas properly in forth 2024-10-25 01:14:50 in perl I express them as hash tables and regex, in lisp as lists, and in forth as words 2024-10-25 01:17:27 I think the fear of variables can be valid. Starting Forth calls them "local" variables although they have global scope and exist for the life of the program. These are globals in C and BASIC. Variables local to a word are not mentioned in Starting Forth. 2024-10-25 01:18:50 You may be able to find a clever way to reuse variables between words but the cleanest thing is to give each word it's own set which eats up memory fast on a little microcontroller. I had this problem on the 6502 for my Robot Game and was able to claw back 2K of RAM for the 90 global variables with a preprocessor. That's huge on a little system like that. 2024-10-25 01:27:06 Those are mostly reasonable points, although as I explained above, they don't actually have global scope. 2024-10-25 01:32:17 Yes, you can redefine the same variable name so you can reuse the name in another word. You still waste a lot of memory that way. 2024-10-25 01:55:37 That's one of the three ways they don't have global scope that I explained. 2024-10-25 01:58:07 But it sounds like the allocation lifetime was the bigger issue for you. Normally we solve that by indexing into a local-variable stack frame, but on a 6502 the runtime cost of that is also significant. 2024-10-25 02:13:38 You can get good performance for locals if you can fit that and the data stack into the first 256 bytes 2024-10-25 02:14:09 and that particular 6502 forth didn't support locals anyway 2024-10-25 02:20:24 Right, I meant with languages like Pascal and C. Fortran would normally use copy-in-copy-out for subroutine parameters instead 2024-10-25 02:26:12 KipIngram: it occurs to me that if you're on a 16-bit microcontroller it would probably be rather slow to shift a 64-bit cell by, say, 6 bits. Although 8 bits might not be too bad. 2024-10-25 02:27:32 avr-gcc compiles a 6-bit shift on a (16-bit) int into a 6-iteration loop of shifting a bit out of the high byte and into the low byte. If you had a bitfield transfer instruction it wouldn't be so bad, but even with bitfield read and write instructions it would be kind of a pain 2024-10-25 03:23:59 KipIngram: okay, I just pushed ingram-token-threading.md to pavnotes2 2024-10-25 05:27:38 xentrac: I wouldn't try to shift a 64-bit cell in that case. I'd load the 16-bit words, shift the bytes of that, and then load a new one. 2024-10-25 05:27:55 Just like I reload after 8 in the current design. On a 32-bit system, you'd reload after 4. 2024-10-25 05:28:10 The all 0's or all 1's will shift in fine in any case, so the reload gets auto-triggered. 2024-10-25 05:28:22 So it's less efficient on the narrower word machine, but will still work. 2024-10-25 20:06:31 KipIngram: yeah! 2024-10-25 20:08:34 vms14: Get a crappy old thinkpad from ebay, that's good enough for fuse-emulator 2024-10-25 20:09:38 I will literally buy you one you rascal 2024-10-25 20:10:55 what country is vms14 in? 2024-10-25 20:10:55 xd don't worry 2024-10-25 20:11:05 https://docs.codewars.com/languages/forth 2024-10-25 20:11:25 xentrac: Not a problem for me lol 2024-10-25 20:11:45 There are some countries where I would have to be a little more 'creative' getting it there 2024-10-25 20:12:37 thinkpad would be a difficult lift for a pigeon 2024-10-25 20:13:10 I probably wouldn't ship to North Korea or Russia right now, not worth the 'heat' 2024-10-25 20:15:01 As far as hardware goes, I'm a bit tempted by Apple's latest offerings. 2024-10-25 20:15:14 lots of countries where the thinkpad gets stolen in transit 2024-10-25 20:15:29 user51: And how long have you had this illness? 2024-10-25 20:15:47 xentrac: That's where creativity is required 2024-10-25 20:16:03 that's expensive 2024-10-25 20:16:16 neauoire might be able to advise on international tips and tricks 2024-10-25 20:16:23 veltas: I'll treat it as joke, I'm just looking at new hardware for the moment. 2024-10-25 20:16:29 :P 2024-10-25 20:16:36 It is a joke, so good you treat it that way 2024-10-25 20:16:52 I forget sometimes British humour's not universal 2024-10-25 20:17:49 Would've been clearer if you called it 'polished rubbish'. Bet it sounds great with an accent. 2024-10-25 20:17:58 Not with my accent lol 2024-10-25 20:43:45 xentrac: That Rosenberg book makes me want to try Fortran out 2024-10-25 20:44:51 It really is, as the disclaimer says, quite opinionated; it's like I've got some old dude breathing down my neck banging on about old C compilers crashing when you chained too many if-else's 2024-10-25 20:45:00 But I like history so it's fun anyway 2024-10-25 20:47:10 "The RENUMBER Program" yeah this feels super old now lol 2024-10-25 20:54:23 :-) Fortran was alright. I do think the rerason it's still arund, though, has more to do with the volume of legacy code and libraries people still want to use than it does with "specific strengths," though. 2024-10-25 20:54:49 I feel no desire to go back to it, but it was the first programming language I ever learned (not counting that HP calculator). 2024-10-25 20:55:09 fortran is still fast for mathy stuff, so they teach atomospheric stuff with python, but do the simulations with fortran 2024-10-25 20:56:22 My point was that I'm not sure it's REALLY faster than more modern languages, inherently, but there are available highly optimized numerical libraries that would have to be created for the newer language, and that would be a lot of work. 2024-10-25 20:56:47 Or else you'd have to find a way to glue your new language to the old libraries. 2024-10-25 20:57:17 After all, all of the languages are manipulating the same hardware resources. 2024-10-25 20:58:14 xentrac: I can't lie, I like this Rosenberg person 2024-10-25 20:58:53 Fortran does support multi-dimensional arrays in a "direct" way, whereras a lot of languages do it via "1d array of 1d arrays of..." That might make a difference somehow, I guess. 2024-10-25 21:05:17 In a lot of languages with lackluster array support you just declare multiple arrays and access them in parallel 2024-10-25 21:05:30 Common in stuff like VB6, VBA code, etc 2024-10-25 21:05:47 Not even necessarily for lack of language support, it's just something people do if they're newer to programming 2024-10-25 21:06:34 I only avoid it in C because it's nicer to think about related data in one 'unit' so you don't lose track of what you're doing, and can pass a pointer to that unit in one. Passing indices around everywhere is error prone 2024-10-25 21:07:06 Or 'safe' because I've heard Rust encourages this, although I don't know Rust well enough to comment 2024-10-25 21:12:45 And I can confirm the GCC compiler compiler from the Free Software Foundation works on the SUN computers, as that's the first thing I did when I got landed on one once 2024-10-25 21:14:38 vms14: Absolutely you should read other people's forth code, by the way 2024-10-25 21:14:48 It's surprisingly readable, even for a beginner 2024-10-25 21:15:07 And we'll help if you want 2024-10-25 21:19:18 I take your words, I will come here to cry when I try to understand random forth code 2024-10-25 21:19:23 ty <3 2024-10-25 21:23:53 hell is other people's code 2024-10-25 21:24:11 Well you're not a beginner but you are a beginner in reading other code based on context 2024-10-25 21:24:37 Dunno thrig, it's just not cricket 2024-10-25 21:25:09 If it's not my eighth abandoned Forth implementation then I don't want to hear about it 2024-10-25 21:25:26 Glad to see Rosenberg's still alive and getting up to no good 2024-10-25 21:26:21 It sucks that people like him find the need to apologise for stating their mind, but maybe I'm the asshole and I'm just less self-aware than him 2024-10-25 21:33:23 blunt speech is accepted in some circles and problematic in others, which makes for sometimes complicated cross pond conferences 2024-10-25 21:37:03 veltas: yeah, I don't agree with Rosenberg about a lot of things, but he certainly seems like I'd enjoy talking with him 2024-10-25 21:37:36 I just have this strong feeling for sincerity and will listen to anyone as long as they're being honest, even if I disagree or might be uncomfortable or repulsed, I think that's the pinnacle of civilisation 2024-10-25 21:38:12 KipIngram: Rosenberg's book explains how to use parallel arrays for things, which is a useful technique to have in your toolbag even if you aren't trying to reverse-engineer old Fortran code 2024-10-25 21:39:50 I don't think he's being especially blunt; it's just that there's a certain element of religious fervor in programming 2024-10-25 21:40:19 which tends to crucify anyone who's doing things in an unfashionable way, because it's hard to understand 2024-10-25 21:40:26 I've encountered some bloody sketchy people online, some of which I have been actually afraid of, so I know I do have limits... I think I'm more liberal in that regard than most people in certain social media circles though lol 2024-10-25 21:41:31 heh 2024-10-25 21:42:12 Maybe I should apply Postel's law to conversation more 2024-10-25 21:45:08 On a more technical subject, people are criticising Postel's law these days, can't help but feel like Big Security is behind this 2024-10-25 21:46:23 yeah, priorities are shifting; Postel's law prioritizes interoperability over other concerns such as security, but security is becoming more important 2024-10-25 21:46:44 I think security industry is just being inflated 2024-10-25 21:47:05 All I ever hear about now 2024-10-25 21:47:52 Being forgiving in what you receive and careful in what you send doesn't have to be a security flaw 2024-10-25 21:48:00 no, it isn't on its own 2024-10-25 21:48:03 the security *industry* is worthless, but *security* is very important 2024-10-25 21:48:54 the problem with being tolerant about what you receive is that in many cases it opens up request-smuggling holes 2024-10-25 21:49:09 or schizophrenic-data-file vulnerabilities 2024-10-25 21:49:34 these were not a serious concern until after Postel died 2024-10-25 21:53:44 It's good to understand security, and these attacks, but Postel's law doesn't contradict that 2024-10-25 21:54:03 There's some nuance there, but people are acting like Postel's law is just a total mistake in context of security 2024-10-25 21:54:33 And I think it's a natural inclination of programmers/engineers, because Postel's law runs against the grain of good engineers 2024-10-25 21:56:21 I'd always prefer clear specs, no ambiguity, stripped-down features. Unfortunately those are qualities of a protocol, and when you write a client or server you aren't usually designing the protocol 2024-10-25 21:57:13 as far as I know there are no security vulnerabilities due to being conserviative in what you send 2024-10-25 21:57:20 In my job I work with a protocol, and the spec is a mess (written by humans, unfortunately), and the other implementations out there have a lot of rough edges (also those pesky humans) 2024-10-25 21:58:34 If the choice is to be liberal and interop with a customer's device, or conservative and not work "out the box", then unfortunately business really takes precedent 2024-10-25 22:01:03 Good to still try and understand the security and theory, but too many security movements now are just stuff like "use Rust" or "Postel's law is bad". 2024-10-25 22:01:13 It feels too much like personal preferences taking over 2024-10-25 22:01:13 yes! 2024-10-25 22:01:45 well, engineers have always been inclined to get carried away with enthusiasms for new religious movements 2024-10-25 22:02:30 I get the urge, I'm human and a programmer, and a *good* programmer even, if I allow myself some conceit; so I know what it's like to see a boring annoying technical issue and fantasize about washing it all away with Go instead or rewriting it all etc 2024-10-25 22:02:33 whether that's Unix, Forth, Pick, TRAC, PDP-10s, Macintosh, or whatever 2024-10-25 22:02:54 WAKE UP SHEEPLE 2024-10-25 22:03:32 just five more minutes please 2024-10-25 22:03:50 ACTION hits the sheeple snooze button 2024-10-25 22:04:00 At work right now I'm quite demoralised working with very technical-debt-heavy code, but the areas where it's improving are partly because I'm embracing the mess and trying to do good without perfection 2024-10-25 22:04:13 It's difficult 2024-10-25 22:04:40 it's emotionally difficult because you know that all the problems you're running into are the fault of somebody being SO STUPID 2024-10-25 22:04:57 Like in a weird way because I am responsible for this code I feel bad about its state, even though I didn't make this project or the decisions that led to this 2024-10-25 22:05:37 in a lot of cases the person who caused all these problems by being SO STUPID was me six months ago 2024-10-25 22:06:24 I'm the object of ire for not dealing with all these 'crucial' issues people find with the code, that pale in comparison to what I'm dealing with right now for customers etc 2024-10-25 22:06:27 but knowing that doesn't really help 2024-10-25 22:06:42 yeah, the ire makes it worse 2024-10-25 22:06:57 The backlog grows about ten times faster than it shrinks, not an exagerration 2024-10-25 22:07:29 It's personal, some engineers have a balanced workload and so are in an sheltered existence 2024-10-25 22:07:57 They don't understand why I 'choose' to live in poverty when they are surrounded by ivory 2024-10-25 22:08:27 "an sheltered" 2024-10-25 22:08:46 Friday night, crack one open for me 2024-10-25 22:12:29 heh 2024-10-25 22:12:48 yeah, people can always think of more things they *could* do than they actually have time to do 2024-10-25 22:21:16 I've gone round in circles writing some basic Forth words in AMD64, think I'll need to play about and profile them when I get the chance 2024-10-25 22:21:24 I keep second guessing how the microarchitecture etc works 2024-10-25 22:21:51 it isn't very well documented, despite Agner Fog's work 2024-10-25 22:23:27 I will be using references like that when it comes to profiling and playing around with it 2024-10-25 22:24:04 I don't want to go crazy deep down that rabbit hole, but I do want to at least avoid having some really bad choices in my core words 2024-10-25 22:24:29 I think that if you want good performance you need to write a native-code compiler 2024-10-25 22:26:05 There are many shades of grey 2024-10-25 23:22:26 right, but with an interpreter, the shades of grey are whether you're losing 90%, 95%, 99%, or 99.9% of your performance to the interpreter 2024-10-25 23:31:35 ^ 2024-10-25 23:32:52 if it were me, I wouldn't stress too much about performance. youre going to lose most of it anyway. 2024-10-25 23:33:03 which is good news :) 2024-10-25 23:35:30 Threaded Forth code is somewhere between interpreter and compiled 2024-10-25 23:38:37 I'm bothered by what I lose to the C compiler 2024-10-25 23:38:57 I guess it's on me to demonstrate what I can do performance-wise 2024-10-25 23:41:18 python is hella slow but remains popular 2024-10-25 23:41:57 It's worth bearing in mind that performance isn't just an ideal to me, it's something I measure and understand 2024-10-25 23:42:37 I've done things like rewriting graphics code in Lua and that has left an impression on me 2024-10-25 23:45:09 Performance limits what you can do, starting with the wrong tool can really snooker you down the road 2024-10-25 23:45:33 I am investing a little in trying to figure out where Forth lies in this equation, it's uncertain to me 2024-10-25 23:46:39 I have managed my expectations, sure, but it's also interesting that I already 'expect' decent performance compared to some popular languages 2024-10-25 23:46:48 And yet with such a simple compiler 2024-10-25 23:48:20 besides performance, rapid prototyping is also handy 2024-10-25 23:49:05 You need both really 2024-10-25 23:49:11 For some things 2024-10-25 23:50:02 And I wonder also what Forth can contribute to 'rapid prototyping', because I've not been able to demonstrate that with Forth much