00:00:00 --- log: started forth/18.12.14 01:03:32 --- join: gravicappa (~gravicapp@ppp83-237-163-54.pppoe.mtu-net.ru) joined #forth 01:17:10 --- quit: verisimilitude (Quit: ERC Version 5.3 (IRC client for Emacs)) 01:19:54 --- join: ncv (~neceve@host165-120-111-163.range165-120.btcentralplus.com) joined #forth 01:19:54 --- quit: ncv (Changing host) 01:19:54 --- join: ncv (~neceve@unaffiliated/neceve) joined #forth 02:03:36 --- quit: ashirase (Ping timeout: 250 seconds) 02:07:33 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 02:10:46 --- join: ncv_ (~neceve@host165-120-111-163.range165-120.btcentralplus.com) joined #forth 02:10:46 --- quit: ncv_ (Changing host) 02:10:46 --- join: ncv_ (~neceve@unaffiliated/neceve) joined #forth 02:11:55 --- quit: ncv (Ping timeout: 246 seconds) 02:33:16 --- quit: dave0 (Quit: dave's not here) 03:17:49 --- quit: pierpal (Quit: Poof) 03:18:07 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 04:16:41 --- quit: pierpal (Quit: Poof) 04:16:59 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 05:32:42 --- quit: gravicappa (Ping timeout: 268 seconds) 05:52:14 --- quit: rdrop-exit (Quit: Lost terminal) 06:01:15 --- quit: smokeink (Ping timeout: 245 seconds) 06:41:35 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 06:44:33 --- join: gravicappa (~gravicapp@ppp83-237-163-54.pppoe.mtu-net.ru) joined #forth 07:05:08 say NIP is basically : NIP SWAP DROP ; \ yes? 07:06:35 Zarutian: Yep. 07:07:39 The stack does ( x1 x2 -- x2 ) according to ANS, so SWAP DROP would be a valid implementation for NIP. 07:11:11 CODE NIP pop %rbx NEXT; 07:11:20 or some register that's not your TOS 07:15:10 then what would you call the sequence >R SWAP R> ? 07:15:10 --- join: [1]MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 07:15:57 weird 07:17:46 --- quit: MrMobius (Ping timeout: 250 seconds) 07:17:46 --- nick: [1]MrMobius -> MrMobius 07:18:10 I feel like I've seen the word "shuffle" used before, but I can't remember what its definition was 07:18:32 I think it might have changed the position of all three top items 07:18:42 like rot but less orderly 07:32:46 --- join: verisimilitude (~user@2604:180:2:725::698a) joined #forth 07:53:50 --- quit: tabemann (Ping timeout: 264 seconds) 08:28:58 --- join: dys (~dys@tmo-100-83.customers.d1-online.com) joined #forth 08:49:06 zy]x[yz: I've seen that as "swish" 09:37:40 --- quit: verisimilitude (Ping timeout: 252 seconds) 09:41:21 --- join: verisimilitude (~user@2604:180:2:725::698a) joined #forth 10:02:18 --- quit: pierpal (Quit: Poof) 10:02:40 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 10:13:08 --- quit: ncv_ (Remote host closed the connection) 10:19:22 lol. i hate these names 10:46:07 If we have variables for subroutines, like "-", why can't we have variables for data?! 10:48:16 wut? 10:48:49 you surely can name your data in forth 11:14:42 --- join: learning (~learning@47.149.80.42) joined #forth 11:14:49 hi 11:15:50 im doing a simple online game for fun and practice. im thinking about doing the backend in forth. i only know the basic syntax of forth. haven't made any real programs with it. 11:16:27 1. is making a webserver in forth too audacious a task for a new forth user? 11:16:54 Hi learning. 11:17:09 2. why do a lot of the forth examples I see mimic C/Algol like languages? coming from a lisp background myself 11:17:44 hi DKordic 11:17:54 Can You elaborate on the last point? 11:18:49 IMHO Web v0.2.0 is NYH2P (Now You Have 2 Problems). 11:19:28 include mysource.fs 11:19:40 for example I see things like: include file 11:19:46 rather than using postfix 11:19:59 which would be the file first and then the function to load/include it 11:20:23 the postfix version would be " file" include - it was probably just seen as more convenient to have the include word parse the following word 11:22:47 You are absolutely correct learning. "included" (slightly different name) is what You were looking for. 11:26:22 as long as building a webserver on my own in forth is doable, i'm willing to put in the effort and frustration to learn how to do it. forth seems like it could teach me quite a lot. just playing around with postfix has opened my eyes. i will admit i'm struggling to wrap my head around how to properly pass bits of code around. i've been using execution tokens. 11:26:50 that's how you do it 11:27:09 ok cool 11:28:35 and to answer your 2, i imagine forth appeals more to people with c/algol backgrounds than it does to people with lisp backgrounds just because of where it's generally applied and because of its shortness of features 11:29:10 and just in general i think there are more people with c/algol backgrounds than there are people with lisp backgrounds 11:29:36 For the record, I vehemently dislike C and Algol. 11:29:53 i don't 11:29:56 Forth and Lisp are more similar than Forth and C. 11:30:33 Forth >>>>>>>> Lisp 11:31:17 i really love that i can just type a function name and have it executed. since im calling functions much more often than im referencing them. having to type function() when programming in js just seems so silly. 11:31:20 learning: If you do want to see a webserver in Forth, a good example is a piece of software called 1991 11:31:47 ty WilhelmVonWeiner. googling now. 11:32:04 it uses gforth's sockets.fs (which I think uses gforth's C bindings.) 11:32:37 i genuinely believe that if you think typing () to call a function is impeding you, you're either doing something wrong or you're measuring something wrong 11:32:38 learning: http://www.1-9-9-1.com/ 11:32:57 (which i guess is still doing something wrong) 11:33:17 i got better things to do then use my shift key lol 11:33:27 but you said you have a lisp background 11:33:37 lisp is lisp 11:33:44 it's the same number of parentheses, they just appear in a different place 11:34:04 yes but the tradeoff makes sense in lisp 11:34:07 it doesnt make sense in js 11:34:58 im using parentheses in my lisp code in order to provide explicit structure. parentheses in a language like js seem like an afterthought. 11:35:03 JS is https://en.wikipedia.org/Cargo_cult indeed. 11:36:01 its one of the things i like about forth. it made me realize that you dont even need the parentheses in lisp, but also showed me what they do for me. 11:36:11 i don't think that's the correct application of that term, but ok 11:36:46 learning, you don't need them in forth because you don't write the operands 11:39:16 with prefix notation, a function has to take an exact amount of args or have some sort of delimiter. the parentheses act as a delimiter 11:39:37 in postfix, you put all your args first, so you don't have to worry about that 11:40:27 it's honestly really cool how orders of operations affect code 11:40:35 eh, it's not quite like that though 11:40:54 really what you're noticing about forth is implicit argument passing 11:41:19 if it weren't for that, you would still need some kind of delimiter or else how would it know what's an argument and what's the function to call? 11:41:35 the "magic" of forth is that everything is a function call 11:41:37 (* 1 2 (- 9 1) 3) => * 1 2 - 9 1 3 11:41:58 you put the asterisk in the wrong place 11:42:29 That doesn't work anyway 11:42:45 * is binary, it takes two values off the stack 11:42:50 3 9 1 - 2 1 * * * 11:43:11 but taking literals out of the picture: x y z - <-- is that (- (z (y x))) or (y x) (- z) or (x) (- x y) ? 11:43:14 im showing what the parentheses do in a prefix language like lisp 11:43:58 also, did you guys notice that subtraction and division are backwards in forth 11:44:23 how are they backwards? 11:44:47 2 1 - == 2 - 1 11:45:08 Yeah I'm lost 11:45:14 That seems mostly normal 11:45:16 because subtract(a, b) => a - b 11:45:26 but in forth subtract(a, b) => b - a 11:45:31 9 1 - 11:45:31 b, a subtract 11:45:37 1 is the first arg 11:45:39 9 is the scond 11:45:52 it's backwards 11:45:59 - is popping the values off the stack 11:46:10 yes, so 1 should be the first value popped off 11:46:17 and then it should subtract 9 from 1 11:46:24 but it does the opposite 11:46:28 according to who? 11:46:53 according to common sense. it reveals itself if you write code to do difference and sum 11:46:57 it works just fine for sum 11:47:04 but then you apply the same logic to dif and it doesn't work 11:47:09 ... summation is commutative 11:47:10 you have to swap the values when you do dif 11:49:10 "a - b" becomes "a b -". You remove the upper stack element from the second one. 11:49:19 *remove -> substract 11:49:19 anyway, in my opinion it makes more sense for those arguments to be in the order that they are for partial application purposes 11:49:29 a - b should be b a - 11:49:45 e.g., : per-hour 3600 / ; 11:50:06 when i was playing around, i wrote code to sum all the numbers on the stack. when i applied the same code to subtraction, i got the wrong answer. i had to swap the numbers in order for it to work. 11:50:26 then i'm sorry that your assumption was wrong 11:50:28 the first number popped off the stack should be the first arg 11:50:38 "first arg" is meaningless 11:50:41 my assumption was not wrong. subtraction and division is done backwards 11:50:44 a - b 11:50:47 a is the first arg 11:50:49 b is the second 11:50:53 - is the operator/function 11:50:59 learning: You subtract left to right. So a-b-c-d is a-(b+c+d). 11:51:28 yes, but on the stack things go from right to left, not left to right 11:51:38 says who? 11:51:43 first in, first out 11:51:58 lol 11:52:05 my point is that you're associating it with something you've seen before that's not forth. your assumption is unfounded 11:52:17 no im not 11:52:27 like i said, i literally had to change my code and add a swap 11:52:46 i'm not denying that you wrote your code wrong 11:52:46 if things were done logically, the swap would not be necessary 11:53:13 i didn't come to learn forth to sit beneath an ivory tower 11:53:20 i came to learn forth to be free of religion 11:53:28 that's ironic 11:53:41 learning: x-y=-y+x. You don't need a swap. 11:54:29 You can easily handle the y first, changing its sign, then add x. 11:55:04 i love how you dont want to accept that subtraction is backwards just because you think forth is perfect 11:55:28 learning: I don't think Forth is perfect, but you seem to think math notation is perfect. 11:56:00 all i said was that it's backwards 11:56:02 john_cephalopoda: Exactly. 11:56:05 because it is 11:56:07 Forth just uses that kind of notation. - is defined as ( x y -- x-y ). / is defined as ( x y -- x/y ). 11:56:11 it doesnt make it wrong 11:56:21 its just backwards from the accepted notation used everywhere else 11:56:48 it's literally subtract(b,a) instead of subtract(a,b) 11:56:49 learning: Reverse polish notation itself is "backwards from the accepted notation used everywhere else" ;) 11:57:07 if you follow postfix 11:57:17 - 1 2 should be 2 1 - 11:57:18 learning: I agree. And _very incomplete_ GForth documentation explicitly mentions that arithmetic procedures have rearanged Parameters in favour of tradition. 11:58:11 gforth online documentation is pretty in-depth imo 11:58:22 ye i used the gforth tutorial 11:58:34 and it even goes through passing execution tokens 11:59:13 i don't think most basic tutorials talk about passing functions 12:00:17 Heh 12:00:35 well, it is pretty simple in Forth. 12:00:47 just an address innit 12:00:49 everything seems a lot simpler honestly 12:00:56 i like the lack of hiding things from me 12:01:51 my first language was C# and you literally have to declare a type in order to pass functions 12:02:07 C# has good reasons for doing the things that it does, but holy fuck what a pain in the ass 12:04:44 learning: IMHO https://en.wikipedia.org/Currying is the link between Forth and Lisp. Are You familiar with https://en.wikipedia.org/Continuation-passing_style ? See also https://en.wikipedia.org/De_Bruijn_index and https://en.wikipedia.org/Point-free_programming . 12:05:08 yes, i've been trying to bend forth to do a lot of the things i'm used to doing in lisp 12:05:11 like lambdas 12:06:32 thank you guys for chatting with me and putting up with me. i bookmarked that 1991 site. and i've been reading through this tutorial https://bernd-paysan.de/httpd-en.html 12:07:42 i'll be back on some other time. i look forward to using forth more and learning more about it. 12:07:44 :3 Any time. 12:08:30 --- quit: learning () 12:08:54 DKordic: Your links are slightly broken., 12:09:07 They should be /wiki/name_of_page 12:09:17 * DKordic [facepalm] 12:09:23 Thank You. 12:10:47 I feel like I should easily understand currying. 12:11:23 I agree :3 . 12:12:11 learning> it's literally subtract(b,a) instead of subtract(a,b) 12:12:15 oh, he already left 12:12:52 So if you have f(x, y) -> x * y, is currying creating a function which could be g(x) -> f(x, 2) 12:12:59 but my point was that this is what I was driving at when I said [yz> my point is that you're associating it with something you've seen before that's not forth. your assumption is unfounded 12:13:05 WilhelmVonWeiner: Currying IMMEDIATEly leads to CPS, right? 12:13:10 there's no reason why it shouldn't be subtract(b, a) 12:14:28 I have _absolutely_ no idea 12:16:06 zy]x[yz: I absolutely agree. What are Your general arguments related to Partial Applicaton?! 12:16:47 * DKordic thinks... 12:21:03 WilhelmVonWeiner: Your "f" is _Identical_ ("=") to "(uncurry *)", assuming that "*" is... Curryed already, so to speak. We _do_ need a Function to Construct a Tuple, right!? Let us call it "&". Is "&" Curryed or not?! 12:21:48 "(= (* a b) (f (& a b)))". 12:23:23 I would think not 12:23:29 unless that was a rhetorical question 12:23:36 in which case, 12:23:38 :3 12:26:09 --- quit: Zarutian (Ping timeout: 240 seconds) 12:31:23 --- quit: FatalNIX (Changing host) 12:31:23 --- join: FatalNIX (~FatalNIX@unaffiliated/fatalnix) joined #forth 12:31:56 --- join: Zarutian (~zarutian@173-133-17-89.fiber.hringdu.is) joined #forth 13:15:42 --- quit: gravicappa (Ping timeout: 250 seconds) 13:30:46 --- quit: verisimilitude (Remote host closed the connection) 13:40:46 I love gforth 13:41:03 but sometimes I'm astonished at the amount of code 13:41:17 in the Forth itself, let alone the source 14:01:47 i discovered lbForth recently, it's only 12KiB compiled 14:31:03 WilhelmVonWeiner: The C bindings are pretty neat though. 14:31:30 --- quit: groovy2shoes (Quit: moritura te salutat) 15:51:04 --- join: dave0 (~dave0@47.44-27-211.dynamic.dsl.syd.iprimus.net.au) joined #forth 15:52:35 hi 15:53:02 h'lo 15:53:10 hi Zarutian 15:57:34 I have a challange for you dave0, port eForth to LC-3 described in https://justinmeiners.github.io/lc3-vm/ 15:58:22 * dave0 clicks! 15:59:17 you just have to port the primitives mind you 16:00:19 the page says it is using literate! 16:00:45 that's nice :-) 16:02:13 I met a literate ..once 16:02:36 PoppaVic: was he innumerate? 16:04:05 well, inconsiderate, anyway 16:04:26 enumeration required. 16:15:04 --- join: Insert_Coin (~insertCoi@h081217214054.dyn.cm.kabsi.at) joined #forth 16:34:01 --- quit: john_cephalopoda (Ping timeout: 252 seconds) 16:36:06 --- join: john_cephalopoda (~john@unaffiliated/john-cephalopoda/x-6407167) joined #forth 16:42:06 --- join: smokeink (~smokeink@42-200-119-160.static.imsbiz.com) joined #forth 16:47:00 --- quit: smokeink (Remote host closed the connection) 17:11:51 --- quit: dave0 (Quit: dave's not here) 17:39:03 --- join: rdrop-exit (~markwilli@112.201.164.82) joined #forth 18:03:15 --- join: tabemann (~tabemann@64.134.149.0) joined #forth 18:09:04 --- quit: tabemann (Ping timeout: 250 seconds) 18:15:37 Any of you have tips on checking for stack underflow on a target with only unsigned numbers? 18:15:58 Should I compare the current stack pointer with the stack base after every word being interpreted? 18:20:40 --- quit: Keshl (Read error: Connection reset by peer) 18:21:00 --- join: Keshl (~Purple@24.115.185.149.res-cmts.gld.ptd.net) joined #forth 18:23:20 Good morning Forthwrights :) 18:23:51 --- join: tabemann (~tabemann@h193.235.138.40.static.ip.windstream.net) joined #forth 18:25:28 --- join: Insert_Coin_ (~insertCoi@h081217214054.dyn.cm.kabsi.at) joined #forth 18:26:27 --- quit: Insert_Coin (Ping timeout: 250 seconds) 18:54:28 --- join: Insert_Coin (~insertCoi@h081217214054.dyn.cm.kabsi.at) joined #forth 18:57:27 --- quit: Insert_Coin_ (Ping timeout: 268 seconds) 19:14:13 --- quit: rdrop-exit (Quit: Lost terminal) 19:15:56 --- quit: dddddd (Remote host closed the connection) 19:47:56 --- join: dave0 (~dave0@47.44-27-211.dynamic.dsl.syd.iprimus.net.au) joined #forth 19:48:12 ahoy 20:15:13 --- quit: tabemann (Ping timeout: 250 seconds) 20:15:29 --- quit: Insert_Coin (Ping timeout: 240 seconds) 20:18:56 --- join: gravicappa (~gravicapp@ppp83-237-160-175.pppoe.mtu-net.ru) joined #forth 20:46:52 --- join: tabemann (~tabemann@2602:30a:c0d3:1890:a433:523c:27b8:b5c8) joined #forth 20:48:23 --- quit: pierpal (Quit: Poof) 20:48:44 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 21:02:36 --- join: rdrop-exit (~markwilli@112.201.164.82) joined #forth 23:05:12 --- join: [1]MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 23:08:33 --- quit: MrMobius (Ping timeout: 250 seconds) 23:08:34 --- nick: [1]MrMobius -> MrMobius 23:11:40 haha autocomplete is almost working 23:11:57 even the Python REPL doesn't have autocomplete 23:31:56 autocomplete like it looks up the word prefix and gives a list of words it could be? 23:32:06 Cool 23:33:00 like if you type S W and it does swap? 23:33:06 that'd be awesome 23:35:29 yes 23:36:09 if you have more than one possibility it lists all the words with that prefix in the current search order, and if only one word has it as a prefix, then it completes it 23:36:41 nice 23:36:50 very user-friendly 23:37:13 you could make the autocomplete key the question mark 23:37:28 no, because there's words with ? in their names 23:37:41 the autocomplete key is the tab key 23:37:43 :-( 23:39:06 hover-list that gets smaller and smaller ;-) 23:41:18 hover-list like a GUI forth environment where there's a caption on hover that shows potential completions? 23:41:30 sure 23:41:42 honestly the idea of a GUI forth environment kinda horrifies me 23:41:56 I thought of adding incremental search if I ever need to speed up the outer interpreter on a Forth, but so far haven't needed to. Going from incremental search to autocomplete would be an easy next step. 23:42:00 I mean, you are already overcoding forth - go bananas ;-) 23:42:40 curses: sticks to kids ;-) 23:43:25 also works with Zenity/xdialog/Dialog, I would suspect 23:43:49 What are those? 23:44:16 thingies to allow scripts to run dialogs, lists, calendars, etc 23:44:40 Ah yes I remember xdialog. 23:51:55 my question is why is one doing anything nontrivial in a shell script 23:52:21 shell scripting is one of the most horrific programming environments, rivaled probably only by Perl 23:53:13 if one has something nontrivial to do in a script, for god's sake at least write it in Python 23:53:14 --- quit: PoppaVic (Ping timeout: 264 seconds) 23:55:30 My shell scripts are never more than a few lines long, no really what I would call programs. 23:55:53 same here 23:55:53 * not really 23:56:14 but yeah 23:56:27 I've seen people write whole applications in pure bash shell script 23:56:59 and it's appalling, since bash has some of the worst semantics of any programming language 23:59:59 --- log: ended forth/18.12.14