2023-01-23 15:56:07 asm.js is quite cool, didn't know that was a thing 2023-01-23 15:56:33 I don't live under a rock, I just don't do web stuff :P 2023-01-23 15:58:00 For those who don't know: it basically lets you write a restricted subset of JavaScript in a way more similar to C, doing some stuff like ORing 32-bit numbers with 0 to guarantee a static rather than dynamic type 2023-01-23 15:58:09 And then it produces faster output 2023-01-23 15:58:40 What's cool is it doesn't require a new browser, you can run all of this on IE6 and it will still work, it just won't have the same level of optimisation 2023-01-23 15:59:19 is there a usable browser yet? chrome had, like, eight zero days last years 2023-01-23 16:00:09 Tried switching back to firefox recently, scrolling doesn't work so I noped out of it quite quickly 2023-01-23 16:00:27 On chrome you can scroll with two fingers on touchpad, on firefox this experience just doesn't work right and nobody can really explain how to fix it 2023-01-23 16:00:41 And it seems like the code on firefox is so extremely complicated nobody will ever fix it 2023-01-23 16:01:00 So much for "smooth scrolling" 2023-01-23 16:01:37 that sounds like a long way to answer "no" 2023-01-23 16:02:15 Complaining at me for a long answer, you are aware KipIngram is resident on this channel as well? :P 2023-01-23 16:04:46 The only decent thing in computers is operating systems. There is Linux which 'probably' works for you and can do most mainstream stuff, sometimes with a bit of pain, and provides a friendly UI for people who don't want to be abused by software 2023-01-23 16:05:04 And then there are other alternatives like OpenBSD if you have issues with Linux 2023-01-23 16:05:51 What do we have for serious open hardware? Open laptops? Open phones? How 'open' are the processes behind RAM, PCIE, USB, etc? Can't even access half of those for free. 2023-01-23 16:06:33 You have one browser that 'works' and it's run by a company thats business model is collecting your data and knowing everything you do and think 2023-01-23 16:08:02 Everything's moving away from independent machines and into the cloud, even though the cloud companies are just doing this to leech massive amounts of money 2023-01-23 16:08:49 Pretty much every normal person uses MS Office, Facebook or another crappy social network, the 'public forum' for politics and serious journalism is apparently Twitter 2023-01-23 16:12:34 You've got a free internet that was designed with certain principles in mind, the part people actually use today is controlled by about 5 people who think quite similarly 2023-01-23 16:13:42 So anyway, it's my opinion that if you care about Forthy ideas for programming, or anything else, you should have an opinion on this stuff. And then ideally people would have some ideas on how to usurp this, or at least coexist 2023-01-23 16:14:57 /rant 2023-01-23 16:18:52 I suppose C compilers are alright. We've got GCC which is good. And then there's LLVM/clang, TCC. You're not buying a subscription to use this stuff, it's fast, you've got small and big projects. 2023-01-23 17:03:52 I quite agree with the spirit of all of that. You're exactly right. 2023-01-23 17:07:03 Hello folks, i have likely a dumb question. are there any extension libraries for forth like with most? like SDL or other stuff like that 2023-01-23 17:07:21 And I also agree that the same sort of mentality that creates an appreciation for Forth likely does lead to having said opinions. 2023-01-23 17:07:31 There's a common factor in those. 2023-01-23 17:08:01 I don't know - an "appreciation for autonomy?" 2023-01-23 17:09:02 Here's an interesting challenge: 2023-01-23 17:09:19 : quadratic ( a b c -- root root) ... ; 2023-01-23 17:09:32 No RAM. 2023-01-23 17:09:56 It's ok to presume the roots are real. 2023-01-23 17:16:54 KipIngram: just curious, why lodsw if youre on 64 bit x86? 2023-01-23 17:17:32 KipIngram: this book is excellent by the way. it will teach you most of what you need for x86-64 - http://www.egr.unlv.edu/~ed/assembly64.pdf 2023-01-23 17:18:11 Willy--: mecrisp stellaris is an amazing forth for various cortex M0/M3/M4 boards including a lot of STM boards 2023-01-23 17:18:39 in my opinion, ignore everything else for cortex M and just use that. it produces optimized machine code which is quite rare in embedded forth 2023-01-23 17:18:54 Since i'm putting all the xts into a table, I'm taking advantage of the opportunity to be able to span 64k word xts with just 16-bits. 2023-01-23 17:18:58 So, to save space. 2023-01-23 17:19:01 mecris-across is based on that and produces optimized machine code a different chip called MSP430 2023-01-23 17:19:01 More compact. 2023-01-23 17:19:39 In a regular space where the xt's are mingled with the other parts of the word they are more spread out and they aren't on even spacing. 2023-01-23 17:19:57 So you'd support far fewer words with 16 bit xt's. 2023-01-23 17:20:18 Willy--: as far as saving the source of the word you typed in, you cant. you can tinker interactively until you get the word how you like it then type it into a file that gets loaded every time you reset the project 2023-01-23 17:20:43 mecrisp will also let you produce a binary on your PC then you can upload it yourself but that seems to be a much less common way to do things 2023-01-23 17:21:13 gzar: I'm just starting a new Forth and am leaning toward integrating SDL. 2023-01-23 17:22:45 MrMobius: The main advantage 32-bit xts have over 64 is greater address span, so we "never run out of room." 2023-01-23 17:23:13 KipIngram: what I mean is why are you using lodsw to move things into the registers instead of mov? 2023-01-23 17:23:15 By compressing the xt's into a packed table, I get the absolute most mileage, in terms of word count support, from any given width. 2023-01-23 17:23:18 regardless of xt size 2023-01-23 17:23:28 I think 64k is more than enough for anything I'll want to do, so that says 16 bits. 2023-01-23 17:24:03 Oh, just because it is a shorter next. I timed them once; they're really close to the same. 2023-01-23 17:24:17 lodsw does exactly what you need it to do. 2023-01-23 17:25:05 so youre using SI for the thread pointer? 2023-01-23 17:25:10 a couple of bytes more or less on the size of next really isn't going to make much difference. 2023-01-23 17:25:23 To some degree is a matter of aesthetics - it just pleases me to have it be small. 2023-01-23 17:25:43 Yes, since it's what works with the lods instructions. 2023-01-23 17:28:36 ok cool :) 2023-01-23 17:29:35 if you know the Agner Fog material, you can see there LODS can hurt performance but then again, that level of optimizing is not necessary for most things 2023-01-23 17:34:01 I'm not familiar with that. 2023-01-23 17:34:10 But it looks "Google-able." 2023-01-23 17:34:52 basically five free pdf manuals full of gold when it comes to optimizing x86 asm: https://www.agner.org/optimize/#manuals 2023-01-23 17:35:05 thank you. 2023-01-23 17:35:15 I only tested it very lightly. 2023-01-23 17:35:28 Quite a few years ago. 2023-01-23 17:36:01 np! not saying you shouldnt use LODSW especially if you like it being short and sweet. just pointing out that x86 is so non-intuitive that something like the Fog manuals is an awesome way to optimize 2023-01-23 17:36:07 assuming you want to optimize that is :P 2023-01-23 17:36:46 LOOP for example sometimes has a performance hit which you wouldnt guess 2023-01-23 17:37:04 INC is also paradoxically worse for performance than ADD 1 2023-01-23 17:37:10 Yeah. It's really received a lot of... not necessarily well organized work over the years. 2023-01-23 17:37:11 lots of weird stuff 2023-01-23 17:37:32 No, by all logic lodsw should be faster. 2023-01-23 17:37:43 It accomplishes the same data manipulation with fewer bytes fetched. 2023-01-23 17:38:24 right but bytes fetched isnt always the bottleneck. LODS produces multiple u-ops which can cause problems 2023-01-23 17:38:44 I'm not arguing against the claim. 2023-01-23 17:38:45 although I do wish we could go off instruction length only :P 2023-01-23 17:42:52 The 16-bit xts - I've just spent the last few years working with 32 bits and putting up with having my system, once it's fairly far along, being up in the 16-20k range. 2023-01-23 17:43:05 It would just be neat to have it back in the 8-10k range. 2023-01-23 17:43:39 Though if I wire in SDL it certainly won't be, but I'd still probably keep up with "my part." 2023-01-23 17:45:45 KipIngram: I hate the word, but Forth is very 'democratising' because the whole stack is accessible to a novice 2023-01-23 17:52:41 Cool KipIngram , i suppose for say, pforth there arent any libraries like that 2023-01-23 17:53:38 forth is kinda lacking in the "copy CTAN" department for various reasons 2023-01-23 17:54:41 i understand, i was just wondering how it supports sockets and networks or is that already part of it? 2023-01-23 18:01:11 pforth is the C one right? 2023-01-23 18:05:34 Yeah. 2023-01-23 18:05:40 Been around a long time. 2023-01-23 18:05:48 I used it way back in 2003 or so. 2023-01-23 18:06:09 I do think "democratizing" applies well to Forth. 2023-01-23 18:06:28 yeah 2023-01-23 18:06:44 Even though not everyone does it, Forth really is a complete control system for a computer that one person can build themselves. 2023-01-23 18:07:02 There's a sort of "power" in that. 2023-01-23 20:54:22 MrMobius: I don't know if I'm tuned in to exactly what you did with your Python asm tools. But what's cooking up in my mind is to generate nasm source that produces a -f bin image. A single block of image data, within which I can have all of the "sections" I want. And contrary to what nasm will let me do directly, each section will be aware of where the others are, and so can refer directly to specific 2023-01-23 20:54:24 locations within them. 2023-01-23 20:55:29 And the goal will be to be able to run a program that allocates a ram buffer, places that image in it, and jumps to it. The initialization code will probably need to doctor up some pointers to account for where it's been loaded, but the code to do that will have been generated. And then it'll be off to the races. 2023-01-23 20:55:57 No "os tinkering" with the image at all. 2023-01-23 20:56:52 My code will know where all the spots that need the base address added (to what in the image will be an offset) are. 2023-01-23 20:57:20 Because the Python will keep a list of those places, and when it produces the init code the whole list will get handled. 2023-01-23 20:58:11 I see the init code being placed at the end, in a spot that the Forth will overwrite soon after it begins to run. Once those offsets have been patched up, we won't need that code anymore. 2023-01-23 20:58:54 seems like you could use malloc or whatever the linux syscall is that underlies it to get a big chunk to stick that into 2023-01-23 20:59:10 Yes, exactly. 2023-01-23 20:59:30 hmm, you might not actually need macros if it's relative 2023-01-23 20:59:57 I already kind of do that. When my system loads, its init code allocates a big buffer and copies the image that the OS loaded into it. 2023-01-23 21:00:15 I need for my sections to know where each other are. 2023-01-23 21:00:25 Nasm won't let me reference one section from another one directly. 2023-01-23 21:00:54 do you mean .text, .data, .bss etc by section? 2023-01-23 21:01:06 Yes, except I need several. 2023-01-23 21:01:20 .bss can't be initialized, so it's not very usable. 2023-01-23 21:01:33 I use .text and .data primarily in my existing system. 2023-01-23 21:02:02 This time I'll just produce one section at the nasm level, but I'll regard it as several different regions in different places. 2023-01-23 21:02:24 And in my Python I'll be able to do something like when I "switch sections" in nasm. 2023-01-23 21:02:35 you can reference labels from one section in another section. is that not what you need? 2023-01-23 21:03:12 Like to compile a definition, I'll want to allocate a CFA pointer in the CFA table section, a PFA pointer in the PFA table section, a name string in the header section, and then the definition will go in the body section. 2023-01-23 21:03:19 And the header section has a table too. 2023-01-23 21:03:29 So I see at least five regions I'm going to build. 2023-01-23 21:03:53 should be easy if you mean constructing those five things at compile time 2023-01-23 21:04:08 Yes, that's what I mean. 2023-01-23 21:04:15 And yeah, I don't see any roadblock here. 2023-01-23 21:04:22 I just have to do it carefully. 2023-01-23 21:04:33 And take a little time to get the code nice and organized. 2023-01-23 21:05:39 I think that would be easier in Python though to be honest 2023-01-23 21:05:48 I think so too. 2023-01-23 21:06:19 Especially because I think I just need to take these ideas a little further than nasm seems to take them. Maybe nasm would let me do this, but I'd likely have to fight to figure out how. 2023-01-23 21:06:27 If I write my own Python I'll know how it works. 2023-01-23 21:07:01 I intend for it to be possible to move these sections around, even at runtime. I may run out of room in some spot and need to shift other stuff out of the way. 2023-01-23 21:07:08 Occasionally. 2023-01-23 21:08:24 as for my Python tool, the 6502 has 256 bytes of zero pages which are like registers since they are faster and serve special functions like pointers. If you can't index into that fast memory quickly to use it as a stack, it makes sense to build a call tree and allocate fixed pieces of the memory to each function. The Python tool lets me have abstractions like functions, function arguments, and local variables by assigning fixed 2023-01-23 21:08:25 addresses in the scarce zero page. 2023-01-23 21:09:11 the cool thing about Python is you can save a table or something until it's done being built then put it anywhere in the source you like. it's a lot more painful in nasm usually 2023-01-23 21:09:12 Ah. Yes, I vaguely knew 6502 had that fast section. 2023-01-23 21:09:28 At some "ran across it years ago" level. 2023-01-23 21:10:49 So for this timer tick thing, I'm going to let each pass through NEXT count down a register. It'll hit zero every million times or so. And when it does, I'll take a conditional jump out of the nice tight NEXT and will grab an xt from a variable and EXECUTE it, and then reload the counter and carry on. 2023-01-23 21:11:13 So I'll be able to write any word I want and poke its xt into that variable. And I'll just put anything I want there. 2023-01-23 21:11:24 like a timer interrupt? 2023-01-23 21:11:33 Keyboard timing for escape sequence detection, etc. 2023-01-23 21:11:35 Yes. 2023-01-23 21:11:56 Background tasks, whatever. 2023-01-23 21:12:14 That one xt will really just be a "hook" into whatever infrastructure I care to build. 2023-01-23 21:13:04 For profiling, I can hook the profiling code in there too and reduce the count to 2, so that I go through it for every NEXT. 2023-01-23 21:13:18 That will be quite slow, of course, but profiling needs to see everything. 2023-01-23 21:14:40 Obviously I wouldn't write it so in that situation it did everything every time. It would just do the profiling stuff every time; the rest would still be occasional. 2023-01-23 21:15:18 I already have this countdown in my existing system; I'm just not doing anything with it except reloading the counter. 2023-01-23 21:25:05 -nan isn't a good position for a orbital body 2023-01-23 21:25:35 I guess that's hyperspace or something. 2023-01-23 21:25:45 yeah maybe dark matter is nan 2023-01-23 21:26:16 millions of Glorkians were just wiped out by my errant code 2023-01-23 21:44:53 Oh, this is nice: 2023-01-23 21:44:56 https://technical.swissmicros.com/decoders/dm42/index.php 2023-01-23 21:45:42 The Swiss Micros DM42 will show up as a USB disk on your computer. You can save your programs from program memory into that file space, and it comes off as a ".raw" file. 2023-01-23 21:45:52 That web page will decode and encode. 2023-01-23 21:46:18 So you can write a program in vim or something, upload it there and make a raw file - send it over to the calculator. 2023-01-23 21:51:40 chip programmers used to be a bit more expensive and complicated 2023-01-23 21:58:14 MrMobius: Python could be used there too, to "generate" really involved DM42 programs, that you then encoded and sent to the machine. 2023-01-23 21:58:41 There's a way to write a program to set up really fancy hierarchical menu systems, that are beyond what the calculator will do natively. 2023-01-23 21:58:49 But those are really tedious to write manually. 2023-01-23 21:59:01 Python could make short work of it, though. 2023-01-23 22:03:03 It also looks like you could use that site to completely reverse engineer the instruction set. Though it's not necessary; the software is open source anyway. 2023-01-23 22:03:11 You can get versions for your computer. 2023-01-23 22:03:17 Free42 2023-01-23 22:04:18 neat idea 2023-01-23 22:05:27 The HP-42S had this "CST" key - custom menu. When you hit it, soft key labels appeared at the bottom of the display, and you could assign things to them; the top row of the keyboard triggered them. 2023-01-23 22:05:41 But those top keys also did other things, so you needed that to be something you could toggle. 2023-01-23 22:05:49 Didn't really make sense to leave it on all the time. 2023-01-23 22:06:08 But the DM42 adds a new row of unlabeled keys up there, so on it it does make sense to leave CST on all the time. 2023-01-23 22:06:16 If you want to, of course. 2023-01-23 22:06:36 But out of the box it's not hierarchical. There are three rows that you can arrow key around, so you get 18 things. 2023-01-23 22:06:44 But apparently people still find that limiting. 2023-01-23 22:06:56 So this programming technique lets you break that barrier. 2023-01-23 22:07:18 It's limited only by the fact that it relies on two-digit labels, so 99 is the new limit. 2023-01-23 22:07:27 Well, a hundred maybe. 2023-01-23 22:07:39 Though 00 may get used for something else. 2023-01-23 22:10:18 The other neat feature is that you can save what they call "state files" off to the side on the calculator. That specifies the entire calculator setup. 2023-01-23 22:10:42 So you can have multiple of those lying around, for different applications, and just load up the one you want at any given time. 2023-01-23 22:11:05 That goes a long way toward lifting the "limits" of the programming environment itself. 2023-01-23 22:11:50 That was a big weakness of the HP-42S. The HP-41 had communication tools, but the 42S had nothing. 2023-01-23 22:12:02 You wrote it down on a piece of paper to get it out, and punched it in to get it in. 2023-01-23 22:15:42 some professors were not amused at the communications offered by some HP calculators during exams 2023-01-23 22:18:37 I think the TI models with a 6 foot link cable were more of a danger than the few inches the HP IR port could reach