2023-12-09 00:22:58 KipIngram: most of my definitions don't span a full 64 columns, but because many of my definitions are so short and repetative, i often like to write multiple things on one line 2023-12-09 00:23:03 zelgomer: I've gotten into the habit of limiting lines to a max of 64 characters, including for languages other than Forth. 2023-12-09 00:23:18 to columnate lots of similar definitoins, for example 2023-12-09 00:25:28 I occasionally have more than one word per line, if they're short enough and it doesn't make the source too dense 2023-12-09 00:26:52 zelgomer: I've done that in C sometimes. Usually if a few very short statements are "functionally integrated" with one another. 2023-12-09 00:27:20 And once in a while I've done it in Forth too, when it made the difference whether a set of source would fit in a block. 2023-12-09 00:27:36 On my older Forth systems they were 64-char lines, period, even if i didn't use them all. 2023-12-09 00:27:45 This last go round I included linef feeds, though. 2023-12-09 00:28:52 I mostly do this with variables, occasionally words (e.g., http://forth.works/share/ap8tXbLqcw.txt ) 2023-12-09 00:29:41 Yes, I've done it with variables sometimes too. I shorten it to var 2023-12-09 00:29:54 And voc rather than vocabulary. 2023-12-09 00:30:21 I have var and var-n (to set an initial value) 2023-12-09 00:30:50 Ah, nice. I might call that var! 2023-12-09 00:41:21 yeah i call that var! or variable! 2023-12-09 01:13:06 why I like to use 40 chars wide is twofold: I can use the other 40 or so char for comments 2023-12-09 01:13:44 be it stack diagrams or notes on why the code is as it is 2023-12-09 01:19:09 psh comments? ok boomer 2023-12-09 02:04:20 comments are good. I don't really do inline comments other than stack effects. On my system using files, I have a system of comments, code sections, and test sections. On the block based system, I either have full line comments or keep commentary in separate blocks. 2023-12-09 16:15:55 I'm also looking into storing comments separately from the source itself. I'm not 100% sure exactly what sort of display options I have in mind. I've thought about popping comments open in a separate text box, but another possibility is to be able to toggle on/off whether some of them display "inline" with the source. 2023-12-09 16:16:30 I do want the connections between the source and the comments to be "explicitly stored" in some way, though. I've thought a b+tree seems like it could do that well. 2023-12-09 18:08:16 Honestly I've regarded my averstion to the visual appearance of comments as a bit of a problem. I recognize the value of good comments. But I've been known to put them in and then go back and take them out because I think they're making my source ugly. :-( 2023-12-09 18:09:16 I watched a bunch of Aaron Hsu's APL codefns stuff, and some of it was on his "philosophy" of proramming. In one he actually said outright that you didn't have to feel bad for not commenting, and I wanted to clap. It felt like a degree of vindication. :-) 2023-12-09 18:09:49 "Maybe I'm ok after all..." 2023-12-09 18:14:27 noobs need a lot more comments 2023-12-09 18:20:31 And it's hard for me to imagine code more "dense" that Hsu's APL code. It's generally just a solid page-filling slab of text. 2023-12-09 18:21:05 asyncBigGrid config image? 2023-12-09 18:21:15 Bit* 2023-12-09 18:47:21 how do i convert single precision integers to floats 2023-12-09 18:48:01 IEEE 754 single precision floats? 2023-12-09 18:48:06 yea 2023-12-09 18:48:35 like if i have 1 on stack how do i get 1e on the float stack 2023-12-09 18:49:03 depends on the forth but I guess I->F or some such 2023-12-09 18:49:34 gforth 2023-12-09 18:50:19 what does gforth documentation say? 2023-12-09 18:50:52 it has double to float 2023-12-09 18:51:07 but i didn't find single to float 2023-12-09 18:51:18 integer to float? 2023-12-09 18:51:23 yea 2023-12-09 18:51:36 no such? 2023-12-09 18:51:55 yes. they have d>f but no equivalent for single precision integers 2023-12-09 18:52:35 here's the source i'm using: https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/index.html 2023-12-09 18:53:40 s>f 2023-12-09 18:54:19 oh thanks :) 2023-12-09 18:54:29 https://forth-standard.org/standard/float/StoF 2023-12-09 18:55:06 ACTION hasnt used floats in any of the forths he had used 2023-12-09 18:56:06 ACTION also thinks it's very niche, but they are doing Codewars katas which for some reason like using floats 2023-12-09 18:56:14 gforth also has f.s for printing out the floating point stack 2023-12-09 18:56:32 (I just guessed at that and it worked :P ) 2023-12-09 18:57:34 Never let 'em know your next move... s>d d>f 2023-12-09 19:02:56 Joa003: I use the floating point instructions to do that. 2023-12-09 19:03:08 There's a "load integer" instruction, that will just handle the whole job. 2023-12-09 19:03:32 You can slurp it into the FP circuitry as an int and then store it back out as a bit pattern. 2023-12-09 19:04:08 I also used the floating point hardware to input floats directly; I capture the mantissa and the exponent as integers and then do some calculations. 2023-12-09 19:04:30 You can't do 10^x "directly," but you can get there with a few instructions. 2023-12-09 19:05:07 I also count the digits to the right of the decimal point when processing the mantissa as an integer, and correct for that (change the power of 10) later on. 2023-12-09 19:05:54 I'm not sure I can find that code, though - I haven't written it in my current system yet, and I think my old source has gotten away from me. 2023-12-09 19:10:24 I think a case could be made for doing it without fp instructions back when fp was an optional coprocessor thing, but these days if you're writing x86 code you have those capabilities. That makes it the slam dunk way to go in my opinion. 2023-12-09 19:12:07 Also, in that process of achieving 10^x there is one unexpected wrinkle - one of the instructions you have to use requires that its argument be in the range 0-1, or 1-2, or something like that. That involves a little hoop jumping (some shifting) and you have to remember to correct for that later too. 2023-12-09 19:16:40 ls 2023-12-09 19:17:40 crc: directory is empty 2023-12-09 19:18:51 :) 2023-12-09 22:24:50 comprehensively verifying an assembler scares the bajeezus out of me 2023-12-09 22:25:02 why? 2023-12-09 22:25:21 seems like an overwhelming undertaking 2023-12-09 22:25:46 depends on the architecture you are targetting 2023-12-09 22:26:02 i've only written the basic ALU instructions so far and the number of different registers and addressing mode permutations is turning out to be enormous 2023-12-09 22:26:38 aah, Crappy Istruction Set Computing 2023-12-09 22:26:44 yes :( 2023-12-09 22:27:15 it's x86 2023-12-09 22:27:33 i have some idiotic fantasy of being self hosting before i start targetting good ISAs 2023-12-09 22:27:58 you can just target a subset of the addressing modes 2023-12-09 22:29:46 true. i'll probably never get any value from actually supporting the 8-bit instructions. and i sure as hell don't plan to implement the full instruction set