2023-04-26 04:07:30 And that's why systemd is a lot faster except when it isn't 2023-04-26 04:08:34 I swear I've not gained any performance improvements because they've been wiped out by occasionally having to wait 120 seconds for an unplugged ethernet port to connect 2023-04-26 04:08:56 Or occasionally it refuses to shutdown without wasting 120 seconds waiting for something 2023-04-26 04:09:12 I'd rather have something simpler that's a little slower starting/stopping 2023-04-26 08:39:51 I often look at compiler output when trying to write assembly, to see what possible optimisations they could suggest 2023-04-26 08:40:19 It works well a lot of the time, especially with the basics, but I am starting to run into situations where both GCC and clang output inoptimal code 2023-04-26 08:40:23 And completely different code too 2023-04-26 09:43:30 guys what's your favourite forth implementation? 2023-04-26 09:44:18 I only have tried pforth and gforth 2023-04-26 09:44:54 I had a look at tile forth, I liked a feature it had to bind values from the stack 2023-04-26 09:45:23 https://github.com/cstrotm/tile-forth 2023-04-26 09:46:04 : 2swap { a b c d } c d a b ; 2023-04-26 09:46:06 for example 2023-04-26 09:46:19 the { } does the binding 2023-04-26 09:46:30 it's supposed to be internal to that word 2023-04-26 09:50:01 That's also implemented in gforth, it's a common feature for Forth implementations that implement locals. 2023-04-26 09:50:41 In Forth 200x standard it's {: and :} 2023-04-26 09:50:53 There are ANS implementations of that and { / } about 2023-04-26 09:51:18 There's a "locals" wordlist for ANS but it's not very good 2023-04-26 09:51:40 It's a controversial feature, some swear by locals, some refuse to use them 2023-04-26 09:52:50 It can make some words easier to write, but it also makes many words more verbose. It's definitely easy to get quickly away from a 'forthy' style with it 2023-04-26 09:55:10 gordonjcp: Yeah, systemd looks pretty nice. It's just my first time working with it, and the machine in question is fairly hard to get an OS installed on - I super duper don't want to have to repeat that process. 2023-04-26 09:56:21 To answer your actual question vms14, I use gforth because it's easy to get on Linux. I don't actually like it much though 2023-04-26 09:56:29 KipIngram: I think you're the first person I see saying systemd is nice 2023-04-26 09:56:44 vms14: Those are the same two I have much experience with. I've used pforth in consulting gigs back in the day; gforth I've mostly just "had around" to toy with. Most of what I've done with Forth has been using imps I've written myself. 2023-04-26 09:57:01 gforth have not done a proper release in many years, so I think the team has some philosophical failings there 2023-04-26 09:57:04 KipIngram: forth consulting? :0 2023-04-26 09:57:26 And also the attitude of gforth team is pretty much "who cares about memory", "use C stack as much as possible" etc 2023-04-26 09:57:37 what kind of programs did you sell? 2023-04-26 09:57:57 I will one day move away from gforth permanently, most likely 2023-04-26 09:58:05 I've not looked very much at all at applying "computer sciencey" ideas to Forth. To me "bind" means "make a variable have a certain value," and in Forth that says ! to me. I don't think of it using a fancy word like "bind," though. It's just a "store." 2023-04-26 09:58:27 That's a functional programming thing to call it binding 2023-04-26 09:58:35 I've never put locals into any of my systems, though I have thought a little about how I'd probably do it. 2023-04-26 09:58:39 At least I only see functional programmers say that 2023-04-26 09:58:39 it's a store, but a one that will disappear once the word finishes execution 2023-04-26 09:58:55 It's called scope in procedural languages 2023-04-26 09:58:59 In one system I do have words that will index the stack - I figure for locals I'd use stack effect comments to associate names with those words temporarily. 2023-04-26 09:59:50 I have a design flaw on my not so forth abomination I don't know how to fix 2023-04-26 10:00:02 vms14: Well, I did use pforth in that particular job. I modified it to work over a network socket instead of the usual console and used it as a scripting language for a system I wrote to run a pick and place machine. 2023-04-26 10:00:25 there's no compiling at all, and the dictionary it's a hash table, so a word can only have one definition 2023-04-26 10:00:31 I chose it because it was easy to recompile it. 2023-04-26 10:00:51 And because I could see what was going on in the source code well enough to make the changes I wanted to make. 2023-04-26 10:00:53 the problem is when a word is using another words, if one of those words gets redefined it will use that new definition instead 2023-04-26 10:01:13 some sort of compiling would solve that, but I'd like to retain the feature of being able to modify a word behavior 2023-04-26 10:01:23 Yeah, that means you're modifying the original CFA field of the word. 2023-04-26 10:01:34 Instead of just adding a new word with the same name. 2023-04-26 10:01:52 Or that's what it would mean, in a typical Forth design. 2023-04-26 10:01:53 if it was a linked list, then it would kind of work 2023-04-26 10:02:12 as the old definition would have some sort of pointer to the old definition 2023-04-26 10:02:23 It's been said before that there aren't any good 'standard' C forths, which is bad because lots of people could probably plug those in to embedded problems, or places where they need scripting in an app 2023-04-26 10:02:26 In traditional Forth when you "redefine" a word all you're really doing is adding a new word that will now get found before the old one when you do a word search. 2023-04-26 10:02:27 but I'd like to be able to choose when a word will use newer definitions and when not 2023-04-26 10:02:40 So NEW definitions will use the new one. But stuff that's already compiled isn't affected at all. 2023-04-26 10:02:44 If you can write a decent C-based forth that's somewhat standard then you've got a niche 2023-04-26 10:02:55 But if you go plug a new value into the original word's CFA field, then that changes everything. 2023-04-26 10:03:06 some sory of compiling would also solve that, even when the dictionary is a hash table 2023-04-26 10:03:20 but then I loose the ability to modify the behavior of an existing word 2023-04-26 10:03:31 See, the point is that an already compiled word doesn't have to search the dictionary for its component words. 2023-04-26 10:03:37 It has pointers to them already in place. 2023-04-26 10:03:50 Being a hash table doesn't actually preclude the old behavior 2023-04-26 10:03:50 That's the difference between "compiled" and "interpreted" in Forth. 2023-04-26 10:03:53 I somehow like to be able to make that word use newer definitions when I want to 2023-04-26 10:03:55 Just use closed buckets 2023-04-26 10:04:12 but having this feature as a default it's a bad choice 2023-04-26 10:04:14 vms14: I think what you're doing is always searching for each word, every time. 2023-04-26 10:04:18 Your issue is you didn't even implement the hash table :P 2023-04-26 10:04:22 KipIngram: yeah XD 2023-04-26 10:04:26 Which means you're actually always interpreting. 2023-04-26 10:04:28 there's no compiling 2023-04-26 10:04:41 a colon word is just an array 2023-04-26 10:04:49 I can even modify that array 2023-04-26 10:04:58 and they can have words names and even values directly 2023-04-26 10:05:08 the interprter would push values or interpret word names 2023-04-26 10:05:43 but the problem is even if I make a new package and define words there, if I'm on that package the interpreter will start looking there 2023-04-26 10:06:10 I suppose I can just get rid of this "feature" and get some sort of compiling 2023-04-26 10:06:22 I wouldn't be able to modify an existing word, but meh 2023-04-26 10:06:54 the problem it gives me does not balance the ability to modify existing words by just making a new word 2023-04-26 10:06:59 IMO your style of forth has been highly influenced by the choice of environment i.e. Perl 2023-04-26 10:07:07 yes 2023-04-26 10:07:11 Well, compiled words in Forth ARE just arrays. 2023-04-26 10:07:15 If you had written in C or assembly would probably have been more like a traditional forth 2023-04-26 10:07:17 it's just a matter of what the array elements are. 2023-04-26 10:07:23 it makes no sense to have memory allocation, nor even a call stack, I already have that 2023-04-26 10:07:32 that's why it will never be a real forth 2023-04-26 10:07:37 not even close to it 2023-04-26 10:07:52 Yeah, a Forth trait is the way it exposes the return stack. 2023-04-26 10:08:29 but I always wonder what if I stick more to a real forth 2023-04-26 10:08:42 Lets you do all kinds of nasty disapproved of things. ;-) 2023-04-26 10:08:57 I love the colon words and for me forth's syntax is super nice 2023-04-26 10:09:04 danger power tools may sever limbs 2023-04-26 10:09:14 you just name the words to execute them 2023-04-26 10:09:14 Damn straight. 2023-04-26 10:09:43 the only drawback I see is not having optional parameters, it forces me to use lists 2023-04-26 10:09:47 Yes, exactly - the key thing compiling accomplishes is that you're now working with code addresses instead of word "identifiers." 2023-04-26 10:10:00 and stack juggling, which I can solve with temporary bindings 2023-04-26 10:10:13 But not all languages let you know what those addresses are. 2023-04-26 10:10:17 question regarding use of byte pair encoding in Forth to ‘name’ words being entered 2023-04-26 10:10:42 good idea or just bad? 2023-04-26 10:10:59 Example? 2023-04-26 10:11:05 Not sure what you mean by that, exactly. 2023-04-26 10:15:16 maybe I'll try to do it in the right way 2023-04-26 10:15:33 mainly faking some sort of memory allocation and a call stack 2023-04-26 10:16:01 KipIngram: maybe it was just a brain burp 2023-04-26 10:16:35 You could, but even better would be to do it with a tool that really lets you do it right. Which to me means either assembly or C (gcc, probably). 2023-04-26 10:16:47 but I wonder if I really have to 2023-04-26 10:17:01 :-) You don't have to do anything. 2023-04-26 10:17:03 yeah, you're right KipIngram 2023-04-26 10:17:16 assembly is just the best choice to make a forth 2023-04-26 10:17:28 C is not as nice, but nicer than the other high level languages 2023-04-26 10:17:29 I'm a fan of assembly these days, but you CAN write a Forth in C that is in every respect a properly operational Forth. 2023-04-26 10:17:38 At least you can using gcc and the extensions it gives you. 2023-04-26 10:18:02 And it's pretty fast, too. 2023-04-26 10:18:02 the labels as values extension 2023-04-26 10:18:12 That's almost what gforth do 2023-04-26 10:18:13 Yes - pointers to labels, specifically. 2023-04-26 10:18:17 when I write C code I get even more stupid 2023-04-26 10:18:31 I start to worry about stuff I should never worry about 2023-04-26 10:18:56 like for example I dislike unions a lot cause they make every element of the union use the memory of the biggest element 2023-04-26 10:19:14 Zarutian_iPad: When I read that it struck me as implying that as you read each word you made a table that associated a 16-bit index with it. 2023-04-26 10:19:19 then I use perl which who knows how much memory uses for an element and I don't care 2023-04-26 10:19:40 but in this case it's me implementing it so I start to get picky with everything 2023-04-26 10:19:43 Yeah, and it probably won't tell you where in memory that element "really" is. 2023-04-26 10:20:04 I wanted a stack able to get any kind of type 2023-04-26 10:20:09 On the other hand, in C foo is at &foo. 2023-04-26 10:20:13 I ended having several stacks + a type stack 2023-04-26 10:20:15 xD 2023-04-26 10:20:42 Type stack is non-standard and to some extent "not Forthy," but that doesn't necessarily make it stupid. 2023-04-26 10:20:43 I like the fact the stacks do not exist until you actually put something there 2023-04-26 10:20:55 KipIngram: stupid is the way I did 2023-04-26 10:20:59 one stack is enough 2023-04-26 10:21:12 be it a void* stack or a union type stack 2023-04-26 10:21:27 but I disliked both ways 2023-04-26 10:21:42 Well, stacks can be "empty" in Forth, so we could have a metaphysical debate about whether such a stack "exists" or not. But the RAM you're going to have it occupy exists. 2023-04-26 10:21:43 a void* stack forces me to allocate memory for every item, including integers 2023-04-26 10:21:48 then I have to free them all 2023-04-26 10:22:08 vms14: Maybe try writing C and not caring about these things, write dumb C code. C was actually designed originally as a dumb easy systems language 2023-04-26 10:22:13 a union type stack will use the memory of the biggest element for every cell, which I dislike too 2023-04-26 10:22:18 That's just a dynamic memory stack, and isn't inherently a bad thing. Just not going to be as performant as an array of ints stack. 2023-04-26 10:22:26 yeah, that's why I say I get even more stupid 2023-04-26 10:22:35 cause I shouldn't be worrying about this 2023-04-26 10:22:40 Stupid code is fine though 2023-04-26 10:22:54 So the way you're really deviating from Forth there is by supporting types in the first place. 2023-04-26 10:22:55 not stupid decisions 2023-04-26 10:23:03 Or write bad code and ask other people with more experience "what would you change" and start there 2023-04-26 10:23:14 But... if it's what you want to do, there's nothing wrong with that. 2023-04-26 10:23:25 KipIngram: yeah, I want a stack able to get any kind of type 2023-04-26 10:23:27 Don't just ask anyone, ask someone (arrogantly) like me who actually has real world C experience 2023-04-26 10:23:39 but I could just have a normal stack and pointers to memory 2023-04-26 10:23:44 You're exploring territory, and I think that's almost always a worthwhile thing to do. 2023-04-26 10:24:07 veltas: I usually come to ##c or alike to ask about something 2023-04-26 10:24:10 I show the code 2023-04-26 10:24:21 A lot of people on ##c don't know what they're talking about 2023-04-26 10:24:23 then they start answering everything except what I asked 2023-04-26 10:24:43 Just because someone knows the standard well doesn't mean they have C experience, for example 2023-04-26 10:25:05 Or someone who hangs out on ##c doesn't necessarily have experience or even know the standard well 2023-04-26 10:25:10 Or what the point of the language is or anything 2023-04-26 10:25:32 The actual standards committee editor doesn't even like C and wants it to fail, he has said so in his blogs 2023-04-26 10:25:34 I think I would have more fun with assembly than C 2023-04-26 10:25:43 That's the way I feel about StackExchange. 2023-04-26 10:25:48 but I mainly want to have stuff like sockets, db, etc 2023-04-26 10:25:53 so C it is 2023-04-26 10:25:57 People mostly seem to want to show how superior they are to everyone else. 2023-04-26 10:26:09 It's like Sunday School. 2023-04-26 10:26:14 I asked once in stackoverflow, I won't do it again 2023-04-26 10:26:17 Lot of posturing. 2023-04-26 10:26:20 Unfortunately there's no way to tell difference between people with good or bad advice 2023-04-26 10:26:40 Like I can say I will give good advice, sound arrogant, but really you can't know without also having that experience if I'm full of it 2023-04-26 10:26:55 a guy started editing my question, and I refused to accept the changes, then he started editing it again every time I refused it 2023-04-26 10:27:12 I sent a mail to that guy telling him to stop and that I don't need CSS on my question 2023-04-26 10:27:17 Sure; I get that. But it's just rude to start out demeaning someone. (Not saying you do that - but a lot of folks do). 2023-04-26 10:27:30 he put my mail on a stackoverflow thread and they blocked my question 2023-04-26 10:27:31 XD 2023-04-26 10:27:49 Nice 2023-04-26 10:27:58 Yeah wikipedia is like that too 2023-04-26 10:28:14 I should try to be fair, though - maybe the experience a lot of sensible people have had there is that the place will get overrun by idiots if they're not careful. 2023-04-26 10:28:32 Maybe it's difficult to find balance. 2023-04-26 10:28:56 Any community with a low bar gets overrun with bad quality eventually 2023-04-26 10:29:55 Yeah. I help moderate a reddit community on a fiction series. Lots of posts get made that are basically "Memes," which we have a category for, or fan casting suggestions (which we have a category for). And there are definitely "serious" people who just lose their shit over that - they don't want to see it. 2023-04-26 10:30:00 Also I feel communities tend to get saturated with increasingly toxic people over time 2023-04-26 10:30:06 It's like they want it to be a serious place for serious discussions only. 2023-04-26 10:30:25 So we wound up making those categories precisely so people who don't want to see that content can filter it out. 2023-04-26 10:32:17 And I don't give advice on Forth because I am not experienced enough. I'll give my two cents but never say "DON'T do this", "DON'T do that" etc because I know I don't know 2023-04-26 10:32:30 I'll chime in when I do actually understand things, in the limited areas I do 2023-04-26 10:35:26 Yeah, I think "don't" doesn't really have a place in Forth. 2023-04-26 10:35:45 It's kind of a freedom oriented language, right down to its origins. 2023-04-26 10:36:20 Of course, various things come with hazards. 2023-04-26 10:37:49 dukes of hazards 2023-04-26 10:37:54 thrig's remark about power tools above definitely applies. 2023-04-26 10:38:43 I used to chat with a guy who disliked it for that reason alone - he felt a language should offer more protection to its user. 2023-04-26 10:39:19 some don't like 10,000 compiler warnings and will uninstall haskell or whatever 2023-04-26 10:40:02 I guess it's a "wrong" vs. "unwise" kind of thing. 2023-04-26 10:40:37 if lispers and perl devs are necromancers 2023-04-26 10:40:42 what forthwrights are? 2023-04-26 10:41:04 How are those people necromancers? 2023-04-26 10:41:11 using dead languages 2023-04-26 10:41:19 but forth isn't even considered dead 2023-04-26 10:41:23 it's just unknown 2023-04-26 10:41:34 Oh. Well, heck, you might say that about Forth too. It's not "dead," but it's a pretty small niche. 2023-04-26 10:41:59 if I say forth to an average programming he will say "you mean fortran?" 2023-04-26 10:42:05 I think that's because of its grassroots origins. 2023-04-26 10:42:06 programmer* 2023-04-26 10:42:19 It didn't come out of some high and mighty group like Bell Labs, or some big university. 2023-04-26 10:42:20 depends 2023-04-26 10:43:19 if the guy came into programming from electronics pre pic and pre avr then the answer would be: chuck moores thing? 2023-04-26 10:43:19 I suspect most people who encounter it are immediately frightened off by it being RPN. They probably never even learn about it beyond that. 2023-04-26 10:43:56 If they do keep learning about it, then they encounter "no types," "no well-established package library," and that kind of thing. 2023-04-26 10:43:57 for me rpn is nice, I always do everything in a reverse way 2023-04-26 10:44:04 so at least forth does understand me 2023-04-26 10:44:19 I used an HP calculator in college, so RPN was the thing that sucked me IN instead of driving me away. 2023-04-26 10:44:19 vms14: There are lots of older programmers aware of Forth and respect it as a sort of "this language will show you how the computer really works" magical thing 2023-04-26 10:44:23 C was a somewhat unapproved project at bell, and unix was sold as "not a new OS" 2023-04-26 10:44:26 Then later I began to see the other beauties of it. 2023-04-26 10:44:46 Didn't it have something to do with supporting a text processing operation? 2023-04-26 10:45:01 Patent library, or something like that? 2023-04-26 10:45:07 I just love colon words 2023-04-26 10:45:12 Unix I mean. 2023-04-26 10:45:37 C is just B with types because B doesn't fit nicely on a byte addressed system 2023-04-26 10:45:45 It was something along those lines they called out as the "payoff" for buying the machines they wound up doing Linux on. 2023-04-26 10:45:48 Unix. 2023-04-26 10:46:08 They promised to deliver something specific. 2023-04-26 10:46:15 probably it was in https://www.youtube.com/watch?v=EY6q5dv_B-o 2023-04-26 10:46:52 in my case people told me forth was what I was looking for xd 2023-04-26 10:46:55 And just didn't mention that they were using an experimental OS. 2023-04-26 10:47:06 I just didn't listen it too much 2023-04-26 10:47:09 Good for them. :-) 2023-04-26 10:47:32 BCPL was a barebones CPL, which was better than CPL for most things (and actually existed unlike CPL) 2023-04-26 10:47:39 UNIX was a barebones MULTICS 2023-04-26 10:47:58 Yeah, MULTICS had left a bad taste in some managerial mouths, I believe. 2023-04-26 10:48:28 MULTICS was actually a failure but the design work helped develop UNIX 2023-04-26 10:48:34 Right. 2023-04-26 10:48:41 Failure as a project. 2023-04-26 10:49:29 I know Unix is still around, but for me the big payoff of the whole history is Linux - we actually have a sound operating system that's not owned by some corporation. 2023-04-26 10:49:38 And that is a good thing. 2023-04-26 10:49:56 It may have soft spots, but it's still nice to have it around. 2023-04-26 10:51:45 ACTION uses NetBSD instead 2023-04-26 10:51:49 I really feel that way about Forth too. Sure, it's not a "does everything for everybody" language, but it still offers probably the simplest way to get something fairly powerful onto a new machine. 2023-04-26 10:52:01 Something a single person can build in a reasonable amount of time. 2023-04-26 10:52:32 And something that is EXTREMELY resource frugal. 2023-04-26 10:53:23 I saw a comparison between Unix and Plan9 a while back. It looked like it had some fairly nice new wrinkles too. 2023-04-26 10:54:01 I got the impression that its big emphasis was distributed computing. 2023-04-26 10:54:19 Which is certainly a worthwhile thing to focus on. 2023-04-26 10:55:48 Nice idea for an internet culture. ipfs is similarly interesting. Someone here mentioned blending ipfs and Forth blocks a few months ago, and that seemed like an interesting idea. 2023-04-26 10:56:13 Very straightforward way to share info among different Forth systems. 2023-04-26 11:05:01 Anyway, re: the systemd stuff, I just want to set up a "final entry" in the chain of things done that runs a script I've tucked away somewhere. Initially I'll just have that script append a timestamp to a file or something, so that I can confirm it's been run. Then I have a couple of pci related commands I want to tuck in there. 2023-04-26 11:05:10 Currently I'm running them manually each time I boot the system. 2023-04-26 11:58:00 NetBSD is pretty hardcore IMO, maybe it's easier going now 2023-04-26 11:58:12 OpenBSD is probably just as hardcore if not more so 2023-04-26 12:30:18 What is lxf? I keep seeing it referenced 2023-04-26 12:30:28 It's some forth implementation with good assembly output for locals 2023-04-26 12:30:39 I can't find it with google 2023-04-26 12:37:01 veltas: forth.works/temp/lxf-ntf.zip ad forth.works/temp/lxf-ntf2017.zip 2023-04-26 12:37:17 Thanks, but what even is it? Who wrote it? 2023-04-26 12:38:37 NTF/LXF is a Forth system developed by Peter Fälth; it's an ANS model (mostly?) for Windows & Linux 2023-04-26 12:39:00 Is there a website for it? 2023-04-26 12:39:13 Is it just distributed on mailing lists or something? 2023-04-26 12:40:16 no websites I can recall; I think I found it in a directory off one of the gforth sites 2023-04-26 12:41:05 That is so old-school 2023-04-26 12:41:23 Will have to try it out some time 2023-04-26 12:41:28 Thanks again 2023-04-26 12:42:08 It's just quite annoying that I watch a video about different forths, and the one with the best output I can't even find online anywhere, even though it seems to be shareware at the very least 2023-04-26 12:42:29 Forth is all magic scrolls tucked away in shady libraries 2023-04-26 12:45:38 And I am so tired of explaining the gforth release situation to people as well 2023-04-26 12:45:57 Why am I attracted to such an esoteric ecosystem? 2023-04-26 13:02:56 looks like my copies of lxf came from https://www.complang.tuwien.ac.at/forth/ 2023-04-26 13:04:16 No license for it 2023-04-26 13:08:29 nope :( 2023-04-26 13:09:07 It's quite possible nobody's actually asked him for a license but I don't know if the source code is even available 2023-04-26 13:09:14 so might be he doesn't want to be open source 2023-04-26 13:13:24 I've not looked into it much. There is some source in the blocks, but I dont' 2023-04-26 13:13:51 Creative strings grepping hasn't illuminated 2023-04-26 13:13:52 don't remember seeing anything like a metacompiler in them when I had last looked 2023-04-26 13:14:08 The blocks file is small, it's not got most of the code in it 2023-04-26 13:43:48 veltas: any interesting examples from GCC and clang output? 2023-04-26 13:44:10 at least for X86, you get some non intuitive output sometimes that actually is faster 2023-04-26 13:47:19 What I'm finding for one thing is that -Os gives the most intuitive result, but whether it's faster is quite random 2023-04-26 13:49:43 This is the most recent thing I've looked at which has some minor differences between clang and gcc https://godbolt.org/z/zoG6v749o 2023-04-26 13:51:01 Actually change the top shift to 8, and GCC does a really bad job 2023-04-26 13:51:17 Because I think it gets confused by a being 'int'. If you make it unsigned it fixes its code 2023-04-26 13:51:55 Even though semantically there's no difference, obviously this doesn't fit well with GCC's IR 2023-04-26 13:53:29 This is related to the code for ilo's inner loop which needs to decode the four bytes in each instruction word as opcodes 2023-04-26 14:04:42 Monthly reminder that GCC still freaks out when you use an array unless it's static const https://godbolt.org/z/6fz3K16dj 2023-04-26 14:05:01 This code works just as well either way on clang, so congrats to clang 2023-04-26 15:10:28 Arrays not working in C? That's pretty bad. Such a fundamental thing. 2023-04-26 16:44:02 KipIngram: They work, the issue seems to be GCC fails to recognise a 'constant' array is constant without saying so, in the way that a 'constant' unchanging variable shouldn't need 'const' to be optimised as such 2023-04-26 16:44:53 And I appreciate why that is but it's 2023 and clang handles it, and it's a pretty common thing now to use arrays like that and everyone expects the compiler to "just work" so I think they should try and recognise that 2023-04-26 16:45:24 I don't really mind, I know how to work around it 2023-04-26 16:46:20 But it's a point that compilers aren't *quite* as smart as people say they are. The user still needs to look at assembly occasionally and understand what the output's doing if performance is critical in a function 2023-04-26 16:46:31 THe rest of the time bad assembly output is more useful than having to write the assembly myself 2023-04-26 20:22:13 veltas: not sure what you mean re Os. Isn't the point to sacrifice speed for space? Or do you mean it produces larger than necessary code 2023-04-26 20:23:24 Big O: the shape your mouth makes when you figure out what your code did to the $250,000 CnC mill 2023-04-26 20:26:35 also, it doesn't bother me that the compiler didn't guess that an array was static without the keyword. there's all kinds of stuff compilers don't guess bc it's not that useful. I can't imagine ever leaving off the static const for something like that but maybe it's bc I mostly use microcontrollers 2023-04-26 20:27:41 I thought about rewriting one of my emulators in C to see if the compiler would figure out it can assign registers to the emulated registers but never tried since that would be a very odd thing for the compiler to figure out itself 2023-04-26 20:28:08 since it's a very niche use case 2023-04-26 20:29:11 some folks have fiddled with register priority to cut down on various attacks