00:00:00 --- log: started forth/08.07.27 00:04:00 --- join: DerDracle (n=jthomas@72-254-127-90.hq.ibahn.com) joined #forth 00:11:56 --- join: ygrek (i=user@gateway/tor/x-5d6c276a2afb8bea) joined #forth 01:51:35 --- quit: ASau (clarke.freenode.net irc.freenode.net) 01:56:16 --- join: qFox (i=C00K13S@234pc222.sshunet.nl) joined #forth 02:05:30 --- quit: qFox (Read error: 104 (Connection reset by peer)) 02:18:21 --- join: qFox (i=C00K13S@234pc222.sshunet.nl) joined #forth 04:31:33 --- nick: _mathrick -> mathrick 05:20:34 --- join: manuel_ (n=manuel@HSI-KBW-082-212-009-082.hsi.kabelbw.de) joined #forth 05:20:45 hi 05:49:59 --- quit: maht (Read error: 104 (Connection reset by peer)) 06:05:12 I like clf! 06:05:14 "This is Forth, not some bondage-and-domination language!" 06:26:16 --- join: maht (n=maht__@85.189.31.174.proweb.managedbroadband.co.uk) joined #forth 07:28:23 --- join: vixey (n=nono@amcant.demon.co.uk) joined #forth 08:41:54 --- join: ecraven (n=nex@78.104.11.116) joined #forth 08:55:50 --- quit: ygrek (Remote closed the connection) 08:58:06 --- join: ygrek (i=user@gateway/tor/x-6cfef1960cfdf839) joined #forth 09:07:16 --- quit: crc () 09:08:39 --- join: crc (n=charlesc@c-68-83-96-46.hsd1.pa.comcast.net) joined #forth 09:11:31 --- quit: ecraven ("bbl") 10:52:28 --- quit: manuel_ () 11:19:20 --- quit: crc ("weather....") 11:40:51 --- join: manuel_ (n=manuel@bigmother.querfunk.de) joined #forth 12:36:55 --- join: iano (n=iosgood@sub26-46.member.dsl-only.net) joined #forth 12:41:38 --- quit: ygrek (Remote closed the connection) 12:45:06 --- join: manuel__ (n=manuel@bigmother.querfunk.de) joined #forth 12:52:07 --- join: Maki_ (n=Maki@adsl-224-84.eunet.yu) joined #forth 13:08:03 --- quit: manuel_ (Read error: 113 (No route to host)) 13:11:21 --- quit: manuel__ (Read error: 113 (No route to host)) 13:59:32 --- quit: tgunr (Remote closed the connection) 14:09:33 --- join: tgunr (n=davec@70-41-252-164.cust.wildblue.net) joined #forth 14:55:50 --- join: BobFunk (n=mathiasc@176.pool85-54-189.dynamic.orange.es) joined #forth 14:57:27 --- quit: zedas (Remote closed the connection) 15:02:12 --- join: zedas (n=zedas@67-207-134-146.slicehost.net) joined #forth 15:24:26 --- join: aum (n=aum@60-234-243-247.bitstream.orcon.net.nz) joined #forth 15:46:00 --- quit: Maki_ ("Leaving") 15:57:31 --- join: tathi (n=josh@pdpc/supporter/bronze/tathi) joined #forth 15:57:31 --- mode: ChanServ set +o tathi 16:03:40 --- join: aguai (n=aguai@122-116-183-8.HINET-IP.hinet.net) joined #forth 16:07:19 --- join: manuel_ (n=manuel@HSI-KBW-082-212-009-082.hsi.kabelbw.de) joined #forth 16:19:06 --- quit: tgunr ("Bye!") 16:19:20 --- join: tgunr (n=davec@70-41-252-164.cust.wildblue.net) joined #forth 16:42:40 --- part: BobFunk left #forth 17:31:39 --- join: JasonWoof (n=jason@c-65-96-161-30.hsd1.ma.comcast.net) joined #forth 17:31:39 --- mode: ChanServ set +o JasonWoof 17:31:43 --- quit: qFox ("Time for cookies!") 18:01:03 --- quit: tathi ("leaving") 18:01:06 --- join: craigoz (n=craigo@202.63.56.72) joined #forth 19:24:47 refactoring, refactoring, @$#%*# refactoring... 19:26:15 --- join: crc (n=charlesc@c-68-83-96-46.hsd1.pa.comcast.net) joined #forth 19:26:48 --- mode: ChanServ set +o crc 19:27:28 hi crc 19:27:40 hi aum 19:27:45 its fun! 19:28:00 totally b0rk3n at the moment 19:28:23 do you have unit tetss? 19:28:53 unit tests dont' help too much when the vm segfaults on startup :P 19:29:09 why not? you can unit test your C code 19:29:33 and if each part of the VM can be tested in isolation of the others, narrow down such problems quickly 19:30:42 i'm binary-searching through the load sequence, narrowing it down 19:31:07 seems things don't work too good when char* vars have value 0x0 19:31:21 memcpy() prefers not to copy stuff to address 0x0 19:32:54 --- quit: JasonWoof (Read error: 110 (Connection timed out)) 19:33:10 heh 19:33:45 i broke the attribute setting code in my oo engine 19:34:30 * aum finds the offending word and fires up his Forth debugger 19:39:45 ahh, found the broken primitive 19:56:51 --- join: JasonWoof (n=jason@c-65-96-161-30.hsd1.ma.comcast.net) joined #forth 19:56:51 --- mode: ChanServ set +o JasonWoof 19:56:56 hmm, with C functions that return a string value, it helps to have a 'return' statement at the end :P 19:58:04 why did some forths have C code in there? 19:58:08 and not assembly? 19:58:13 enable gcc warnings, aum 19:58:17 it will catch this mistake 19:58:30 vixey: a desire to minimize cpu-specific parts, perhaps 19:58:31 slava: you're right, but when I'm coding impatiently i get a bit numb to warnings 19:58:44 aum: -Werror will change that :) 19:59:03 vixey: portability - assembly hog-ties you to one CPU, while C is 'semi-portable assembler', 19:59:12 slava: good idea 19:59:34 only problem is that I have one C++ module that barfs a zillion 'deprecated conversion of string constant to char*' warnings 19:59:57 gcc has gone in a weird direction lately - seems "Hello, world" is no longer a char* 19:59:58 then fix those 20:00:07 its a const char* 20:00:50 * aum started with K&R C 24 years ago, doesn't use 'const' much 20:04:05 const is your friend 20:04:55 I got an idea for my forth program 20:05:18 I can take the QUIT loop and add in stuff to that 20:09:29 -Werror is one strict mofo 20:13:37 aum: sometimes very helpful, usually quite annoying :) 20:14:00 would probably save time in the long run 20:14:16 makes me wonder if the typing stuff is really worth it. I think I'd be happier if there was one one type of pointer 20:14:32 i disagreew ith some design decisions in C for sure 20:14:39 or, I should say that pointers would cast to other types of pointers automatically, no need to explicitly cast them 20:14:43 but when I'm coding C, I try not to fight it and just figure out a way to express my code in a way that fits well with C 20:14:48 it saves effort in the long run 20:14:50 K&R C is a classical jewel 20:15:07 sure, I think it's worth getting rid of all the warnings -Werror is cool 20:15:20 I just wish I didn't have to paste in so many pointer casts 20:15:33 gets worse when compiling C++ code 20:16:08 the fact that void* exists shows that even the creatiors of C realized that the difference between pointer types doesn't always matter 20:16:35 I've got source files which contain forth words and C++ code words, and a compiler which turns it into a C++ source file - it's amazing the trivial shit that gcc comes up with when compiling C++ 20:16:40 oh don't get me started on C++. I'm working on a C++ project right now, syntax gets pretty rediculous 20:16:57 I don't want to get depressed about it until I've finished adding the feature I want gnash to have 20:17:28 * iano is very very happy that he doesn't have to maintain C++ code any more :) 20:17:42 C++ is pretty ridiculous - started out as some nice OO extensions to C, but went off into la-la land, kinda like evolving a 2-bedroom bungalow into a 20-storey office block 20:18:04 I'd like to see a 'C++ lite' language 20:18:41 My Forth project tonight is helping Marcel Hendrix debug my chess program on his spanking new iForth64. 20:19:23 interesting stuff 20:19:34 dealing with 32- to 64-bit cell size problems 20:20:10 I deal with cell size issues by defining a cell as a union of all the basic C types, from char to long, pointer, float 20:20:31 so my forth should work transparently on 16, 32 and 64-bit 20:20:40 but then each cell is the size of a float? 20:20:58 C++ is a deadly weapon if you use it effectively 20:21:04 no - each cell is the size of max(sizeof(int), sizeof(long), sizeof(void*), sizeof(float)) 20:21:11 templates let you write very high-level code without any perforamnce penalty at runtime 20:21:15 but i agree, its kind of unweildy 20:21:52 I used to call that an "unfubbie" (union { float; unsigned; bool; int }) 20:21:58 templates are ok i guess 20:22:25 my biggest gripe with forth is the lack of standardised features for managing high-level data structures 20:22:48 aum: they're working on a standard struct vocabulary for the 200x standard 20:23:33 agreed, that and the lack of standard array syntax were some of my first stumbling blocks coming from C 20:25:02 gforth's struct stores field names in global view :( 20:25:41 oh, you want *scoping* too? try one of the object systems instead 20:26:05 naah, I've written my own OO system 20:26:48 kinda like a drunken one-night-stand between Python and Javascript 20:29:17 but it works, feels good to use, and is very flexible 20:39:43 aum: I believe there is at least one "C++ lite" type thing. iirc there's one called C-- :) 20:40:50 isn't c-- lower-level than C? 20:41:07 C-- is a target language for compilers 20:41:13 and its pretty much been superceded by llvm 20:41:21 oop, I'm wrong 20:41:31 forth is a great target language for compilers 20:41:41 C-- is an intermediate language between what the programmers write and assembly 20:41:51 k 20:42:28 * aum hugs his forth debugger 20:43:09 are there any small compilers which output forth which I could look at ? 20:43:48 i think outputting forth is pretty rare 20:44:08 stack-based vms are used pretty frequently, but they tend to differ from forth in important respects 20:45:33 it would only take an evening to write a C to Forth compiler in Python using PLY 20:46:08 there is the new traceable JavaScript VM, which compiles JavaScript to a Forth-like intermediate language 20:46:16 yes 20:46:19 tamarin-tracing 20:46:24 aum: what about a language like C but that allows multiple returns? 20:46:26 Python's bytecode is forth-ish 20:46:33 so is javas 20:46:36 but stack vm != forth 20:46:54 slava: what are the importart differences? 20:47:04 vixey: that would totally rule, but then, there's the garbage problem 20:47:26 aum: I haven't heard of that, what is it ? 20:48:26 vixey: C is based on the idea of handling primitive data types, because they can be trafficked through CPU registers - if a language supports returning n values, the memory has to be dynamically allocated from somewhere, and that leads to management issues 20:48:42 uh, that's not true 20:48:54 C already supports multiple return values -- you can return a struct 20:49:05 there's no memory management there, its allocated on the stack by the caller and the callee receives the address 20:49:06 can you return massive structs? 20:49:10 sure 20:49:52 call me retro, but I'm still getting used to this 'pass/return structs by value' thing 20:49:56 its no different from passing a struct as a parameter 20:50:20 I coded for years using compilers that would barf if one attempted to return, assign or pass structs (rather than pointers to struct) 20:50:32 so they werent ansi c 20:50:38 k&r 20:50:57 the first ansi C compilers only supported passing/returning/assigning small structs 20:51:15 that was back in the late 1980s 20:57:57 i'm working on a new optimizer phase for my compiler 20:58:00 : optimize-tree ( nodes -- newnodes ) normalize compute-copy-equiv propagate cleanup compute-def-use unbox-tuples compute-def-use remove-dead-code strength-reduce detect-loops fuse-branches elaborate ; 20:59:22 * aum runs and hides 20:59:46 * aum has yet to implement tail-call 21:00:08 i'm overhauling the whole compiler 21:00:12 it started as just a new codegen 21:00:22 but then i put that aside and decided to redo the frontend and optimizer 21:01:09 6925 lines of code so far, its about half-done 21:02:35 wow 21:02:43 slava: I'm looking forward to more Factor code in the Shootout and Rosetta Code 21:03:01 iano: factor will be in the shootout when the new compiler is done 21:03:02 hey what does an abstract syntax tree look like in forth? 21:03:17 iano: i didn't want to add it until i can beat gforth and bigforth 21:03:18 vixey: is there such a thing as an AST in forth? 21:03:26 I don't know 21:03:32 factor's ASTs are sequences of words and literals 21:03:34 sorry I am really new to forth .. 21:03:47 : foo 3 * 4 / ; -- that's 4 'things 21:03:47 vixey: the whole concept of forth is that there are only 2 states - compile and interpret - and all compilation is done on the fly 21:04:04 the closest thing to an AST in forth is the content of the data stack at compile-time 21:04:07 you can't do any optimization with a one-pass compiler though :) 21:04:24 you can do tail-call though 21:04:38 ok, but that's really trivial 21:05:02 and you can do trivial factorings - eg you could factorise '2 3 +' to '5' 21:05:18 i can turn 2 >r foo r> 3 + into foo 5 :-) 21:05:45 that's nice going :) 21:05:52 good heuristics 21:06:48 what about tail-call? 21:07:04 dup 10 <= [ dup 10 >= [ 3 * ] [ ... ] if ] [ ... ] if 21:07:12 aum: in the above, the 3 * becomes drop 30 21:07:30 aum: i do a lot of things like that after inlining as much as makes sense 21:07:37 slava: does your compiler build an AST ? 21:07:51 the effect is that general code becomes efficient if you don't actually use the full generality all the time 21:08:26 you use the recurse word to do recursion 21:08:40 and what is a tail call optimization in forth? 21:08:41 aum: i have two intermediate representations 21:09:07 vixey: tail call in forth is where the last instruction in a word definition is a call to another word 21:09:08 aum: both are SSA 21:09:12 eg: 21:09:18 : foo ... do stuff ... ; 21:09:26 aum: factor code is converted into high-level SSA, optimized, then converted into low-level SSA, optimized more, then code generation occurs 21:09:26 : bar ... do stuff ... foo ; 21:09:27 but why is it optimized? 21:09:29 --- quit: manuel_ () 21:09:47 vixey: in the above, 'bar' compiles to: 21:09:58 ... do stuff ... call(foo) return 21:10:14 so the optimisation is to change the 'call(foo) return' to 'jump(foo)' 21:10:23 aum: another example, if i have 5 [ "Hi" print ] times 21:10:30 aum: then if this was forth, times would be a word taking an XT 21:10:30 oh I see 21:10:35 which loops and calls the XT 21:10:38 vixey: that saves a needless pushing of the IP onto the return stack then popping it off again 21:10:40 an indirect jump on each iteration 21:10:48 cool I get it 21:10:51 thank you 21:10:52 :) 21:10:54 np 21:11:01 aum: but factor's compiler inlines the 'times', and notices that the indirect call always receives the constnat [ "hi" print ] on the stack 21:11:17 aum: so it inlines it right there, converting it into a loop 21:11:22 without an indirect jump 21:11:26 slava: sounds like factor is only a few months from becoming self-aware :) 21:11:39 the new optimizer will do better register allocation too 21:11:43 so the loop counter will end up in a register 21:12:24 so i'm going to have programs in the shootout at the same level of abstraction as python but they will beat bigforth 21:12:33 all that makes me speculate on the possibilities of genetic algorithms/programming for optimisation 21:12:45 aum: all i'm doing is standard compiler techniques 21:13:04 nothing that C, Lisp or ML compilers don't do 21:13:53 k 21:14:10 i'm especially looking forward to cooking every other forth on floating point numerics 21:14:36 marcel hendrix should add iforth to the shootout so that he can lose to factor in a few months :) 21:15:11 :) 21:15:36 aum: heres another fun example 21:15:45 dup 10 < swap -10 > and [ 100 mod ] when 21:15:54 s/swap/over/ 21:16:13 factor knows the value is between -10..10 and so the mod is redundant and can be deleted 21:16:20 nice 21:16:33 and your optimisation is all written in factor? 21:16:46 yes 21:17:11 the unfinished compiler source is at http://factorcode.org/responder/cgi/gitweb.cgi?p=factor.git;a=tree;f=unfinished/compiler;hb=HEAD 21:17:34 eek, my OO module has grown to 1500 lines of mixed forth/c 21:18:29 my object system is 1966 lines of code 21:35:35 --- join: hml (n=x@unaffiliated/hml) joined #forth 21:35:42 is thinking in forth a good starting point for forth? 21:38:08 no 21:38:11 "starting forth" 21:38:23 "thinking forth" is philosophy for experienced forthers 21:38:26 read "starting forth" 21:38:51 great intro 21:38:58 outdated in some ways, but a great intro 21:39:17 and here's the important thing: run a forth and try the examples and experiment as you go 21:39:32 gforth works well for this 21:39:36 --- quit: JasonWoof ("off to bed") 21:53:54 arquebus: No that's not true 21:54:02 oh sorry...... 21:54:06 this is not where I meant to type 21:55:46 --- quit: proteusguy (Remote closed the connection) 21:56:32 --- join: proteusguy (n=proteusg@61.7.144.97) joined #forth 22:03:47 ahh, after a refactor and no more than 25 segfaults, my OO is running cleaner/faster now :) 22:14:43 --- quit: DerDracle (Connection timed out) 22:21:01 --- quit: vixey () 22:22:31 does 'lines of code' more often mean the number of lines of text in the source file, or the number of lines of actual code (excluding comments, empty lines etc)? 22:25:22 depends who you want to impress :) 22:25:53 sometimes more lines of code impresses, sometimes less lines 22:26:21 mind you, the average width of a line of code is increasing these days as more folks use widescreen monitors :P 22:26:37 I try to stay at 80 chars max/line, but it's tough 22:28:17 and with my forth code, I tend to lay things out as indented blocks instead of all on one line 22:37:30 I thought it was the proliferation of object oriented design patterns that led to >80 column code 22:37:46 I try not to breach 60; usually it's not that difficult 22:37:53 i don't see what OOP has to do with line length 22:37:59 4-char indenting helps 22:38:27 slava: AbstractContainerFactory->MethodGetter->Invoke(MagicalFropMachine->Foo->bar()) 22:39:02 not OOP as such, but enterprisey style buzzword-compliant coding conventions 22:39:03 if your code has long identifier names or deeply nested expressions, surely you can jus break them up over multiple lines to avoid long lines if necessary 22:39:17 ironically, most enterprisey people don't do OOP right 22:39:20 that's how I do it :-) 22:39:32 of course not .. enterprisey people thrive on doing things wrong 22:42:06 java code tends to have a lot of indirection not because of OOP, but because its written in a style where individual components depend on each other as little as possible, allowing large teams to work on the same codebase by having each programmer specialize on a single component without worrying too much about what other people are chaging 22:49:03 --- join: DerDracle (n=jthomas@72-254-127-90.hq.ibahn.com) joined #forth 23:18:31 --- join: manuel_ (n=manuel@82.212.9.82) joined #forth 23:19:54 as they say, the amount of work will grow to consume all available resources 23:20:37 i can imagine java folks creating silly useless abstraction classes just for the hell of it, then they can get out of their cubicles into a conference room and argue for a few hours over who has the wankiest abstraction class 23:21:24 just like the forth guys make their own silly forths for the hell of it :-) 23:29:17 hehe 23:30:12 but in my defense, I will say that my forth has some unique feature combinations that would make it a forth of choice in many scenarios 23:31:42 for one thing, the speed and ease of adding C primitives is something I haven't seen in other forths 23:32:17 I added 20 primitives last night - average time taken to code/debug them was about 45secs each 23:34:31 how many primitives do you have? 23:34:59 2.5 screenfuls 23:35:23 prolly around 350 23:35:30 wow 23:35:36 factor has 182 23:35:57 about 20 are in asesmbly, the rest in C 23:36:13 i'll reimplement a lot of these primitives in forth once aumForth stabilises 23:36:35 especially the compiling words, that aren't as performance-critical 23:37:01 --- join: ecraven (n=nex@140.78.42.101) joined #forth 23:37:03 a lot of my primitives are wraps for 3rd party libs, eg libdl, libscl, libbstrlib 23:37:14 i use an ffi for that 23:37:39 slava: you mentioned that before - you've implemented ffi for n platforms 23:37:58 i've done most of the ANS core, and a few of the ANS add-ons 23:38:48 it's somewhat inspired by FICL - with the ability to easily embed it as a scripting engine into other C applications 23:39:53 there's only 11 deep-core primitives 23:40:23 --- join: ygrek (i=user@gateway/tor/x-e5a911e193053dcb) joined #forth 23:41:13 bbl 23:59:59 --- log: ended forth/08.07.27