2022-03-27 04:04:08 KipIngram: It seems like one of the reasons APL is terse is the use of lots of weird symbols 2022-03-27 04:04:22 There are forks of APL that use more normal ASCII though I think 2022-03-27 04:05:12 It's very mathsy and seems good at performing linear algebra and stuff, I wonder how good it is for general programming 2022-03-27 07:13:00 apl isnt that mathsy 2022-03-27 07:13:53 nmz: you concatenate lists by the , operator 2022-03-27 07:33:11 K and J are APL-like with ASCII 2022-03-27 07:33:43 mhm 2022-03-27 08:19:15 eris[m]: My meaning of "mathsy" might be different to yours 2022-03-27 08:19:23 thats fair 2022-03-27 09:01:10 KipIngram: Wait... so LOAD puts the entire block in the input buffer? 2022-03-27 09:01:56 I just assumed it would do a line at a time, so actually I need to leave a space at the end of each line? 2022-03-27 09:04:15 And in the standard the length of a line affected by \ is implementation-dependent... *face-palm* 2022-03-27 09:54:57 i made a distinction between `whitespace` and `end of line` 2022-03-27 09:55:20 it's quite elegant but it's also non-standard 2022-03-27 09:57:02 `word` which gets the next token from the input buffer, skips whitespace and newline for the 1st part, then characters until whitespace or newline 2022-03-27 09:57:32 `parse` which gets part of the line up to a character, stops at the end character or newline 2022-03-27 09:57:54 only the 1st part of `word` will go past newline 2022-03-27 09:58:23 the input buffer itself is a string c-addr n 2022-03-27 09:58:58 it's only when you get to the end of a string, not newline, when `word` returns a 0 length token 2022-03-27 10:00:23 the standard wants to use `refill` to go to the next line 2022-03-27 10:00:34 but that requires a scan of the string to newline 2022-03-27 10:01:28 my non-standard `word` and `parse` only make a single pass over the input buffer, and i use c-addr n for all strings, so there's no copying a counted string for classical `word` 2022-03-27 10:01:37 my `word` is more like `parse-name` 2022-03-27 10:01:57 but parse-name is a silly name :-) 2022-03-27 10:02:53 Quite 2022-03-27 11:20:08 Yeah, I think apl is a linear algebra "centric" language. Though that may be "among other things," I guess. 2022-03-27 11:20:25 not sure 2022-03-27 11:21:09 Right - LOAD runs BLOCK, which bring an entire block in. And in traditional implementations that would all get processed as a single line by INTERPRET. 2022-03-27 11:21:43 Having line feeds in data on disk is an "innovation." 2022-03-27 11:22:23 But as long as you're wwaiging around for a disk access, you may as well get a good size chunk. It's the equivalent of filling an entire cache line on RAM reads. You're "likely to need what comes next." 2022-03-27 11:23:13 In some systems a null is guaranteed just beyond the end of the disk buffer, to serve as the termination for INTERPRET. 2022-03-27 11:23:29 I didn't want that, because it throws off the alignment of multiple disk buffers. 2022-03-27 11:24:11 Instead, I added a variable that represented the longest possible INTERPRET string. If >IN becomes larger than that, then the routine in interpret that fetches the next character force-returns null. 2022-03-27 11:24:53 I suppose that's in WORD - haven't looked there in a week so I'd have to check. 2022-03-27 11:25:22 My TIB has a null after it, but my disk buffers don't. So I have that max val set to 4096. 2022-03-27 11:26:53 What it does is forces WORD to eventually parse out the "null word," and in my system the string "" is the name of a word that uses ;; to exit INTERPRET's loop. 2022-03-27 11:27:12 Instead of returning to INTERPRET, it returns to INTERPRET's caller, which is QUIT. 2022-03-27 11:27:36 Or LOAD. 2022-03-27 11:28:41 LOAD just saves BLK and >IN to the return stack, puts the block # to load in BLK and 0 in >IN, calls INTERPRET, and then restores BLK and >IN from the return stack. 2022-03-27 11:29:26 i have to emulate >IN (which i haven't done yet) .. all my stuff uses `c-addr n` strings 2022-03-27 11:30:21 i don't like counted strings, or offsets 2022-03-27 11:31:52 i haven't written anything that needs to modify >IN to `go backwards` or reparse something 2022-03-27 11:32:31 There's not anything in traditional Forth that needs to do that. 2022-03-27 11:32:47 It's a straight linear forward scan, traditionally. 2022-03-27 11:33:07 that's very simple and fast, i like it :-) 2022-03-27 11:33:19 I was wondering the other day whether anything could be done with playing >IN games. 2022-03-27 11:33:26 Anything highly useful. 2022-03-27 11:33:57 It's actually rather inefficient, because WORD calls BLOCK for every character. BLK @ BLOCK >IN @ + to get a pointer to the next char. 2022-03-27 11:34:00 the only thing i can think of would be interpreting IF ELSE THEN 2022-03-27 11:34:16 Technically you'd only need to call BLOCK after each EXECUTE. 2022-03-27 11:34:27 That could be optimized to happen fairly easily. 2022-03-27 11:35:05 BLOCK is fast if the block is already in a buffer, but it still is like 12-15 lines of assembly, even in the fast case. 2022-03-27 11:35:38 One could have a flag that gets cleared when WORD calls BLOCK, and would only call it again if the flag was set. 2022-03-27 11:35:59 BLOCK would reset the flag if it actually loaded a buffer. 2022-03-27 11:36:52 But in general in Forth you're supposed to recall BLOCK, instead of just reusing the address it gave you last time, if there is any possibility that your buffer has been overwritten by intervening work. 2022-03-27 11:37:45 Which basically means that the result of BLOCK is good only u until another BLOCK call. 2022-03-27 11:38:01 up 2022-03-27 11:38:30 You don't know, in general, how many buffers you even have - you might only have one. 2022-03-27 11:38:36 Though you usually have several. 2022-03-27 11:38:39 And I have a LOT. 2022-03-27 11:38:53 It's a worthwhile thing to invest plentiful RAM in. 2022-03-27 11:42:30 Yeah, you could cobble up an interpretation of IF ELSE THEN. I could cobble up interpretation of my conditional returns and conditional ME words. 2022-03-27 11:42:43 I decided after thinking about it it wasn't worth the cobbling. 2022-03-27 11:43:27 I think the main use would be to be better able to test pieces of definitions manually, and eventually I'll have a debugger which will meet all the same needs. 2022-03-27 11:43:44 Decided I didn't need to ugly up the compiler to solve that problem twice. 2022-03-27 11:45:41 I probably will optimize WORD, though, to only call BLOCK on the first char, though. That would speed up compilation for me quite a lot, expecially since it's currently getting called for every space character in a whole 4096 byte block of source. 2022-03-27 11:46:06 it's BLOCK's fast past, but even so that would add up to a lot of unnecessary wheel spinning. 2022-03-27 11:46:15 s/past/path/ 2022-03-27 11:47:19 So long as WORD is just "taking more chars" after the first one, and nothing has been EXECUTED yet, then the buffer address is still guaranteed valid. 2022-03-27 11:51:47 I was thinking about line feeds in disk data myself last night. In the past I haven't had them, and I've just treated disk blocks as 64 x 64 fixed length lines. I'm changing that this time, so gotta think it through. 2022-03-27 11:52:02 It'll change the editor rather drastically. 2022-03-27 11:55:47 In prep for that I changed WORD so that it ignores chars < 32 other than null. 2022-03-27 11:56:42 That had an immediate benefit, though - it made it so I can open my blocks.dat file with vim and past code into it. Obviously that's only workable so long as I don't have any real content in blocks.dat yet - it throws off the alignment of everything after the edit point. 2022-03-27 11:56:50 But it's a good way to bootstrap. 2022-03-27 11:57:01 I suppose what I meant was terse 2022-03-27 11:57:30 apl? Yes - I don't "know it" but my impression has always been that it's very terse. 2022-03-27 11:57:44 A lot of my word names are like that - very "symbol based." 2022-03-27 11:58:33 Totally a matter of preference - I just personally don't like the long "multiple English words" names. 2022-03-27 11:59:28 I concede the symbol usage makes code "hard to read" for a non-initiate. 2022-03-27 11:59:39 its not that 2022-03-27 12:01:19 its that when you code, you usually have to chop things in modules, I think apl is right in making the base be terse, I don't really think writing "for" "while" "repeat" "function" is necessary, everyone knows what that is. but what one write, (the functions/variables one make) should be legible, especially if you only use it once 2022-03-27 12:02:01 in 2 months you're not gonna know what x y z are or mean 2022-03-27 12:02:31 I think that's a good point - heavily used words are better candidates for terseness. A one-time-use function is a lot harder to remember the exact operation of, so the more the name can help you the better. 2022-03-27 12:02:49 ACTION nods 2022-03-27 12:03:30 I'm coding a lot in lua and its painful. the verbosity makes things less legible 2022-03-27 12:04:24 because you have to read "end" instead of }, its easy to see the end of the block with }, but with end I can feel myself reading "end" and looking what block it is 2022-03-27 12:06:06 I think a fault of mine is that I care too much about how a group of source lines "look," in terms of their structure and layout. For example, if I have half a dozen lines that are all around the same length, and then one more line in the group that sticks out 15-20 chars further than the others, that bothers me. It's a silly thing to care about, I think, but it's "in me." 2022-03-27 12:06:21 Almost like I'm looking at the code on the page as a painting or something. 2022-03-27 12:06:34 And one bad effect of this is that it causes me to under-comment. 2022-03-27 12:06:41 nmz: I think the verbocity of lua is due to the authors speaking portugese as their native language and the verbocity of romani languages had spilled over 2022-03-27 12:07:06 This time I intend to build in a way to have commentary remote from the source code, with a sort of "links" system. 2022-03-27 12:07:17 nah 2022-03-27 12:07:27 I think its because they're fans of pascal 2022-03-27 12:07:40 they're teachers, and teachers rarely code 2022-03-27 12:08:18 nmz: could be that fanning is due to the aforesaid lingustic factor? 2022-03-27 12:08:36 I could see teachers caring more about readability that usability. 2022-03-27 12:09:09 spanish is my mother tongue and I HATE verbosity. 2022-03-27 12:09:22 theres not that much difference between portuguese and spanish 2022-03-27 12:09:32 what was the term again for readability of signs versus 'readability' of text? 2022-03-27 12:10:30 info sign must be easily understood in short time 2022-03-27 12:10:31 BTW, there's a good book on the evolution of languages called "The Unfolding of Language," by Guy Deutscher. 2022-03-27 12:10:40 Lots of fascinating info in there. 2022-03-27 12:10:45 brevity yet informative 2022-03-27 12:11:03 I was just reading that wirth made oberon as fast to parse and compile. so I think there's a trick to oberon like languages because Go which is oberon based, is also super fast to parse and compile. (though I think the reason for that is importing or #include does not happen multiple times) 2022-03-27 12:11:45 one thing I have hated for a long time is the space waste of 'good layout' of text 2022-03-27 12:11:48 You can see that same difference in various regex processors - some are much faster than others. 2022-03-27 12:12:02 There are particular features that got added to regex "later on" that slowed things down a lot. 2022-03-27 12:12:06 oxford is teaching it. and I'm reading a book from time to time and its definitely a much easier first language to learn than C 2022-03-27 12:12:15 But now people won't give those features up - they're considered "required." 2022-03-27 12:12:21 KipIngram: oh? which ones? 2022-03-27 12:12:30 Hang on a sec. 2022-03-27 12:12:41 I think PCRE and extended regex goes too far 2022-03-27 12:12:51 Here's a good paper: 2022-03-27 12:12:53 https://swtch.com/~rsc/regexp/regexp1.html 2022-03-27 12:13:26 and I want to stap all typographers that think slender stroke seriffy fonts like Times News Roman are good fonts 2022-03-27 12:13:28 I think it's backtracking, but there's a related term I forget right now and it may be that. 2022-03-27 12:13:29 Looking. 2022-03-27 12:13:39 stab 2022-03-27 12:13:39 lua doesn't have backreferences. no >? no lookups. you can achieve a lot with it. I also managed to make a csv parser in awk, even though awk is very limited with its regex engine 2022-03-27 12:14:09 tcl's regexp are quite speedy too 2022-03-27 12:14:16 https://stackoverflow.com/questions/3296050/how-does-this-regex-find-primes this is just stupid 2022-03-27 12:14:48 smart but also wow 2022-03-27 12:14:49 Yeah, the addition of backtracking changed the O() behavior so that pathological cases require exponential time in the length of the string to implement. 2022-03-27 12:15:20 Times New Roman is terrible font for dyslexics and near dyslexics as the font was made to skim on ink in news paper printing 2022-03-27 12:15:25 Right - the original idea was still a quite powerful one, and could be very fast. 2022-03-27 12:15:47 I tried tcl, had to write a program in windows, it was like, 2000 lines 2022-03-27 12:15:49 That link really is a good paper - I learned a lot from it. 2022-03-27 12:15:55 something that would be like 200 in unix 2022-03-27 12:16:02 max 2022-03-27 12:16:30 nmz: what were you doing with 2000 lines? 2022-03-27 12:19:21 I downloaded a romset of snes games, it contained every single patch out there. however each file was a rom, no patches, so in order to save space, I wanted to have a originalfile and ips patches for each original file. this means you have to loop through each file, find the original crc (because sfc has a crc of the original rom in the file (unsure)) and create an ips patch 2022-03-27 12:19:54 cut a few gbs of the patchset 2022-03-27 12:20:10 I wrote an EDA board to pick and place format converter in less than 500 and it had quite a bit of gui in it 2022-03-27 12:20:45 It was my first program on tcl so perhaps it was big because I didn't know how to use it correctly 2022-03-27 12:21:15 you may have a point 2022-03-27 12:21:22 I still dislike it and prefer shell though 2022-03-27 12:22:53 probably. Have you read throug SICP from MIT? I found after going through it and porting eForth to DCPU-16 that I tended to grow the language instead of piling on code 2022-03-27 12:23:53 I must admit that I skimmed it 2022-03-27 12:25:15 lot of novices code I have seen, in any pl, is rambly and unstructured 2022-03-27 12:25:27 got 4 chapters in maybe? 2022-03-27 12:25:41 I don't think I'm a bad coder though 2022-03-27 12:28:19 you try to keep you functions/words/routines so that you do need to scroll of screen? 2022-03-27 12:29:03 Factorization is a forth idea. 2022-03-27 12:29:27 in other languages, calling functions is actually costly :S 2022-03-27 12:30:23 on shitty archs like x86 yes. But sometimes I use macros instead and turn up the function inlining 2022-03-27 12:31:33 I don't think its a x86 thing https://kotaku.com/someone-got-ps1-classic-tomb-raider-running-on-a-game-b-1848367887 2022-03-27 12:33:11 apparently, how the speed of this is achieved is by yes, not calculating as much as possible, but fetches are cheap in arm 2022-03-27 12:33:30 it depends on how crappy the pro- and epi-logues and call site code the compiler emits 2022-03-27 12:34:24 plus the pipeline stalls 2022-03-27 12:36:41 what I like about dual stack machines based architectures like excamera J1 is the zero operand in instructions 2022-03-27 12:38:31 with RISC, CISC or even accumulator architectures, the cpu has to decode the addressing mode, find out which registers to feed which functional unit 2022-03-27 12:41:04 whilist J1 alu can perform all the operations it has on tos and nos and the controler only has to mux out the wanted op result 2022-03-27 12:43:38 its entirely dependent depends on the language too, If you're on the low end, sure you'll be thinking about CPU, but I often program on the high end, and in the highend, or at least lua prefers table fetches instead of calls (functions). 2022-03-27 12:44:01 also I'm on a pi atm which is arm, so I stopped thinking of the CPU 2022-03-27 12:44:29 also allows for the read write port of wram to know potential addresses might be accessed 2022-03-27 12:46:06 well in lua table fetches can actually be function invocations in disguise if you are using metatables with __index and __newIndex 2022-03-27 12:47:10 but lua encourages more data ?driven/centric/oriented? aproach 2022-03-27 12:51:41 what bugs me a bit about lua is that it still doesnt have anything like debug.getRelativePC(coroutineThread, callLevel) and debug.setRelativePC(coroutineThread, callLevel, relpc) 2022-03-27 12:52:58 because with that I could easily serialize out into lua code form most of if not all of an lua interp state 2022-03-27 12:53:59 (relative pc of the function running at that call level) 2022-03-27 12:55:20 (plus that there are no C functions in that coroutine thread callstack) 2022-03-27 13:52:19 Opinions please. Should redefining a word throw a warning? Or perhaps throw a warning only if the word already exists in CURRENT (but not if the match is in a different vocabulary)? Or not at all, and I just have to know what I'm doing? 2022-03-27 13:53:01 Either of those options for warning would be relatively easy to implement. 2022-03-27 13:54:17 But currently I make no warning. 2022-03-27 13:54:56 It's easy to add, because CREATE runs BL WORD, but equally well could run FIND DROP, and that dropped item is an existence flag. 2022-03-27 13:59:20 I stay away from the debug library :S 2022-03-27 13:59:27 haven't gotten that far yet 2022-03-27 13:59:33 its mostly because I write bug free code 2022-03-27 13:59:45 always 2022-03-27 14:00:01 Never need to debug :P 2022-03-27 14:00:39 :-) 2022-03-27 14:00:52 That's outstanding. 2022-03-27 14:02:06 It wouldn't be quite as simple as what I just said - FIND searches an entire list of vocabularies, and for that restricted warning I'd only want to search the one. But FIND has a component that does that I could dig out and call. 2022-03-27 14:03:42 Or at least could use for a "FIND_IN_CURRENT" word (which I'd never give that name). 2022-03-27 14:04:11 All that uses that "longjmp on success" mechanism I've talked about, so I'd have to be sure I was set up for that. 2022-03-27 14:04:26 That jumps back past the level where the vocabulary list is handled. 2022-03-27 16:46:51 nmz: I love Lua, but I don't love the decision to use `end` over `}` &c 2022-03-27 16:46:59 Are you at Oxford? 2022-03-27 16:47:55 Zarutian_HTC: I grew up reading serif everywhere and typesetting everything with serif, so for me and many people it's what's more comfortable 2022-03-27 16:48:41 ſerif 2022-03-27 16:49:25 KipIngram: Redefining a word should never produce a warning, it annoys me that gforth does this 2022-03-27 16:49:35 I've turned gforth's warnings off because almost all of them are noise 2022-03-27 16:56:18 Zarutian_HTC: What I do actually hate is Computer Modern, it's terrible and people love it because it reminds them of TeX and good typeset articles 2022-03-27 16:56:40 You can get good Times fonts for TeX though 2022-03-27 17:28:29 And good Times fonts for your terminal like Verily Serif Mono lol 2022-03-27 18:17:50 That doesn't sound bad to me - I generally don't expect Forth to "take care of me." 2022-03-27 18:18:01 That fact that it doesn't try to do much of that is part of why I like it. 2022-03-27 18:18:34 I like Go Mono for terminal. 2022-03-27 18:18:52 I have to have 12 these days instead of 10, though. :-( 2022-03-27 18:37:49 It's also just legitimate to want to define a new meaning for a word, whether because you're ignoring the old meaning or extending it 2022-03-27 18:39:00 Certainly - there are all kinds of valid reasons for doing that. 2022-03-27 18:39:25 I am currently using a Courier-style font 2022-03-27 18:39:48 Since my PFA is represented as a pointer in my headers, I can even replace all the compiled references to a word with a new meaning - I just change that pointer. 2022-03-27 18:40:03 So I don't need a special class of "vector" words - they're all vectorable. 2022-03-27 18:42:08 If your eyesight is going maybe try other fonts like a Courier font 2022-03-27 18:42:38 I find Courier is weirdly readable, even though it doesn't really display its serifs nicely at smaller sizes 2022-03-27 18:43:13 Not that you need lots on your screen at once, sometimes less is more 2022-03-27 19:06:55 Well, I flinch at that wording. :-) It's just the normal "gradual difficulty of focusing up close" that's been going on for the last 15 years or so. 2022-03-27 19:07:23 But yeah - my 13" screen still seems to have ample real estate. 2022-03-27 19:23:50 I just find the Go font "prettier." 2022-03-27 19:23:59 Some of the fonts seem garish to me.