2023-12-08 04:33:05 I think eforth works in esp32 2023-12-08 04:35:27 there's a lot of interest im svfig 2023-12-08 04:40:20 also some of the newer esp32s are not xtensa 2023-12-08 07:24:44 I'm not really worried about the "best forth" part; my forth runs on a virtual machine, so I just need to implement that. 2023-12-08 13:04:58 So, what exactly characterizes a funnel shifter? My wild guess is that it somehow achieves an arbitrary shift by concatenating power-of-two bit count shifts based on the bits of the count specification? 2023-12-08 13:05:34 I.e., it has the hardware connections to do any 2^n shift, but not arbitrary n shifts? 2023-12-08 13:05:55 That does seem like a reasonable middle ground between single bit shift and barrel shifting. 2023-12-08 13:08:52 Ah, I found some info on them here: 2023-12-08 13:08:53 http://people.ee.duke.edu/~jmorizio/ece261/classlectures/arithcircuits2.pdf 2023-12-08 13:09:10 And my wild guess looks totally wrong. 2023-12-08 13:12:50 So, is there perhaps a C library that gives you a routine that will take from you a string representing an x86_64 assembly language instruction, and will return to you an array of bytes for the encoding of that instruction? 2023-12-08 13:13:18 That seems like something that ought to exist. 2023-12-08 13:18:07 maybe something in capstone or somesuch? 2023-12-08 13:19:16 Looks like maybe there is: 2023-12-08 13:19:18 https://intelxed.github.io/ref-manual/ 2023-12-08 13:20:15 Doesn't look like it works exactly as I described, but it seems to do the basic job. 2023-12-08 13:20:50 also, unfortunately not written in C (but if you're linking to a library who cares if it's written in C++): https://asmjit.com/ 2023-12-08 13:20:53 Anyway, this C emulator/generator I've talked about - at some point I'm going to need to add the actual vm implementation to the image. 2023-12-08 13:21:04 And it seems like a tool like this could help with that (for x86 targets). 2023-12-08 13:21:13 C++ can be annoying to compile and annoying to link to 2023-12-08 13:21:15 Thanks. 2023-12-08 13:22:17 thrigh: it's possible to make compiling and linking to code written in C terrible too 2023-12-08 13:22:22 thrig* 2023-12-08 13:23:39 sure, but it's easier to get "special" compile times and unusable symbols from C++ 2023-12-08 13:24:01 fair enough 2023-12-08 13:26:08 and I've seen a bunch more "there's no compiler for that yet" due to C++23 or whatever than for folks using too-modern C 2023-12-08 16:23:09 what do you guys like for max column width when writing forth? 2023-12-08 16:24:06 i know classic worth was 64 columns. when i write c i try to target 80. thinking of splitting the difference and restricting myself to 72 2023-12-08 16:34:55 something less than the 80 the terminals are set to, anyways 2023-12-08 17:17:01 40 chars 2023-12-08 17:33:23 I usually limit myself to 64 chars max, but start to squirm a little if a defition get longer than 45 characters or so. 2023-12-08 17:33:49 I use the shortest names I can, though, so if you're a longer name person that would probably come in more like 64. 2023-12-08 17:34:27 I lived in the "block = 16 64-char lines" world long enough to get it kind of burned in. 2023-12-08 17:34:27 orthodoxy from other programmers is to wrap at 120 or even more columns for modern languages 2023-12-08 17:34:46 I despise wrapped lines for program source. 2023-12-08 18: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-08 18: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-08 18:23:18 to columnate lots of similar definitoins, for example 2023-12-08 18: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-08 18: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-08 18: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-08 18:27:36 On my older Forth systems they were 64-char lines, period, even if i didn't use them all. 2023-12-08 18:27:45 This last go round I included linef feeds, though. 2023-12-08 18:28:52 I mostly do this with variables, occasionally words (e.g., http://forth.works/share/ap8tXbLqcw.txt ) 2023-12-08 18:29:41 Yes, I've done it with variables sometimes too. I shorten it to var 2023-12-08 18:29:54 And voc rather than vocabulary. 2023-12-08 18:30:21 I have var and var-n (to set an initial value) 2023-12-08 18:30:50 Ah, nice. I might call that var! 2023-12-08 18:41:21 yeah i call that var! or variable! 2023-12-08 19: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-08 19:13:44 be it stack diagrams or notes on why the code is as it is 2023-12-08 19:19:09 psh comments? ok boomer 2023-12-08 20: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.