2023-05-04 00:59:45 "The pop in the condition of the while removes the character that was read with fgetch. This is not a problem in Joy, because at the end of the condition, after the condition code has been read, the stack is restored to what it was before the condition started." 2023-05-04 01:00:09 Really? Wow. I didn't know Joy saved the stack. 2023-05-04 01:00:22 That seems.. sus. 2023-05-04 01:00:33 It's not hard to leave the stack in the same state. 2023-05-04 02:17:10 KipIngram: Nice. I remember reading this previously. Can confidently claim proficiency in the algol and apl families. Am reasonably productive in lisp and ml families, but they haven't seeped in enough yet to deeply affect how I design architectures. Am a baby at forth :D 2023-05-04 03:02:19 Look: spreadsheets in terminal look good https://github.com/taviso/123elf 2023-05-04 03:46:58 crc: https://i.imgur.com/da9bQd7.png this is what I mean by roundhand 2023-05-04 03:47:27 I'm not saying to make it look like that, but just suggesting what I think reads more easily 2023-05-04 03:58:50 What I like about your program for fibonacci crc is that the listing is a valid retro program as well, if I understand rightly, which writes the source into the current block 2023-05-04 04:07:16 I think vms14 should use asm.js if they want to use JS, but really they should use x86 assembly since that's what they ultimately want 2023-05-04 04:07:31 Or some small VM like crc has 2023-05-04 04:16:25 crc if you want to write a javascript version just use the basic stuff that's been in JavaScript since like IE6, and write it in "asm.js" (subset of JS that can be more aggressively optimised and treated like C) 2023-05-04 04:17:28 And then maybe provide file upload/download buttons for the ROM and blocks files, keeping them in memory otherwise 2023-05-04 04:17:52 You could use web storage for browsers that suppor tit 2023-05-04 04:18:38 I might be tempted to write a javascript prototype for ilo as well when the x86-64 draft is done 2023-05-04 04:31:28 Also tempted by writing a fixed point version of fibonacci function that uses the formula with golden ratio for nth position in sequence 2023-05-04 05:26:30 veltas: thank you for the roundhand example; this will be helpful 2023-05-04 05:52:55 An interesting property of fibonacci sequence is the ratio of successive terms increasingly approximates phi 2023-05-04 05:53:32 So if you want to use the phi-based formula version you can calculate phi yourself by using a dumb iterative version first up to the 50th term or so 2023-05-04 05:53:50 But also this is helpful because the ratio you get is a nice rational number, so it works better with a fixed point calculation 2023-05-04 05:55:09 And the other irrational number is -1/phi, so again you can get that from the same ratio without loss of accuracy 2023-05-04 05:58:58 And then when you finish just divide by a newton-raphson approximation of sqrt(5) and round the result (i.e. add "0.5" first and truncate) 2023-05-04 05:59:18 Can do the powers with repeated squaring 2023-05-04 08:24:35 Yeah, that is an interesting property. 2023-05-04 08:24:49 All those "interactions and convergences" like that are pretty fascinating. 2023-05-04 08:39:39 So, I'm interested in suggestions on this process scheduling bit I alluded to last night. I know how I want to write the deepest layer of that - that's where I have next decrement a register and "detour" when it hits zero; otherwise it just carries on with next-ing the running process. 2023-05-04 08:41:09 When it does detour, I regard that as an opportunity for a task switch. The simplest thing to do would be just run around a ring to the next process to run. But here's where I'd like to do something more intelligent than that, so that I can associate a priority of some kind to different processes - higher priority process will exploit more of their opportunities - lower priority ones less. It's that scheme 2023-05-04 08:41:11 of prioritization I'd like suggestions on. 2023-05-04 08:41:21 Seems like something that has probably received a fair bit of thinking over time. 2023-05-04 08:43:16 I could get as fancy as I like, but obviously I still do want to be fairly efficient - I don't know that I want to be making a lot of os calls and so on in that decision making (i.e., I don't know if I want to check the actual time), but bringing time into it would be a useful thing to do - it would let me give some "real time" flavor to things. Maybe I should time that particular os call so I can quantify 2023-05-04 08:43:18 its costs. 2023-05-04 08:49:59 KipIngram: Two USER values, one is called 'niceness', the other is called 'waits'. When a thread suspends set waits to niceness. Each time the thread is considered for scheduling run the thread if waits is zero, else decrement waits and skip scheduling. Use a round-robin scheduler. 2023-05-04 08:50:35 So if you don't care all niceness can be set to 0. If you do care then set high priority niceness to 0, and low priority niceness to 10 or whatever 2023-05-04 08:53:04 The thread can also use the waits value to detect if it's been yielded, set it to 1 and if it becomes 0 you've yielded 2023-05-04 08:55:45 You can consider an optimisation, keep track of the lowest niceness value you saw on the previous round-robin loop (not lowest waits), if you see threads with lower niceness then set waits to zero regardless and run them immediately 2023-05-04 08:57:13 And when you set niceness, update the lowest niceness value if necessary, to make sure a newly high priority thread will get to run straight away 2023-05-04 08:58:21 The two USER values don't need to be larger than a byte. So only 2 bytes overhead (or less, if you want to squeeze further) 2023-05-04 08:59:33 "if you see threads with lower niceness" -> "if you see threads with lower or equal niceness" 2023-05-04 09:09:00 I like it. And maybe I check system time "occasionally" (however occasionally I like), so that I can have the possibility of wall clock scheduling processes. For that I'd probably move them out of the main ring and into a separate list. 2023-05-04 09:09:31 The main ring would ignore that list until the next scheduled time arrived. 2023-05-04 09:19:40 Looks like the time call takes about a hundred nanoseconds. 2023-05-04 09:37:46 This looks like a fun conversation. Some cooperative multitasking in forth? 2023-05-04 09:39:12 Well, you might call it that, but the task switching mechanism will be wired into the deep mechanics of Forth - it won't really be "up to" a given Forth program whether it gets swapped out or not. 2023-05-04 09:39:20 So in that sense it's preemptive. 2023-05-04 09:39:49 Of course, if one wrote a big complex primitive all in machine code, that would bypass the mechanism, so yes, such a task would need to cooperate. 2023-05-04 09:39:57 So it kind of straddles the line. 2023-05-04 09:40:39 Or someone could write a primitive that just reloaded the downcount register with a new value - that would bypass it too. 2023-05-04 09:41:01 So I look at it as "preemptive, but with cheating possible in theory." 2023-05-04 09:42:34 The way I will use it it will function preemptively, but a hacker could easily take full machine resources. It's not intended to be "secure" in that sense. 2023-05-04 09:43:17 But Forth allows you to do all manner of horrible things to a system, so it's not really odd in that sense. 2023-05-04 09:44:23 foot howitzer 2023-05-04 09:48:16 For sho. 2023-05-04 09:49:10 What I want to wind up here is a system where I might potentially have a very large number of threads in play, but so long as most of them ran only now and then I'd like for the system to still be nice and snappy. 2023-05-04 09:49:40 I mean like thousands - tens of thousands. In theory - I don't know what I might write that does that, but I'd like to try to support it. 2023-05-04 09:49:58 I've read that on a fairly normal server Erlang can easily have a million lean threads going. 2023-05-04 09:50:33 I assume in such a system that many many of them would be there to handle circumstances that only came up once in a while. 2023-05-04 10:10:44 Might be useful if a thread usually runs with higher priority for it to tune down its priority if it doesn't expect to come back quickly, i.e. waiting on slow I/O I might set my niceness to 50 or 100, and then set it back to the previous value when it's done waiting 2023-05-04 10:11:03 The OS usually does stuff like that automatically but in Forth I think you need to think with your brain 2023-05-04 10:16:09 Indeed. 2023-05-04 10:16:29 I look at it as a collaboration among hardware, software AND PROGRAMMER. 2023-05-04 10:17:07 brains are expensive. cheaper to get some java coders at the discount bin 2023-05-04 10:18:34 Or maybe if an interrupt can indicate the resource is ready then the interrupt handler can set priority/wait to 0 2023-05-04 10:19:06 PolyForth has intricate description of a task system as well, I think I've already pointed you to that, this one I just described I literally just came up with 2023-05-04 10:19:24 I wouldn't use priority at all, I would just do round robin, but I'm a simple person :) 2023-05-04 10:32:46 thrig: foot nuke is more accurate 2023-05-04 10:33:57 That's cool. So a kind of opt-out-able pre-emptive multi-tasking. 2023-05-04 10:38:45 It's not preemptive if I don't also schedule it, but just set priority/wait to 0 2023-05-04 10:39:23 maybe it could be postemptive and support COMEFROM 2023-05-04 10:40:03 Imagine P.S. programming. I.e. "P.S. my loop should have been 10 iterations, not 6" 2023-05-04 10:40:32 "P.S. should be i < size, not i <= size 2023-05-04 10:41:04 I've reviewed code like this actually 2023-05-04 10:41:29 A big loop where each run different code executes, and the different stages of this 'state machine' were not in order 2023-05-04 10:43:30 thrig: Technically every YIELD is also a REENTRY 2023-05-04 10:44:10 : check-heat-shields ... ; 2023-05-04 10:47:15 What's a good name for YIELD ? SHARE ? PATIENCE ? 2023-05-04 10:48:03 Sharing and patience are virtues of cooperative threads 2023-05-04 10:50:05 patience, how long will that take 2023-05-04 10:51:41 COOPERATE 2023-05-04 10:55:35 I am not number! I am a free thread! 2023-05-04 10:56:02 COOPERATE 2023-05-04 10:56:27 I actually typed that out by accident, looks like irssi wants you to conform thrig 2023-05-04 10:56:43 well I don't see any weather balloons, yes 2023-05-04 11:03:35 veltas: Yes, certainly interrupts could trigger me to move tasks out of a "waiting area" back into the ring. I haven't given that a whole lot of thought yet. 2023-05-04 11:04:18 I think that's something the interrupt can do if you want it to, not something that needs a 'generic' solution 2023-05-04 11:04:32 Although I can think of generic solutions to it, I just try to avoid it 2023-05-04 11:05:46 for some reason in gforth if I type `hex 12 .` twice in a row interactively, the first time . returns `c` (correct) but subsiquent attempts return `12` which is not correct. Why might that be happening? 2023-05-04 11:06:18 Which gforth? 0.7.3? 2023-05-04 11:06:36 Oh no jgaz that's correct 2023-05-04 11:06:43 You set it to hex, so 12 is $12 2023-05-04 11:06:47 And it correctly prints 12 2023-05-04 11:06:57 base, hex, etc be footgun 2023-05-04 11:07:00 Why would it print c the first time? 2023-05-04 11:07:00 yes, 0.7.3 2023-05-04 11:07:25 But set to decimal and print that 12 and it will become 18 2023-05-04 11:07:34 hex: 10 a, 11, b, 12 c, 13 d, 14, e, 15 f. 2023-05-04 11:07:41 hex changes the base of number literals you input 2023-05-04 11:07:49 as well as the base of output 2023-05-04 11:08:01 Yes, but if you say HEX 12 then it should interpret that 12 as hexadecimal 12, which is decimal 18. 2023-05-04 11:08:22 ah, so I need a `$` prefix? 2023-05-04 11:08:23 I bet they wrote `12 hex .` the first time 2023-05-04 11:08:29 No you don't need a $ prefix 2023-05-04 11:08:31 you might be right 2023-05-04 11:08:34 1 sec 2023-05-04 11:08:48 you're right, `12 hex .` 2023-05-04 11:08:49 Here's the sticky aspect of BASE in Forth. 2023-05-04 11:08:50 You need a `#` prefix if you want decimal specifically, and I don't know if 0.7.3 supports that 2023-05-04 11:08:59 Ok, that would give you c. 2023-05-04 11:09:06 and then it would give you 12 the second time. 2023-05-04 11:09:21 wow, that's a foot-gun. 2023-05-04 11:09:23 Because when you type the second 12 BASE is decimal 16. 2023-05-04 11:09:26 But write `12 hex . decimal 12 hex .` and it will print c twice 2023-05-04 11:09:31 Yeah, it's a clumsy element of Forth. 2023-05-04 11:09:47 I resolve it for numeric input by using a number format that can include the base. 2023-05-04 11:09:53 It's not too much of a foot-gun when you're used to it 2023-05-04 11:09:55 I'd type x:12 for hex 12. 2023-05-04 11:09:58 Or 16:12 2023-05-04 11:10:13 I can use any base I want there before the :, up to 62. 2023-05-04 11:10:26 x: is a shortcut for hex, b: is a shortcut for binary. 2023-05-04 11:10:38 Digits come from 0..9, A..Z, a..z as needed. 2023-05-04 11:11:11 For less than base 37 letters are case insensitive - they become case sensitive only when both cases are needed to get the needed digits. 2023-05-04 11:11:14 Ok, so no `$` or `%`? 2023-05-04 11:11:22 For hex and bin respectively? 2023-05-04 11:11:29 I think that will work on some forths 2023-05-04 11:11:30 jgaz: What I just described is non-standard; it's how my system works. 2023-05-04 11:11:50 Yeah KipIngram is just telling us stuff about a Forth we can't use, hope you find that helpful ;) 2023-05-04 11:11:55 I still have BASE, though - it's just used for output only. 2023-05-04 11:12:38 Sorry about that. I did say it was how "I resolve it," but that wasn't sufficiently clear. 2023-05-04 11:12:44 :P 2023-05-04 11:13:42 jgaz: To be clear, Forth 2012 added $%# prefixes to specify base, probably stolen from some older Forth, so some newer 'standard' Forths will support that 2023-05-04 11:13:50 But the classic approach is to use DECIMAL HEX and BASE 2023-05-04 11:14:26 I'd have to look at my code to be sure but I think (also in my non-standard system) I have (.) that expects the base value on the stack, and then . just runs 10 (.) (decimal 10 there). 2023-05-04 11:14:27 That reminds me of 6502 asm. 2023-05-04 11:14:42 the prefixes 2023-05-04 11:14:47 And honestly some classic forths probably ignore $ at start so you can write `$19.99` as an alternative to 1999. for your accounting software 2023-05-04 11:15:17 Classic forths tend to allow periods (and other separators) anywhere in a number to specify that it's a double number 2023-05-04 11:15:20 I hadn't tought of that. 2023-05-04 11:15:34 I'm quite the n00b. 2023-05-04 11:15:50 So you can write like 05.04.2023 or 2023-04-05 if you prefer in many forths 2023-05-04 11:16:01 You've found a good place to hang out, if you're interested in Forth. 2023-05-04 11:16:02 Pretty much all forths allow this, gforth does I believe 2023-05-04 11:16:10 I'm sbouncing between Starting Forth and the XO laptop Forth tutorial. 2023-05-04 11:16:11 pretty sure starting forth had an example with phone numbers 2023-05-04 11:16:19 Yeah 2023-05-04 11:16:39 for that digital rolodex to go with your zoot suit and platform shoes 2023-05-04 11:16:43 I'm only on chapter 2 and struggling to manipulate the stack. (Yeah, it will be trivial in a few weeks.) 2023-05-04 11:17:02 Looks like gforth only supports . as separator 2023-05-04 11:17:07 "zoot... zoot" babylon 5 reference? 2023-05-04 11:17:42 Zoot suit is a real thing - B5 was referring to that. 2023-05-04 11:17:48 But I remember when that came up on B5. 2023-05-04 11:18:09 swiftforth supports the other separators 2023-05-04 11:18:14 https://www.imdb.com/title/tt0083365/ 2023-05-04 11:18:24 The expression goes way back before that movie, though. 2023-05-04 11:18:32 Just an old fashion thing. 2023-05-04 11:19:04 Way early on when I was dating my first wife she wanted to go see that movie - we were in college at the time. 2023-05-04 11:19:06 yeah, I just Googled it. 2023-05-04 11:19:49 But you've distinguished yourself now as a Babylon 5 fan, and that's a "good thing." :-) 2023-05-04 11:20:20 heh 2023-05-04 11:20:28 Did you hear about the new movie? 2023-05-04 11:20:57 JMS just anounced it yesterday... animated with the surviving cast. 2023-05-04 11:25:11 No - that's outstanding. 2023-05-04 11:26:16 https://www.ign.com/articles/babylon-5-animated-movie-announced-a-love-letter-to-the-fans 2023-05-04 11:26:35 Too bad Jerry Doyle, Brigs, and many others didn't live to see it. 2023-05-04 11:27:04 Yeah, for sure. 2023-05-04 11:27:11 But I guess that was a good while ago. 2023-05-04 11:27:22 Groundbreaking TV show. 2023-05-04 11:27:34 It was really the pioneer of the "big arc" TV shows. 2023-05-04 11:27:46 Now having a big arc is almost required. 2023-05-04 11:28:13 Yeah, except JMS did a far better job of it on average without making it feel forced. 2023-05-04 11:28:41 Things also made sense from a sociological and psychological perspective. 2023-05-04 11:29:13 You could understand the carrots and sticks being moved around in characters heads that caused them to make the decisions (good and bad) that they did. 2023-05-04 11:30:45 Most people can't write like that, they don't have a deep enough understanding of human nature. 2023-05-04 11:32:38 if i wanted to write a forth with assembly, where would i start? 2023-05-04 11:33:05 you'll probably want a computer 2023-05-04 11:33:09 jonesforth? 2023-05-04 11:33:16 yes, start with jonesforth 2023-05-04 11:33:23 read the assembly, it's *very* heavily commented 2023-05-04 11:33:40 it's i386, but you should be able to follow the broad strokes. 2023-05-04 11:34:50 https://github.com/nornagon/jonesforth/blob/master/jonesforth.S 2023-05-04 11:40:04 thanks 2023-05-04 11:41:23 seems to use motorola syntax 2023-05-04 11:43:28 http://ratfactor.com/nasmjf/ 2023-05-04 11:45:35 it's a nasm port of jonesforth 2023-05-04 14:53:11 How do I get vim to recognize my forth syntax automatically? `( vim: syntax=forth )` isn't working. 2023-05-04 14:53:37 I suppose I mean, how do I put a vim directive in a Forth file? 2023-05-04 14:54:34 \ some vim thing here 2023-05-04 14:55:03 Hmm... I thought I tried that... let me try that again. 2023-05-04 14:55:09 or put a consistent ending on the forth files and associate that with autoaction something something 2023-05-04 14:56:25 yeah, no joy on `\ vim: foo` 2023-05-04 14:58:03 crc do you build forms with retro? 2023-05-04 14:58:07 html forms 2023-05-04 14:58:50 hmm... I think I may have a vimrc problem... 2023-05-04 14:59:18 forth ain't got no syntax. 2023-05-04 14:59:35 it does 2023-05-04 14:59:37 I guess you could do something for \ comments and such 2023-05-04 14:59:43 Well, almost none. 2023-05-04 14:59:50 Not like other languages. 2023-05-04 15:00:14 And things like BEGIN ... AGAIN, IF ... THEN, and so on; that's "syntax." 2023-05-04 15:00:34 But beyond those things, it's pretty minimal. 2023-05-04 15:00:39 jgaz: doesn't it recognize a .fs file? 2023-05-04 15:01:06 You could impose a color scheme similar to Chuck's color forth. 2023-05-04 15:01:20 Files matching "*.fs" could be F# or Forth. If the automatic detection doesn't work for you, or you don't edit F# at all, use this in your startup vimrc: let filetype_fs = "forth" 2023-05-04 15:01:25 names of definitions in one color and so on. 2023-05-04 15:01:28 https://vimhelp.org/syntax.txt.html 2023-05-04 15:02:08 jgaz: you'll probably want "set modeline" in your vimrc, and at the beginning of your forth source, something to the effect of \ vim: whatever=here 2023-05-04 15:02:13 I played a little with the idea of just having input I type one color, output of commands I run another color, and "system" output (like the ok promot) either of two colors, depending on whether it was an error message or not. 2023-05-04 15:02:13 vms14 et al, I was missing 3 lines in my vimrc 2023-05-04 15:02:16 It's workign now 2023-05-04 15:02:23 That's not really "syntax" related, though. 2023-05-04 15:02:33 It was pleasing enough in operation. 2023-05-04 15:02:36 `\ vim: syntax=forth ` works now. 2023-05-04 15:02:43 I used green for the ok prompt and red for error messages. 2023-05-04 15:02:49 colors are nothing xterm*colorMode:false can't fix 2023-05-04 15:02:55 jgaz: what extension are you giving your forth source? 2023-05-04 15:03:07 unjust `.fs` 2023-05-04 15:03:21 if you have syntax on in your vimrc, it should recognise forth source by the ".fs" extension 2023-05-04 15:03:54 and that's without a modeline in the source file 2023-05-04 15:04:06 vms14: yes 2023-05-04 15:04:19 crc do you have code? 2023-05-04 15:04:22 :0 2023-05-04 15:04:54 I try to make a form builder 2023-05-04 15:05:00 not public; it's part of code I develop for my employer 2023-05-04 15:05:06 it needs to perform validation and stuff 2023-05-04 15:05:14 it's a bit of a mess 2023-05-04 15:05:42 it accepts code as callback for validation 2023-05-04 15:06:24 and the submit is also code that will receive a hash/object with all the input elements and validation errors 2023-05-04 15:07:06 I'm hoping to get an ok to publish the non-proprietary parts later this year 2023-05-04 15:07:14 [ [ name validation [ 'oh equal ] meh ] ] 2023-05-04 15:07:42 What do your brackets do, vms14? 2023-05-04 15:07:45 'oh equal will be executed every time a character is put on the 2023-05-04 15:07:51 KipIngram: lists 2023-05-04 15:07:58 Ok. 2023-05-04 15:08:00 and I expect lists as code 2023-05-04 15:08:23 1 [ " is one" ] [ " is not one" ] if.else . 2023-05-04 15:08:56 jgaz, vms14: I tend to use .4th now, that's what Forth Inc do 2023-05-04 15:09:13 I use .oh 2023-05-04 15:09:16 :D 2023-05-04 15:10:03 .fth 2023-05-04 15:10:52 the vim forth syntax is cool 2023-05-04 15:10:54 Concatenative combinators are cool but the original paper just has way too many. 2023-05-04 15:10:56 I'm trying it now 2023-05-04 15:11:04 dup, swap, drop, compose, quote, apply. 2023-05-04 15:11:07 All you need. 2023-05-04 15:11:14 i liked .f - but vim thinks it's fortran unless told otherwise 2023-05-04 15:11:29 it does color immediate words different from "normal" words 2023-05-04 15:11:57 vim? 2023-05-04 15:12:04 vi improved 2023-05-04 15:12:22 yeah, I've just installed it xD 2023-05-04 15:12:23 No I mean was vms14 referring to vim with that last. 2023-05-04 15:12:38 emacs has no builtin forth mode 2023-05-04 15:12:42 That means it's interpreting the source. In order for it to know which words are immediate. 2023-05-04 15:12:45 and the ones I saw suck 2023-05-04 15:12:53 Even that is fancier than I would have expected. 2023-05-04 15:13:00 KipIngram: I'd say it's just a list of immediate words 2023-05-04 15:13:03 It means it's building a dictionary, or parts of one at least. 2023-05-04 15:13:13 You can mark any word immediate. 2023-05-04 15:13:18 jgaz: You might want to try out my forth syntax file for vim https://github.com/Veltas/forth-vim 2023-05-04 15:13:23 or someone regexed things out of ANS and then stuck them in a huge color defs file 2023-05-04 15:13:27 Do you mean only immediate NATIVE words? 2023-05-04 15:13:31 yeah, user defined words are not highlighted 2023-05-04 15:13:39 Ok - that's easier to buy. 2023-05-04 15:13:54 it would be cool 2023-05-04 15:14:14 but only in a forth editor written in forth 2023-05-04 15:14:22 Likewise you might want to try mine out too vms14 2023-05-04 15:14:54 vim's syntax highlighting is not really designed for Forth, but for most programs you can make it reasonably accurate 2023-05-04 15:15:26 I tend to turn syntax highlighting off, but if it's on I *need* my one, the one that comes with vim is too loud for me 2023-05-04 15:16:07 veltas: by loud, are you refering to colourscheme or highlighting style? 2023-05-04 15:16:22 style 2023-05-04 15:16:53 what does yours do differently? 2023-05-04 15:17:08 It highlights a lot less words 2023-05-04 15:17:21 And it's a bit more clever about how to highlight stuff 2023-05-04 15:17:29 I tend to like syntax highlighting fairly well as long as it's just using colors. When it starts changing text style on me it starts to grate. 2023-05-04 15:17:39 Like you can write a colon definition for : and it will highlight the : differently to the name : 2023-05-04 15:17:54 And you can use unicode names 2023-05-04 15:18:42 Often vim's highlighting is not good out of the box, I had to patch javascript.vim of all things 2023-05-04 15:18:42 veltas: I'm trying it 2023-05-04 15:18:48 this is how I see it 2023-05-04 15:19:09 I would have thought the syntax for the most popular language would support most literals but it barely supported any of them 2023-05-04 15:19:15 https://i.imgur.com/SoC8lkB.png 2023-05-04 15:19:47 i guess vim isn't the most popular editor amongst javascript programmers? 2023-05-04 15:20:12 I use emacs 2023-05-04 15:20:23 Honestly I have no idea but JS is so big I'd expect proper support 2023-05-04 15:20:25 I hate it, but I can't find something better 2023-05-04 15:20:29 vms14: I won't try to figure out what that code is doing. 2023-05-04 15:20:32 or mainly, I'm just used to it 2023-05-04 15:20:37 I was a vi fan at first 2023-05-04 15:20:48 KipIngram: xD 2023-05-04 15:20:49 But anyway that's why my name and email is in vim (because I was credited in source for some reason, rather than the git log) 2023-05-04 15:21:03 for fixing number literals in js 2023-05-04 15:21:08 speaking of editors, i'm waiting for an ed improved to come along 2023-05-04 15:21:29 I used to use emacs. Actually liked its keyboarding a little better than vim's. But at one point I was using an Android tablet fairly heavily and there was a Linux console emulator package I liked, and it came with vim instead. 2023-05-04 15:21:31 with multiple buffer support, yank/paste across buffers, and binary mode support 2023-05-04 15:21:37 So I switched over, and now I'm fine with vim. 2023-05-04 15:21:47 I don't participate in the holy war around vim vs. emacs. 2023-05-04 15:21:56 My opinion is that they're both perfectly good editors. 2023-05-04 15:22:05 vim's just a little bit saner and faster for me, I am currently supporting people using emacs at work though 2023-05-04 15:22:43 Had to help someone with their .emacs today, write some elisp 2023-05-04 15:22:45 The way emacs uses the control key makes more sense to me. 2023-05-04 15:22:59 Yeah I agree 2023-05-04 15:23:04 It's how readline works too 2023-05-04 15:23:09 veltas: the only real problem emacs has is it can't read large files 2023-05-04 15:23:10 both vim and emacs are pretty sluggish 2023-05-04 15:23:12 So it's nice having those shortcuts down 2023-05-04 15:23:19 because rms is idiot and reads the whole file 2023-05-04 15:23:23 vim can 2023-05-04 15:23:27 lol that's not the only problem emacs has 2023-05-04 15:23:30 yeah 2023-05-04 15:23:35 but the real one 2023-05-04 15:23:38 And RMS isn't an idiot :P 2023-05-04 15:23:42 :0 2023-05-04 15:23:52 vms14: can't you patch it to use mmap instead? 2023-05-04 15:23:53 I do not understand what comes to his mind 2023-05-04 15:24:03 emacs is full of what I call rmsisms 2023-05-04 15:24:33 Like what? 2023-05-04 15:24:38 unjust: no, but my hate relationship with emacs makes me want to make my own editor 2023-05-04 15:24:48 veltas: like regex 2023-05-04 15:25:02 like 8 spaces and the way to change them 2023-05-04 15:25:02 https://viewsourcecode.org/snaptoken/kilo/ hop to it! 2023-05-04 15:25:05 the documentation 2023-05-04 15:25:14 it has some jokes 2023-05-04 15:25:16 thrig: vim sluggish? I've not experienced that myself 2023-05-04 15:25:26 like when you want to disable backups and autosave 2023-05-04 15:25:31 try looking for that 2023-05-04 15:25:40 Try micro emacs, it starts up so quickly you will think it's broken at first 2023-05-04 15:26:05 30 milliseconds to startup, ye gods (slower than emacs client), too much code (vim has more in *.h files than vi has in total) 2023-05-04 15:26:06 https://www.gnu.org/software/emacs/manual/html_node/efaq/Disabling-auto_002dsave_002dmode.html 2023-05-04 15:26:19 emacs official documentation for how to disable autosave 2023-05-04 15:26:25 "you don't want to do this" 2023-05-04 15:26:39 and doesn't tell you how to do it xD 2023-05-04 15:26:47 you have to look somewhere else 2023-05-04 15:26:58 thrig: 30ms is reasonable and no I don't want a server for my text editor, just adds complication I don't need 2023-05-04 15:27:00 I had a weird thing happen the other day. I use terminator as my terminal emulator. I had to reboot my computer, and when it came back up and I tried to launch terminator, that would reboot it again. 2023-05-04 15:27:29 thrig: And yeah vim is quite large but honestly most of its features are useful to ... someone. Which vi are we talking about? 2023-05-04 15:27:29 30ms is hella slow, vi was down near 9ms when I benchmarked it, and has less crap to fix than vim does 2023-05-04 15:27:39 ex-vi from openbsd base, modified 2023-05-04 15:27:41 I finally worked it out by discarding ~/.config/terminator/config and setting up all my splits again and so on, but it's damn odd that anything in there could clobber the whole computer like that. 2023-05-04 15:28:22 KipIngram: was that as an unprivileged user? 2023-05-04 15:28:26 thrig: I don't know what to say, 0.03s is reasonable to me. Emacs is the only editor I've used that's noticeably slow. 2023-05-04 15:28:41 I mean I don't use vim to script my system, it's an interactive text editor 2023-05-04 15:28:58 vim cursor motions are also slow. again, probably too much code. also having to turn off all the status bar geegews and whatnot 2023-05-04 15:29:05 veltas: emacs clones aren't emacs 2023-05-04 15:29:15 they won't be better 2023-05-04 15:29:17 thrig: You can configure that stuff 2023-05-04 15:29:31 emacs is good if you're willing to spend time configuring it 2023-05-04 15:29:40 How does ex-vi on openBSD differ from classic ex-vi? 2023-05-04 15:29:44 not really, and they kept adding more crap to turn off 2023-05-04 15:29:48 this is why I say the only real problem emacs has is loading whole files 2023-05-04 15:29:50 I've used classic ex-vi quite a bit 2023-05-04 15:30:18 I will say vim is often distributed with a lot of crap turned on, but actual vim from source doesn't come with that. It's distro's fault 2023-05-04 15:30:20 I just hate the way it does the stuff 2023-05-04 15:30:28 and it's the way rms does the stuff 2023-05-04 15:30:33 Fair enough, I like buffers, jump lists, etc. 2023-05-04 15:30:35 And tabs 2023-05-04 15:31:11 still emacs is the best lisp environment you can get 2023-05-04 15:31:20 That's why I first used emacs 2023-05-04 15:31:27 and it's my irc client 2023-05-04 15:31:31 To try out lisp, because everyone in lisp says to use emacs 2023-05-04 15:31:45 veltas: I was refusing to use emacs just because of that 2023-05-04 15:31:51 I was a vi fan 2023-05-04 15:31:55 vi has set sm 2023-05-04 15:32:04 which does paren highlight 2023-05-04 15:32:05 emacs has jump lists but they don't work well 2023-05-04 15:32:16 but nothing is better for lisp than emacs 2023-05-04 15:33:08 I came eventually emacs, not because lisp, but because I knew the value it could have if I spend time configuring it 2023-05-04 15:33:23 to* 2023-05-04 15:34:23 you can do a lot of stuff 2023-05-04 15:34:41 and people has done a lot of stuff you can use 2023-05-04 15:35:06 thrig: Does ex-vi on openbsd have jumplists, or buffers? 2023-05-04 15:35:07 You can do the same kind of "fancy dancing" with vim. I think of them as fairly equivalent in that regard. 2023-05-04 15:35:25 what are jump lists? 2023-05-04 15:35:54 I can use Ctrl+O to go 'back' through files, between files, when moving around and using tag lookup 2023-05-04 15:36:02 And Ctrl+I to go 'forward' again if I feel like it 2023-05-04 15:36:38 map ]b :next map [b :previous map [B :rewind 2023-05-04 15:36:56 I don't use ctags, otherwise 2023-05-04 15:37:09 tags are a huge gain for me 2023-05-04 15:37:35 I also have F10 bound to "recursive grep current dir for current search pattern" 2023-05-04 15:37:47 and pastes the results in a new tab 2023-05-04 15:38:05 I find it incredibly useful/productive 2023-05-04 15:38:24 I have a little ncurses program to present and pick on recursive grep which can launch vi 2023-05-04 15:38:54 No buffers? 2023-05-04 15:39:28 ponder what :next might do 2023-05-04 15:39:32 veltas: that's the benefits of a programable editor 2023-05-04 15:40:17 did you guys make a forth text editor? 2023-05-04 15:40:53 I tend to imagine one 2023-05-04 15:41:01 binding keys to words 2023-05-04 15:41:04 I know what :next does and it's not "open another buffer" on classic ex-vi 2023-05-04 15:42:53 I only use :next extremely rarely if I have a bunch of files to do quick edits on 2023-05-04 15:43:13 vi supports buffers, though I have no idea how that differs from your concept of buffers 2023-05-04 15:43:17 Which is what it's for really, it's not designed to be a poor man's tab/buffer 2023-05-04 15:43:32 vim buffers are like emacs buffers really 2023-05-04 15:43:48 bloated? 2023-05-04 15:44:09 No it just keeps the file open until you close it, it can open more than one file at a time 2023-05-04 15:44:13 I rarely wind up in use cases where I need a whole slew of files open. Mostly because I'm not a C programmer for my living. 2023-05-04 15:44:23 I see what the guys at my office do with vim, and it's pretty impressive. 2023-05-04 15:44:34 vi can keep a file open until you close it, and can open more than one file at a time 2023-05-04 15:50:12 I'm reading the manpage and it says you can get a split-screen on openbsd ex-vi which is something classic ex-vi doesn't do 2023-05-04 15:50:43 Although I'm assuming you can't do a vertical split 2023-05-04 15:50:45 when you're talking about classic ex-vi, are you refering to nvi? 2023-05-04 15:50:56 "4.4BSD re-implementation of vi" 2023-05-04 15:51:08 thrig uses OpenBSD's ex-vi 2023-05-04 15:51:21 a modified version thereof 2023-05-04 15:51:23 Oh you mean me, I'm talking about actual ex-vi 2023-05-04 15:51:32 :E filename 2023-05-04 15:51:37 will give you a horizontal split in nvi 2023-05-04 15:52:28 Yeah I see that in the manpage 2023-05-04 15:52:46 I removed most or all of the Upper Case Do Different Things 2023-05-04 15:53:25 it's too bad :next filename doesn't preserve the already open file buffers though 2023-05-04 15:53:30 vim's just a lot more flexible about this stuff, which I find to make me more productive 2023-05-04 15:54:17 I had a line in .vimrc to workaround the 'more files to edit' (E173) bug, in my vi I removed that feature from the code 2023-05-04 15:54:38 unjust: You can do :N to split and then close the other pane if that's the case, based on my reading 2023-05-04 15:55:47 That's not a bug thrig, it's reminding you you have more files to edit 2023-05-04 15:55:54 it's a bug. I removed it. 2023-05-04 15:56:07 another downer is that :e filename doesn't seem to link the new buffer to the (buffer?) list if you jump around with :prev: or :next 2023-05-04 15:56:45 :edit is for a pair of files you can flip with control-^ 2023-05-04 15:56:49 Because you invoke vim with multiple files it means "I want to process a bunch of documents" 2023-05-04 15:57:09 Use -p if you want to just have a bunch of files open at once to switch between 2023-05-04 15:57:14 i'm talking about nvi (as in 4.4BSD vi) not vim 2023-05-04 15:57:14 I am aware of that opinion 2023-05-04 15:57:19 :) 2023-05-04 15:57:30 I'm just playing along 2023-05-04 15:57:43 And for the sake of any readers who aren't aware 2023-05-04 15:57:44 nvi in netbsd freezes when I use emacs hotkeys xD 2023-05-04 15:57:59 I'm used to emacs and when I use vi I end typing emacs 2023-05-04 15:58:15 Most terminal apps freeze when you type Ctrl+S 2023-05-04 15:58:24 it does freeze if I try to ctrl x s 2023-05-04 15:58:26 ctrl+q thaws them out 2023-05-04 15:58:32 ^ 2023-05-04 15:58:33 (xon/xoff) 2023-05-04 16:01:06 oh 2023-05-04 16:01:35 lol I didn't know how to thaw it 2023-05-04 16:02:18 hang up the modem and dial in again 2023-05-04 16:02:23 it does not happen on vim 2023-05-04 16:02:30 linux aliases vi to vim 2023-05-04 16:02:49 Ctrl-x and ctrl-q; that's old terminal data flow stuff. 2023-05-04 16:03:07 vi might be aliased to vim, or it might be nano or lord knows what (depending on the flavor of linux) 2023-05-04 16:03:55 pretty sure I ended up using busybox vi the last time I was on linux, which wasn't too terrible 2023-05-04 17:47:06 fossils.retroforth.org:8000/ilo/file?name=vm/ilo-js.html&ci=tip&txt=1 is a start of an ilo vm in javascript; not fully working yet (blocks aren't in place) 2023-05-04 17:58:08 :0 2023-05-04 17:58:15 how did you decide to work with blocks? 2023-05-04 17:58:23 it won't work on the browser? 2023-05-04 17:59:26 I see https://developer.mozilla.org/en-US/docs/Web/API/FileReader on your .js 2023-05-04 17:59:53 but it says it only works with 2023-05-04 18:00:13 so you'll have some sort of hidden input type="file" or how? 2023-05-04 18:02:45 ah, it's the image file? 2023-05-04 18:03:35 today I saw an introductory video about indexed DB 2023-05-04 18:03:53 for now. I think I can have it load the image from a server as well, but haven't tested that yet (probably will do so tomorrow) 2023-05-04 18:03:56 it's good for having a general idea 2023-05-04 18:04:03 webmidi, webdb, webtoiletplunger, ... 2023-05-04 18:04:06 still considering the blocks 2023-05-04 18:04:52 https://www.youtube.com/watch?v=yZ26CXny3iI 2023-05-04 18:05:03 I 2023-05-04 18:05:51 crc you can autogenerate the html and have the image file pasted in a 2023-05-04 18:07:07 I made it also load it from src="" using fetch 2023-05-04 18:07:16 The image is binary data, not text 2023-05-04 18:07:31 you can encode it with base64 2023-05-04 18:07:34 it's quite verbose 2023-05-04 18:07:39 but it works 2023-05-04 18:07:51 and no idea if you can embed js blobs in html 2023-05-04 18:09:00 oh 2023-05-04 18:09:10 a guy uses to embed binary data there 2023-05-04 18:09:40 the cool thing is img can work with src="", making the browser load a remote file 2023-05-04 18:09:52 does not happen with a script that it's not js 2023-05-04 18:09:53 354kb for the image as base64 2023-05-04 18:10:03 base64 is super verbose :/ 2023-05-04 18:11:56 if you add dom support you can start making cool stuff with that implementation 2023-05-04 18:12:24 and canvas 2023-05-04 18:12:28 you have even webgl 2023-05-04 18:12:32 and a sound api 2023-05-04 18:12:33 etc 2023-05-04 18:13:07 it would be cool as retro forth is a mature language 2023-05-04 18:13:45 why you didn't start earlier 2023-05-04 18:13:52 I wouldn't have to make mine 2023-05-04 18:14:21 I've ended getting used to my dirty lang 2023-05-04 18:14:40 I like it xD 2023-05-04 18:14:46 ACTION dislikes browser based development :) 2023-05-04 18:14:50 it's weird like me 2023-05-04 18:15:05 crc why? 2023-05-04 18:15:10 because of css? 2023-05-04 18:15:13 the limitations? 2023-05-04 18:15:15 js? 2023-05-04 18:15:48 I don't like js. And browsers are big, complicated things. 2023-05-04 18:16:05 I'm not fan of js, but when I saw it, it wasn't that bad 2023-05-04 18:16:21 it's actually quite good 2023-05-04 18:16:26 and fast 2023-05-04 18:16:43 I only regret js was going to be a scheme 2023-05-04 18:16:51 but js gets turned into Electron, which is quite bad, and slow 2023-05-04 18:17:06 I can't install electron 2023-05-04 18:17:13 but I would use it if I could 2023-05-04 18:17:25 I've already have a lang on top of js 2023-05-04 18:17:31 I* 2023-05-04 18:18:17 and it's better than my perl one, but the perl one has more "unix scripting" features 2023-05-04 18:18:29 I have to learn node properly 2023-05-04 18:18:31 and js 2023-05-04 18:18:32 xD 2023-05-04 18:18:55 I like being closer to the machine I'm using 2023-05-04 18:19:45 I only care about freedom when I choose a language 2023-05-04 18:19:58 this is mainly why I like forth 2023-05-04 18:20:15 Though I use a VM, it's *small*; a few hundred instructions to implement in assembly 2023-05-04 18:20:45 no idea if wasm can give you a sense of being close to the machine 2023-05-04 18:21:17 I don't even really know what web assembly is 2023-05-04 18:21:48 but the syntax is funny 2023-05-04 18:21:58 it's lisp and reversed forth at the same time 2023-05-04 18:25:20 crc did I influence you to write that .js implementation? 2023-05-04 18:25:42 because of deployment? 2023-05-04 18:25:51 I've looked at wasm a little, but not used it anywhere 2023-05-04 18:26:25 doing a js version was on my todo list after the first release 2023-05-04 18:27:31 if you add some bindings to browser stuff it could be cool 2023-05-04 18:27:49 it won't be js anymore, but retro forth on the browser 2023-05-04 18:28:05 that's the reason of implementing a lang on top of js 2023-05-04 18:28:10 or a js transpiler 2023-05-04 18:28:28 not having to use js 2023-05-04 18:28:40 what haskellers call "The javascript problem" 2023-05-04 18:28:44 I'll likely leave that for others; I'll be happy enough to get the basic system fully functional 2023-05-04 18:28:57 wow you really dislike it xD 2023-05-04 18:30:53 it's not something I expect to end up using personally, so I'm not motivated to do anything extra at this point 2023-05-04 18:32:08 a lot of applications use html as interface 2023-05-04 18:33:09 it's an easy way to get a portable ui 2023-05-04 18:33:13 The main motivation with js is you can be like "here is konilo in the browser, go play" 2023-05-04 18:33:14 or client 2023-05-04 18:33:16 yes, that doesn't make it a good solution 2023-05-04 18:33:58 It's why I considered doing it, because I think it's a great way to demo it 2023-05-04 18:34:08 yeah no one needs to install retro forth 2023-05-04 18:34:13 I maintain an application with an HTML based interface. The HTML is all statically generated by the backend, with traditional CGI for form processing & such. No JS needed. 2023-05-04 18:34:27 it's just a url 2023-05-04 18:34:42 it should be noted that the ilo vm is for konilo, not retro 2023-05-04 18:35:25 I worried a lot on the past to provide text browser compatibility 2023-05-04 18:35:55 but since today a browser without js can only browse wikipedia it makes no sense 2023-05-04 18:36:07 and crawlers have other ways to crawl a site 2023-05-04 18:36:13 like json 2023-05-04 18:36:18 if you want retro in a browser, https://github.com/RickCarlino/retroforth-web-terminal or https://github.com/RickCarlino/retro-ts are good starting points 2023-05-04 18:45:12 veltas: serving as a demo is probably going to be the main thing it'll get used for 2023-05-04 18:45:51 It'll at least be lighter than pointing people to the konilo on an x86 pc emulator in js demo I have now 2023-05-04 18:45:58 Yeah 2023-05-04 18:46:21 Excited to try out ilo-js at some point, code looks very clean so far 2023-05-04 18:47:41 ACTION hides his dirty code 2023-05-04 18:50:55 I think I'll have everything functional within the next week. I still have to think on the UI a bit and make some decisions on the block handling and initial image loading before I can move on. 2023-05-04 19:08:13 forthional 2023-05-04 19:08:33 Oh, I'm stealing that word... 2023-05-04 19:09:00 let's see how long before chatgpt can cough it up 2023-05-04 19:09:35 :-) You know, I've heard some bizarre stories about those things. Some of them imply the things make stuff up. 2023-05-04 19:09:50 Cite nonexistent papers, and so on. It's hard for me to see how that could happen. 2023-05-04 19:09:52 before I forget: May the 4th/fourth/Forth be with ya’ll 2023-05-04 19:10:19 https://thrig.me/tmp/forth-the.png 2023-05-04 19:11:20 re chatgpt citing none existant papers: some academics are intrested just in the titles and what those papers could be about 2023-05-04 19:11:25 vms14: i wrote something sort of like a forth in javascript a few months ago to see how it would pan out, and i think DOM manipulation in RPN looks promising: https://imgur.com/a/ckU5NDg 2023-05-04 19:12:37 :0 2023-05-04 19:12:47 you can add stylesheets with insertRule 2023-05-04 19:13:15 I use lists for the dom 2023-05-04 19:13:22 I can for example 'p dom 2023-05-04 19:13:26 and have a

