2022-08-09 20:07:07 :D 2022-08-09 20:07:29 Welcome vms14 2022-08-09 20:08:15 thank you crc, sorry for /query you, emacs erc doesn't seem to redirect and says I needed to be invited 2022-08-09 20:08:52 No worries on the /query :) 2022-08-09 20:08:59 I have adnvanced a bit with my not so forth, now I'm trying to read the starting forth book 2022-08-09 20:09:24 the only reason I made a forth-like was to follow that book and I've just realized today 2022-08-09 20:10:03 btw I have variables that have colon word scope, it eases a lot the stack manipulation 2022-08-09 20:10:30 I don't have to rot swap and alike, I can 1 2 3 [one two three] bind 2022-08-09 20:10:51 3 .three sets a variable three. pushes the value on the stack 2022-08-09 20:11:20 I have globals too because normal variables won't escape a colon word scope 2022-08-09 20:12:00 even if a variable is defined in the global scope a colon word can use that initial value and change it, but changes won't survive once the colon word ends 2022-08-09 20:12:51 basically for every colon word being called the variables are stored before executing and restored to that value once the word ends 2022-08-09 20:13:14 Can you modify a global and have the value persist? 2022-08-09 20:13:24 if you want to keep changes then use a global like 3 ..three 2022-08-09 20:13:46 two dots is a global, one a normal variable 2022-08-09 20:14:06 but it's quite different from forth 2022-08-09 20:14:32 https://termbin.com/0le9 this is the implementation 2022-08-09 20:15:04 https://termbin.com/abohc this is some code from starting forth adapted to my lang 2022-08-09 20:15:43 https://termbin.com/hxhl this is some bad and outdated documentation 2022-08-09 20:16:23 .+ ..+ and alike have been renamed to increment add rest and decrement 2022-08-09 20:17:16 and I use * to denote different behavior and ! to denote destructive behavior so for example increment* increments a global instead of a variable 2022-08-09 20:17:49 increment is a funny way to write 1+ or +! 2022-08-09 20:19:05 yes xD 2022-08-09 20:19:27 I was going to name it increment.by.one 2022-08-09 20:19:28 XD 2022-08-09 20:19:50 http://sprunge.us/2m9sG9 would be my systems equivalent to your sample code; it’s nice to contrast different systems 2022-08-09 20:19:52 increment.by.one.in.twos-compliment.mostly.atomic 2022-08-09 20:20:35 granted folks with 300 baud modems might have been more conservative with their keystrokes 2022-08-09 20:20:51 :word in mine is accessing to a hash property 2022-08-09 20:21:01 actually setting it 2022-08-09 20:21:28 word: gives the value and :word sets it, like .var var. ..global global.. 2022-08-09 20:22:09 I try to not think into performance btw 2022-08-09 20:22:13 Would :word: work to both set and give a value? 2022-08-09 20:22:30 code is crap so why I should microoptimize 2022-08-09 20:22:35 crc nope 2022-08-09 20:22:52 would set a property named "word:" 2022-08-09 20:23:12 well idk which test goes first 2022-08-09 20:23:41 will give the value of a property named ":word" 2022-08-09 20:24:08 and I was thinking in using :: to denote a package 2022-08-09 20:24:13 like main::some.word 2022-08-09 20:25:37 it only has basic stuff if if.else do.times while, hashes lists variables globals, words can also be a value 2022-08-09 20:25:44 and has persistent hashes :D 2022-08-09 20:25:58 I call them magic hashes xD I love them 2022-08-09 20:26:34 ACTION has vague flashbacks of c++ on the :: 2022-08-09 20:26:43 'file.name magic.hash .hash 2022-08-09 20:27:04 now hash is a variable which is a hash tied to a database named "file.name" 2022-08-09 20:27:18 if you set values will automagically be saved to the db 2022-08-09 20:27:42 I’m assuming the main source is in perl? 2022-08-09 20:27:46 but sometimes if you exit the values won't be saved so you can use magic.flush to force a sync 2022-08-09 20:27:49 Common LISP uses :: for packages (or :) 2022-08-09 20:27:52 crc yes 2022-08-09 20:28:07 those hashes are DB_File tied variables 2022-08-09 20:28:21 you can run the lang with perl file.pl 2022-08-09 20:28:34 and accepts files to load as additional args 2022-08-09 20:28:44 has some file words btw 2022-08-09 20:29:06 . prints last element of the stack 2022-08-09 20:29:14 but if you use 'file.txt in.file 2022-08-09 20:29:21 I’ll play with it a bit later this week; I’ve downloaded the source and your linked documentation to my dev box 2022-08-09 20:29:23 now . will print in that file 2022-08-09 20:29:43 crc I should really document it properly 2022-08-09 20:30:07 it was some words being rushed cause a guy asked me to document it 2022-08-09 20:30:20 also I'm using those hashes to provide a doc database 2022-08-09 20:30:48 if you have a .init.oh in your home will load it at startup 2022-08-09 20:31:08 https://termbin.com/i85g this is my .init.oh 2022-08-09 20:31:21 it defines the doc and document word 2022-08-09 20:32:05 'main.oh "prints oh..." "none" "none" "meh" document this will create documentation for a word named oh in main and save it to a db 2022-08-09 20:32:19 then you can 'main.oh doc and will print all the info 2022-08-09 20:32:52 and I've made a very similar version in js 2022-08-09 20:33:01 vms.neocities.org/oh.js 2022-08-09 20:33:10 there's a repl in vms.neocities.org/oh.html 2022-08-09 20:33:28 you can draw rectangles :D it has aa canvas as a background 2022-08-09 20:33:54 'canvas by.tag car set.context 'blue fill.color 0 0 30 30 fill.rectangle 2022-08-09 20:34:24 but I actually want to make the perl forth transpile to js with just forth words 2022-08-09 20:34:51 having packages I can just switch to 'js package and words like if if.else would write js code instead 2022-08-09 20:35:10 but I need to think about that, I'm not sure how I want to approach the generation of html and js 2022-08-09 20:37:08 and btw the word do.times expects now [code] number do.times it was at the reverse order first 2022-08-09 20:37:16 I'm not sure the order it should have 2022-08-09 20:40:15 btw if you happen to play with it, it has no readline features, I use rlwrap 2022-08-09 20:40:35 it's very annoying if it has no readline features 2022-08-09 20:42:07 in my system, that would be “count [ code ] times”; I’ve found it more useful with the count first (in terms of factoring) 2022-08-09 20:42:30 crc I think I'll expect the number first too 2022-08-09 20:42:50 I have rlwrap,my systems don’t (yet) have readline type editing 2022-08-09 20:42:56 It was like that at first, I've just changed it now when making that thinking forth code 2022-08-09 20:44:17 I was actually wondering what order should I keep, but knowing you also have it like that I'll go for it 2022-08-09 20:45:12 seems dumb, but it affects to the concatenative stuff 2022-08-09 20:48:58 for some reason I'm enjoying comparing your example with mine 2022-08-09 20:49:32 the only word we have in common is : blip margin star ; 2022-08-09 20:51:26 crc how do you define a word that returns an adder 2022-08-09 20:51:56 a word that you give a number and will return callable code than then called with another number will sum both 2022-08-09 20:52:55 I use `curry`: 2022-08-09 20:53:03 #10 [ #33 n:add ] curry 2022-08-09 20:53:09 :0 2022-08-09 20:53:22 This would return 43 when called 2022-08-09 20:53:46 I have this : adder '+ 2 list ; 2022-08-09 20:53:53 then you have to eval that list 2022-08-09 20:54:07 3 adder eval 2022-08-09 20:54:34 [ code ] is a quotation, basically just an anonymous word; curry binds a value and quotation into a new quotation that pushes the value and calls the original function 2022-08-09 20:54:41 oh, wtf it's doing what I thought I couldn't 2022-08-09 20:55:16 I wanted to do the next step which is making that word remember the value and go summing 2022-08-09 20:55:40 so every time you call it it will update the value for the next time 2022-08-09 20:56:02 but I have no closures so I couldn't find a way 2022-08-09 20:57:00 oh it's not doing it, but I think I could do it 2022-08-09 20:57:36 The larger of my systems has a `does` word that can be used to do accumulators and such. I have an example of this at http://retroforth.org/examples/accumulator.retro.html 2022-08-09 20:58:40 I had immediate words, but I got rid of them cause the only immediate word I was using was ; 2022-08-09 20:59:08 as lists can be taken as code by eval you have a way to metaprogramming 2022-08-09 21:02:17 but I can't do that trick cause variables die 2022-08-09 21:04:09 I need to add closures somehow 2022-08-09 21:04:23 or variables that are retained in colon words 2022-08-09 21:08:10 I’ve avoided actual local variables in my systems; I can simulate them using globals (as illustrated by http://retroforth.org/examples/local-variables.retro.html ) when I think they’d be useful. 2022-08-09 21:08:11 crc did you make some software with your forth? 2022-08-09 21:08:54 Yes. I write programs using my forth daily. 2022-08-09 21:09:09 - my web & gopher servers are written in my forth 2022-08-09 21:09:10 that's nice, that's really my goal 2022-08-09 21:09:27 use this lang as my main programming language 2022-08-09 21:09:41 - my personal tools (editors, calculators, basic file management, etc) are all in forth 2022-08-09 21:09:48 I fear that may be too slow 2022-08-09 21:10:19 I try to not think in performance, but in letting me be happy 2022-08-09 21:10:33 but I wonder if the performance will end being a problem 2022-08-09 21:10:50 - at work, we have a browser-based application written mostly in it; this is used to track all of the orders we process, as well as sales analytics, contacts, and messaging. 2022-08-09 21:11:13 so it transpiles to js or what? 2022-08-09 21:11:16 I don’t chase performance. 2022-08-09 21:11:33 No; the logic is all server-side 2022-08-09 21:11:39 :0 2022-08-09 21:11:47 I've added mine to apache with modperl XD 2022-08-09 21:12:06 I’m not a fan of JS; I use it very sparingly. 2022-08-09 21:12:46 I liked it when node leaked memory in a tight loop 2022-08-09 21:12:53 I'd have no interest in js if it wasn't because if you want to reach the most users, logic says to make a web application 2022-08-09 21:13:32 nothing can compare to the deploy and portability of js, I mean it will run on iphone, mac, linux, windows, android, bsd... 2022-08-09 21:13:56 and can make a pwa which is installable and fool the users into thinking it's a native app 2022-08-09 21:14:15 not for me 2022-08-09 21:14:44 js isn't very portable, needs a browser of the larger kind 2022-08-09 21:14:49 I want to somehow make this able to transpile some js code 2022-08-09 21:15:17 thrig: yeah but it reaches the biggest number of users by relying on a browser 2022-08-09 21:15:51 I mean, people has no home, but has a phone able to run js 2022-08-09 21:15:57 biggest number means basically Windows and android. that's unrelated to portability 2022-08-09 21:16:50 if you stick to android you loose all iphone users 2022-08-09 21:16:57 if you stick to windows, meh 2022-08-09 21:17:11 but js let's you target them all 2022-08-09 21:17:44 that's the only feature that can be interesting from js 2022-08-09 21:19:22 Most users now have browsers with js. Doesn’t mean I need to use js in the applications I serve them. 2022-08-09 21:19:44 yeah, actually js is not really needed 2022-08-09 21:20:03 depends on the kind of application 2022-08-09 21:20:50 for example a game would need it, but almost all other kinds of applications could run without js 2022-08-09 21:22:00 I needed to hear those words btw crc 2022-08-09 21:22:25 I was putting focus on something I don't really need :D 2022-08-09 21:22:32 and don't even want 2022-08-09 21:23:08 btw what about KipIngram 2022-08-09 21:23:35 I missed him a bit :D 2022-08-09 21:26:13 align the scope better? 2022-08-09 21:27:11 He’s been active here recently; not today though 2022-08-09 21:27:22 thrig: sounds the best option 2022-08-09 21:27:42 "have scope right" and not the shit I have 2022-08-09 21:28:26 ACTION is going to be heading to bed soon; it’s getting late here 2022-08-09 21:28:31 I've had some scope by using packages in the first implementations 2022-08-09 21:28:39 see you crc, and thanks for everything :D 2022-08-09 21:29:16 but maybe I'll just make special variables 2022-08-09 21:29:31 idk, I don't even know if I'll really need them 2022-08-09 21:32:26 My advice: add things as you need them. Best not to waste effort if you aren’t sure you have an actual use for them. 2022-08-09 21:34:39 I'll take that advice 2022-08-09 21:35:04 I'm looking at your docs 2022-08-09 21:35:07 https://gist.github.com/crcx/260308/d3d97fdc884558467221395c5d07c93af26aaedb 2022-08-09 21:35:40 I wanted something similar to 'save' 2022-08-09 21:36:05 but will only work for colon words 2022-08-09 21:36:58 I have 'contents' that pushes the body of a word 2022-08-09 21:37:49 words can be functions (builtins) lists (colon words) or any other value 2022-08-09 21:37:57 contents will push whatever the word is 2022-08-09 21:44:03 was nice to annoy you with random stuff, I'll go off for a while 2022-08-09 21:44:09 see you :D