00:00:00 --- log: started forth/17.05.09 00:28:19 --- quit: wa5qjh (Ping timeout: 240 seconds) 01:23:15 --- join: true-grue (~true-grue@176.14.219.178) joined #forth 01:29:40 --- quit: ACE_Recliner (Ping timeout: 240 seconds) 01:42:38 --- quit: ovf () 01:42:51 --- join: proteus-guy (~proteus-g@202.156.23.12) joined #forth 01:43:53 --- join: ovf (sid19068@gateway/web/irccloud.com/x-tppbctygmubbljuk) joined #forth 02:13:55 --- quit: dys (Ping timeout: 264 seconds) 02:28:14 --- quit: proteus-guy (Remote host closed the connection) 02:29:38 --- quit: nighty-- (Quit: Disappears in a puff of smoke) 03:11:49 --- join: nighty-- (~nighty@s229123.ppp.asahi-net.or.jp) joined #forth 03:29:37 --- join: sacculina (~oblivia@156.57.149.237) joined #forth 03:57:08 --- join: vincenttoups (~user@nc-76-6-6-25.dhcp.embarqhsd.net) joined #forth 04:00:10 --- quit: LeCamarade (Ping timeout: 240 seconds) 04:00:51 --- join: LeCamarade (~revence@139.59.111.106) joined #forth 04:39:15 --- join: GeDaMo (~GeDaMo@212.225.127.213) joined #forth 04:52:03 --- join: izabera (~izabera@unaffiliated/izabera) joined #forth 04:57:12 i have 20 minutes to master forth 04:57:14 where do i start 04:59:09 https://learnxinyminutes.com/docs/forth/ 04:59:53 i want to master 04:59:57 not to learn 05:00:05 why did you even link that 05:00:08 can't you read 05:00:25 It's all you need to know. :P Well, it's not, but then I don't know. 05:01:25 which forth? what other languages are you experienced in? 05:02:18 there's more than one? 05:02:35 "When you've seen one Forth, you've seen one Forth" :P 05:03:06 izabera: there are hundreds of dialects of forth 05:03:17 aint nobody got time for that 05:03:24 Then write your own! 05:04:28 some follow various standards (F79, F83, FIG, ANS, Forth200x), others are very different (e.g., colorForth, 8th, retro) 05:09:30 You can't master Forth. Even in infinite amount of the time. 05:19:31 heh 05:25:10 --- quit: vincenttoups (Ping timeout: 240 seconds) 05:37:55 ok so everything in forth is programmed in forth 05:38:11 even \ is coded in forth 05:38:19 Yes 05:38:33 what are the native commands? 05:38:41 you must start somewhere 05:38:45 Native in what sense? 05:39:02 There are some primitives, they vary between implementations 05:39:19 for instance, "see +" is crashing my gforth 05:39:31 so i'm assuming + is a primitive 05:40:03 Most likely yes 05:40:19 what are the others? 05:41:27 --- quit: ricky_ricardo (Remote host closed the connection) 05:41:45 I have not memorised which of gforth's words are primitives 05:48:43 --- join: vincenttoups (~user@76.6.6.25) joined #forth 05:58:10 i found the list of core words in the ans standard and i'm surprised to find stuff like 1+ or 2drop in there 05:58:37 izabera: normally 'see' should work in gforth. IIRC, it uses gdb for disassembling primitives. 05:58:40 can't you implement 2drop like this? : 2drop drop drop ; 05:58:51 yes 05:58:57 so why is it a core word? 05:59:07 but it may be significantly more efficient to do as a primitive 06:00:34 An important thing is that not all core words have to be loaded by default, just available to load 06:00:51 from the start of section 3: 06:01:03 A system need not provide all words in executable form. The implementation may provide definitions, 06:01:03 including definitions of words in the Core word set, in source form only. If so, the mechanism for adding 06:01:03 the definitions to the dictionary is implementation defined. 06:09:26 I've been sort of hankoring to write a game in forth, for some reason 06:09:36 What's the best current forth implementation for that kind of thing? 06:14:40 I know gForth has been used with OpenGL and SDL. I have a friend who wrote a game using SwiftForth + Allegro: http://www.indiedb.com/games/the-lady 06:15:29 In 80s there were few commercial games written in Forth. 06:16:07 Nowadays you'll find none of such games. 06:16:31 So, maybe all modern Forths are not good for games? :) 06:16:38 I don't know how well Forth works in a larger company 06:16:48 when you have to work with other people 06:17:24 The biggest and most popular game in Forth was written by a group of 5 (if I remember correctly) people. 06:17:38 and what was it? 06:18:36 It's a real classic. Old gamers know and love this game. 06:18:46 https://en.wikipedia.org/wiki/Starflight 06:19:31 Maybe it's the most successfull app written in Forth for all times. 06:19:48 let me guess: you're a star and you have to fly 06:19:51 yeah very original 06:19:54 (yawn) 06:19:56 --- join: ACE_Recliner (~ACE_Recli@c-50-165-178-74.hsd1.in.comcast.net) joined #forth 06:20:38 izabera, Bleh, is it you? :) 06:22:45 Oh wow 06:22:50 Starflight was Forth? 06:23:23 On reflection it seems that factoid might have been rattling around the back of my head, actually. 06:23:35 Yes. And it's possible to find the sources (partly) and design docs. 06:24:14 There were some really good and popular games written in MacForth, too. 06:25:07 I'm mostly a Lisper (I have a ~medium size game written in Scheme coming out soon). 06:25:14 But I would say my style is forth inspired 06:25:48 Oh, so you know about Abuse and Naughty Dog, right? 06:30:52 Totally. 06:31:25 Its weird to me that (from my point of view) the best languages all have more or less failed as far as popularity goes because of irregular syntax. 06:31:34 Smalltalk, Forth, Lisp, J/APL 06:32:18 well, J is very math oriented IMO 06:32:33 for general programming 06:32:50 why are they the best languages? 06:34:43 From my point of view? 06:34:51 sure 06:35:07 I guess because they show an ability to transcend immaterial conventions in pursuit of simplicity and expressiveness. 06:39:39 vincenttoups, I think, you heard this: "Forth is an amplifier: a good programmer can write a great program; a bad programmer a terrible one." The same belongs to other languages in your list. 06:40:05 I think smalltalk actually is pretty good about not letting inexperienced programmers mess up too bad 06:40:14 But its definitely true of Lisp 06:40:24 And you sort of have to be a wiz-bang genius to even program in J 06:41:00 Industry needs a language not for hackers or artists, but for average programmer. Without amplifying his incompetence :) 06:41:36 yeah 06:41:42 that's why Python is successful 06:41:49 and Java back then 06:42:01 The weird thing is that successful languages often have very complicated semantics 06:42:07 And impose a much higher cognitive load 06:42:17 But they have superficially approachable styles 06:43:36 Lisp syntax is very simple 06:43:57 it's almost like C-style procedure calls: foo(1, 2) vs. (foo 1 2) 06:44:36 itym (((Lisp (syntax) (is ((very) (simple)))))) 06:44:39 and parens are not for decoration :-> 06:45:01 well, they define structure with out { } and ; 06:45:09 whoa 06:45:21 that's like the biggest problem of normal programming languages, right? 06:45:27 that you have to type { } and ; 06:45:30 Hush z0d, it's supposed to be a secret that C and Lisp syntax really are quite similar. 06:45:50 izabera: of course not 06:46:27 but I'd rather read Python than { foo(1, 2); bar; { baz; }; }; 06:46:35 I like my syntax light 06:46:55 light syntax is fine, but significant whitespace is the devil incarnate 06:47:16 i think most people don't give a fuck and just pick a style and try to be consistent 06:47:34 Lisp has one advanage here. It's an expression-based language. 06:48:00 sometimes using statement-based languages is quite annoying :) 06:48:04 zy]x[yz: I don't agree, but I accept your point 06:48:24 true-grue: and that code is data and also huge 06:48:46 z0d, Well, in fact, not many programmers use this feature. 06:49:32 Lisp has powerful metaprogramming functions. But still most of lispers program in AST representation, not in some hand-made declarative DSL. Why so?... :) 06:50:01 Lisp syntax is not an AST 06:50:15 an AST can have type information 06:50:56 don't you understand that the whole point of lisp is to make it easy for compilers rather than people? 06:51:02 S-expressions can have types too. And everything else. 06:51:35 that's also the whole point of c, btw 06:52:09 I think its more like someone wrote Lisp and said "Does the syntax need to be any more complicated?" and decided, "nah." 06:52:22 Its not really about ease for the compiler writer or even homo-iconicness 06:52:25 the first Lisp had m-expression (for humans) 06:52:38 Yeah, and then they decided it really wasn't worth it 06:52:42 Which was a worthy decision 06:52:42 yup 06:52:54 Cast off that which is not necessarily 06:52:59 the point of c is most definately not ease of implementation 06:53:00 In that sense Lisp is a sort of stoic language 06:53:03 or if it is, they failed miserably 06:53:12 As ar Smalltalk and Forth 06:53:19 I mean Forth is like the most stoic language there is 06:53:26 zy]x[yz: its points are ease of implementation and portability, that's why *everything* is ub 06:53:54 ub is in direct conflict with portability 06:53:59 no 06:54:17 ub is caused by portability requirements 06:54:44 if you can't implement this particular operation portably across all the machines you want c to run on, it's ub 06:55:02 what's UB? 06:55:06 undefined behavior 06:55:07 undefined behavior 06:55:10 ahh 06:57:07 well anyway, don't get me wrong - I like c. but I stand by that if their goal was ease of implementation, they failed miserably. 06:57:36 what parts are hard to implement? 06:57:47 it's an incredibly complex standard 06:58:03 C++ on the other hand.... 06:58:05 then name something that's hard to implement 06:58:07 The idea of "stoic" language is that it's a small language and the programmer is able to understand how it works. So you can trust your tool and you full understand what it does "behind curtains". 06:58:50 < izabera> then name something that's hard to implement 06:58:51 no 06:58:54 why 06:59:01 you can't come up with a single example? 06:59:09 come on, you can do better 06:59:22 did you just come here to pick a fight? 06:59:39 i didn't know this was a fight 07:15:52 btw my c89.pdf is 230 pages and http://forthworks.com/forth/standards/DPANS/DPANS.pdf is 220 07:16:14 that's nice 07:22:36 --- join: neceve (~ncv@86.125.247.109) joined #forth 07:22:36 --- quit: neceve (Changing host) 07:22:36 --- join: neceve (~ncv@unaffiliated/neceve) joined #forth 07:40:54 izabera, Good observation. 07:41:14 ANS Forth is very complex and ugly language. 07:41:27 --- join: smokeink (~smoke@175.20.93.180) joined #forth 07:41:44 Lua reference manual has 65 pages. 07:42:24 Scheme R5RS has 50 pages. 07:42:34 what's the good forth? 07:42:48 keep in mind that like half of lua's reference manual is the c api 07:44:46 Oberon report has 17 pages. 07:45:27 where is it? 07:49:51 https://www.inf.ethz.ch/personal/wirth/Oberon/Oberon07.Report.pdf 07:51:29 --- quit: smokeink (Quit: leaving) 08:16:23 I'd argue that a stoic language is one that acknowleges that many of our desires about what we want from a programming language are not actually important 08:17:01 And so the stoic language provides the small number of important features without agonizing over petty details which ultimately don't improve our lives 08:28:21 can i just say that if foo else bar then looks really stupid 08:28:38 it'd be much better with fi instead of then 08:30:50 You can define : fi postpone then ; immediate 08:33:16 izabera: https://ideone.com/1acsqh 08:34:01 didn't know that ideone supported forth 08:42:28 --- join: gravicappa (~gravicapp@83.237.174.88) joined #forth 08:46:23 I think that nowadays the emphasis is more on libraries than language features 08:47:10 because there's a lot of integration going on. you have to interface with databases, YAML, JSON, HTTP, you name it 09:31:39 --- quit: neceve (Quit: Konversation terminated!) 09:41:58 what's an example of "!" ? 09:42:39 sorry for the noob q, still a beginner 09:42:55 do i need to define an array first? 09:43:37 "!" is store, it stores a value to an address 09:43:52
! 09:44:14 yes but i get Invalid memory address 09:44:32 What address are you giving it? 09:44:40 idk 09:44:51 1 2 ! just to try it out 09:45:28 variable x 09:45:31 1 x ! 09:45:44 thank you 09:46:10 --- quit: nighty-- (Quit: Disappears in a puff of smoke) 09:48:08 --- join: dys (~dys@ip-109-44-0-142.web.vodafone.de) joined #forth 10:50:55 --- quit: ACE_Recliner (Ping timeout: 246 seconds) 12:54:22 : square dup * ; : * + ; 3 3 * . 3 square . 12:54:28 why does this print 6 9? 12:55:03 because three plus three is 6 and three squared is 9 12:55:45 When you redefine a word, only subsequent uses wil use the new definition 12:56:01 i see... 12:56:38 izabera: http://wiki.c2.com/?HyperStaticGlobalEnvironment 12:58:35 so when i define a word, the interpreter must completely expand it and saves it as a list of primitives 13:00:20 not necessarily 13:00:26 I'm not sure what you mean by "completely expand it" 13:00:27 forth allows for optimizing compilers 13:00:40 or many threading models 13:01:01 crc: what do you mean? 13:01:59 the compiled code can be a lot of things. a list of tokens, some form of bytecode, a list of addresses, native machine code 13:03:40 GeDaMo: in my mental model an interpreter could work as a macro replacer. when the user defines something, all the tokens are treated as macros and expanded to a list of primitives 13:04:24 crc: what do you mean by threading models? forth has threads? 13:04:33 isn't it older than multithreading cpus? 13:04:42 no, not that kind of thread 13:04:54 https://en.wikipedia.org/wiki/Threaded_code 13:05:15 Basically a sequence of addresses 13:05:25 my forth is subroutine threaded with some limited inlining and runs on a simulated MISC cpu. 13:05:26 --- join: Zarutian (~zarutian@168-110-22-46.fiber.hringdu.is) joined #forth 13:06:22 : square dup * ; might be stored as
13:06:30 (roughly) 13:07:10 did you all implement a forth for learning purposes? 13:07:31 s/for learning purposes// 13:07:48 I'm implementing one because I don't see how I could stay interested in it otherwise 13:08:14 i'm implementing one because it's a great way to learn a language 13:09:58 I took over an existing implementation and have continued evolving it over the last decade and a half 13:16:44 I've written bits of a couple of implementations and I'm thinking of doing it again :P 13:27:56 --- join: zincing (~zincing@2a03:1b20:1:f410::10de) joined #forth 13:32:00 what are the most performant interpreters/compilers out there? 13:32:44 for conventional (ANS): iforth and vfx 13:33:13 non-conventional: Reva (x86 only, Windows/Linux) focused on performance 13:40:00 --- quit: zincing (Quit: Leaving) 13:54:32 --- quit: GeDaMo (Ping timeout: 240 seconds) 14:02:13 if you want free/open source and can tolerate 32-bit x86 only, then probably bigforth 14:02:52 vfx generates slightly faster code but is proprietary 14:10:08 maybe even significantly faster but the free version doesn't come with sources 14:10:25 so would not recommend it for learning on 14:12:44 --- quit: gravicappa (Remote host closed the connection) 14:40:55 --- join: MickyW (~MickyW@p4FCFEEB1.dip0.t-ipconnect.de) joined #forth 15:19:50 --- quit: true-grue (Read error: Connection reset by peer) 15:24:44 --- join: zincing (~zincing@2a03:1b20:4:f011::20de) joined #forth 15:46:56 --- join: zincing_ (~zincing@2a03:1b20:4:f011::20de) joined #forth 15:47:42 --- quit: zincing (Remote host closed the connection) 15:58:19 --- join: mark4 (~mark4@cpe-66-25-211-108.tx.res.rr.com) joined #forth 15:59:12 --- quit: nighty- (Quit: leaving) 16:01:10 --- join: nighty- (~cp@www.taiyolabs.com) joined #forth 16:06:20 --- quit: Zarutian (Quit: Zarutian) 16:21:11 --- join: dual (~bonafide@66.186.162.179) joined #forth 16:32:23 --- join: dual_ (~bonafide@66.186.162.179) joined #forth 16:32:32 --- quit: mark4 (Quit: Leaving) 16:33:22 --- quit: dual (Ping timeout: 260 seconds) 16:37:16 --- quit: dual_ (Ping timeout: 272 seconds) 16:40:17 --- join: dual (~bonafide@66.186.162.179) joined #forth 17:00:04 --- quit: dual (Ping timeout: 272 seconds) 17:32:11 --- join: neceve (~ncv@unaffiliated/neceve) joined #forth 17:46:56 --- quit: dys (Ping timeout: 272 seconds) 18:09:01 --- join: wa5qjh (~Thunderbi@121.54.90.139) joined #forth 18:11:27 --- join: nighty-- (~nighty@d246113.ppp.asahi-net.or.jp) joined #forth 18:12:15 --- quit: nighty-- (Remote host closed the connection) 19:35:17 --- quit: MickyW (Quit: Leaving. Have a nice day.) 20:11:36 --- join: nighty-- (~nighty@d246113.ppp.asahi-net.or.jp) joined #forth 20:16:42 --- quit: koz_ (Ping timeout: 255 seconds) 20:38:41 --- join: dual (~bonafide@subzeroup.core.rzwireless.net) joined #forth 20:54:40 --- quit: Uniju_ (Quit: Feeling down? You may already be a charge target.) 20:57:29 --- quit: dual (Ping timeout: 260 seconds) 20:58:58 --- join: dual (~bonafide@subzeroup.core.rzwireless.net) joined #forth 21:02:00 --- join: ACE_Recliner (~ACE_Recli@c-50-165-178-74.hsd1.in.comcast.net) joined #forth 21:02:29 --- quit: neceve (Quit: Konversation terminated!) 21:12:48 --- join: Uniju (~frog_styl@cpe-74-78-4-232.mass.res.rr.com) joined #forth 21:12:54 --- quit: dual (Ping timeout: 260 seconds) 21:55:24 --- join: dual (~bonafide@subzeroup.core.rzwireless.net) joined #forth 22:01:30 is gforth not any good? 22:14:49 --- quit: dual (Ping timeout: 240 seconds) 22:20:54 --- join: dual (~bonafide@subzeroup.core.rzwireless.net) joined #forth 22:32:09 --- quit: dual (Ping timeout: 255 seconds) 22:37:50 --- join: koz_ (~koz_@121.99.240.58) joined #forth 23:11:12 --- quit: zincing_ (Quit: Leaving) 23:40:47 --- join: proteus-guy (~proteus-g@49.228.92.248) joined #forth 23:59:59 --- log: ended forth/17.05.09