←2005-07-23 2005-07-24 2005-07-25→ ↑2005 ↑all
00:03:47 -!- Aardwolf has quit ("Leaving").
00:07:26 <GregorR> 5114
00:07:29 <GregorR> COME ON, BREAK 5000!!!
00:14:57 <graue> so it's already complete and working?
00:17:16 <GregorR> Huh?
00:19:26 <graue> what are you talking about?
00:19:35 <graue> you're shrinking the size of your checkers program, right?
00:22:30 <jix> my bf interpreter/compiler test-suite-scripts are done
00:23:00 <jix> it runs on a 99% cpu idle box with nice -20
00:23:11 <jix> 400mhz intel celeren
00:23:13 <jix> celeron
00:23:26 <jix> now name interpreters / compilers to add!
00:23:34 <GregorR> Heheh.
00:23:44 <GregorR> No, I'm compressing the first 5 lines of the King James Bible.
00:23:47 <GregorR> Not for any good reason.
00:24:14 <GregorR> jix: egobfi :P
00:24:18 <GregorR> jix: qdb
00:24:36 <GregorR> jix: bff, bftools, brfd, yabfi2
00:25:29 <jix> afbi is the only interpreter i added atm
00:25:38 <jix> i'm going to add the other ones
00:25:41 <GregorR> And the only one I haven't listed :P
00:25:52 <jix> GregorR: hmm do you know afbi?
00:26:14 <GregorR> Not personally, would you mind introducing us? ;)
00:26:22 <jix> the interpreter
00:26:27 <GregorR> Yeah, I know.
00:26:41 <jix> http://www.harderweb.de/jix/langs/brainfuck/afbi.c
00:26:56 <jix> i wrote it for pgimeno's brainfuck interpreter speed-test
00:27:16 <jix> it's faster than brfd on ppc but slower on pgimeno's computer
00:30:34 <GregorR> lol
00:30:37 * GregorR compares it to egobfi
00:34:10 <GregorR> It would appear that I'm afbi-incompetent >_>
00:35:28 <GregorR> When I run it against mandelbrot.b, it drags my CPU into the mud and doesn't seem to do anything ...
00:35:32 <GregorR> Oh wait, it segfaulted.
00:35:57 * GregorR is perplexed.
00:38:13 <jix> hrmg
00:38:51 <jix> afbi has some problems with reallocating and computed gotos
00:43:30 <GregorR> I assume Mandelbrot works for you?
00:44:39 <graue> jix: obi2, wib, pibfi, awib
00:45:10 <graue> jix: this javascript interpreter: http://www.esolangs.org/svn/esofiles/brainfuck/impl/di.html
00:45:31 <GregorR> Umm, isn't wib a compiler?
00:45:35 <GregorR> And awib?
00:45:43 <GregorR> Or was he looking for compilers?
00:45:52 <graue> jix: this longer javascript interpreter: http://www.esolangs.org/svn/esofiles/brainfuck/impl/i.html
00:46:16 <GregorR> jix: If you do test both, please clearly mark them - obviously compilers will generally be faster.
00:46:41 <graue> jix: this interpreter in ORK: http://www.esolangs.org/files/ork/src/orkfuck.ork
00:46:58 <graue> jix: this interpreter in Kipple: http://www.esolangs.org/files/kipple/src/bfi.k
00:47:26 <GregorR> I can't believe I didn't mention orkfuck XD
00:48:00 <jix> GregorR: i will mark them
00:48:14 <GregorR> OK, good :)
00:48:41 <jix> hmm interpreters with program/input in one file arn't supported yet
00:48:53 <jix> uhm... they are..
00:49:05 <jix> i have InterpreterSetup.prepare
00:54:17 <GregorR> BTW jix, what are your tests?
00:54:35 <jix> helloworld & mandelbrot atm
00:54:39 <jix> but i'm going to add more
00:54:47 <GregorR> I would recommend adding primes-up-to-200.
00:55:03 <GregorR> Merely because for some inexplicable reason, egobfi beats qdb with it, but not with mandelbrot :P
00:56:52 <graue> for compilers, you could also produce a second series of results, with the time taken to compile factored in
00:57:23 <jix> graue: i could.. if i rewrite my whole test-code
00:57:37 <graue> just a thought
00:57:38 <GregorR> OH! And also, you should be VERY careful to compile all the compilers with the same optimizations.
00:57:53 <GregorR> Some will default to -O3, some will default to -O0, they should all use -O2 for fairness.
00:57:53 <jix> GregorR: and interpreters too
00:58:02 <GregorR> Err, s/compilers/interpreters/
00:58:03 <jix> all -O3 or?
00:58:09 <GregorR> -O3 breaks some things.
00:58:12 <jix> yes?
00:58:14 <GregorR> So I'd lean towards -O2.
00:58:24 <jix> ok
00:58:27 <GregorR> Most things don't break with -O2.
00:58:35 <jix> is egobfi default -O2?
00:58:41 <GregorR> Yes
00:59:02 <graue> make sure you compile Erlang, Ruby, and the JavaScript interpreter you use with -O2 as well
01:00:45 <jix> yes
01:01:02 <GregorR> If there's any interpreted interpreter that's actually FASTER than a C interpreter, I will be blown away.
01:01:51 <jix> optimizing interpreted interpreter vs unoptimized c interpreter?
01:02:14 <GregorR> Hmmmmmmmmmmmmmmmm, then it might get close.
01:02:22 <GregorR> I guess it would depend on the interpreter of the interpreter.
01:03:10 <jix> theres a bug in my test-code
01:03:33 <GregorR> See, nobody's seen it yet, so you didn't need to tell anybody, and we would have never thought you were capable of writing bugs ;)
01:07:04 <jix> if i run the command manually it works
01:07:09 <jix> but from the script it doesnt
01:07:31 <GregorR> What's the command, what's the language, how are you calling it?
01:08:42 <jix> it's ruby i use system and the command is nice -n -20 sudo -u jannis time -o /tmp/to -f "%e %S" ./qdb /home/jannis/interpretertest/b/helloworld.b > /home/jannis/interpretertest/b/helloworld.out.cmp 2>/dev/null
01:08:53 <jix> uhh %U where underline starts
01:09:36 <GregorR> Well, for one, there's no reason to run it through sudo, that will only effect the real time, not the user/system time (which are the only valuable ones)
01:09:50 <GregorR> It may be that sudo wants a password there, and can't possibly get one.
01:09:57 <jix> GregorR: nonono
01:10:06 <jix> i start the script as root because i want to nice it
01:10:08 <GregorR> Err, nice rather.
01:10:18 <GregorR> Sorry, I meant "there's no reason to nice it there"
01:10:18 <jix> but i don't want the interpreter as root
01:10:22 <jix> ok
01:10:42 <GregorR> Because nice would only effect real time, which is irrelevent, it's user/sys time that are important, and they're unaffected by nice.
01:11:56 <jix> same problem
01:12:12 <GregorR> Today on #esoteric, Gregor solves nothing!
01:12:13 <jix> but only qdb fails egobfi doesn't
01:12:54 <GregorR> I would continue to try to help diagnose, but I've actually got to go.
01:13:05 <GregorR> So, I'll see y'all later, hope to see some interesting results at some point ^_^
01:13:20 <jix> later
01:13:57 <jix> /usr/bin/time: cannot run ./qdb: No such file or directory wtf?
01:14:29 <GregorR> It could be that your script silently chdir'd somewhere, I would try using a full path.
01:14:40 <GregorR> (or worse, the interpreter silently chdir'd somewhere)
01:14:44 <jix> ahh found the bug
01:14:54 <jix> no the interpreter may chdir anywhere
01:15:00 <jix> i'm chdiring back at the end
01:15:12 <GregorR> Incidentally, I'm not here 8-D
01:15:13 <jix> but i used always the dir of the first interpreter for all interpreters
01:20:37 <jix> fixed
01:25:28 <jix> bff added
01:28:49 <calamari_> GregorR: whats the current size? :)
01:35:03 <jix> g'night
01:36:12 -!- jix has quit ("Bitte waehlen Sie eine Beerdigungnachricht").
01:59:26 -!- calamari_ has quit ("Leaving").
02:17:37 -!- kipple___ has quit (Read error: 110 (Connection timed out)).
05:54:19 -!- graue has quit (Read error: 110 (Connection timed out)).
05:57:28 -!- cmeme has quit (Connection timed out).
05:57:57 -!- cmeme has joined.
07:59:59 -!- clog has quit (ended).
08:00:00 -!- clog has joined.
08:06:22 -!- ChanServ has quit (kornbluth.freenode.net irc.freenode.net).
08:06:22 -!- pgimeno has quit (kornbluth.freenode.net irc.freenode.net).
08:06:22 -!- {^Raven^} has quit (kornbluth.freenode.net irc.freenode.net).
08:06:23 -!- CXI has quit (kornbluth.freenode.net irc.freenode.net).
08:06:23 -!- mtve has quit (kornbluth.freenode.net irc.freenode.net).
08:06:24 -!- GregorR has quit (kornbluth.freenode.net irc.freenode.net).
08:06:24 -!- lament has quit (kornbluth.freenode.net irc.freenode.net).
08:06:45 -!- ChanServ has joined.
08:06:45 -!- irc.freenode.net has set channel mode: +o ChanServ.
08:06:47 -!- {^Raven^} has joined.
08:06:47 -!- CXI has joined.
08:06:47 -!- mtve has joined.
08:07:11 -!- GregorR has joined.
08:07:11 -!- lament has joined.
08:46:10 -!- pgimeno has joined.
09:20:17 <GregorR> Well, I either just made egobfi mind-blowingly slow, or I just broke it.
09:29:37 <GregorR> YES YES YES YES YES!!!!!!!!!!!!!!!!!!!
09:29:45 <GregorR> egobfi pulls WAAAAAAAAAY ahead!!!
09:31:35 <GregorR> Damn bff, how the hell does it do it?!
09:54:15 <GregorR> Just got add-to optimization, checking if it's actually helpful :P
09:55:14 <GregorR> Wow, that was much much worse.
12:03:53 -!- jix has joined.
12:04:37 <jix> moin
13:27:48 <jix> brfd fails on hello world
13:28:00 <jix> it doesn't output the last newline
13:31:46 <jix> should i strip all leading \n?
13:49:21 <jix> pgimeno: brfd fails on hello world
15:07:43 <jix> i have to include compile time because awib needs 4 mins cpu time to compile mandelbrot but only 49secs to execute it
15:20:17 <jix> pfoo added compile times
15:21:01 <jix> if compile times are < 0.1 seconds they don't show up
15:21:34 <jix> and they aren't as exact as the execution times
15:21:44 <jix> and no one listens to me :'(
15:25:40 <mtve> yep, we're just reading.
15:38:12 <jix> haha
15:39:40 <jix> fixed some bugs
15:43:03 -!- ZeroOne has quit (Ping timeout: 14400 seconds).
15:49:29 -!- fizzie has quit ("muutto").
16:00:15 -!- cmeme has quit (kornbluth.freenode.net irc.freenode.net).
16:00:15 -!- puzzlet has quit (kornbluth.freenode.net irc.freenode.net).
16:00:15 -!- lindi- has quit (kornbluth.freenode.net irc.freenode.net).
16:02:42 -!- cmeme has joined.
16:02:42 -!- puzzlet has joined.
16:02:42 -!- lindi- has joined.
16:37:53 -!- fizzie has joined.
16:38:38 <pgimeno> jix: fails in what sense? the parser is a bit quirky, I guess
16:39:42 <pgimeno> I wrote it before I knew about any established standard
16:55:12 <jix> in the helloworld example the newline is missing
16:55:34 <jix> and i'm not going to include interpreters that need more than 10 minutes for mandelbrot
16:55:39 <jix> obi2.rb is at 40minutes
16:56:14 <jix> killed
16:56:17 <pgimeno> what helloworld?
16:57:24 <jix> http://en.wikipedia.org/wiki/Brainfuck#Hello_World.21
16:57:56 <lindi-> jix: include in what?
16:58:12 <jix> lindi-: in my brainfuck interpreter/compiler speed test
16:58:29 <lindi-> jix: you are doing one? great!
16:58:45 <lindi-> jix: please put the results online
16:59:00 <lindi-> jix: what's the fastest so far?
16:59:02 <jix> lindi-: the first test run is still running
16:59:15 <jix> and it's just a test test run
16:59:20 <lindi-> :)
17:00:12 <jix> oh and if obi2.rb fails it's because i killed it
17:00:13 <pgimeno> jix: it's because of the parser; the ! is the frontier between code and input
17:00:35 <jix> pgimeno: thanks
17:00:39 <jix> i'm going to fix that
17:01:10 <jix> i commented out print("Optimizing") and print.... because they ignored -Q
17:01:29 <pgimeno> oh
17:01:48 <pgimeno> well, the optimizing run.c was not ready for release :)
17:03:36 <jix> the non optimizing one was at 6mins for mandelbrot (i have top running during the tests which takes ALWAYS 0.3%cpu) maybe it needs more than 10min
17:05:30 <pgimeno> it was 4:31 on my machine
17:05:41 <pgimeno> I'm not good at optimizing C code, though
17:05:50 <pgimeno> so doesn't bff run on your box?
17:06:07 <jix> i'm not testing on my main computer
17:06:13 <jix> (too many processes running)
17:06:27 <jix> but on a 400mhz intel celeron computer with ~300mb ram
17:06:47 <pgimeno> oh, I guess that bff runs properly there
17:06:56 <jix> it does
17:08:13 <jix> ahh no!
17:08:29 <jix> there is a bug
17:08:39 <jix> mandelbrot can't be completed in 0secs
17:09:07 <jix> and yes slow brfd is too slow
17:09:35 <jix> ah i forgot to activate output validation for mandelbrot
17:09:51 <pgimeno> hm, bff gives a couple of warnings with valgrind
17:10:10 <jix> bff is the fastest interpreter here
17:10:35 <jix> egobfi the slowest with no fail
17:10:59 <pgimeno> you said it doesn't run on your mac or am I wrong?
17:11:29 <jix> bff?
17:11:45 <jix> yes doesn't run here
17:11:55 <jix> mandelbrot validation is on
17:14:36 <jix> need to find the bug
17:14:50 <pgimeno> in bff?
17:14:55 <jix> no in my test script
17:14:57 -!- BigZaphod has quit.
17:14:58 <pgimeno> ah
17:15:19 <jix> it's impossible to calculate mandelbrot in <0m0.0005s
17:15:36 <pgimeno> guess so
17:15:56 <jix> ok with c it's possible
17:16:02 <jix> but not with brainfuck!?
17:16:45 <pgimeno> it depends on how optimizing is the optimizer :P
17:17:20 <jix> compilers writtin in bf are now self bootstrapped
17:19:46 <jix> the testbox has 0k swap used
17:20:01 <jix> 291mb ram free
17:20:50 -!- ZeroOne_ has joined.
17:35:12 <jix> the fastest way to bootstrap awib with a bootstrapped wib... wib awib.b => awib.c;gcc awib.c => awib_wib;awib_wib awib.b => awib
17:57:38 <GregorR> Wowsa.
18:01:57 <jix> UAHRG
18:02:01 <jix> time output: Command exited with non-zero status 42
18:02:16 <jix> Command is as float.. 0 exited is as float 0 with is as float 0
18:08:15 <jix> fixed all bugs running a new test
18:08:29 <jix> /away
18:35:41 -!- graue has joined.
18:37:11 <graue> bff doesn't work for me, it seems to either crash or inexplicably print wrong things forever
18:39:29 <pgimeno> valgrind reports a few errors
18:41:36 <pgimeno> I've taken a quick glance but couldn't find what's wrong
18:42:41 <GregorR> I'm apparently incapable of implementing add-to loop optimization in such a way that it's actually better :P
18:42:52 <GregorR> I've tried two schemes now.
18:43:38 <GregorR> Both very simple because I don't actually care :P
18:47:36 <graue> it's easy, but complicated and possibly time-consuming
18:48:39 <graue> implement an intermediate language with a command ADD_MEM(M,N) where M is a signed integer and N is an integer with the range of the integers you're using for each cell, that adds N to the cell M cells forward from the current location of the memory pointer
18:48:55 <graue> then add a command ADD_PTR(M) where M is a signed integer, that moves the memory pointer M cells forward
18:49:40 <graue> whenever you see any string of only ><+-, reduce it to at most one ADD_PTR and at most one ADD_MEM for each M
18:49:57 <graue> then, if a loop contains only the ADD_MEM command, you can reduce it to a series of multiplications
18:50:08 <jix> http://www.harderweb.de/jix/langs/brainfuck/result2.txt
18:51:25 <jix> graue: hey that's what my compiler is going to do
18:53:17 <GregorR> graue: That's precisely what I did
18:53:18 <graue> if you add a PUTCHAR(N) command you can also optimize strings containing .
18:53:38 <graue> GregorR, have you tried it on something that takes much longer to run than to parse/optimize?
18:53:48 <GregorR> I used mandelbrot.b
18:59:11 <GregorR> .......
18:59:19 <GregorR> I just made a change that ought to have made it more optimal, and yet it's slower ...
18:59:32 <graue> what change?
19:00:10 <jix> GregorR: egobfi is #8 in the test
19:00:17 <jix> #6 with out compilers
19:00:22 <graue> jix: you need to add more programs
19:00:29 <jix> graue: yes i know
19:00:30 <graue> hello world is trivial and mandelbrot is just one example
19:00:41 <jix> graue: it's my first complete test
19:00:47 <GregorR> Hello World would throw most optimizers waaay below.
19:00:53 -!- sp3tt has joined.
19:01:06 <GregorR> I did the check to make sure that it had parsed as much as would be needed for an add-to loop in the main function instead of the add-to function.
19:01:12 <GregorR> That should have saved a function call and been faster.
19:01:16 <GregorR> Instead it was slower.
19:01:16 <jix> graue: all other tests had some bugs in my test scripts
19:01:45 <GregorR> jix: BTW, 0.3 is quite a bit faster.
19:02:04 <sp3tt> Someone needs to implement RPN in brainfuck... <.<
19:02:52 <GregorR> I'm sure there's an RPN calculator in BF ...
19:05:28 <sp3tt> http://lancelot.pecquet.org/download/soft/rpn.html#Brainfuck teh pain!
19:05:56 <sp3tt> lol... Compare the BF version to the C version...
19:11:49 <GregorR> http://gregorr.homelinux.org/egobfi-0.3.tar.bz2 < now fassssssssster, still powerfullllllllllllller.
19:18:31 <lindi-> GregorR: that runs mandelbrot.b in 26 seconds on pentium@2.8GHz. if i compile mandelbrot.b with BF2C.c and gcc it runs in 2.9 seconds
19:18:45 <graue> how long does the compilation take?
19:19:21 <lindi-> graue: gcc runs for 6 seconds
19:20:00 <lindi-> so, is there any point in writing interpreters? ;)
19:20:18 * jix is writing a compiler
19:21:09 <GregorR> Har har har.
19:21:13 <GregorR> Yukk it up :P
19:21:24 <graue> lindi-, how long does BF2C run?
19:21:52 <lindi-> graue: hard to measure, less than 0.004 seconds
19:22:01 <graue> whoa
19:22:03 * GregorR writes a compiler backend for egobfi :P
19:22:20 <graue> I guess BF2C does no optimizations whatsoever?
19:22:25 <lindi-> jix: GregorR: we should all just start optimizing gcc's optimizer :)
19:22:29 <lindi-> graue: true
19:22:56 <lindi-> then every gcc user would benefit too
19:22:56 <graue> where is BF2C, I don't have it
19:23:08 <lindi-> esoteric.sange.fi/brainfuck/impl/compilers/BF2C.c
19:23:46 <graue> heh, I wrote something like this before :)
19:26:00 <graue> how fast is it if you do the gcc compilation with -O0?
19:27:17 <lindi-> graue: then gcc runs for 1.0 seconds and mandelbrot runs for 22 seconds
19:27:43 <lindi-> -O1 is 1.7 and 3.0
19:28:17 <lindi-> and -O3 is 11 and 2.9
19:29:56 <graue> so even on -O0 it beats egobfi, heh
19:30:24 <lindi-> yes, barely
19:31:11 <lindi-> -O2 and gcc from cvs 2005-07-20 produces a binary that runs in 2.6 seconds ;)
19:32:15 <lindi-> i think it's going to be hard to beat that
19:32:17 <graue> so -O1 gets the best results, if compilation time is counted
19:32:36 <lindi-> graue: yep
19:34:08 <lindi-> graue: but if i changed that mandelbrot to use higher resolution then -O2 would be better
19:34:32 <lindi-> cause it would not affect compilation time but it would affect running time
19:37:11 <lindi-> graue: http://iki.fi/lindi/mandelbrot.asm has disassembly of the created binary
19:44:46 <GregorR> Darn, egobfc only gets it down to 5sec.
19:44:58 <GregorR> However, it supports unicode and any-size characters :)
19:48:42 <lindi-> gcc seems to optimize multiple +'s
19:49:21 <GregorR> Well, that makes my optimization of multiple +s suboptimal.
19:49:22 <lindi-> i mean >
19:49:45 <GregorR> Well, that makes my optimization of multiple >s suboptimal.
19:50:32 <GregorR> With gcc -O2, the actual compilation of mandelbrot.c is quite slow.
19:50:40 <GregorR> Is that also the case with bf2c?
19:51:10 <lindi-> yes, see above
19:51:22 <GregorR> I don't read *shrugs*
19:51:41 <GregorR> So it's possible that compile b-c + compile c-bin + run is still slower than interpreting.
19:52:05 <lindi-> yep
19:52:34 <GregorR> Well, I'm off, I'll release egobfc later when I've knocked out some bugs.
19:54:05 <lindi-> see you later then
19:55:03 -!- graue has quit (Read error: 104 (Connection reset by peer)).
19:55:53 -!- graue has joined.
20:04:18 -!- _graue_ has joined.
20:06:04 <{^Raven^}> what about a JIT interpreter?
20:07:42 <{^Raven^}> i've got some ideas based on the assumption that a BF interpreter is actually a virtual machine
20:08:08 <{^Raven^}> there's some useful emulator techniques that would be handy for a BF-VM
20:08:15 <lindi-> {^Raven^}: why not just use gij?
20:09:41 <{^Raven^}> wouldn't that imply Java?, that would give a VM running on a VM running on a RM
20:09:50 <{^Raven^}> too many VMs spoil the speed
20:10:36 <jix> dynamic recompiling? jit compiling?
20:10:45 <jix> vm's often jit compile
20:10:53 <jix> emulators often dynrecompile
20:11:30 <jix> dynamic recompiling is a special form of jit compiling
20:11:56 <{^Raven^}> it would preferably need to be host platform independant
20:12:15 <jix> uhm thats impossible
20:12:22 <{^Raven^}> yeah i know
20:12:26 <jix> without calling gcc
20:12:59 <lindi-> {^Raven^}: not really, python can be compiled to the same bytecode too, so why not brainfuck?
20:13:22 <{^Raven^}> lindi-: gij is not in my area of expertise
20:13:29 <jix> brainfuck can be compiled to machine code.. that's faster
20:15:25 <{^Raven^}> a interpreter/VM/emu could store the compiled code in a cache, meaning that a program would only need to be compiled once
20:15:39 <{^Raven^}> using the compiled code from the cache on subsequent runs
20:16:40 <lindi-> that could be a shell script that caches results to ~/.bf-cache :)
20:17:41 <{^Raven^}> or %APPDATA% or Choices: depending on OS
20:19:29 -!- graue has quit (Read error: 110 (Connection timed out)).
20:19:49 <sp3tt> Why not write a brainfuck module for gcc or some other compiler?
20:19:56 <sp3tt> I mean, that removes some overhead.
20:20:13 <lindi-> good idea
20:20:19 * {^Raven^} doesn't know how to
20:20:33 <lindi-> shouldn't be that difficult
20:21:25 <sp3tt> Imagine the overkill of getting the dragon book for that.
20:21:34 <lindi-> dragon book?
20:22:05 <lindi-> ah
20:22:37 <sp3tt> Compiler book with a dragon on the cover.
20:24:46 <{^Raven^}> IMHO we need a good intermediate language to compile through
20:25:18 <lindi-> C is one :)
20:26:15 <{^Raven^}> no, before C, straight BF>C is non-optimal even after run-length encoding
20:26:51 <{^Raven^}> unless you know something i don't :)
20:27:01 <lindi-> i'm not sure what you mean :/
20:27:24 <lindi-> you want lower or higher level than C?
20:28:01 <{^Raven^}> i want high level than straight BF>C
20:28:13 <{^Raven^}> *higher
20:28:21 <jix> {^Raven^}: thats what my bf2c compiler does
20:28:36 <{^Raven^}> jix: link?
20:29:12 <jix> {^Raven^}: myharddisk://under.dev.el/opement
20:29:31 <jix> not ready and the intermediate language is still growing
20:29:38 <jix> and the only output language atm is ruby
20:29:42 <{^Raven^}> hehe
20:31:22 <{^Raven^}> i am working on a compiler here, not much dev-time though
20:31:40 <{^Raven^}> idea is to reduce the number of instructions in a BF program to as few as possible
20:33:13 -!- _graue_ has changed nick to graue.
20:33:19 <{^Raven^}> mine outputs to BF, C, C(ommented), BBC BASIC and pure object code
20:41:22 <{^Raven^}> purely an exercise atm rather than a releasable tool
20:45:57 <{^Raven^}> jix: i'd like to see what you've got
20:52:19 <jix> i'm still writing the top framework no optimizations yet
20:58:06 <jix> modulo math.. 0o
20:58:30 <sp3tt> Easier than RPN.
20:58:38 <jix> rpn is easy
20:58:46 <sp3tt> Exactly.
20:58:50 <sp3tt> I learned about it today.
20:58:56 <jix> i love rpn
20:59:04 <jix> i use it on my calculator
20:59:05 <sp3tt> Wrote an infix-> RPN.
20:59:12 <jix> and no it's not a hp calc
20:59:16 <sp3tt> And a 12 line RPN-calculator.
20:59:21 <jix> sp3tt: pha.. i do that in my head
20:59:25 <sp3tt> I want an RPN calculator
20:59:34 <jix> gimme an infix expression and i output rpn
20:59:35 <sp3tt> jix: so?
20:59:40 <sp3tt> Heh.
21:00:12 <sp3tt> Imagine my math teacher's face.
21:00:22 <jix> hehe
21:00:30 <jix> i'm going to write my next math test using base -9
21:00:35 <sp3tt> "But this is gibberish" "You don't know RPN?" "No, wtf is that?" "N00B!"
21:00:45 <sp3tt> Base... negative 9?
21:00:46 <jix> no one ever said that i have to use base 10
21:00:47 <sp3tt> o.0
21:00:53 <jix> sp3tt: yes no need for a sign
21:00:53 <sp3tt> Good one.
21:01:19 <sp3tt> How about binary? Or is that too easy.
21:01:24 <jix> of course i write a converter base 10 <=> -9 for my calculaotr
21:01:31 <sp3tt> Probably... base 3 is hard.
21:01:34 <jix> sp3tt: my teacher has a computer no problem to convert
21:01:41 <sp3tt> Well, not hard.
21:01:44 <jix> and there are programs for any positive base
21:01:52 <sp3tt> No base is hard.
21:01:54 <jix> but no programs for negative bases
21:02:06 <sp3tt> It's just that some are more confusing.
21:02:19 <sp3tt> I love to count in binary with my fingers though. Especially 4.
21:02:31 <jix> 10 is in -9 => 181
21:02:41 <jix> sp3tt: *g*
21:03:03 <sp3tt> That is just... painful.
21:03:15 <jix> -9 is in -9 => 10
21:03:22 <jix> -8 is in -9 => 11
21:03:33 <jix> 9 is in -9 180
21:03:34 <graue> I like that
21:03:34 <sp3tt> -9 + 81 + -81*9?
21:03:55 <jix> uhm ?
21:04:09 <sp3tt> I don't think I follow the logic of negative bases.
21:04:10 <jix> 181 == 1*81 + 8*-9 + 1*1
21:04:31 <jix> 1*(-9)^2 + 8*(-9)^1 + 1*(-9)^0
21:04:35 <jix> just like positive bases
21:04:57 <sp3tt> Ah yeah...
21:05:09 <jix> the rightmost digit counts 1 the 2nd digit counts base the 3rd digit counts base square...
21:05:21 <sp3tt> Forgot that...
21:05:23 <sp3tt> <.<
21:05:29 <sp3tt> Beat me with a stick.
21:05:41 <jix> sp3tt: too much brainfuck programming?
21:05:44 <sp3tt> Nah.
21:05:51 <sp3tt> Not done any of that for a while.
21:06:17 <sp3tt> I'm not forgetting Latin conjugations and declinations at least :)
21:06:30 <jix> who needs latin...
21:06:40 <sp3tt> Study Latin in one's free time. Can it get geekier?
21:06:56 <sp3tt> Don't know.
21:06:58 <jix> i don't like latin
21:07:01 <sp3tt> But it is fun to know.
21:07:17 <jix> japanese or russian would be cool
21:07:19 <sp3tt> Because insulting people in a language they cannot grasp is hilarious.
21:07:33 <sp3tt> My father once got in a car accident in Portugal.
21:07:47 <sp3tt> Well, not accident, but some Portuguese idiot reversed into his cars.
21:08:02 <jix> and...?
21:08:08 <sp3tt> And the Portuguse started shouting in Portuguese.
21:08:24 <sp3tt> And he told them to stfu and called them mofos in Swedish XD
21:08:41 <jix> haha
21:08:59 <sp3tt> They shouted "Calma, calma!"
21:09:18 <jix> Calma?
21:09:28 <sp3tt> "Calm down" or something to that effect.
21:09:44 <jix> ah
21:09:45 <sp3tt> AFK, movie's on again.
21:09:48 <sp3tt> The Godfather :)
21:25:18 <jix> argh modulo math
21:27:05 <jix> val-(c*e) === 0 (mod 256) i know c and want a rule for getting e if i know val
21:27:23 <jix> uh val+(c*e)
21:29:35 <jix> if c is 1 then e === val (mod 256)
21:30:01 <jix> if c is 2 there is only a solution if val === 0 (mod 2)
21:30:26 <jix> but for all odd c there is a solution for all val
21:30:32 <jix> i know that because of brute-forcing
21:32:04 <graue> I suppose this will be 8-bit with wrapping only?
21:32:43 <graue> will you optimize exponentiation and tetration
21:32:44 <graue> ?
21:33:39 <jix> i want to optimize all loops that don't contain other loops or input output
21:35:34 <graue> will you optimize recursively, e.g. [[[[[[-]]]]]] (for a trivial example)?
21:35:44 <jix> yes but only trivial examples
21:35:54 <graue> why?
21:36:06 <graue> is this because you have decided that nontrivial cases of that cannot be optimized?
21:36:18 <jix> because i optimize '['*n + bla + ']'*n
21:36:30 <jix> an that's trivial
21:37:04 <graue> what about [+>>-<<->>+[+>>-<<->>+[+>>-<<->>+[+>>-<<->>+[+>>-<<->>+[-]+>>-<<->>+]+>>-<<->>+]+>>-<<->>+]+>>-<<->>+]+>>-<<->>+]?
21:37:22 <graue> oh wait, I got that wrong
21:37:29 <graue> but what I mean is, you're not naive about it, right?
21:37:39 <jix> hn?
21:37:57 <jix> i would probably optimize [+>>-<<->>+[-]+>>-<<->>+]
21:37:58 <graue> i.e., if it's effectively such a trivial example, will you hndle it?
21:38:00 <graue> okay
21:38:31 <jix> but i'm at the code for handling non-moving non-nested non-io loops
21:38:43 <jix> ie multiplication / naive-divide
21:38:50 <jix> move
21:38:58 <jix> copy
21:39:03 <jix> and combinations of that
21:39:35 -!- BigZaphod has joined.
21:39:47 <jix> and that's where i need a solution for that modulo equation
21:49:02 <jix> my newest optimization [-]++ => cell=2 (and things like that)
21:49:27 <jix> still not done with the move/mul/div optimization
21:53:07 <graue> do you also optimize by removing any instructions prior to a [-] that modify only that cell?
21:54:41 <jix> yes that too
21:54:49 <jix> but [-]++ could be e = 0 ; e+=2
21:54:56 <jix> i output e=2
21:55:25 <graue> yes
21:56:17 <jix> i do some bf-space o11s ( [odd number of + or -] => z ; delete <>|><|+-|-+ and + or - in front of z)
21:56:37 <jix> and some o11s within the loop tree
21:57:10 <jix> ++>+<- => p[0]+=1 p[1]+=1
21:57:28 <graue> what's an oll?
21:57:32 <jix> and even ++>[-]<->+<- => p[1]=1
21:57:42 <jix> its o-eleven-s optimisations
21:57:46 <graue> oh
21:57:49 <jix> optimizations
21:58:15 <jix> like i18n
21:58:24 <graue> and a10y, yes
21:58:44 <jix> a10y?
21:58:49 <graue> or maybe a11y
21:58:51 <graue> accessibility
21:59:35 <jix> i don't remember them.. and i only use them if i wrote the whole word at least once
22:00:33 <jix> BFCode.new("++>[-]<->+<-").gencode => [[:set, 1, 1]]
22:15:01 <jix> fixed some bugs
22:15:02 <jix> and now:
22:15:03 <jix> e = BFCode.new("[>++<[-]>-<+>-<]").gencode => [[:inf_loop]]
22:31:20 <jix> when i'm done i have 3 optimization stages
22:32:30 <jix> 1 that works on the brainfuck source 1 that does the bf-tree => intermediate-lang and 1 that removes dead code from the intermediate-lang
22:54:33 <GregorR> Here's a question ...
22:54:46 <GregorR> Would it be a speed improvement to write the BF code to a void * memory array and then call that as a function?
22:54:54 <GregorR> Err, write machine code, but from BF, obviously.
22:55:30 <jix> yes
22:55:59 <GregorR> Hmmmmmmmmm.
22:56:17 <GregorR> I don't think it would be TOO difficult ...
22:56:24 <GregorR> It would be totally architecture-dependent of course.
22:56:32 <jix> that's like jit compiling
22:56:50 <GregorR> Oh, yes it is.
22:56:54 <GregorR> lol, didn't occur to me.
22:57:46 <jix> if you compile all loops as soon as they get executed it's real jit compiling if you always translate the next n instructions it's dynamic recompiling
22:58:30 <GregorR> And cache said loops I assume *shrugs*
22:59:33 <GregorR> While I think that if I really wanted to, I could probably write something like that, I'm still not going to :P
23:08:01 -!- heatsink has joined.
23:33:04 -!- sp3tt has quit (Client Quit).
23:52:40 <jix> i'm done with the modulo math
23:52:59 <jix> good ol'paper and pencil
←2005-07-23 2005-07-24 2005-07-25→ ↑2005 ↑all