element 2023-05-04 19:13:35 dom is document.createElement() 2023-05-04 19:13:39 but I also have html 2023-05-04 19:14:00 [ span :color orange text ` some text` ] html 2023-05-04 19:15:29 #some-id would set the id and .some-class the class 2023-05-04 19:15:31 interesting syntax 2023-05-04 19:15:53 and there's onsomething and oncesomething 2023-05-04 19:15:53 XD 2023-05-04 19:16:18 [ span onclick [ 'oh . ] ] 2023-05-04 19:16:39 [ span onceclick [ 'oh . ] ] would only trigger once 2023-05-04 19:16:53 and now I'm making a form builder 2023-05-04 19:17:05 [ [ name validation [ 'oh equal ] meh ] [ oh validation numbers ] ] [ form . ] form body append 2023-05-04 19:17:36 it's a bit weird and I'm defining it yet 2023-05-04 19:17:45 it's a mess 2023-05-04 19:18:06 https://termbin.com/r0hu 2023-05-04 19:18:15 it's the form(stuff,callback) function 2023-05-04 19:20:13 https://termbin.com/8p5w this is a todo app I'm trying to make 2023-05-04 19:20:36 but I needed the form word for adding entries 2023-05-04 19:20:45 it uses localStorage 2023-05-04 19:21:12 storage keys [ storage get deserialize render ] do.list 2023-05-04 19:21:21 looks promising, what's behind word() btw? 2023-05-04 19:21:30 serialize and deserialize are JSON parse and stringify 2023-05-04 19:21:47 word needs to be an object with an environment 2023-05-04 19:21:53 these are the only 3 words i've written for DOM manipulation so far: https://pastebin.com/tMd2T2pA 2023-05-04 19:21:55 words have environments 2023-05-04 19:22:15 https://termbin.com/khxa0 this is the implementation 2023-05-04 19:22:37 the browser stuff is what you've seen and goes in a different file 2023-05-04 19:22:47 so the "core" can run in both node and browser 2023-05-04 19:25:17 unjust: add document.createElement() 2023-05-04 19:25:35 if you have a way to set and get object properties you have almost full dom manipulation 2023-05-04 19:30:26 it's cool that you take them from a string 2023-05-04 19:30:37 the SEE word could show that code 2023-05-04 19:31:03 and you could even use it to transpile to js 2023-05-04 19:34:38 everything ends up as javascript source in a fat string variable, more or less... then 'compiled' as: Dictionary[Word].meaning = new Function(define()); 2023-05-04 19:35:07 s/string/array of strings/ 2023-05-04 19:35:44 where define() just glues the strings together depending on the interpreter state and type of token 2023-05-04 19:36:21 i can put the source somewhere if you're interested in that 2023-05-04 19:37:01 i don't have a SEE yet, because i'm not sure if there's an easy way to reverse javascript functions back to some equivalent source representation? 2023-05-04 19:37:16 :0 2023-05-04 19:37:20 can I see the code? 2023-05-04 19:37:33 otherwise i would have to keep the source in an attribute of Dictionary[Word] and hope that it doesn't go out of sync with .meaning 2023-05-04 19:37:36 sure 2023-05-04 19:43:18 https://github.com/jhswartz/eczema 2023-05-04 19:46:38 :0 your code is clean 2023-05-04 19:46:44 thanks 2023-05-04 20:22:21 unjust: js`someFunc.toString()` gives you the source code of someFunc 2023-05-04 20:23:25 thanks a lot Zarutian_iPad! 2023-05-04 21:51:41 https://remarkable-syrniki-9f35ac.netlify.app/ah.html a todo app 2023-05-04 21:51:57 can't edit fields :/ 2023-05-04 21:52:16 https://termbin.com/r01d the code 2023-05-04 22:39:38 heh @ remarkable-syrniki 2023-05-04 22:46:26 I think I have the dom access I wanted 2023-05-04 22:46:35 https://i.imgur.com/PUUUILm.png 2023-05-04 22:46:49 i like how the html is represented as s-expressions with brackets 2023-05-04 22:47:14 what does bind.keys do? 2023-05-04 22:47:39 takes an object and a list of keys to bind as words 2023-05-04 22:48:16 it's actually taking the values of localstorage 2023-05-04 22:48:28 it sets the keys as env words 2023-05-04 22:48:49 env words are lexical 2023-05-04 22:48:51 what is localstorage? 2023-05-04 22:49:07 the browser's localStorage 2023-05-04 22:49:13 a javascript persistent object 2023-05-04 22:49:38 not familiar with this concept, can you recommend something to read about it? 2023-05-04 22:49:40 I use serialize and deserialize to put stuff there and act as a db 2023-05-04 22:49:52 no, just open the browser and press f12 2023-05-04 22:50:00 on the console type localStorage 2023-05-04 22:50:11 it should be an "empty" object with length of 0 2023-05-04 22:50:18 you can localStorage.oh = 3 2023-05-04 22:50:22 local storage is so web apps can sometimes be run offline, e.g. lojban dictionaries 2023-05-04 22:50:34 when you refresh the page localStorage.oh will remain 2023-05-04 22:51:03 if you use json.parse + stringify then you have some kind of db 2023-05-04 22:51:57 is localStorage partitioned on a per remote host/site basis? 2023-05-04 22:52:11 per url 2023-05-04 22:52:24 or what is named as "origin" 2023-05-04 22:52:26 localStorage.gratuituousHolubtsi isn't present anywhere else 2023-05-04 22:52:41 so yeah, per host xD 2023-05-04 22:53:58 https://developer.mozilla.org/en-US/docs/Web/API/Storage 2023-05-04 22:54:20 you can ignore the methods and use it as a normal object 2023-05-04 22:55:27 the big brother of localStorage is indexedDB 2023-05-04 22:55:36 but it's much more complex 2023-05-04 22:57:27 thanks 2023-05-04 22:59:14 the form builder still needs to improve 2023-05-04 22:59:25 but the dom and css stuff is fine for now 2023-05-04 23:00:02 looks a lot better than writing html/css the usual way 2023-05-04 23:00:29 yeah, I had one html generator in lisp and it was super nice 2023-05-04 23:00:37 I didn't want to write raw html never again 2023-05-04 23:00:43 lisp as in common lisp? 2023-05-04 23:00:48 yes 2023-05-04 23:01:37 prefer it to scheme? 2023-05-04 23:01:47 yes 2023-05-04 23:01:58 the only scheme I like is s7 scheme 2023-05-04 23:02:49 https://gitlab.com/vms14/all/-/blob/master/lisp/html.lisp 2023-05-04 23:02:54 this is the html generator 2023-05-04 23:03:01 it creates functions 2023-05-04 23:06:09 https://gitlab.com/vms14/all/-/blob/master/lisp/create-gallery.lisp this is an example usage 2023-05-04 23:06:21 it's missing the js part, it was cool 2023-05-04 23:06:25 what about fuckyouall.lisp? 2023-05-04 23:06:36 you gave it a list of images and made a gallery 2023-05-04 23:07:11 I don't remember what it does 2023-05-04 23:07:21 it was some kind of exercise some guys were making 2023-05-04 23:07:33 fuckyouall is refered to them 2023-05-04 23:08:16 i guess the magic happens between mapcar and the lambda that produces

