00:00:00 --- log: started forth/17.04.18 00:38:57 immediate word? 00:39:11 interpretation semantics are runtime words 00:41:36 interpretation semantics are the behavior of a word when interpreting 00:41:58 which are usually the execution semantics 00:43:00 compilation semantics are the behavior of words when compiling. this is usually, but not always, to append the execution semantics to the current definition 00:43:29 and immediate word is a word whose compilation semantics are not that but are instead the execution sematnics 00:43:36 i.e. it gets run immediately even when compiling 00:44:28 e.g. 00:44:32 : foo ." i run now" ; immediate 00:44:33 : bar foo ; 00:44:35 -> i run now 00:44:40 and bar is an empty definition 00:46:57 that at least makes sense 00:47:11 foo is an immediate word there, i.e. when compiling its execution semantics get run instead of getting appended to the current definition 00:47:58 what happens if I use foo when not inside the : word 00:48:06 circling back to create, create is not an immediate word, so it does not get run right away when it appears inside a colon definition 00:48:28 so if you do : foo create bar ; 00:48:49 that will call create when foo is run, and then call bar 00:51:58 I do not understand what create does 00:53:12 http://lars.nocrew.org/dpans/dpans6.htm#6.1.1000 00:54:45 it parses a token from the input buffer and creates a word that returns a pointer to its data field. that data field is the HERE value immediately after create executes 00:57:56 create foo 0 , is (mostly) equivalent to variable foo apart from the value being initialized 00:58:41 *checks* in fact gforth defines variable as : variable create 0 , ; 01:03:03 meh 01:05:23 how does gforth define create 01:06:06 see create 01:06:14 where 01:06:19 in gforth 01:06:23 or dig it out of the source 01:08:24 that's really helpful 01:08:38 header starts a definition. reveal makes it visible. i don't feel like digging, but dovar looks like it is a pointer to some code that returns a pointer to a word's data field. i assume cfa, appends to the code field of the current/latest definition 01:09:08 header does see header 01:09:12 dovar does see dovar 01:09:53 ? 01:11:40 : input-stream-header parse-name name-too-short? header, ; latestxt defer (header) is (header) latestxt defer header is header 01:19:12 *actually waht i said in :08 doesn't quite make sense unless there are separate code and data areas. i don't feel like digging that deeply into gforth right now 01:27:31 --- join: smokeink (~smoke@175.20.93.33) joined #forth 01:33:04 --- quit: dual (Ping timeout: 240 seconds) 01:34:43 --- join: dual (~bonafide@subzeroup.core.rzwireless.net) joined #forth 01:41:35 --- quit: smokeink (Quit: leaving) 01:48:34 --- quit: dual (Ping timeout: 260 seconds) 01:50:02 --- join: dual (~bonafide@subzeroup.core.rzwireless.net) joined #forth 01:53:12 --- quit: yunfan (Ping timeout: 252 seconds) 01:53:27 --- join: yunfan (~roooot@unaffiliated/yunfan) joined #forth 02:18:38 --- join: proteusguy (~proteus-g@180.183.96.76) joined #forth 02:18:38 --- mode: ChanServ set +v proteusguy 02:23:34 --- quit: proteusguy (Ping timeout: 240 seconds) 02:24:04 --- quit: fiddlerwoaroof (Ping timeout: 240 seconds) 02:33:22 --- quit: mtsd (Quit: Lost terminal) 02:39:35 --- join: proteusguy (~proteus-g@180.183.96.76) joined #forth 02:39:36 --- mode: ChanServ set +v proteusguy 02:40:23 --- join: fiddlerwoaroof (~fiddlerwo@unaffiliated/fiddlerwoaroof) joined #forth 02:46:36 --- quit: nighty-- (Quit: Disappears in a puff of smoke) 02:53:05 --- join: true-grue (~true-grue@176.14.222.10) joined #forth 03:28:59 --- join: wa5qjh (~Thunderbi@121.54.90.132) joined #forth 03:29:50 --- join: nighty-- (~nighty@s229123.ppp.asahi-net.or.jp) joined #forth 03:40:28 --- quit: karswell (Remote host closed the connection) 03:41:52 --- join: karswell (~user@36.91.199.146.dyn.plus.net) joined #forth 03:42:39 --- quit: proteusguy (Remote host closed the connection) 03:44:57 --- quit: wa5qjh (Ping timeout: 260 seconds) 03:54:08 --- quit: dys (Read error: Connection reset by peer) 04:05:45 --- join: gravicappa (~gravicapp@ppp83-237-169-185.pppoe.mtu-net.ru) joined #forth 04:10:45 John[Lisbeth]: http://galileo.phys.virginia.edu/classes/551.jvn.fall01/primer.htm#create might be helpful with understanding create and does> 04:15:02 also: http://wiki.laptop.org/go/Forth_Lesson_18 , https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/CREATE.html , https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/User_002ddefined-Defining-Words.html#User_002ddefined-Defining-Words 04:35:31 also: it bears noting that those latter two links are actually the manual for the forth john is using 04:46:23 yeah, but he is using forth not manuals :-D 04:50:57 --- join: GeDaMo (~GeDaMo@212.225.127.213) joined #forth 05:45:38 hmm? 05:46:07 lol I dont really need the manuals anymore anyway because I have the see word 05:47:13 wow 05:47:27 : header (:noname) ; 05:47:52 that's like one of the most useful words 05:47:56 header 05:49:05 : :noname 0 useraddr <160> ! maxalign here (:noname) ; 05:50:00 it seems useraddr is at the bottom layer of abstraction. 05:51:14 when I see useraddr it actually makes my forth stop working 05:51:59 but anyway it should mean that I can copy noname to be whatever I want 05:53:08 eh there's some kind of trickery going on 05:54:39 --- quit: Quozl` (Ping timeout: 252 seconds) 05:58:22 see can be misleading there. best to use the source if you are going to delve into that 06:00:08 by convention words in parentheses like (:noname) are internal words not meant to be called directly 06:06:28 --- join: Quozl` (~quozl@18.85.44.128) joined #forth 06:07:09 --- join: Zarutian (~zarutian@168-110-22-46.fiber.hringdu.is) joined #forth 06:07:28 --- quit: Zarutian (Read error: Connection reset by peer) 06:07:47 --- join: proteusguy (~proteus-g@2405:9800:b408:bc31:baf6:b1ff:fee4:301c) joined #forth 06:07:47 --- mode: ChanServ set +v proteusguy 06:09:14 --- join: Zarutian (~zarutian@168-110-22-46.fiber.hringdu.is) joined #forth 06:24:32 John[Lisbeth]: you're delving into lower levels of code, not the lofty abstractions you prefer 06:27:07 yes I realize this 06:28:17 I managed to make a version of : called define 06:28:49 ' : constant define-pointer : define define-pointer execute ; 06:29:21 nice 06:29:33 good work pal keep it up 06:29:45 if only it were possible to change the ; word as well 06:30:15 yes, if only 06:30:53 why wouldn't it be possible to change ; ? 06:31:11 I dunno seems hard 06:31:20 I tried two ways and no works 06:31:25 ' : alias define 06:31:27 actually I have tried at least 3 ways 06:31:43 ' ; oops 06:31:48 would be shorter unless you need a define-pointer elesewhere 06:31:50 you goofed buddeh 06:31:56 GOOFED I SAY 06:32:16 how do you want to change ; 06:32:21 just the name, or the behavior? 06:32:37 I want to make it be the same as finish-definition 06:33:55 I tried comp' ; drop alias finish-definition but no work 06:34:56 it needs to be IMMEDIATE 06:35:13 two approaches: 06:35:24 comp' ; drop alias finish-definition immediate 06:35:33 easy done 06:35:34 : finish-definition postpone ; ; immediate 06:35:42 no dont feel like reading your second one 06:35:52 the first won't be portable (comp' isn't part of ANS) 06:36:01 it is a waste of the storage space on my neurons 06:36:05 is alias part of ANS? 06:36:24 I can implement alias in portable ans 06:36:53 reepca: no 06:37:16 hee he he heheeh eh ehe 06:37:19 but it's probably easier to implement in a portable way than comp' would be 06:37:35 MUAHAHAHAHAHAHAHAHAHAHAHHA 06:38:34 something like : alias ( ptr "name" -- ) create , does> @ execute ; 06:39:23 eh looks like garbage 06:44:04 looks like forth. are you sure you're in the right place? 06:44:10 he he he 06:44:23 why can't I do define foo :noname 2 finish-definition finish-definition 06:46:06 or we can make it even easier on the eyeballs 06:46:10 :noname isn't nestable 06:46:17 ' :noname alias lambda 06:46:21 u wot? 06:46:32 you want quotations, which aren't part of ANS and can't be portably implemented 06:46:49 lambda lambda lambda 2 finish-definition finish-definition finish-definition tho 06:47:17 wtf? 06:47:37 wot u meaan cant be portably implemented 06:48:01 quotations require carnal knowledge of how the compiler works in a given implementation 06:48:31 preprocessor 06:48:42 http://www.forth200x.org/quotations.txt 06:48:53 nah cause watch 06:49:43 vfx, amforth, bigforth support these. gforth does in the development branch. openfirmware will someday. 06:50:42 the quotations problem is sort of similar to the nested arrays problem, isn't it? 06:50:53 reepca: yes 06:51:31 lambda 2 finish-definition constant lambda1 lambda lambda1 execute finish-definition constant lambda2 lambda lambda2 finish-definition constant lambda3 define nested-lambda lambda3 execute finish-definition 06:52:15 I see some room for automation in there 06:52:24 I dunno about you but there seem to be patterns here 06:52:51 Then I'd like it if they exposed the general mechanism used, as I've spent some time scratching my head trying to figure out a nice way to define nested arrays. I ended up settling on sort of "constructing" each array at HERE + UNUSED and then copying it to HERE once it's "finished", but I don't think messing around with un-allotted memory is portable. 06:53:22 that seems silly reepca 06:53:42 to nest arrays you put the pointer to your nested array into the other array 06:54:13 John[Lisbeth]: Implement it. 06:54:52 In under O(n^2), if you don't mind. 06:55:28 details details. If I had already implemented arrays I would do it but I don't feel like implementing arrays 06:55:40 well let me see how easy it is to do actuallly 06:56:01 details matter 06:56:10 nah sort out the details when you get to it 06:56:28 life is full of details you will never finish looking over the details 06:57:41 details won't write themselves 06:57:57 that is a true statement 06:58:30 here's my array type define array anonymous-pointer swap 1 + cells allot finish-definition 06:58:42 here is a nested array 06:59:03 10 array 10 array cell + ! 06:59:29 now quit bitching about how I cant write code 06:59:38 It is not that I cant I just dont feel like it 06:59:39 how is array defined? 07:00:02 how do you track the size of an array? 07:00:41 So the extra cell is for the type info of the array but I was too lazy to implement that so this is an untyped array 07:00:48 nevertheless still a fully working array 07:02:40 arrays happen to be not super interesting to me 07:02:43 I perefer linked lists 07:03:02 In certain instances I may use arrays in my code but only to a limited degree 07:03:27 that is why I had not implemented them yet 07:03:39 --- quit: Zarutian (Quit: Zarutian) 07:04:26 I don't believe anonymous-pointer is built into gforth. 07:04:31 incidentally, your approach is much more visually noisy than standard forth. : array ( size -- ptr ) here swap 1+ cells allot ; 07:04:56 define anonymous-pointer here cell allot finish-definition 07:06:21 Now make it work for arbitrarily-sized arrays. Surely a high-level programmer shouldn't be expected to count how many elements are in their array literals, after all. 07:06:44 I am not going to include arbitrary sized arrays in my language actually 07:07:01 the language is extensible such that people can put arbitrary types in there 07:08:44 my types are int, string, bool, lambda, fixed-array, list, and doubly-linked list, and trees are done with lists or fixed trees are done with fixed arrays 07:09:08 oh and object too 07:09:22 objects will just be a tree of chars for lookup 07:09:30 why would one choose your language over something else? 07:09:42 because it is bettter than bash 07:09:47 at doing what bash does 07:09:50 if I do it right 07:10:02 --- quit: dual (Ping timeout: 240 seconds) 07:11:36 tbh, I never saw choosing programming language "instead of bash" 07:12:39 I want to make something to replace bash as the standard linux shell 07:12:42 how will your language/shell work for launching programs and piping input/output between them? 07:12:58 I have not figured that part out yet 07:13:15 there is the forth word system but I suspect this just uses the system shell 07:14:38 but your shell is the system shell 07:15:02 that is my point. If the forth word system indeed calls the system shell then it will not be useable as the basis for my shell 07:15:53 my hope is that operators such as | should not be so hard to implement 07:19:41 you'll have to do some POSIX stuff if I'm not mistaken 07:19:52 that's usually my approach to software development, as well: have grandiose plans, and just hope that it won't be hard to figure out later 07:23:49 yeah to some degree I will have to be compliant with posix 07:24:10 I plan to offer all the syntax that a posix compliant language would give but I will not make that syntax work in a posix copliant way 07:24:51 is there any part of posix that specifies syntax? 07:26:25 not sure I have never read posix 07:26:35 http://pubs.opengroup.org/onlinepubs/9699919799/ then hit "Shell & Utilities" 07:27:02 * crc is certain that John[Lisbeth] hasn't read the posix spec since he won't even bother to read the ans spec to find things 07:27:37 oh, syntax for sh 07:29:10 well I mean 07:29:26 I basically need these right here | >> > 07:29:34 I am not sure if there are any thers I need 07:29:58 a shell that requires all existing shell scripts to be rewritten won't be very popular as a replacement 07:30:03 you'll also need < 07:30:44 not true because my shell can be modified to contain bash within it so that they can type a macro and start using their old shell scripts 07:31:17 you can also keep those old shells (aka bash) as a dependency 07:31:29 and sure I need < as well 07:33:49 --- quit: true-grue (Read error: Connection reset by peer) 07:34:14 the hard part in making the shell seems not to be actually making it use the system but actually making macros that will make shell commands compileable 07:38:22 --- join: true-grue (~true-grue@176.14.222.10) joined #forth 07:56:36 basically there are a few main parts of a shell 07:56:56 first of all you need to be able to take a string that is a path and use that to fetch a file from the filesystem 07:57:06 then you need to eecute that file passing into it the given arguments 07:57:17 and finally you need the ability to redirect that output somewhere else 07:59:30 --- quit: nighty-- (Ping timeout: 252 seconds) 08:12:44 --- join: nighty-- (~nighty@s229123.ppp.asahi-net.or.jp) joined #forth 08:14:43 you'll also need something to setup/maintain the environment variables 08:16:25 and some job control functionality 08:39:20 --- join: neceve (~ncv@86.125.247.109) joined #forth 08:39:20 --- quit: neceve (Changing host) 08:39:20 --- join: neceve (~ncv@unaffiliated/neceve) joined #forth 09:12:07 --- join: dys (~dys@ip-109-40-1-221.web.vodafone.de) joined #forth 09:12:44 --- quit: dys (Read error: Connection reset by peer) 09:23:39 --- join: dys (~dys@ip-109-40-1-221.web.vodafone.de) joined #forth 09:38:57 --- join: ACE_Recliner (~ACE_Recli@c-50-165-178-74.hsd1.in.comcast.net) joined #forth 09:40:20 --- quit: neceve (Quit: Konversation terminated!) 09:47:00 --- quit: karswell (Remote host closed the connection) 09:48:21 --- quit: ACE_Recliner (Ping timeout: 260 seconds) 09:48:25 --- join: karswell (~user@36.91.199.146.dyn.plus.net) joined #forth 09:49:04 --- join: ACE_Recliner (~ACE_Recli@c-50-165-178-74.hsd1.in.comcast.net) joined #forth 09:53:00 --- quit: true-grue (Read error: Connection reset by peer) 10:13:12 --- join: true-grue (~true-grue@176.14.222.10) joined #forth 10:57:53 --- join: Zarutian (~zarutian@168-110-22-46.fiber.hringdu.is) joined #forth 11:02:43 --- join: John[Lis` (~user@2601:601:8f01:a6a0:5d90:2d7f:a033:7136) joined #forth 11:06:55 --- quit: John[Lisbeth] (Ping timeout: 258 seconds) 13:01:10 not being able to nest colon definitions is a pretty basic consequence of how the dictionary works in most forths 13:02:40 (and of how : and ; are normally defined, but that is a tautology) 13:03:46 also, i have discovered the cure for cancer. we just need to give the patient something that will make them not have cancer anymore. don't ask me about chemical composition. i'm a high-level physician 13:05:33 sounds promising! 13:05:57 but will it be better than bash? 13:09:12 yes. it will unlock so much manpower in the newly healthy populace that we won't need computers anymore to do the things we use them for now 13:10:56 Why would you even *want* to nest colon definitions? If you want definitions that write more definitions.... shouldn't you use CREATE DOES>? 13:11:12 he's probably trying to create closures 13:13:11 "The essence of quotations is to provide nested colon definitions, in which the inner definition(s) are nameless." http://www.forth200x.org/quotations.txt 13:15:58 --- join: Mat4 (~claude@ip5b410455.dynamic.kabel-deutschland.de) joined #forth 13:16:52 maybe I just haven't been around long enough, but I just don't see the point of that. :noname ... ; constant #temp#, or even better : (somedescriptivename) ... ; - and then later a ['] (somedescriptivename) - seems just as good if not a better style 13:17:54 zy]x[yz: aesthetic thing, mostly 13:29:33 * crc uses quotations extensively, but there are other options; I just like them less :) 13:31:54 which options ? 13:32:43 Not using combinators for flow control, and things like zy]x[yz mentioned 13:33:33 There's an example in the quotations text using return address manipulation 13:56:31 --- quit: GeDaMo (Remote host closed the connection) 13:56:56 In languages as APL, the need for control structures is minimal. Probably it all depend on the abstraction level 13:58:58 --- quit: Mat4 (Quit: Mat4) 14:02:12 It's hard to unleash the full power of quotations in Forth. 14:03:32 What we really want is something like closures, but styled in Forth. 14:04:30 i, personally, have investigated the usefulness of quotations in Forth-like language when I wrote Forpost in the middle of 2000-x. 14:05:52 isn't that what does> gives you - closures?] 14:07:06 It's very interesting to generate code and do program transformations on the fly, but if you have no GC (and variables bindings) you need to do something dangerously resembling of self-modifying code. 14:08:30 does> gives us some limited form of OOP. It's like we have in C with the structures that have some function pointers inside. But in case of Forth we have only on function pointer per word for some reason :) 14:08:52 "only one function pointer" 14:09:16 which is what a closure is 14:09:23 an object with one method 14:11:22 You can emulate objects with closures, but closures are more powerful things. You can do metaprogramming with them. Most of the thing for which some ugly macros are used. 14:12:59 In SICP you can find a number of internal DSLs which are based on closures. 14:14:21 --- quit: gravicappa (Remote host closed the connection) 14:14:47 In Forth-like language with GC you can imitate this by using of concatenation of parameter with quotation, so the new quotation will be build as a result. 14:15:42 --- join: dual (~bonafide@cpe-74-75-153-119.maine.res.rr.com) joined #forth 14:30:05 --- quit: ACE_Recliner (Ping timeout: 258 seconds) 14:30:35 --- join: ACE_Recliner (~ACE_Recli@c-50-165-178-74.hsd1.in.comcast.net) joined #forth 14:36:13 --- quit: ACE_Recliner (Ping timeout: 258 seconds) 14:36:24 --- quit: koz_ (Quit: WeeChat 1.7) 14:36:43 --- join: ACE_Recliner (~ACE_Recli@c-50-165-178-74.hsd1.in.comcast.net) joined #forth 14:38:03 --- join: koz_ (~koz_@121.99.240.58) joined #forth 14:53:01 --- quit: dual (Ping timeout: 260 seconds) 15:07:52 --- quit: true-grue (Read error: Connection reset by peer) 15:25:06 --- quit: John[Lis` (Ping timeout: 255 seconds) 15:40:02 --- join: wa5qjh (~Thunderbi@121.54.90.152) joined #forth 15:47:23 --- quit: nighty-- (Quit: Disappears in a puff of smoke) 15:55:31 --- join: vsg1990 (~vsg1990@static-72-88-80-103.bflony.fios.verizon.net) joined #forth 16:18:49 --- join: John[Lisbeth] (~user@2601:601:8f01:a6a0:5d90:2d7f:a033:7136) joined #forth 16:31:29 --- join: John[Lis` (~user@2601:601:8f01:a6a0:5d90:2d7f:a033:7136) joined #forth 16:35:49 --- quit: John[Lisbeth] (Ping timeout: 258 seconds) 16:41:34 --- quit: John[Lis` (Ping timeout: 258 seconds) 16:44:35 --- join: John[Lisbeth] (~user@2601:601:8f01:a6a0:5d90:2d7f:a033:7136) joined #forth 16:55:48 --- join: dual (~bonafide@cpe-74-75-153-119.maine.res.rr.com) joined #forth 17:03:53 --- join: neceve (~ncv@86.125.247.109) joined #forth 17:03:53 --- quit: neceve (Changing host) 17:03:53 --- join: neceve (~ncv@unaffiliated/neceve) joined #forth 17:36:54 --- join: nighty-- (~nighty@d246113.ppp.asahi-net.or.jp) joined #forth 19:03:56 --- quit: vsg1990 (Read error: Connection reset by peer) 19:04:19 --- join: vsg1990 (~vsg1990@static-72-88-80-103.bflony.fios.verizon.net) joined #forth 19:21:25 --- quit: Zarutian (Quit: Zarutian) 19:26:22 --- quit: vsg1990 (Quit: Leaving) 20:02:47 --- join: John[Lis` (~user@2601:601:8f01:a6a0:5d90:2d7f:a033:7136) joined #forth 20:03:27 --- nick: John[Lis` -> John[Lisbeth]` 20:03:53 --- quit: John[Lisbeth]` (Client Quit) 20:04:32 --- join: John[Lis` (~user@2601:601:8f01:a6a0:5d90:2d7f:a033:7136) joined #forth 20:07:06 --- quit: John[Lisbeth] (Ping timeout: 260 seconds) 20:09:43 --- quit: John[Lis` (Ping timeout: 258 seconds) 20:18:58 --- quit: ACE_Recliner (Ping timeout: 240 seconds) 20:31:23 i think you dont need object simulation, just provide a shadow stack feature 21:01:54 --- quit: neceve (Quit: Konversation terminated!) 21:23:55 --- join: ACE_Recliner (~ACE_Recli@c-50-165-178-74.hsd1.in.comcast.net) joined #forth 23:11:19 holy, so much new words 23:11:46 for me... (I'm low level manager :-D) 23:45:38 --- quit: ACE_Recliner (Remote host closed the connection) 23:59:59 --- log: ended forth/17.04.18