00:00:00 --- log: started forth/16.10.19 00:26:54 this chat urges me to code something in forth :-D 00:36:53 he he he 00:36:58 just logged in 00:37:09 How should I make my own type system then? 00:37:43 I guess I just invent words that work with numberes but that seems like such an inefficient thing to do 00:38:26 Forth already comes pretty complete with most things you could want as a programmer and there's only a few doo dads I'd want to add 00:38:49 For example I can see myself writing alot of finite state machines and so I will make a domain specific language for writing finite state machines 00:39:16 But really you can just use forth to control your flow of data an borrow alot from other languages and protocols 00:40:13 I can see myself doing all of my shell scripting in gforth and all of my javascript in forth 01:42:54 --- quit: moby (Ping timeout: 260 seconds) 01:46:11 --- quit: M-jimt (Write error: Connection reset by peer) 01:59:40 --- join: M-jimt (jimtmatrix@gateway/shell/matrix.org/x-kelxtouxbvmcvooa) joined #forth 02:23:39 --- quit: nighty (Quit: Disappears in a puff of smoke) 02:25:23 --- quit: X-Scale (Ping timeout: 256 seconds) 02:28:13 nerfur, PLEASE DO! 02:29:29 John[Lisbeth], if you're going to do it in proper forth then your type system is really just a set of concatenative functions used to manipulate those types. You're not going to have a pure compiler-checked type system most likely. If you wanna break out of normal forth you can change the implementation to support this kind of thing. 02:30:24 proteusguy, do what? ) 02:31:08 code something in forth. 02:31:40 ah) yeah, I still work on my little internal web projects in forth) 02:33:07 nice 02:49:57 nerfur, using gforth or something else? not a lot of folk doing web stuff in forth. 03:23:53 --- join: nighty (~nighty@s229123.ppp.asahi-net.or.jp) joined #forth 03:40:01 --- quit: proteusguy (Ping timeout: 252 seconds) 03:43:33 --- join: X-Scale (~ARM@2001:0:53aa:64c:0:f2bd:b176:2199) joined #forth 04:01:19 well 04:01:33 I think I am going to take the idea of types and say "fuck that" and throw it out the window 04:01:58 I wish I could throw out everything I know aobut programming in my brain and just learn forth as a baby programmer 04:02:22 I wish I could go back in time to just after I passed algebra II and teach myself forth 04:02:46 to me using forth is like breaking all the rules that everyone ever set forth for me on a computer 04:03:19 But it is not forth that is magical, it is reverse polish notation 04:03:38 reverse polish notation is what is so great about forth not the particular way forth is written 04:04:03 indeed 04:04:14 Have you tried Postscript and Scheme ? 04:04:25 I was a lisper for a few months and still am 04:04:33 They'll challenge your mind in similar RPN ways 04:04:50 I am pretty familiar with basic functional programming 04:05:00 the idea that you transform data by passing them through functions 04:05:07 I think now I like finite sate machines more though I dunno 04:05:22 yes, but in Scheme you also have mutation through set! 04:05:42 giving you all the side effects of a FSM 04:06:18 I dunno I'd have to look into it 04:06:25 i like how RPN renders parentheses and operation precedence rules totally useless 04:06:46 http://www.schemers.org/Documents/Standards/R5RS/r5rs.pdf 04:06:49 I actually liked parentheses better until I found out it was easier to compute rpn and that got me curious 04:06:52 the spec is only 50 pages 04:07:11 I think there is no coencidence why forth fits on the smallest machines and also why the inventor of rpn liked it because he said it allowed him to do is maths faster 04:07:22 rpn is just faster than regular pn 04:07:48 I find myself reading rpn faster than I read lisp and writing in rpn faster than I write in lisp 04:08:43 In lisp it can be difficult to work something through in my head whereas in rpn I just have to read left to right 04:08:50 That's interesting. I guess it can't get simpler than with rpn 04:09:03 who knows maybe it can 04:09:07 and have a mental stack 04:09:11 rpn is so good because it happens to go well with pushdown stacks 04:09:29 and there maybe a different syntax with a different thing than a pushdown stack which is even better 04:09:38 one dude in here keeps swearing it's this thing called a krivine machine 04:09:40 who knows 04:10:16 if in rp you did away with parentheses and precedence rules, I don't think there is much else you can discard 04:10:20 Only data and ops are left 04:10:25 rpn* 04:11:06 I am a minimalist in my every day life 04:11:16 but in my mind the reason you take away is so that you have room to add back on 04:11:28 taking away should not be a ritual it should be an optomization 04:11:41 and adding should not be a right, it should be a luxury 04:12:00 but you add when you have room to add and you take away when you need more room 04:12:10 it's a game of push and pull and the demands on your program are always changing 04:14:04 "Programming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make additional features appear necessary." 04:15:40 To me this is how I program 04:15:48 I think of the problem I am going to solve 04:15:58 and then I try to program that as the most dumb programmer humanly possible 04:16:16 I just find the minimum side effect necessary to execute that thing, and I just start typing it in manually over and over again doing it like a computer 04:16:28 I make myself the machine and get into the thought process of solving the problem extra manually 04:16:40 and then I naturally see a pattern in the sequence of letters I am typing 04:17:04 naturally any times you see a pattern in the sequences of letters you are typing you can write a word, function, method, or whatever you'd like to call it in order to automate that thing 04:17:24 But the way I see it mathematics are very fractal, and so as we keep building functions on top of functions certain patterns emerger over and over again 04:17:43 and so you get very high level languages with very high level solutions that the low level languages they were written in already solves 04:18:10 and when you trace it back to the lowest level you can really go, it seems assembler gives you everything you need too 04:18:20 but nobody likes to program in assembler 04:18:29 why? It's the fastest and it gives you everything you need 04:18:47 wrong. What you need is to save yourself time and that is you are writing a computer program instead of pretending to be the computer like I do. 04:19:01 You would be wasting time today if you wrote in assembler unless your spec was absolutely micro 04:19:49 Assembler is too difficult, that is why it is inefficient 04:20:15 Forth gives you most of the advantages that assembler would, only that it is very very easy 04:20:19 in fact ridiculously easy 04:20:41 It is such a simple system that one person can learn how it works all the way through 04:21:10 But people look at those sizes in the kilobytes and they start to get greedy 04:21:58 Don't be greedy with a kilobyte. Today we have the cloud and my virutal machine I pay for with minimum wage has 1 gigabyte of ram, and even more of storage which can be used as "slow" ram. 04:22:22 And I can write a little botnet with a license that makes it legal on android and get a whole bunch of compute for free 04:22:49 So you don't need to waste your time worrying about how big your program is when you write it in forth 04:23:00 just write it fast and write it pretty and write it so it's sure as fuck not to break 04:24:31 Forthers are so obsessed with minimalism that they write these tiny little comments that basically mean very little than declaring how the stack is affected. You can write actual really long comments that go into great detail about your thought process behind what you are coding and why you wrote it that way. Nody is stopping you from just taking ten minutes and just writing out a really well thought out explanation of what you are 04:24:32 doing, and you will save everyone some trouble down the road. 04:25:20 I have one github project with one source on my github and I documented it very well with lots and lots of comments and everyone who reads it tells me how good my comments are. 04:26:02 Why not just spin up really large arrays? Why not just use huge innefficient database written in JSON 04:26:59 I had a peer my age who told me that his job was having him use programs that took up 16 gigs of ram, and it turned out that was a bug and it could actually run in 8 gigs. And the reason for this bloat was to make the language easier to use. 04:27:17 Think about it. One "bug" causing 8 gigabytes of waste 04:27:49 If you could tell that to the old guys in IBM back when they were on huge magnets that president could barely buy they'd shit themselves laughing. 04:28:28 But these are professionals 04:29:53 It seems computers are just gonna get faster and faster until one day people will laugh at terrabytes. Maybe that but it has been trending that way when you look at the course of human history and information storage 04:30:55 Sure there's a market for programming firmware and old 80's computers that nobody wants to replace, but there are some serious markets in cloud computing where forth would reign supreme. 04:31:12 One really good example is microcontainers 04:31:28 Containers with no fileystem, just a single binary with as few dependencies as possible. 04:32:20 Forth can fit into these teeny spaces and with less effort than with c. You could fit way more forth programs into a virtual machine than ubuntu containers. 04:32:31 --- join: proteusguy (~proteusgu@180.183.140.191) joined #forth 04:32:31 --- mode: ChanServ set +v proteusguy 04:32:46 aloha 04:33:11 I am going on a rant about forth at 4:32 AM 04:35:43 Anyway my point is 04:35:52 forth gives you the ultimate control and alot of room to work with it 04:36:31 so just take all that room and go crazy with it and use up your virtual machine 04:40:31 Anybody still present? 04:44:05 proteusguy, using gforth right now, but tbh it is way too big and confusing to me, forth is like little fun "brain gym" for me 04:45:06 so I'm using it for web just for fun and in very raw and barbaric way 04:45:25 nerfur, yeah it's hard to find a forth that deals with files & network stuff that isn't complicated. 04:46:31 I'm trying to implement url shortener and "bookmark page" in forth ) 04:49:55 most ground breaking (for me) moment was then pointfree share his hashing oneliner (I'm using another little algo, but still suddenly understand how to write something really beatiful in forth) 04:50:19 I still think that it is my masterpiece :-D 04:50:19 : sdbm ( a n1 -- n2 ) &0 -rot bounds ?do 65599 * i c@ + $10000000 mod loop ; 04:51:13 btw, thanks again pointfree ;) 04:57:01 Well 04:57:39 for a url shortener you need to recieve a piece of a url and use that piece to find a longer url 04:57:47 easiest way to store the longer url is in a database 04:58:52 You take the piece of the url that equals the location of the longer url, and use that piece to form a url which requests the long url from the database 04:59:08 If you want do like oauth too 04:59:31 Then once you have the longer url, you print that to the user 04:59:50 Or perhaps if you want to redirect there should be an easy way to redirect a user with little compute power 05:00:32 So it can be nearly all done with http as far as I understand 05:02:28 --- join: true-grue (~true-grue@176.14.222.10) joined #forth 05:16:24 nerfur, groovy! :) 05:35:04 --- quit: mnemnion (Remote host closed the connection) 05:41:28 yeah) 05:41:46 John[Lisbeth], I take another approach) 05:41:59 oh? 05:44:19 After you sent URL to shorten I'm trying to create little cgi forth file that produce output with html redirecting to original url ) 05:44:53 so I have static hash-named files in folder ) 05:47:26 What about this 05:48:01 first you get redirected to a page that plays a little ascii animation while the longer url is fetched, and then after the longer url is fetched or after a minimum number of times you get redirected 05:48:20 and you could put a little ad in there and monetize it 05:49:01 I don't plan to use it "outside", it is just "forth challenge" for me 05:49:22 Why not make a real url shortener? 05:49:27 I have no time and power/resources to try to create competitor for existing shorteners 05:49:43 Don't try to compete with others try to compete with yourself 05:49:54 That's what I do right now) 05:50:00 writing url shortener in forth ) 05:50:44 But if you can't really shorten urls then it is not a url shortener 05:51:55 If you stuck just a little java in there you could get a decent enough ad that it would pay for your thing so it was free 05:52:54 why it doesn't shorten? I didn't get it 05:53:36 Well it seems to me the point of shortening a url is so that you can give a short link to someone like if you are posting on twitter or on a billboard 05:53:46 yes, it is 05:54:03 if that short url works only for you then you've really not captured the purpose of the program 05:54:15 the problem it was trying to solve was to give the url to others so it would work 05:54:34 it works on internet, just only me "know" about this url and shortener) 05:54:55 until I give it to somebody, yes 05:55:16 You could also open source it so it would be easy to clone 05:55:29 and then others would make their own version of your thing 05:55:36 maybe, then it will be finished 06:04:12 I am pretty tired I think I will sleep 06:04:21 --- join: rgrinberg (~rgrinberg@blk-212-79-74.eastlink.ca) joined #forth 06:23:13 "good night" ) 07:04:28 --- join: neceve (~ncv@unaffiliated/neceve) joined #forth 07:21:07 --- join: moby (~moby@177-177-183-251.user.veloxzone.com.br) joined #forth 09:23:49 --- quit: rgrinberg (Remote host closed the connection) 09:25:58 --- join: rgrinberg (~rgrinberg@blk-212-79-74.eastlink.ca) joined #forth 09:26:01 --- quit: rgrinberg (Client Quit) 09:31:15 --- join: rgrinberg (~rgrinberg@blk-212-79-74.eastlink.ca) joined #forth 10:09:51 --- nick: DGASAU` -> DGASAU 10:19:38 John[Lisbeth]: build all your life in forth... and all existence in forth. (from past, to now). please! 10:49:36 --- quit: neceve (Quit: Konversation terminated!) 11:32:28 --- quit: rgrinberg (Ping timeout: 252 seconds) 12:20:49 --- mode: ChanServ set +v bluekelp 13:20:46 --- quit: John[Lisbeth] (Ping timeout: 250 seconds) 14:22:25 Would being able to use names in postfix fashion make things clearer or worse? For example, would 5 someConst Constant be clearer than 5 Constant someConst? I can't tell if the extra consistency would make it easier to read, or if the lack of distinction between name-parsing words and other words would make it harder to read. Likewise, would : dup * square ; be intrinsically harder to readthan : square dup * ; ? 14:24:32 no 14:25:08 5 ( 5 goes on the stack ) constant (the word constant executes) blah ( the word constant creates a new instance of a constant called blah with a value of 5 ) 14:25:11 you cant say 5 blah constant 14:25:19 because blah would be unknown 14:30:15 I guess I had better explain what I'm thinking then... suppose that the interpreter was "lazy" by default. That is, when it encounters a word, unless the word is immediate, it just puts the symbol on the stack (or maybe on a separate symbol stack thing, I haven't quite worked it out). Then immediate words could manipulate the ordering of words, what words there are, etc, before they get compiled / executed. It would enable lisp-like 14:30:15 macro capabilities. I could say 2 4 / [ sym-rot sym-swap ] and it would now be 4 2 / . 14:30:37 --- join: rgrinberg (~rgrinberg@24.222.87.130) joined #forth 14:32:23 Of course that would mean that when I actually wanted to execute stuff I would have to use an immediate word (maybe I would call it "NOW!") to do it, and likewise when I wanted to compile a definition ; would have to go through the symbol-stack (although it would actually probably do it from bottom-up, so if I'm going to call it a stack I'd have to reverse it), look up the xt of a symbol, and compile that in. 14:32:23 --- quit: rgrinberg (Read error: Connection reset by peer) 14:34:07 if you need to execute a word at compile time you can make it immediate or you can do [ xyzzy ] 14:34:27 the word [ switches back to interpret mode so you can execute xyzzy then ] switches back to compile mode 14:34:50 if you need to compile an immediate word at compile time instead of exeucting it therse [compile] 15:09:16 --- quit: moby (Ping timeout: 250 seconds) 15:33:28 --- join: Zarutian (~zarutian@168-110-22-46.fiber.hringdu.is) joined #forth 15:47:49 --- quit: nighty (Quit: Disappears in a puff of smoke) 15:58:33 --- join: nal (~nal@adsl-64-237-236-116.prtc.net) joined #forth 16:20:28 --- join: rgrinberg (~rgrinberg@blk-212-79-74.eastlink.ca) joined #forth 16:49:05 --- quit: true-grue (Read error: Connection reset by peer) 17:13:04 --- join: nighty (~nighty@d246113.ppp.asahi-net.or.jp) joined #forth 17:48:34 --- quit: rgrinberg (Ping timeout: 250 seconds) 18:05:21 --- join: rgrinberg (~rgrinberg@blk-212-79-74.eastlink.ca) joined #forth 18:18:17 --- join: John[Lisbeth] (~user@52.165.40.155) joined #forth 18:18:22 I crashed last night 18:39:58 are you in the hospital!? 18:40:38 --- join: neceve (~ncv@unaffiliated/neceve) joined #forth 18:50:32 --- quit: Zarutian (Quit: Zarutian) 18:58:29 no my server crashed 18:58:36 otherwise my nick would still be logged in 18:58:41 whenever I crash I consider it a personal failure 18:59:05 Uptime needs to approach infinity until ten days have passed 19:02:17 its cool cause I can go like : update-freebsd s" sudo pkg update" system ; 19:13:56 --- quit: beretta (Ping timeout: 250 seconds) 19:14:57 --- quit: rgrinberg (Remote host closed the connection) 19:15:27 and emacs is : s" emacs" system ; 19:17:01 --- join: rgrinberg (~rgrinberg@blk-212-79-74.eastlink.ca) joined #forth 19:17:33 I think you forgot something between : and s" 19:18:31 : vim s" spacemacs" system ; 19:27:12 --- join: beretta (~beretta@cpe-184-58-116-76.columbus.res.rr.com) joined #forth 19:44:52 --- join: mnemnion (~mnemnion@2601:410:300:8d11:14eb:1c60:6a82:198f) joined #forth 19:51:38 wow, you use spacemacs 20:09:55 wow, seeing that reminds me of why bourne shell exists 20:09:59 and i hate sh 20:15:49 --- quit: nal (Quit: WeeChat 1.4) 20:28:54 I don't use spacemacs I just really like where it's going 20:32:57 --- quit: neceve (Quit: Konversation terminated!) 20:43:35 when I do s" boop" I get what looks like a memory address and some sort of placeholder 20:43:57 I am wondering if I can use those to values to reverse the operation 20:44:47 it seems like the 4 might indicate the number of cells, because boop is four letters 21:06:32 dont use s" 21:06:42 i think s" should be nuked off the face of the earth 21:06:43 use 21:07:03 create blah ," this is a string" 21:07:07 blah count type 21:09:48 --- quit: beretta (Ping timeout: 250 seconds) 21:23:10 --- join: beretta (~beretta@cpe-184-58-116-76.columbus.res.rr.com) joined #forth 21:27:45 --- quit: rgrinberg (Ping timeout: 265 seconds) 21:46:20 thats weird doesnt add anything to the stack 21:51:34 it wont 21:51:39 till you reference what was created 21:51:44 create blah ," this is a string" 21:51:47 blah 21:51:52 now the address of the string is on the stack 21:51:57 count type 21:52:01 it will emit the string 21:55:23 --- quit: dys (Ping timeout: 252 seconds) 22:51:34 meh I dunno 22:51:43 I think I could use either one 22:54:48 you can 22:54:54 i just think s" is wrong 22:55:48 s" builds an inline string which at run time has to be jumped round 22:55:52 two operations 22:55:56 1: put address on string 22:56:02 2: jump to end of string 23:08:29 I dunno 23:08:41 I think I may end up implementing strings as dynamic arrays 23:09:19 I've heard good arguments for them being linked lists but meh 23:12:35 your just making things complicated 23:12:48 theres no such thing as an array 23:12:51 or a string 23:12:56 its just bytes in memory 23:20:36 I don't care 23:20:52 theres no such thing as bytes in memory its just electrical impulses in your brain 23:31:56 --- quit: proteusguy (Ping timeout: 250 seconds) 23:46:32 It just just so daunting to start programming 23:47:07 take one step at a time 23:59:59 --- log: ended forth/16.10.19