yeah, but the js part is missing :/ 2023-05-04 23:09:13 it added fullscrenn and the arrows changed the image 2023-05-04 23:10:12 You can only use 8 words. Which do you pick? 2023-05-04 23:10:27 once you're used to (html (head (viewport)) (body (p :class 'oh "haha"))) you don't want to write normal html anymore 2023-05-04 23:12:10 decay: maybe CODE [ ] CREATE DOES> IMMEDIATE POSTPONE ' SEE 2023-05-04 23:12:50 Isn't that 9? 2023-05-04 23:13:04 ok, leave out SEE then 2023-05-04 23:13:11 heh. 2023-05-04 23:15:04 or maybe s/POSTPONE/,/ 2023-05-04 23:16:09 vms14: wasn't that how html (or sgml?) was meant to look initially? 2023-05-04 23:21:07 no ida 2023-05-04 23:21:14 idea* 2023-05-04 23:21:27 it's how js was meant to look 2023-05-04 23:21:35 but nope 2023-05-04 23:30:03 let's talk about SEXP baby 2023-05-04 23:36:03 I always liked m-exp more 2023-05-04 23:36:25 and I'm respecting forth's ( comments) 2023-05-04 23:39:34 althought I always disliked the ( comment) without a space at the end 2023-05-04 23:39:48 it should be ( comment ) :/ 2023-05-04 23:43:59 i guess you could force that space if you ditch the idea of the ( word searching for the next instance of ) and advancing the input buffer past it, and instead make ( eat tokens until ) appears? 2023-05-04 23:44:38 s/buffer/pointer/ 2023-05-04 23:45:58 I had it the space forced because I was reading by words 2023-05-04 23:46:06 but not I left it as in forth 2023-05-04 23:46:09 now* 2023-05-04 23:46:23 idk if in forth comments are recursive, but they are here 2023-05-04 23:46:56 and they don't need a space once the first ( is present 2023-05-04 23:47:08 ( some(comments(nested))) 2023-05-04 23:48:01 When I was working on my own concatenative language, I didn't have quotation notation. 2023-05-04 23:48:22 Instead, I allowed you to push any unknown symbols to the stack. 2023-05-04 23:48:39 so there was no error when a word wasn't found and not a number? 2023-05-04 23:48:49 Nope. You just treated it as a symbol. 2023-05-04 23:48:58 I thought on doing that, but it fucks even more the debugging process 2023-05-04 23:49:00 how did you handle strings? 2023-05-04 23:49:04 and I have troubles debugging 2023-05-04 23:49:16 I parsed strings as symbols 2023-05-04 23:49:23 So "foo" and foo were the same thing. 2023-05-04 23:49:35 in my lang are also sort of the same thing 2023-05-04 23:49:56 You could use this behavior to define a word, ], that repeatedly pops and composes the stack with the item under it. 2023-05-04 23:50:01 Until it encounters a [. 2023-05-04 23:50:10 I have ` and " which both make a string, but behave different in colon words and lists 2023-05-04 23:50:30 [ ` oh` ] eval will eval the word 'oh' 2023-05-04 23:50:40 [ " oh" ] eval will push the string "oh" 2023-05-04 23:51:06 So [ foo [ bar [ baz ] ] ]] will just push the symbols [ foo [ bar [ baz. 2023-05-04 23:51:23 And then execute three words in sequence, ] ] ] 2023-05-04 23:52:01 It was neat. 2023-05-04 23:52:37 it's kind of a design flaw 2023-05-04 23:52:43 but I like it 2023-05-04 23:52:50 Hardly a design flaw. 2023-05-04 23:53:06 I mean mine 2023-05-04 23:53:18 Yeah, hardly a design flaw. :P 2023-05-04 23:53:21 :0 2023-05-04 23:53:37 I like it for metaprogramming 2023-05-04 23:53:41 as lists can be code 2023-05-04 23:54:04 [ oh 'oh ] eval 2023-05-04 23:54:18 the first executes 'oh' the second pushes a string 2023-05-04 23:54:53 and I have a weird way to insert stuff on lists 2023-05-04 23:55:45 [ @oh ] @ will interpret 'oh' and insert it there 2023-05-04 23:56:07 1 [ @ ] @ would insert the 1 2023-05-04 23:56:14 same as [ @1 ] @ 2023-05-04 23:56:15 xD