2024-08-15 00:00:17 rather than useful 2024-08-15 00:01:10 in most programming languages you have the difficulty that it's difficult to say enough on one line to make it useful to program them over IRC 2024-08-15 00:07:44 in standard Forth you instead have the difficulty that redefining an existing word doesn't change the behavior of the things defined in terms of it; you could imagine a simple option to do that 2024-08-15 00:09:18 redefined put; to replace the old definition and recompile the 8 definitions dependent on it and the other 53 definitions you've defined since then, type replace put 2024-08-15 00:10:22 do you mostly use RetroForth interactively, or by loading source code from files? 2024-08-15 00:11:51 in retroforth, mostly from files 2024-08-15 00:12:52 in my other forth, konilo, I use blocks instead of files, and I only use that system interactively 2024-08-15 00:40:39 i think most irc bots i've seen that try to offer some sort of interactive REPL tend to fail due to a lack of a line editor, which makes fixing the inevitable bugs hard to do, and the multiline nature of most languages just ends up creating too much channel noise for most users to tolerate 2024-08-15 00:56:06 the ideal bot would allow each irc to create their own memory image where they can define words, and interact with it over PM 2024-08-15 00:56:38 each irc user, I meant 2024-08-15 00:57:57 yeah‚ I think probably the bot would need a channel of its own that's exclusively for interacting with the bot 2024-08-15 00:58:25 so that you'd only see stuff on this channel when someone wanted to use it as part of a conversation 2024-08-15 00:59:28 I think a bot channel would be superior to PM for making it possible to learn how to use the bot 2024-08-15 00:59:55 because if all that defining and interacting and debugging and bug-fixing happens in privmsg, nobody else can learn from it 2024-08-15 01:02:58 lispmacs[work]: I did that in one of my retroforth bots 2024-08-15 01:07:38 it'd be nice to have some ability to interact between the different users' code 2024-08-15 01:27:54 i like the bot channel idea 2024-08-15 01:29:44 it may be interesting to split the bot service into two parts, maybe an evaluation bot that focuses on providing an interpreter in a public/channel view, and an editting bot that allows users to mess around on their own in a PRIVMSG session with the bot directly 2024-08-15 01:44:36 because people might be too embarrassed to write bugs where other people can see? 2024-08-15 01:46:00 maybe that too, but i was thinking it might be too noisy if more than one of us is trying to figure stuff out at any given time if the only interface is via PRIVMSG #channel 2024-08-15 01:46:58 definitely the option should be there that you can proudly display your pest control bounty in channel too though 2024-08-15 01:47:46 sounds like maybe a feature to add later if the problem comes up 2024-08-15 01:48:14 right now I'm trying to figure out how redefining words should work 2024-08-15 01:48:37 it's probably just a case of allowing the bot to answer requests from lines that indicate if the sender's target was the bot's nick name or the channel name ;) 2024-08-15 01:49:11 right, but I mean, it's a feature that might turn out to have undesirable effects in a social context 2024-08-15 01:49:23 especially at first 2024-08-15 01:50:00 ok 2024-08-15 01:50:36 what are you going to write the bot in? 2024-08-15 01:52:30 I don't know, I might not 2024-08-15 01:52:54 probably I'd write a first prototype in Python if I did it though 2024-08-15 01:53:24 what do you think about sticking gforth in the most minimal vm anyone of us can tolerate hosting, and shimming gforth {stdin, stdout, stderr} streams to some small program that passes data between them and the irc server (parsing implied) 2024-08-15 01:53:38 Gforth doesn't have multiuser support 2024-08-15 01:53:39 as a proof-of-concept? 2024-08-15 01:53:41 AFAIK 2024-08-15 01:54:19 and it also doesn't have `forget` 2024-08-15 01:54:19 i think you're right 2024-08-15 01:54:58 which seems like it might be critical 2024-08-15 01:55:01 maybe the small glue program could spawn a bunch of gforths and create unix users for each irc user that interacts with it 2024-08-15 01:55:18 sure, but the bunch of gforths wouldn't be able to interact 2024-08-15 01:55:35 you couldn't import somebody else's definitions 2024-08-15 01:55:40 they could possibly REQUIRE files from other user's home directories 2024-08-15 01:55:57 yes, that's true 2024-08-15 01:56:04 all the users could be part of the same group and their umasks could have group readable permission enabled by default 2024-08-15 01:56:18 I think it would be more interesting to have them all running in the same process 2024-08-15 01:56:33 but admittedly that's more challenging to implement, especially robustly 2024-08-15 01:57:01 i agree, i'm just thinking about the quick dirty way to make it happen 2024-08-15 02:00:05 the upside to this quick & dirty approach is that you could possibly have other implementations like retroforth to play with on demand 2024-08-15 02:00:35 maybe what i'm thinking of is basically just a shell account server but exposed via irc 2024-08-15 02:04:24 I'm thinking that in a line like this: 2024-08-15 02:06:07 : [[ postpone [ ; immediate width height * value size : ]] ] ; 2024-08-15 02:06:24 (which admittedly is kind of stupid but valid) 2024-08-15 02:07:00 and you want to implement my hypothetical `replace` word so that you can redefine `size` or `[[` later 2024-08-15 02:07:44 how do you know that `immediate` is part of the definition of `[[` but `width` is part of the definition of `size`? 2024-08-15 02:08:47 I kind of grew up on BASIC interpreters where retyping a line of code in order to replace it was not only a sensible way to edit your program but actually the only way I could figure out how to do it 2024-08-15 02:08:58 (with a line number) 2024-08-15 02:10:21 I mean you don't need to know it IMMEDIATEly to replace `size`; you can just reach into the dictionary and point a pointer at the new definition 2024-08-15 02:11:14 but if later on you want to `replace` something earlier in your program that might affect how your new `size` definition is compiled, you need a source-code version of it 2024-08-15 02:11:47 here's an even uglier version of the problem: 2024-08-15 02:12:07 create grid width height * dup allot value size 2024-08-15 02:21:20 i guess at face value, there's nothing to differentiate immediate and width based on the tokens alone and their neighbours. the viewer has to be aware that immediate is somehow special and modifies the last word defined 2024-08-15 02:23:05 right, what I mean is that if I'm programming a bot over IRC, and I want to change the definition of size or [[, I'd rather not have to use ed-style s,,, commands to do it 2024-08-15 02:24:00 I'd rather just provide the new definition. in standard Forths, though, the new definition won't be used by existing words (unlike in Lisp or ColorForth) 2024-08-15 02:24:49 so I could have a command like replace size which does the necessary surgery — and consequent recompilation 2024-08-15 02:24:50 other syntax ideas: (algolish) line[tokenIndex] = replacement (hsilop) replacement n line token! 2024-08-15 02:25:10 haha, hsilop 2024-08-15 02:25:45 but I don't want to count, I have a computer to do that for me 2024-08-15 02:26:33 I mean in Lisp the workflow is just to eval the edited define or defun or defparameter or whatever 2024-08-15 02:27:10 there's no way to do that and also be able to use code from the bot in Gforth or PFE or other standard Forths 2024-08-15 02:27:22 (akslop) replacement offender line index? line token! 2024-08-15 02:28:39 maybe replace could offer you a draft redefinition of the line you could revise before resubmission 2024-08-15 02:28:40 the names could be better, but i can't think of a better approach atm 2024-08-15 02:29:55 your draft idea sounds useful 2024-08-15 02:32:52 like create ( 0 ) grid ( 1 ) width ( 2 ) height ( 3 ) * ( 4 ) dup ( 5 ) allot ( 6 ) : ( 7 ) size ( 8 ) width ( 9 ) height ( 10 ) * ( 11 ) ; ( 12 ) use n x to delete token numbered n or n i new text to insert new text before token n 2024-08-15 02:32:59 except I guess i is a bad name! 2024-08-15 02:35:17 ok 2024-08-15 02:35:50 in that case you'd probably want to delete token 5 (dup) 2024-08-15 02:36:07 it definitely makes sense how you've illustrated it 2024-08-15 02:36:49 i'd also be interested to see what the token numbers would look like as a header line, so a two line display, with the bottom line showing the tokens alone 2024-08-15 02:37:13 i'm thinking some definitions might be too long to inject the indicators inline? 2024-08-15 02:37:33 without line wrapping at least 2024-08-15 02:38:11 those are both good points, and you don't really know how wide the IRC user's display is or how they wrap 2024-08-15 02:39:05 would be a good idea to let them have some sort of stty-like config, or at least a means to define their viewing dimensions 2024-08-15 02:39:14 maybe the least bad approach is actually to use line numbers 2024-08-15 02:39:57 using irc colour codes if their client allows it would be pretty cool as well 2024-08-15 02:40:00 so that at least for recent input lines you can edit them in your IRC client's interactive line editor rather than trying to shoot down tokens 2024-08-15 02:40:05 at least for syntax highlighting 2024-08-15 02:40:05 yes! 2024-08-15 02:40:23 heh, you could use IRC color codes for ColorForth token categories 2024-08-15 02:41:25 why not have a colorforth irc bot? 2024-08-15 02:43:00 is anybody using ColorForth these days? GreenArrays seems to have abandoned it 2024-08-15 02:44:20 i've never tried it, my familiarity is that i looked at chuck moore's page about it and some block listings via the internet archive once 2024-08-15 02:44:51 yeah, I've looked a little deeper but never tried it 2024-08-15 02:45:19 it was 20 years ago 2024-08-15 02:47:34 I feel like it would be useful to display the state of the operand stack after every line, kind of like HP calculators 2024-08-15 02:48:13 I think a real colorforth would be difficult to do on irc; the system isn't really built around line inputs like you get with irc 2024-08-15 02:48:38 I think you could rig up a way to feed it line inputs probably? 2024-08-15 02:48:45 crc: ah ok, it's the use of colour instead of symbols that intrigues me most about it 2024-08-15 02:49:12 like the AVNC client I was mentioning the other day lets you edit a line of text on your Android phone and then send it all to the VNC server as a sequence of keystrokes 2024-08-15 02:49:48 xentrac: if you allow the user to configure the prompt, you could let them replace prompt with .S rather than ." ok" ? 2024-08-15 02:50:21 i meant: if you allow the user to configure the prompt, you could let them replace prompt with .S rather than ." ok" ? 2024-08-15 02:50:21 heh 2024-08-15 02:50:53 oh yeah, prompt is what Gforth calls that word 2024-08-15 02:51:40 crc: what sort of keyboard and layout do you use nowadays? 2024-08-15 02:51:57 too bad it doesn't defer it 2024-08-15 02:51:59 http://forth.works/temp/ilo-and-irc.pdf is a somewhat older document where I started thinking about interfacing one of my systems with irc 2024-08-15 02:52:11 cool, thanks! 2024-08-15 02:52:26 unjust: I mostly use either a keyboardio atreus or an ergodox ez 2024-08-15 02:54:20 thanks, nice options 2024-08-15 02:54:33 so here's what I've been thinking about preventing segfaults 2024-08-15 02:54:40 my base layout is dvorak, with numbers, symbols, and navigation on seconary layers 2024-08-15 02:54:59 in standard Forth each create and each variable creates a new "region" of data memory 2024-08-15 02:55:09 and I guess each allocate 2024-08-15 02:55:40 crc: any positive effects/side-effects from switching to dvorak? 2024-08-15 02:56:09 I think it should be possible to do an effectively standards-compliant Forth with dynamically-typed cells, where each cell is either an integer or a pointer into a region, represented as a (region, offset) pair 2024-08-15 02:56:37 c! would transmogrify whatever cell it was storing into into an integer 2024-08-15 02:57:13 I think that gives a bounds-checkable Forth which can run effectively all standard Forth code 2024-08-15 02:57:34 unjust: it's helped with my RSI issues 2024-08-15 02:58:08 although I think there are some tests in even the Forth 2012 standard which do things like test the ordering of addresses returned from here in different memory regions which I think would fail 2024-08-15 02:58:39 crc: a secondary layer for numbers and symbols sounds like it would help a lot! where do you put the layer shift key, and what layout do you use for the layer? 2024-08-15 02:58:43 though I did switch to using the ergo style keyboards about the same time as I did a full switch to dvorak, so it's a little unclear as to exactly how much is due to dvorak vs the split keyboard & more compact layouts 2024-08-15 02:59:28 that's pretty interesting how the layout could have played a role in improving your health 2024-08-15 02:59:56 dvorak definitely involves less finger movement, and not needing a number row seems like it would even more so 2024-08-15 03:00:49 i'm going to deface my keyboard with some stickers to give it a try this weekend 2024-08-15 03:02:18 does the dynamic-typing proposal above make sense? The issues are pretty subtle and I'd like to make sure I'm getting it right 2024-08-15 03:05:08 you wouldn't be able to implement cmove and cmove> quite as simply, because they'd have to copy entire cells whenever possible (just as high-performance implementations do normally) 2024-08-15 03:05:18 https://configure.zsa.io/ergodox-ez/layouts/WWVl3/latest/0 and https://configure.zsa.io/ergodox-ez/layouts/xbz4x/latest/0 are older versions of the layout I use on the ergodox; the basic layout of the alpha & symbols/numbers is the same. I've modified some of my other layers (I tend to tweak my shortcut/navigation layers every 6-12 months) a few times since this 2024-08-15 03:07:10 I didn't remember that the unshifted, non-number-row punctuation on Dvorak was almost the same as on QWERTY. It's missing / but adds - according to WWVl3 2024-08-15 03:07:19 and missing [], which I reassign to () anyway 2024-08-15 03:07:28 I periodically do heatmap analysis based on my collected writing, programs, and periodic key logs (a few times a year I run a full key logger to get more data on control key & navigation usage) from the last ~20 years, and do small changes to try to optimize things for my particular writing 2024-08-15 03:08:25 xentrac: would bounds checking occur on every access? 2024-08-15 03:08:26 [ ] are on my home row in the number/symbol layer as I type them a lot 2024-08-15 03:08:45 heh, I like th he in er an re nd at 2024-08-15 03:11:29 unjust: yes, you'd have to do bounds checking on every access. in my test at http://canonical.org/~kragen/sw/dev3/diter_sum.S the baseline array iteration (sum_without_diter) takes about 530 picoseconds per array item, while the same thing with a bounds check on each array access (sum_boundschecked) is about 650 ps, according to http://canonical.org/~kragen/sw/dev3/sumnums.c 2024-08-15 03:12:37 so the cost of bounds checking is quite detectable but much smaller than things like a subroutine call, simple loop iteration, or ITC or DTC inner interpreter dispatch 2024-08-15 03:13:38 crc: where do you use [] more than ()? 2024-08-15 03:14:51 xentrac: my forth systems make extensive use of [ ] for quotations 2024-08-15 03:15:10 I see! 2024-08-15 03:15:22 that makes sense 2024-08-15 03:17:14 unjust: the `sum_diter` version where the array items are produced by a sort of coroutine which is allocated some registers instead takes 1400 picoseconds, for example 2024-08-15 03:19:16 Re forth bots, I got pretty far then chickened out since it would run from a box on my home network: https://joldosh.blogspot.com/2023/12/irc-forth-chatbot.html 2024-08-15 03:19:33 xentrac: watching my screen? heh 2024-08-15 03:19:37 I think you could probably get the bounds-checked Forth to perform that well, but it would require hoisting the type check (to ensure that what you were dereferencing wasn't an integer) out of the inner loop 2024-08-15 03:19:40 i was reading that subroutine as you wrote that 2024-08-15 03:19:45 heh 2024-08-15 03:20:02 no, I just thought it called for an explanation 2024-08-15 03:20:07 Python glue code to communicate with irc that spawned a C thread for interpreting that killed the process after soany seconds 2024-08-15 03:22:33 MrMobius: the 64KiB segment idea is an interesting way to handle bounds-checking! 2024-08-15 03:23:56 a lot of bytecode systems have something like a 3-bit index field packed into a byte for common opcodes like fetching and storing local variables (not, obviously, in Forth) 2024-08-15 03:24:30 if you guarantee that every stack frame has at least 7 local variables you don't have to do any dynamic bounds-checking for that 2024-08-15 03:24:58 (or if you do static bounds-checking ensuring that all the embedded indices are smaller than the actual stack frame) 2024-08-15 03:27:26 (typically one of the 8 possible indices is reserved for variable indices that need an additional byte or two to represent them) 2024-08-15 03:30:37 MrMobius: nice writeup, did you ever think of running it via a free shell account server somewhere, like sdf.org? (assuming they still allow outbound irc) 2024-08-15 03:31:02 MrMobius: wrt ctypes I've found that sometimes it's more trouble than it's worth to use ctypes rather than writing to the CPython API 2024-08-15 03:31:30 just because I don't like debugging segfaults in CPython 2024-08-15 03:34:24 ctypes requires less code but sometimes more work 2024-08-15 03:34:58 another option might be a US$5/month virtual server from someplace like DigitalOcean or Cockbox 2024-08-15 03:35:48 if you want to go that route, i know of a provider that you can get something for around 1.70USD p/m with a recurring coupon code 2024-08-15 03:36:16 seems alright at that price for the monitoring i've had it do for the last 2 months 2024-08-15 03:40:04 xentrac: i had started to write a class for a recent project where i had considered using ctypes to get a union. basically i wanted a union to mimic the 8086 16-bit register split. something union { uint16_t AX; struct { uint8_t AH; uint8_t AL; }; }; 2024-08-15 03:41:37 i ditched ctypes and wrote a Register class that just did the necessary shifting and masking to get respective bytes if requested, or assign to them 2024-08-15 03:42:20 unjust: you can do tricks with pointers and c macros to make it look like eg. AX = AL * AH; but behind the scenes is pointers and macros 2024-08-15 03:43:10 i'd imagine it'd be dead simple in forth 2024-08-15 03:44:00 dave0: i had to recover some logic from an old dos executable and i reimplemented it in C initially, but my client then paid to have it reimplemented in python so they could use it on a webserver *shrug* 2024-08-15 03:44:36 oh ok 2024-08-15 03:44:53 well if they paid i guess? :-) 2024-08-15 03:46:32 not much, but it was interesting to get to play with symbolic execution of a subset of x86 asm by simulating just enough of the instruction set to do a bunch of shifts, rolls and weird arithmetic 2024-08-15 03:47:22 unjust: interesting, was ctypes not doing the right thing? 2024-08-15 03:47:37 I think you meant struct { uint8_t AL; uint8_t AH; }; 2024-08-15 03:48:20 I guess that wouldn't help if you wanted to move on to abstract interpretation though 2024-08-15 03:48:41 it did suck that i had to sit and figure out what structured blocks were needed in python that were inteded by all my C gotos spaghetti i ripped from the disassembly 2024-08-15 03:49:05 xentrac: yes, well caught 2024-08-15 03:50:21 sometimes while:else: can provide useful flexibility there 2024-08-15 03:52:04 xentrac: i don't think i've ever seen that combination before 2024-08-15 03:52:37 i'm guessing the flow of execution falls into the else block if the while statement is never true? 2024-08-15 03:54:54 Just a wild guess - does the else clause execute if the while condition isn't true AT ALL, even on first entry? 2024-08-15 03:55:19 So if the while stuff executes even once, the else gets skipped? 2024-08-15 03:55:36 KipIngram: that's what i'm thinking as well 2024-08-15 03:55:47 I can see that being useful. 2024-08-15 03:56:04 If's sort of an if then else with a jump back at the end of the then clause. 2024-08-15 03:56:25 Instead of a jump "over". 2024-08-15 04:04:32 this is an example of a function that evolved from spaghetti code influenced by some disassembly, to my best approximation of how branching could have been structured, to something similar in python: https://pastebin.com/zVBvhgci 2024-08-15 04:07:24 from https://docs.python.org/3/reference/compound_stmts.html#the-while-statement : 2024-08-15 04:07:56 > A break statement executed in the first suite terminates the loop without executing the else clause’s suite. A continue statement executed in the first suite skips the rest of the suite and goes back to testing the expression. ¶ A break statement executed in the first suite terminates the loop without executing the else clause’s suite. 2024-08-15 04:08:47 basically it means that break takes you to a different place than the condition being false 2024-08-15 04:09:00 the fake CPU: https://pastebin.com/NBkAFMu3 2024-08-15 04:10:34 nice 2024-08-15 04:11:00 can you re-enter the while loop from the else block somehow? 2024-08-15 04:11:07 oh, oops, I copied the wrong text 2024-08-15 04:11:38 > This repeatedly tests the expression and, if it is true, executes the first suite; if the expression is false (which may be the first time it is tested) the suite of the else clause, if present, is executed and the loop terminates. ¶ A break statement executed in the first suite terminates the loop without executing the else clause’s suite. 2024-08-15 04:12:10 nope, no way back into the loop once you've exited. It just gives you a second exit, because it's pretty common to want to do something different when a loop terminates early 2024-08-15 04:12:57 also, how difficult is it to implement something like goto or any kind of labelled jump/branch in python 3? 2024-08-15 04:13:02 of course if you want to do something that only happens when the loop terminates early, you can just put it right above the break statement 2024-08-15 04:13:11 i'm guessing you have to mess with the bytecode somehow 2024-08-15 04:13:29 yeah, you can do it at the bytecode level 2024-08-15 04:14:00 but you can also just do it with while True: if state == 0: ... elif state == 2: ... elif state == 3: ... 2024-08-15 04:15:24 ok i can see how a state machine could get you most of the way there 2024-08-15 04:16:32 basically you replace each label with "pc = x \n elif pc == x:" 2024-08-15 04:16:53 and each jump with "pc = x; continue" 2024-08-15 04:20:13 I forget if this was in Böhm and Jacopini's original paper (though a much more cursed transformation was) but it was definitely in Knuth's "Structured Programming with GO TO Statements" 2024-08-15 04:21:20 where he used it to demonstrate that you can trivially transform any program into single-entry single-exit constructs, but sometimes shouldn't 2024-08-15 04:22:34 I've been excited recently about Henry Baker's COMFY control-flow constructs, which are single-entry dual-exit constructs, and avoid the problem of Böhm and Jacopini's constructs which make Boolean expressions a separate magisterium 2024-08-15 04:23:20 i've read neither of those, but i'll look them up 2024-08-15 04:26:13 if you've read that 2024-08-15 04:27:27 ACTION has no formal compsci background 2024-08-15 04:29:16 unjust: Me either, really. Couple of classes, and otherwise just stuff I've looked into on my own. I came up through hardware. 2024-08-15 04:31:25 yeah, I have a formal comp sci background in that I took a programming class in sixth grade I guess 2024-08-15 04:31:39 but I also published a couple of papers 2024-08-15 04:33:53 KipIngram: nice, did you encounter forth for the first time via some interesting sort of control system? 2024-08-15 04:34:32 xentrac: i guess i'm just not well read enough then. what did you publish? 2024-08-15 04:35:34 http://zesty.ca/pubs/yee-sitaker-passpet-soups2006.pdf and https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=dbc8bba4a728242fa0d987172ee0f879802d844d 2024-08-15 04:35:44 mostly forgotten papers 2024-08-15 04:37:06 I found out about Forth after I dropped out of college; the local university library was throwing out a bunch of old books including things on Forth, APL, and Ada 2024-08-15 04:37:33 that's also when I read Knuth's paper, which was included in a book I got hold of through interlibrary loan 2024-08-15 04:38:58 finding old papers and books is a *lot* easier now 2024-08-15 04:39:02 kind of sad to see books being thrown out 2024-08-15 04:39:41 i've found archive.org is fairly good for finding old books, while it lasts, i guess 2024-08-15 04:41:21 yeah. as Brewster says, "Governments burn libraries." 2024-08-15 04:41:30 I used to be married to his secretary 2024-08-15 04:41:43 har-extractor is my best friend when i flip through those boooks while on loan 2024-08-15 04:41:55 ah ok 2024-08-15 04:42:28 libgen is better for finding old books, if it's legal where yo uare 2024-08-15 04:44:18 didn't know it actually worked, i had visited it before and it wouldn't yield any links 2024-08-15 04:46:03 it works now though, thanks for sharing that 2024-08-15 04:46:44 it occasionally breaks for a day or two 2024-08-15 04:54:21 MrMobius: i was reading https://joldosh.blogspot.com/2024/05/msp430-development-on-linux.html - if you don't need C and want to ditch TI's MSP430 toolchain, you can build your own: https://github.com/jhswartz/msp430-elf/ 2024-08-15 04:57:23 you could build it for that Radxa ROCK 3C if you have a suitable toolchain 2024-08-15 05:00:58 is msp430-elf-as a GNU binutils thing? 2024-08-15 05:01:42 yes 2024-08-15 05:05:35 I didn't know about it 2024-08-15 05:05:52 I've never gotten into TI stuff (except as a kid) in part because TI is pretty hostile to hobbyists 2024-08-15 05:06:08 they blacklisted Limor Fried for sampling too many parts 2024-08-15 05:06:47 ah 2024-08-15 05:07:07 most of my MSP430s were samples 2024-08-15 05:08:04 they were somewhat generous when the launchpad became popular 2024-08-15 05:08:40 did you make use of the popular MCUs? PIC or AVR? 2024-08-15 05:15:16 in microcontrollers I've mostly programmed AVRs 2024-08-15 05:15:50 here's a trivial AVR hack I did shortly after I moved to Argentina: http://canonical.org/~kragen/light_sensing/ 2024-08-15 05:16:46 nothing in Forth, unfortunately 2024-08-15 05:20:44 unjust, ya I have a Linode account but I don't really want to pay and it only solves half the problem anyway since that account being compromised is less dangerous than running at home but still something to put thought into 2024-08-15 05:22:06 xentrac: I never used ctypes until that project and thought it was absolutely awesome. I built a 6502 emulator and assembler in Python and was checking bounds which would be so much simpler if it was just a native ctype 2024-08-15 05:22:56 and for debugging, it's faster to have a C program that calls the C library for the debugging then call it from Python when you have it straightened out 2024-08-15 05:24:39 yeah, the thing that I thought was a pain was when I screwed up the types in ctypes 2024-08-15 05:24:52 when I do that in C I get compiler errors or at least warnings 2024-08-15 05:25:03 which is a terribly funny thing to be complaining about in ##forth I guess 2024-08-15 05:33:41 I think we're (mostly) a fairly laid back bunch here. 2024-08-15 05:35:02 unjust: im not sure what you mean about msp430-elf there. the repo is nearly empty and the 9.3.1 gcc mention in the post is msp430-elf compiled from TI's sources 2024-08-15 05:35:52 xentrac: ya that's rough! 2024-08-15 05:36:37 MrMobius: look in doc/static if you want to build a static toolchain, or in doc/dynamic if you want to build one that's linked dynamically. there's an interrupt driven uart-echo demo in demo/ 2024-08-15 05:36:58 it's really just a collection of text files that tell you what to do 2024-08-15 05:37:47 not really 2024-08-15 05:38:29 I dont see where it's compiling gcc 2024-08-15 05:38:53 why do you need gcc if you're writing assembly? 2024-08-15 05:39:00 all you need is an assembler and a linker 2024-08-15 05:39:04 which binutils provide 2024-08-15 05:39:07 ah I see 2024-08-15 05:39:14 to be more specific: https://github.com/jhswartz/msp430-elf/blob/master/doc/static/binutils.txt :) 2024-08-15 05:40:55 but the downside to this approach is that you don't get TI's linker scripts, and you don't get their header files 2024-08-15 05:41:32 but you can define those yourself 2024-08-15 05:42:23 this might sound like I'm demanding justification, but is there still a reason to use MSP430 now that Ambiq offers lower-power ARMs and Cypress offers much cheaper ARMs? 2024-08-15 05:42:56 or is it just for people who want to pursue unilateral disARMament? 2024-08-15 05:43:03 heh 2024-08-15 05:43:25 Cypress has 1.5¢ 48MHz ARMs with 4KiB of RAM 2024-08-15 05:43:40 if we can believe https://www.lcsc.com/product-detail/Microcontrollers-MCU-MPU-SOC_Infineon-Cypress-Semicon-CY8C4045FNI-DS400T_C2952624.html 2024-08-15 05:43:52 xentrac: no ARM chips in throughhole 2024-08-15 05:43:53 for new designs, i guess MSP430 is definitely cost prohibitive 2024-08-15 05:44:13 there was an NXP ARM in throughhole iirc 2024-08-15 05:44:17 was 2024-08-15 05:44:26 discontinued about a year after they came out 2024-08-15 05:44:53 that sounds like a problem to solve with a breakout board rather than a hostile vendor ;) 2024-08-15 05:45:32 I have wondered about the price of msp430s since they do seem expensive but they pop up in all kinds of things. there was a thread on the forum before it died off of people spotting them in the wild in things like light up mickey mouse ears and apple keyboard controllers 2024-08-15 05:45:47 I guess low power was their original claim to fame 2024-08-15 05:46:25 MrMobius: i worked with some cashcode bill validators once that had msp430f* has part of the bill/note scanning head 2024-08-15 05:46:33 s/has/as/ 2024-08-15 05:47:26 neat 2024-08-15 05:47:47 as I understand it they were developed in the 1990s for utility meters among other things 2024-08-15 05:47:52 only place i've seen them in the wild 2024-08-15 05:48:15 also the FRAM parts are neat. I havent seen that from any other vendor 2024-08-15 05:48:30 were those only in QFP? 2024-08-15 05:48:57 yeah, the FRAM parts are tempting, I have to admit 2024-08-15 05:48:57 and no complaints from me about TI being hostile. they were very generous with samples when I got started 12 years ago or so and ive been happy to pay for the 4-5 msp430s I consume per year out of my own pocket 2024-08-15 05:49:01 although Ambiq has MRAM parts now 2024-08-15 05:49:18 unjust: SMD only but not sure if QFP only 2024-08-15 05:50:00 there are a certain number of SOICs an TSSOPs 2024-08-15 05:50:30 *and 2024-08-15 05:50:30 I mean not sure about QFP for FRAM parts. msp430 in general is SOIC and TSSOP as you say as well as QFN for example 2024-08-15 05:50:41 ARMs I mean. I was just searching on Digi-Key and couldn't find any through-hole ARMs 2024-08-15 05:50:53 ya that definitely doesnt exist 2024-08-15 05:50:55 trust me :) 2024-08-15 05:50:58 heh 2024-08-15 05:51:21 the pic32s are pretty amazing though if youre still playing with throughhole parts 2024-08-15 05:51:26 it just blows my mind that there are literally thousands of ARM microcontrollers from dozens of different vendors but no through-hole parts 2024-08-15 05:51:37 so I thought I'd check and you seem to be correct 2024-08-15 05:51:51 they expect you to use an adapter board if you really want to prototype with through hole 2024-08-15 05:52:22 yeah, that seems reasonable 2024-08-15 05:52:31 50mhz is about the fastest mcu youll see in throughhole and 48mhz is the slowest arm ive seen so not a lot of overlap. they would basically be putting the bottom of the barrel in the throughhole chips 2024-08-15 05:52:56 Digi-Key's website is not working very well for me though. I keep getting this horrible cellphone interface in my desktop Firefox 2024-08-15 05:53:01 most of the dev boards have headers which is how most people are probably prototyping 2024-08-15 05:53:46 since your adapter board still needs capacitors and a whole bunch of other stuff on various pins you might not get right on a breadboard 2024-08-15 05:54:19 what's the whole bunch of other stuff? 2024-08-15 05:55:03 decoupling capacitors and xtal/clock source, at least 2024-08-15 05:55:09 ya xtal 2024-08-15 05:55:15 resistors on programming pins possibly 2024-08-15 05:55:23 maybe on reset pin too 2024-08-15 05:55:32 a lot of microcontrollers can be configured to use an internal RC oscillator 2024-08-15 05:55:36 not just AVRs :) 2024-08-15 05:56:10 breadboard is probably asking for trouble though, matrixboard is probably ok though if you want a mix of smd and tht 2024-08-15 05:56:25 is matrixboard perfboard? 2024-08-15 05:56:40 true but when I see like 7 decoupling capacitors scattered all over the reference design it doesnt give me hope that it will work reliably on a breadboard 2024-08-15 05:56:56 xentrac: pretty much 2024-08-15 05:57:09 yeah it won't :) 2024-08-15 05:57:45 right. hence the appeal of throughhole since 50mhz is generally enough and i dont need to turn a profit. no interest in soldering smd adaper boards 2024-08-15 06:01:23 I see 2024-08-15 06:11:36 if you want multiples of 300: https://www.digikey.com/en/products/detail/nxp-usa-inc/LPC1114FN28-102-12/3430860?s=N4IgjCBcoGwJxVAYygMwIYBsDOBTANCAPZQDaIALGGABxwDsIAuoQA4AuUIAyuwE4BLAHYBzEAF9CAVgAMMRCBSQMOAsTIgAzGAo0am5m06Qe-YWPGWgA - 46,683 In Stock @ $2.36 2024-08-15 06:14:18 yeah, I was limiting my query to in-stock parts 2024-08-15 06:14:29 are you also getting the terrible cellphone UI with no table of parts? 2024-08-15 06:18:40 nope 2024-08-15 06:20:05 that's good 2024-08-15 06:20:12 it looks fairly normal with firefox 129 2024-08-15 06:22:11 nice hack btw, that's a pretty clever use of an LED 2024-08-15 06:23:06 thanks! but, as the page explains, it's far from original to me 2024-08-15 10:39:59 Wow channel's super active now lol 2024-08-15 14:01:01 ^^ 2024-08-15 14:58:54 Seems to come in waves. 2024-08-15 15:00:39 Yup 2024-08-15 15:01:06 I wanna write a part 2 to my blog post, pushing more of the DSL implementation into the DSL language itself (mini-Lisp, Forth) instead of PHP. 2024-08-15 15:01:09 Not much time tho 2024-08-15 15:06:53 olle: I too am puzzled at not finding more Lisps in Forth 2024-08-15 15:08:30 right? 2024-08-15 15:08:48 Forth feels like the perfect bootstrap environment for a Lisp :d 2024-08-15 15:28:49 predictably lispers would rather bootstrap in lisp 2024-08-15 15:29:33 it's not that much more complex than a forth 2024-08-15 15:30:50 Lisp might even be less complex to bootstrap than Forth 2024-08-15 15:31:34 would sectorlisp vs. sectorforth be a good comparison for that? 2024-08-15 15:32:28 dunno 2024-08-15 15:32:46 I think Lisp is about 500 instructions 2024-08-15 15:32:54 normally 2024-08-15 15:33:05 sectorlisp is obviously smaller 2024-08-15 15:34:00 depending on the environment you might be able to get by without a GC (which IIRC sectorlisp has) 2024-08-15 15:35:15 Sectorlisp has a garbage collector, it's the only one which is simple enough for me to really understand :P 2024-08-15 15:35:36 eForth 1.0 is 171 instructions 2024-08-15 15:37:39 it's a little over 1000 for common lisp, about 50 for the scheme core 2024-08-15 15:37:59 1000 what? 2024-08-15 15:38:22 built-in functions 2024-08-15 15:38:31 oh, I meant machine instructions 2024-08-15 15:39:38 like http://canonical.org/~kragen/sw/dev3/tinylisp.c compiles to 549 machine instructions with GCC 12.2.0 with -Os 2024-08-15 15:40:10 if you measure Lisp by built-in functions and special forms, it obviously wins 2024-08-15 15:40:47 all you need is cons, car, cdr, labels, lambda, cond, quote, and eq 2024-08-15 15:41:45 oh and atom I guess 2024-08-15 15:41:51 and/or null 2024-08-15 15:44:23 but there's some significant complexity being swept under the carpet in the form of the reader, the printer, the GC, the local variable mechanism, and the function call operation 2024-08-15 15:47:36 you can go further in that direction; Qfitzah (http://canonical.org/~kragen/sw/dev3/qfitzah.s) doesn't have any built-in functions at all, but is still Turing-complete 2024-08-15 15:48:51 Need macros too :d 2024-08-15 15:48:54 but it's still like 350 machine instructions 2024-08-15 15:49:03 yeah, Lisp didn't have macros originally 2024-08-15 15:49:28 but they were added pretty early on 2024-08-15 15:50:22 GeDaMo: does sectorlisp have macros? 2024-08-15 15:50:22 SectorLisp has a garbage collector? 2024-08-15 15:50:32 That's surprising to me 2024-08-15 15:50:39 Hmmm ... I don't remember macros 2024-08-15 15:50:50 The garbage collector is based on a stack :P 2024-08-15 15:51:58 https://justine.lol/sectorlisp2/#garbage 2024-08-15 15:54:46 Oh that's not really a garbage collector 2024-08-15 15:54:56 And it seems similar to dictionary allotting 2024-08-15 15:55:11 It's more like budget reference counting 2024-08-15 15:55:58 It copies live cells out then back over the unused cells 2024-08-15 15:58:02 if your language guarantees data structures are acyclic, reference counting is enough 2024-08-15 15:58:26 but it seems like it lacks the performance problems of reference counting 2024-08-15 17:53:48 xentrac: I just don't think you can or should call reference counting garbage collection, but yes you're correct 2024-08-15 17:54:02 I guess in that universe it is garbage collection 2024-08-15 17:54:25 It's interesting when better performing constructs are also less code to implement 2024-08-15 17:54:49 Reminds me of sentinel nodes / circular linked lists 2024-08-15 17:54:54 Personal favourite of mine 2024-08-15 22:26:47 unjust: heh, yes, people do that here in Argentina too, because Argentine Spanish doesn't have a separate [θ] phoneme 2024-08-15 22:27:16 heh, block posts 2024-08-15 22:27:41 veltas: health problems? 2024-08-15 22:29:48 No thanks 2024-08-15 22:30:51 Nah I just have a family, by the time I can I'll be too old to want to 2024-08-15 22:32:49 oh yeah, a friend just visited Perú 2024-08-15 22:33:02 I asked him how it was and he said, well, you don't get to see as much when you're traveling with kids 2024-08-15 22:34:08 I've known quite a few retirees who travel around a lot, but it depends a lot on how your health is at that age