00:00:00 --- log: started forth/08.07.18 00:03:48 got locals in the return stack, now gotta figure out how to support access to them within do/loop 00:04:32 nice 00:04:37 i'm making my compiler compile faster 00:05:37 oh hang on, that's easy, cos I'm restricting locals so they can only be declared outside of control structures 00:05:49 hmm 00:06:06 { 1 2 3 } [| i | i . ] each 00:06:13 stuff like this is nice 00:06:23 although i'm not sure if its really necessary when you have a fixed set of control structures as in forth 00:08:32 does factor facilitate creating one's own control structures? 00:10:29 yes, you can pass blocks of code to otherw ords 00:10:44 k 00:10:47 and blocks of code can be composed to form new blocks 00:10:49 or called 00:11:12 there is a primitive conditional if 00:11:16 but no primitive looping 00:11:34 all looping eventually bottoms out as a recursive word 00:12:09 doesn't that eat a ton of stack? 00:13:04 the last call in a word compiles as a jump 00:13:13 so if the recursion is tail recursion it uses constant stack space 00:13:22 if the recursion is non-tail recursion then that's not something you can express with a loop anyway :) 00:13:35 fair nuff :) 00:13:46 * aum gets locals access within loops working 00:13:59 :: foo ( a b -- c ) a b + ; 00:14:01 that's my locals syntax 00:14:19 fiar nuff 00:14:25 :: foo ( a -- q ) [ a + ] ; 00:14:29 i've gone for the ugly ANS syntax: 00:14:31 this pushes a function on the stack 00:14:39 which adds a to the top of the stack when you call the funciton 00:14:47 : foo locals| a b| a b + ; 00:15:10 or, more correctly 00:15:16 : foo locals| b a| a b + ; 00:15:22 are your locals mutable or immutable? 00:15:39 presently immutable, until I add a coupla lines of code to my 'to' primitive 00:16:00 i allow mutable locals but you have to declare them as such 00:16:08 locals are moderately costly 00:16:10 :: foo ( a! -- b ) a 1+ a! a ; 00:16:21 mine compile to the same code as you'd get with using the stack 00:16:33 and vice versa 00:16:39 so there's no performance cost 00:16:41 with immutable locals 00:16:44 mutable locals are slow right now 00:16:58 have you thought of doing a 'micro-factor'? 00:17:06 not seriously 00:17:12 or refactoring factor so it can be built amazingly tiny? 00:17:17 i don't see a use-case 00:17:29 a dynamically typed language needs an optimizing compiler to be useful 00:17:34 and optimizing compilers are big and use memory 00:19:01 i disagree that an optimising compiler is needed to be useful 00:19:29 well, as far as i'm concerned, python, ruby, lua, etc aren't fast enough for what I want to do 00:19:50 they can be pretty sluggish 00:20:08 but python has a choice of shedskin or cython for revving it up 00:20:19 fair enough -- not that there's nothing that can be usefully done in such slow languages. 80% of the software I use is far from efficient 00:21:17 aum: those aren't really dynamic though 00:21:43 well, dynamism * speed = a constant 00:21:50 i disagree 00:22:07 maybe dynamism * speed / complexity = a constant 00:22:23 might be more accurate 00:22:27 --- quit: ramkrsna (Remote closed the connection) 00:22:30 i'm working on a compiler overhaul right now 00:22:31 dynamism has a huge book-keeping overhead 00:22:41 i'm pretty sure when its done i'll beat gforth and bigforth on all of the shootout benchmarks 00:22:51 wow, that'd be quick 00:23:00 gforth cheats a lot with assembler tho 00:23:05 well, gforth and bigforth are not very dynamic 00:23:15 but they're also implemented in a very simplistic manner 00:23:24 so they pick extreme simplicity over speed 00:23:27 which is fine 00:24:16 actually, i take that back 00:24:21 gforth and bigforth are not 'simple' 00:24:25 because the code is messy 00:24:34 they're simple in function, not form, perhaps 00:24:43 that's one thing I'm fighting for in aumForth - ultra-clean code 00:24:49 that's good 00:24:56 the engine is well south of 1k lines of C 00:25:02 that's nice 00:25:08 and that's including all the API utilities 00:25:15 the engine only has 6 primitives 00:25:20 heh 00:25:25 the rest is done with add-ons 00:25:36 addons in C or Forth? 00:25:40 both 00:26:05 i have a parser which compiles forth to C - and the forth syntax has C statements in the 'code' words 00:26:27 any forth in such files gets packed into a big string and executed on startup as softcode 00:26:54 why not actually copile the forth to C? 00:26:56 i haven't gone anywhere near the issue of image construction and relocation - feels pretty hard at the moment 00:27:21 problem is that the compiler is presently written in python, so it's not forth-smart 00:27:48 when i port the compiler to forth, it'll be forth-smart enough to compile the forth in sysgen scripts into STC C funcs 00:27:53 ok 00:27:56 you can do bette than that 00:28:00 compile static stack usage into C locals 00:28:13 true 00:28:55 man, if I had a $ for every segfault I've seen while building/debugging aumForth 00:29:14 having a good test suite helps 00:29:27 ur right 00:30:31 one weird feature of aumForth - in the console, if you type a line where the first word isn't in the vocab, but is in the system PATH, it executes the line as a shell command 00:30:36 heh 00:30:52 guess I should rename the console as 'fsh' 00:32:26 man i hate it when a bug creams out the stack and messes up the backtrace 00:33:31 that's why memory-safe languages are nice 00:34:55 * aum sends another bug to the segfault mausoleum 00:34:58 bbiab 00:45:24 --- join: ygrek (i=user@gateway/tor/x-18bce6f3799aac4d) joined #forth 01:14:13 back 01:59:44 --- quit: nighty__ (Read error: 110 (Connection timed out)) 02:11:49 --- quit: ASau` (Read error: 110 (Connection timed out)) 02:45:44 --- quit: ecraven ("bbl") 03:19:15 --- quit: aum ("Leaving") 03:27:56 --- quit: ygrek (Remote closed the connection) 04:09:13 --- join: ygrek (i=user@gateway/tor/x-320ae144aa36d8dc) joined #forth 05:33:03 --- join: proteusguy (n=proteusg@61.7.144.97) joined #forth 06:09:16 --- quit: ygrek (Remote closed the connection) 06:35:24 --- join: ygrek (i=user@gateway/tor/x-8d04184578b6a04a) joined #forth 08:04:37 --- quit: DerDracle (Read error: 54 (Connection reset by peer)) 08:06:57 --- join: DerDracle (n=jthomas@72-254-127-90.hq.ibahn.com) joined #forth 08:07:51 --- quit: ygrek (Remote closed the connection) 08:19:12 --- join: ecraven (n=nex@78.104.23.66) joined #forth 08:55:14 --- join: forther (n=forther@c-24-5-187-203.hsd1.ca.comcast.net) joined #forth 08:57:09 --- quit: forther (Client Quit) 08:59:57 --- join: dlowe (n=dlowe@ita4fw1.itasoftware.com) joined #forth 09:00:12 could someone help me with gforth's >number? 09:01:39 dlowe: I'll try 09:01:46 dlowe: whacha doin? 09:01:47 the signature from the doc is ud1 c-addr1 u1 -- ud2 c-addr2 u2, where the resulting value is in ud2 09:01:47 but 0 s" 5" >number .s <3> 1 6491857 0 ok 09:01:47 and 0 0 s" 5" >number .s <4> 5 0 6491889 0 ok 09:01:53 --- join: craigoz (n=craigo@202.63.56.72) joined #forth 09:01:55 trying to convert user input into a number :p 09:02:45 what's ud1? 09:03:18 Attempt to convert the character string c-addr1 u1 to an unsigned number in the current number base. The double ud1 accumulates the result of the conversion to form ud2. 09:03:34 so I figure, ud2 = the number in the string + ud1 09:03:52 oh. "double" means use two stack elements to hold the number 09:04:04 oooh. I thought it was double precision float 09:04:22 I'm surprised it didn't error, then 09:04:37 gforth doesn't check underflows real carefully 09:04:48 thanks a bunch 09:07:18 np 09:21:49 dlowe: 0 0 s" 5" >number 2drop d. 09:36:28 --- join: fwiffo (n=user@unaffiliated/fwiffo) joined #forth 09:53:38 is there any way to make this shorter? http://www.pastebin.ca/1075686 10:05:21 --- join: Quartus` (n=Quartus`@205.205.50.1) joined #forth 10:13:00 why do s" ..." type instead of ." ...." 10:13:26 any place i see s" i shudder 10:14:21 --- quit: dlowe (Read error: 104 (Connection reset by peer)) 10:42:05 --- join: dlow1 (n=dlowe@ita4fw1.itasoftware.com) joined #forth 10:54:02 --- nick: dlow1 -> dlowe 11:07:00 mark4: so you can pass it to other words 11:07:19 nice for testing parsing w ords like above 11:25:52 --- join: fwiffo` (n=user@201.80.209.120) joined #forth 11:30:23 --- join: ick_ (n=Anna@zonnebloem.demon.nl) joined #forth 11:30:34 --- quit: ick_ (Client Quit) 11:30:53 --- join: ick (n=Anna@zonnebloem.demon.nl) joined #forth 11:31:52 Did anyone implement call/cc in Forth? 11:34:45 And more simple: how do I push 200,000 on the stack in gforth? 11:35:32 I get undefined word for 200,000 although it should work according to the starting forth tutorial. 11:37:49 lose the , 11:37:56 200000 11:38:26 Why does the starting forth tutorial suggest it? 11:38:42 what's it say? 11:38:53 200,000 3 1 M*/ D. 11:38:55 if you want to make it more readable, you can define 200,000 11:38:58 That should work for example. 11:39:07 dunno 11:39:26 I never learned the stuff with multi-cell math 11:44:18 --- quit: fwiffo (Read error: 110 (Connection timed out)) 11:52:59 on some older systems, , and . can be used interchangeably to denote a ouble-cell value 11:53:04 double 11:56:21 How do I denote 1e9 as a double? 11:56:54 Or 3,14 12:05:44 You're thinking 'double' refers to floats -- it doesn't. It means a two-cell integer on the stack. 12:07:25 Er, I meant float. 12:09:44 How do I put the float 3.14 on the top of the parameter stack? 12:10:29 --- join: fwiffo`` (n=user@201.80.209.120) joined #forth 12:19:31 floats are usually on their own stack. 12:19:45 3.14e 12:20:07 the e denotes a float, and can be followed by an exponent 12:21:00 --- join: ygrek (i=user@gateway/tor/x-9cb5d6ef539e7ddb) joined #forth 12:25:21 How can I see all stacks? I know there is a param. stack, and a return stack (and that some Forths had a float stack(but no idea of how to get to one). 12:29:20 --- quit: fwiffo` (Read error: 110 (Connection timed out)) 12:31:53 --- join: Maki_ (n=Maki@adsl-224-84.eunet.yu) joined #forth 12:33:07 I found the float stack already. 12:37:36 That is, the top, not something like showstack. 12:38:46 there's sometimes a .fs to display the float stack. .s shows the parameter stack. 12:39:10 showstack is a pforth specific thing I guess. 12:39:21 I was aware of .s. Thanks. 12:39:47 There is no .fs in gforth. 12:41:32 There is a fs., but it doesn something else. 12:42:20 does* 12:43:03 ick: I think it's f.s 12:46:04 JasonWoof: you are right. 12:46:40 This is rather confusing. 12:47:16 Or is it behaviour defined in some standard? 12:47:42 basically, to work with the float stack, you just put f before the normal words 12:47:48 fdup fdrop f. etc 12:54:36 --- quit: ick ("leaving") 13:10:53 --- quit: fwiffo`` (Remote closed the connection) 13:11:14 --- quit: dlowe ("*poof*") 13:11:26 is there some short description of the way you define words for forth? like >MOVE or (CREATE) and weirdo things like that... 13:11:46 what do the ()'s mean, and >foo vs. foo> etc... 13:13:55 brb, rebooting emacs 13:14:01 --- quit: ams (Remote closed the connection) 13:14:27 --- join: ams (i=ams@gnu/inetutils/ams) joined #forth 13:22:09 --- join: Astrobe (n=chatzill@ARouen-156-1-141-50.w90-51.abo.wanadoo.fr) joined #forth 13:33:10 ams: > is used to indicate moveing/placing something 13:33:22 ams: eg >r means move to r. and r> means move from r 13:33:30 (r being return stack in this case) 13:33:45 : foo ( this is a comment) bar ; 13:34:26 definition of function foo that adds one and two and prints the result: : foo 1 2 + . ; 13:37:36 --- quit: ygrek (Remote closed the connection) 13:38:35 there's a Standard document, linked in the topic 15:32:41 --- mode: ChanServ set +o crc 15:44:39 --- quit: Astrobe ("ChatZilla 0.9.83 [Firefox 3.0.1/2008070208]") 15:46:12 --- quit: Maki_ ("Leaving") 15:54:54 --- quit: crc (Remote closed the connection) 15:55:12 --- join: charleschilders (n=charlesc@c-68-83-96-46.hsd1.pa.comcast.net) joined #forth 16:02:26 --- quit: charleschilders () 16:04:42 --- quit: ecraven ("bbl") 16:13:27 --- join: ASau` (n=user@79.111.35.66) joined #forth 16:30:06 --- quit: qFox ("Time for cookies!") 16:30:36 --- quit: ASau` (Remote closed the connection) 16:30:55 --- join: ASau` (n=user@79.111.35.66) joined #forth 16:51:09 --- join: nighty__ (n=nighty@x122091.ppp.asahi-net.or.jp) joined #forth 16:52:32 --- quit: craigoz ("Leaving.") 17:04:08 --- join: fwiffo (i=none@unaffiliated/fwiffo) joined #forth 17:13:11 --- quit: nighty^ (Connection timed out) 17:36:32 --- quit: ASau` (Read error: 110 (Connection timed out)) 18:44:33 --- join: aum (n=aum@60-234-243-247.bitstream.orcon.net.nz) joined #forth 21:49:44 --- join: fwiffo` (i=none@201.80.226.4) joined #forth 22:07:45 --- quit: fwiffo (Read error: 110 (Connection timed out)) 22:23:45 --- join: ygrek (i=user@gateway/tor/x-78016b7b2711a025) joined #forth 23:59:59 --- log: ended forth/08.07.18