2022-07-01 06:34:30 lisbeths: I've never explored reversible computing so couldn't say 2022-07-01 09:03:18 I think it's possible to implement any boolean circuit in a reversible fashion if you want to. The gates that would otherwise result in information loss accumulate "junk." You can implement a quantum computing circuit that is fully equivalent to any "classical logic" network, and those produce such junk - a standard part of many quantum algorithms is "junk reversal." 2022-07-01 09:04:36 Usually what you want in a quantum computer is for the output to be a superposition of many inputs, and input cases that have different junk output won't super-pose with one another properly. So you have to include a section that "reverses out" the junk. Those bits start out zero - they get junk. When you reverse the junk out you take them back to zero, and now all of your cases have zero on the extra bits 2022-07-01 09:04:38 and will then interfere with one another the way you want. 2022-07-01 09:05:25 That junk reversal stuff really felt like a violation of the quantum no cloning theorem to me, but evidently it works, so I'm looking at it the wrong way somehow. 2022-07-01 09:06:11 Anyway, all quantum computing operations are inherently reversible - it's not possible to have one that's not. 2022-07-01 09:07:00 It's because they're all representable by unitary matrices, and all unitary matrices have an inverse. 2022-07-01 09:08:17 The big argument that Stephen Hawking and Leonard Susskind had about black holes had to do with information loss - Hawking contended that Hawking radiation from black holes carried no information; Susskind said that couldn't be because then information would be lost, and quantum theory doesn't allow that. 2022-07-01 09:08:24 In the end Hawking conceded the debate. 2022-07-01 09:32:17 https://web.cecs.pdx.edu/~mperkows/CLASS_VHDL_99/tran888/lecture003-reversible-logic.pdf 2022-07-01 09:33:05 One of the more interesting aspects of all of this is that at the very theoretical level it's actually erasing information that costs energy in computation. You can reduce the energy required for a reversible computation "without limit" in theory. 2022-07-01 09:33:27 Of course we're nowhere near that limit in our computing technology today. 2022-07-01 09:33:56 Feynman's Lectures on Computation goes into all this stuff. 2022-07-01 09:34:35 I swear, Feynman just had his fingers in pies all over the place. 2022-07-01 09:36:05 He was one of the first people to glom onto the idea of quantum computers in the first place - he noticed that the amount of computer time required to model quantum systems rose exponentially with the size of the system - somehow nature was doing something that required a LOT of work to model. So he speculated that maybe we could turn that around and find a way to take advantage of that complexity, with a 2022-07-01 09:36:07 new type of computer. 2022-07-01 09:37:47 I remember the day he died - I was in an antenna theory class and the prof walked in and told us. 2022-07-01 09:38:36 That was before everyone found out everything in seconds via their phones. 2022-07-01 09:41:52 I sometimes think things were better then - the "speed of information" these days leads to people reacting emotionally almost all at once - back then by the time "most people" found things out the first people who found out had had time to settle down. Overall we reacted more "thoughtfully" to thinks. These days we have a tendency to go berserk, en masse. 2022-07-01 09:43:29 https://www.scribd.com/doc/52657907/Feynman-Lectures-on-Computation 2022-07-01 11:33:05 anyone familiar with flashforth? im wondering if i can run it in qemu or similar since i dont have a board to try it on 2022-07-01 11:34:45 maybe the microchip ide since that has a simulator 2022-07-01 11:40:09 MrMobius: Around six months or so ago I spent some time trying to see if I could get FlashForth running in some free software simulator/emulator or other, without success 2022-07-01 11:40:38 Since I'm a free software advocate, though, I haven't tried any of the Microchip software 2022-07-01 11:41:17 which is in the end the reason I abandoned Flashforth, since it is now dependent on Microchip's prioprietary compiler to build 2022-07-01 11:41:35 MrMobius  What is your application?  That might influence our recommendation. 2022-07-01 11:42:04 I spent some time trying to get Flashforth to build with just gcc compiler and linker, but in the end was not able to get a working build 2022-07-01 11:42:34 Why? 2022-07-01 11:44:13 I had to do some things with the linker script to get the code to be placed at the correct place in memory. I thought I had it figured out, but when I loaded my build on the chip, flashforth wouldn't boot correctly 2022-07-01 11:44:20 skvery, im just curious about the assembly output and optimizations so i want to type in some example programs then examine the generated assembly 2022-07-01 11:44:55 skvery, so I could use the AVR or pic version assuming the optimizations are mostly the same 2022-07-01 11:46:06 Why not look at Mecrisp or gForth - more modern stuff? 2022-07-01 11:46:57 skvery, ive already looked at mecrisp and its optimizations. someone on a podcast was talking about how fast flashforth is and how it can optimize down to a single instruction which doesnt match the optimizations described on the flashforth website so i want to see for myself 2022-07-01 11:49:52 The problem with flashForth as far as I understand is that it uses a cross-compile.  Mecrisp and gForth compiles natively on the chip - pseudo-interpret. 2022-07-01 11:51:11 for mecrisp it depends. the one for MSP430 is tethered and optimizes extremely well before transmitting machine code with no core 2022-07-01 11:52:35 MSP430 Mecrisp also uses on-chip compile for bigger chips - only the tiny ones need the tethered version. 2022-07-01 11:56:42 Compiling natively, very close to the hardware is key to get things working bottom-up quickly.  Cross-compilation forth looses that key benefit.  (I find the compile-flash-run cycle wasting a lot of my time.) 2022-07-01 11:57:08 When I used flashforth on AVR it was compiling on the chip 2022-07-01 11:57:20 after loading core Forth, of course 2022-07-01 11:57:58 In a code threaded system, I'd expect a default behavior of having "very small" primitives just inlined, automatically, instead of called. And *some* of those (e.g., 1+ and 1-) would just be single instructions. 2022-07-01 12:00:10 I guess that qualifies as an optimization, but I hardly think of it as one - just seems like how such a system should work. 2022-07-01 12:00:27 The idea is to profile the program when you need more speed and inline those parts - or assemble them as part of the Mecrisp core (GAS assembler.) 2022-07-01 12:01:38 skvery, ya mecrisp is cool because youre cross compiling but you also get the interactivity since the ARM board is simulating the MSP430 2022-07-01 12:03:06 skvery, I found the MyFFshell/MyFORTHshell program for windows which seems to be able to cross compile but I can't get it to do anything without a board attached 2022-07-01 12:03:17 Have not used that version.  Have used normal Mecrisp quite a bit on the MSP430 series. 2022-07-01 12:03:21 ff-shell.py errored out for me on linux 2022-07-01 12:03:26 skvery: Yes, that's my long term plan. A good profiler and the ability to deploy assembly where I need it. 2022-07-01 12:03:45 But I'd still want a code threaded system to do what I said, because it's "too easy not to." 2022-07-01 12:04:53 I mean, it's more than "nothing" in terms of complexity, but it really doesn't get much easier than that. 2022-07-01 12:05:31 My system's indirect threaded, so inlining isn't available in the same way. 2022-07-01 12:06:57 My latest project is to get Mecrisp going on the microbit V2 and then the BLE interrupts. 2022-07-01 12:08:28 actually, i dont think ff-shell or MyFORTHshell does any compiling. hmm, so then flashforth is not cross compiled? 2022-07-01 12:09:56 OK  then the code should be simpler to trace.  Is it C or assembler?  MrMobius 2022-07-01 12:11:37 skvery, what do you mean? I just started looking into flashforth today so I dont know much about it yet. there are hex images in the directory to flash to the mcu 2022-07-01 12:18:08 although you can build it from the assembly files of course 2022-07-01 12:18:55 seems https://github.com/oh2aun/flashforth/tree/master/pic18/src is the flashforth assembler for PIC18? 2022-07-01 12:26:39 you can build flashforth with the assembly files but only using the Microchip compiling/linking suite 2022-07-01 12:27:10 after loading core on the chip, you compile new words on the device itself. at least, that is the way it is with AVR 2022-07-01 12:28:24 In that case mecrisp is more open - uses gas to assemble the core. 2022-07-01 12:28:51 I was able to build mecrisp without using any proprietary software 2022-07-01 12:29:14 and use the symbols from that for debugging purposes over SWD 2022-07-01 12:29:17 ^ 2022-07-01 12:29:58 ooh have not tried debugging that way... 2022-07-01 12:30:38 very nice experience, using mecrisp symbols + SWD + gdb 2022-07-01 12:31:28 though, since mecrisp includes a disassembler (the see word) often you don't need to bother with that 2022-07-01 12:31:51 https://portal.mozz.us/gemini/gem.librehacker.com/gemlog/tech/20220331-0.gmi?inline=1 2022-07-01 12:32:40 It can be fun to use SWD + gdb to step through the code though, as described in my post above 2022-07-01 12:33:32 step through the code, look at registers, etc 2022-07-01 12:33:50 though for optimization purposes I usually just use the built-in mecrisp disassembler 2022-07-01 12:34:43 lispmacs[work], right I know it can be built. the thing im asking is if i can try it out without an AVR board 2022-07-01 12:34:58 i might be able to use qemu avr or something 2022-07-01 12:35:31 MrMobius: I spent a week or two trying to figure out how to get Flashforth to run in Qemu and some other free software simulators but was in the end frustrated 2022-07-01 12:35:59 Mecrisp works without the AVR board - is that the question? 2022-07-01 12:36:22 Mecrisp is not for AVR, it is for ARM 2022-07-01 12:36:47 hopefully two threads of thought are not getting mixed up here 2022-07-01 12:37:31 MrMobius I understood was asking about simulating Flashforth for AVR. I was chatting with skvery about Mecrisp on ARM (Rpi Pico) 2022-07-01 12:37:42 skvery, I already clarified that above. im not interested in mecrisp. ive seen how it works and im curious about how flashforth works 2022-07-01 12:38:29 Then I am out of my depth, sz. 2022-07-01 12:39:04 MrMobius: I think Flashforth still has an IRC channel on freenode, if you still have an account there, and want to check with them 2022-07-01 12:39:14 also there is their email list 2022-07-01 12:39:43 lispmacs[work], how did you install qemu for avr? there is qemu-system-arm, qemu-system-mips, etc but no separate qemu-system-avr to install on ubuntu at least 2022-07-01 12:39:45 I can only say that I tried to get Flashforth running on free software simulators and didn't find a working solution 2022-07-01 12:42:26 MrMobius: IIRC, there was no package available on my distro either, so I tried other simulators 2022-07-01 12:43:07 oh wait, sorry... 2022-07-01 12:43:17 I use Guix, and it just has one package that covers them all 2022-07-01 12:43:39 qemu package provides qemu-system-avr 2022-07-01 12:44:27 I really should look into making mine run in qemu or something similar. 2022-07-01 12:45:01 I want it to eventually be portable across a variety of common platforms - that would really be a good (and low cost) way to pursue that. 2022-07-01 12:45:33 If I was still interested in Flashforth, I would probably try the Guix qemu-system-avr with the instructions on this page: 2022-07-01 12:45:38 https://www.qemu.org/docs/master/system/target-avr.html 2022-07-01 12:46:17 memory is a little fuzzy, but I think I tried this and it didn't work 2022-07-01 12:46:22 Well, I'm off until 7/12; maybe I should spend some of that time delving into that. 2022-07-01 12:47:05 lispmacs[work], right, that's the link I found for qemu-system-avr. there are no install instructions. installing qemu-system installs 30+ others but not avr 2022-07-01 12:47:06 something to do with the fact that the only working binary I had was the .hex file provided by flashforth, but qemu wants elf 2022-07-01 12:47:19 ah 2022-07-01 12:48:14 MrMobius: my qemu package on guix does provide a qemu-system-avr, though unfortunately that does not help you 2022-07-01 12:49:14 listed here for ubuntu 21 and 22 but not 20 https://pkgs.org/download/qemu-system-avr 2022-07-01 12:49:27 linux version fuckery ftw 2022-07-01 12:50:31 MrMobius: it is actual possible to install Guix on your Ubuntu system and then use it to build Qemu, but not sure if you want to go down that rabbit hole 2022-07-01 12:50:58 in theory, I could also use Guix to build you a stand-alone Qemu 2022-07-01 12:52:15 i dont know anything about guix. im running ubuntu under WSL which is why im on Ubuntu 20 until i get my server back which is ubuntu 22 2022-07-01 12:53:09 lispmacs[work], ill try it if you want to give it a try. maybe it will help you out too 2022-07-01 12:53:13 Debian actually has a guix package available 2022-07-01 12:53:30 is it available on your Ubuntu version 2022-07-01 12:54:01 you would just need to install guix, and then "guix install qemu" 2022-07-01 12:55:18 I think it is only available for ubuntu 22 2022-07-01 12:57:41 I'm trying out the "guix pack" command to see if I can get you a build of qemu with all dependencies included 2022-07-01 13:03:24 On packages of that sort I'm always torn over how to go about it - installing a package from the distro's repos is so easy, but often you wind uup *way* behind the cutting edge. Building from source is often a crap shoot - sometimes it "just works," but sometimes it can drive you half insane. 2022-07-01 13:04:09 I installed ngspice from the repo - I figured that's an old tool and likely wouldn't be missing *too* much from there. 2022-07-01 13:06:34 KipIngram: let me introduce you to Guix :) 2022-07-01 13:06:58 rolling release! 2022-07-01 13:07:36 plus, nifty "time-machine" feature if you want to install from a version of Guix you haven't upgrade to yet! 2022-07-01 13:08:46 "foreign distro" installs also available if you want to use Guix package but not give up your current distro 2022-07-01 13:10:16 MrMobius: So, I was able to build a full-contained, relocateable Qemu for you, using "guix pack" 2022-07-01 13:10:36 unfortunately, however, the tarball comes in at 600 MB, so getting it to you might be a challenge 2022-07-01 13:10:50 heh 2022-07-01 13:10:54 :-) 2022-07-01 13:11:01 I'll definitely look into it. 2022-07-01 13:11:07 Sooner or later I really need to. 2022-07-01 13:11:58 It may be time - I'm in a "build things" mode right now, but I've shied away from anything involving embedded processors for lack of an "easy vehicle" to use. 2022-07-01 13:12:27 But if I had a working build of my Forth for one of the common micros that barrier would just melt away. 2022-07-01 13:12:40 And that would open a ton of additional possibilities. 2022-07-01 13:13:33 It occurred to me while I was reading the earlier parts of this conversation that I should go through my code and so some re-structuring. 2022-07-01 13:14:09 Because scattered about in there I have code that is aimed at setting the host system up the way I want it - like the termios and stuff. 2022-07-01 13:14:44 That stuff will need to stay on the host; even if the system itself is on a remote gadget, I'll still likely be *talking to it* from my notebook. 2022-07-01 13:14:51 And that's where the screen behavior lives. 2022-07-01 13:15:27 So I should go through and segregate all of that sort of thing into a well-defined section. 2022-07-01 13:33:17 so i got simavr working and connected to gdb. the first instruction it executes jumps to uninitialized memory 2022-07-01 13:34:23 MrMobius: what -m device option are you using for simavr? 2022-07-01 13:34:33 atmega328 2022-07-01 13:35:52 I seem to recall running into the same or similar problem with simavr 2022-07-01 13:49:16 hmm, so it starts executing at 0x7E00 and the first instruction is to jump to $1AFC. the next instructions look like garbage 2022-07-01 13:49:57 the first 8 instructions at address 0 are exactly the same. apparently the reset vector is stored at 0 2022-07-01 13:52:19 so if it's an address instead of an instruction, it should jump here which looks like forth code to me: https://dis.yaxpeax.net/avr/F9DD66DD65DD52DD8CDD51D1 2022-07-01 14:05:52 MrMobius: something I'm wonder about is what bootbit fuse settings are assumed by simavr 2022-07-01 14:05:56 https://embedds.com/all-you-need-to-know-about-avr-fuses/ 2022-07-01 14:06:10 like BOOTRST, BOOTSZ0, BOOTSZ1 2022-07-01 14:08:29 good point. i dont know how those are stored in the hex file 2022-07-01 14:08:36 they aren't 2022-07-01 14:08:44 maybe thats why there are 8k at 0x0 and 350 bytes or so at 0x7E00 2022-07-01 14:08:59 I believe that that the flashforth tool sets them 2022-07-01 14:09:07 ah ok 2022-07-01 14:10:41 any clue why the two sets of data in the hex file? 2022-07-01 14:11:20 i vaguely recall there was some forth system stuff that had to go in a very precise location near the end of flash memory, something to do with the boot process 2022-07-01 14:11:43 or with flash writing areas, or both 2022-07-01 14:12:19 okie dokie. should be able to figure that out 2022-07-01 14:13:23 https://flashforth.com/atmega.html 2022-07-01 14:13:36 you see there is a line there showing what fuses have to be set with avrdude parameters 2022-07-01 14:14:19 not sure how that simavr deals with that 2022-07-01 15:44:12 ff appears to run in the microchip IDE but the UART output is blank 2022-07-01 15:44:27 in the simulator 2022-07-01 17:42:24 I got it to boot and output to the UART in simavr! 2022-07-01 17:42:40 Ah, outstanding. 2022-07-01 17:43:36 for some reason, simavr thinks the memory at 0x7E00 is a bootloader. if you switch that to be first and the program second, it works and doesnt say anything about trying to load a bootloader 2022-07-01 17:58:36 MrMobius: How do you switch those? 2022-07-01 18:00:58 just copy and paste in the hex file 2022-07-01 19:54:41 lispmacs[work], it works on this shareware simulator: https://www.oshonsoft.com/avr.php