←2007-02-19 2007-02-20 2007-02-21→ ↑2007 ↑all
00:11:34 -!- sebbu2 has quit ("@+").
00:55:15 <oklopol> i made bf with wav output :P
01:09:37 <bsmntbombdood> hmmm
01:09:46 <bsmntbombdood> I wonder how to parse something like this:
01:10:03 <bsmntbombdood> <expr> := i
01:10:11 <bsmntbombdood> <expr> := *<expr><expr>
01:15:28 <bsmntbombdood> oh, heh, nevermind
01:16:21 <bsmntbombdood> that took a whole 8 lines
01:21:13 <bsmntbombdood> http://pastebin.ca/364284
01:29:03 <SevenInchBread> hmmm... it's odd how different my mindset was before I started programming.
01:29:10 <SevenInchBread> "complex" had a positive connotation.
01:29:12 <bsmntbombdood> ?
01:35:41 <bsmntbombdood> oui
01:42:14 -!- oerjan has joined.
01:53:54 -!- ShadowHntr has joined.
02:05:05 -!- kxspxr has quit.
02:25:17 <bsmntbombdood> ~exec exec "x='floo'" in globals()
02:25:22 <bsmntbombdood> ~exec sys.stdout(x)
02:25:23 <bsmnt_bot> floo
02:25:28 <bsmntbombdood> cool
02:50:06 <SevenInchBread> bsmnt so why doesn't the normal mode of execution simply go to the "globals"?
02:50:16 <SevenInchBread> ~exec x = 2
02:50:17 <bsmntbombdood> because
02:50:25 <SevenInchBread> ~exec sys.stdout(x)
02:50:25 <bsmnt_bot> floo
02:50:31 <SevenInchBread> because that would make too much sense right?
02:50:36 <bsmntbombdood> no
02:50:44 <bsmntbombdood> because then the locals aren't available
02:50:51 <bsmntbombdood> self, for example
02:50:53 <SevenInchBread> what locals?
02:51:13 <SevenInchBread> sure they are.
02:51:22 <SevenInchBread> self isn't a local... in this context it's a global.
02:52:02 <bsmntbombdood> no, it's local
02:52:03 <oerjan> doesn't exec take two environment arguments, one for the globals and one for the locals? So you could have both.
02:52:10 <SevenInchBread> yes.
02:52:11 <SevenInchBread> it does.
02:52:17 <bsmntbombdood> uh huh
02:52:24 <SevenInchBread> self is a variable name...
02:52:35 <bsmntbombdood> but if you say something like "x=2", x goes in the locals
02:52:40 <SevenInchBread> it's neither local nor global... it's whatever you decide to put it in.
02:53:00 <bsmntbombdood> self isn't in globals()
02:53:00 <SevenInchBread> in my opinion it would be more convient to simply (and more intuitive) to treat everything as globals..
02:53:18 <SevenInchBread> ~exec global x; x = 2
02:53:38 <SevenInchBread> ~exec sys.stdout.write(x)
02:53:38 <bsmnt_bot> 2
02:54:08 <oerjan> but then you couldn't do tricks like ihope's extra bot inside the bot
02:54:22 <SevenInchBread> it doesn't make any sense to, nor is it even useful to, by default, bind variables to a temporary local scope.
02:54:24 <bsmntbombdood> I think you could
02:54:51 <bsmntbombdood> I could copy the globals dict, then add the need locals into i
02:54:52 <bsmntbombdood> t
02:55:17 <oerjan> i suppose.
02:55:38 <SevenInchBread> ....just make self a global.
02:55:39 <bsmntbombdood> ~exec pprint.pprint(locals(), sys.stderr)
02:55:52 <oerjan> but if self is global you cannot have two bots!
02:55:55 <bsmntbombdood> SevenInchBread: no
02:56:02 <SevenInchBread> wrong... you cannot have two selfs.
02:56:07 <bsmntbombdood> ~exec pprint.pprint(locals(), sys.stdout)
02:56:08 <bsmnt_bot> {'command': 'pprint.pprint(locals(), sys.stdout)',
02:56:08 <bsmnt_bot> 'message': ':bsmntbombdood!n=gavin@about/copyleft/user/bsmntbombdood PRIVMSG #esoteric :~exec pprint.pprint(locals(), sys.stdout)',
02:56:08 <bsmnt_bot> 'r': <_sre.SRE_Match object at 0xb7c55cc8>,
02:56:08 <bsmnt_bot> 'self': <__main__.IRCbot instance at 0xb7c4208c>}
02:56:17 <bsmntbombdood> so that works
02:56:38 <SevenInchBread> hmmm...
02:56:40 <bsmntbombdood> uno momento
02:56:46 <oerjan> threading would mess up horribly then, wouldn't it? or do threads have different global directories?
02:56:50 <SevenInchBread> I really don't like using the global declaration.
02:57:11 <SevenInchBread> no... they all seem to share a global directory...
02:57:19 <bsmntbombdood> no, globals is the same
02:57:37 <oerjan> so it doesn't work, because multiple execs run in separate threads.
02:57:48 <bsmntbombdood> what doesn't work?
02:57:50 <oerjan> and they might need different selfs.
02:58:05 <oerjan> it doesn't work to make self global.
02:58:14 <bsmntbombdood> of course not
02:58:26 <bsmntbombdood> ~quit
02:58:27 -!- bsmnt_bot has quit.
02:58:29 -!- bsmnt_bot has joined.
02:58:36 <SevenInchBread> it would work... if each bot were a different process.
02:58:48 <bsmntbombdood> SevenInchBread: then NOTHING would work
02:59:00 <SevenInchBread> ...?
02:59:08 <bsmntbombdood> ~exec pprint.pprint(locals(), sys.stderr)
02:59:38 <bsmntbombdood> ~exec x=1
02:59:43 <bsmntbombdood> ~exec sys.stdout(x)
02:59:52 <bsmntbombdood> damnit
03:00:00 <bsmntbombdood> it still goes into a local scope
03:00:18 <bsmntbombdood> ~exec sys.stdout(self)
03:00:19 <bsmnt_bot> <__main__.IRCbot instance at 0xb7bd508c>
03:00:40 <bsmntbombdood> it looks like it generates an empty local scope if you dont' give it one
03:01:09 <bsmntbombdood> ~exec x= 42; pprint.pprint(locals(), sys.stderr)
03:01:14 <oerjan> hm... can you pass it globals(), globals() ?
03:01:32 <bsmntbombdood> i'll try
03:01:45 <SevenInchBread> you could.
03:01:54 <bsmntbombdood> ~quit
03:01:55 <SevenInchBread> or just {}, globals() if you wanted....
03:01:55 -!- bsmnt_bot has quit (Client Quit).
03:01:57 -!- bsmnt_bot has joined.
03:02:06 <bsmntbombdood> ~exec x = 32
03:02:08 <SevenInchBread> that would make global declarations act screwy though...
03:02:11 <bsmntbombdood> ~exec sys.stdout(x)
03:02:18 <bsmntbombdood> nope
03:02:21 <bsmntbombdood> weird
03:02:21 <SevenInchBread> so globals(), globals() would be best.
03:02:25 <oerjan> still gebrochen?
03:02:37 <bsmntbombdood> gebrochen?
03:02:43 <oerjan> mock german
03:02:43 <bsmntbombdood> oh, damn
03:02:50 <bsmntbombdood> I was making a copy of the dictionary
03:02:55 <bsmntbombdood> so nothing could be added
03:02:55 <SevenInchBread> ...yeah
03:03:04 <SevenInchBread> I was about to say... that would work.
03:03:07 <bsmntbombdood> but without making a copy, I can't put self into it
03:03:22 <SevenInchBread> sure you can.
03:03:31 <bsmntbombdood> no, you can't
03:03:43 <bsmntbombdood> that will break
03:03:52 <bsmntbombdood> ~quit
03:03:53 -!- bsmnt_bot has quit (Client Quit).
03:03:56 -!- bsmnt_bot has joined.
03:03:56 <SevenInchBread> globals().update({"self":self})
03:03:56 <oerjan> Sheesh. Rewrite the bot in Erlang or something :)
03:04:00 <bsmntbombdood> ~exec x = 23
03:04:14 <bsmntbombdood> ~exec sys.stdout(x)
03:04:15 <bsmnt_bot> 23
03:04:18 <bsmntbombdood> yeah
03:04:23 <bsmntbombdood> ~exec sys.stdout(self)
03:04:24 <oerjan> huzzah
03:04:31 <SevenInchBread> or or just globals["self"] = self
03:04:31 <bsmntbombdood> <bsmnt_bot> NameError: name 'self' is not defined
03:04:37 <bsmntbombdood> no, SevenInchBread
03:04:45 <SevenInchBread> globals()["self"] = self
03:04:47 <bsmntbombdood> because globals are shared
03:04:52 <SevenInchBread> so?
03:05:00 <oerjan> and self must not be shared.
03:05:09 <bsmntbombdood> so you can't have more than one bot running
03:05:10 <SevenInchBread> if you rewrite self each time... it effectively doesn't matter.
03:05:16 <bsmntbombdood> threads
03:05:28 <oerjan> execs can run simultaneously
03:05:38 <bsmntbombdood> all the execs running use the last exec executed's self
03:05:41 <oerjan> and will, if some are long-running computations
03:05:53 <SevenInchBread> so just fork a new process like a sane person.
03:06:14 <oerjan> What, sane persons, in #esoteric? Perish the thought.
03:06:35 <bsmntbombdood> with forks, none of the cool tricks are possible
03:06:55 <SevenInchBread> basically... you want to preserve the locals.
03:07:05 <SevenInchBread> so... give each bot a local dictionary?
03:07:21 <SevenInchBread> and then... all the bots share a glolbal dictionary?
03:07:27 <bsmntbombdood> hmmm
03:07:40 <SevenInchBread> it seems kind of obvious now that I think about it...
03:07:47 <oerjan> i thought that was the way it was working already
03:07:56 <SevenInchBread> a global declaration in this case means "all bots can share"
03:07:58 <bsmntbombdood> nope
03:07:58 <SevenInchBread> nope...
03:08:03 <bsmntbombdood> one sec
03:08:10 <SevenInchBread> locals are basically just discarded after a thread is executed.
03:08:51 <bsmntbombdood> ~quit
03:08:52 -!- bsmnt_bot has quit (Client Quit).
03:08:55 -!- bsmnt_bot has joined.
03:08:58 <bsmntbombdood> ~exec x=12
03:09:12 <bsmntbombdood> ~exec pprint.pprint(locals(), sys.stderr)
03:09:19 <bsmntbombdood> yay!
03:09:23 <oerjan> ~exec sys.stdout(x)
03:09:23 <bsmntbombdood> ~exec sys.stdout(x)
03:09:23 <bsmnt_bot> 12
03:09:24 <bsmnt_bot> 12
03:09:34 <bsmntbombdood> ~exec pprint.pprint(locals(), sys.stdout
03:09:36 <bsmntbombdood> ~exec pprint.pprint(locals(), sys.stdout)
03:09:39 <bsmnt_bot> {'x': 12, 'self': <__main__.IRCbot instance at 0xb7c0008c>}
03:09:43 <oerjan> eh, wait, are you making the local directory persistent?
03:09:47 <bsmntbombdood> yeah
03:09:48 <oerjan> weird stuff
03:10:04 <bsmntbombdood> each bot has it's own locals dictionary
03:10:17 <SevenInchBread> makes sense... really.
03:10:57 <bsmntbombdood> the threads might run over each other still
03:11:09 <SevenInchBread> makes managing scopes between bots far less of a pain in the long run.
03:11:31 <bsmntbombdood> might delay updates to the dictionary untill finished executing
03:12:03 <SevenInchBread> hmm... yeah... that might be a good idea.
03:12:10 <bsmntbombdood> except not
03:12:23 <bsmntbombdood> still conflicts
03:12:26 <SevenInchBread> so two processes on the same thread don't like... murder each other.
03:13:04 <oerjan> what is wrong with the old idea that execs that wanted persistence add attributes to self?
03:13:08 <SevenInchBread> basically... python's scoping makes inter-process memory weird.
03:13:20 <SevenInchBread> but it works great for normal stuff.
03:13:26 <bsmntbombdood> oerjan: i dunno
03:14:16 <SevenInchBread> well.. the problem with that is that functions defined on self don't have the closure of their local scope.
03:14:36 <SevenInchBread> which is an unexpected behavior in Python
03:14:39 <bsmntbombdood> ~exec foo = lambda : self
03:14:47 <bsmntbombdood> ~exec sys.stdout(foo)
03:14:47 <bsmnt_bot> <function <lambda> at 0xb7c01684>
03:14:51 <bsmntbombdood> ~exec sys.stdout(foo()
03:15:02 <bsmntbombdood> gAH I HATE THE INSERT KEY
03:15:04 <bsmntbombdood> ~exec sys.stdout(foo())
03:15:17 <bsmntbombdood> <bsmnt_bot> NameError: global name 'self' is not defined
03:15:20 <bsmntbombdood> bargle
03:15:27 <SevenInchBread> like that.
03:15:31 <oerjan> i thought the expected behavior in Python is that scope hardly makes sense ;)
03:15:44 <bsmntbombdood> closures are broken
03:15:57 <SevenInchBread> eh... scope makes sense in Python... to me anyways... but that's because I've been using it... a lot.
03:16:09 <bsmntbombdood> i don't understand scope in python
03:16:40 <SevenInchBread> everything is local unless stated otherwise.
03:16:47 <bsmntbombdood> mm hmmm
03:17:16 <SevenInchBread> and a closure is just an encapsulation of the globals() at the time of definition.
03:17:55 <SevenInchBread> so... any idea of what's causing self to be undefined? I'm thinking it might be something with the way you have it set up... can I see the source?
03:19:10 <bsmntbombdood> bsmntbombdood.mooo.com/chroot_ircbot.py
03:20:38 <bsmntbombdood> argh
03:20:45 <SevenInchBread> I think it would be cool if python.exe could take URLs as pathnames.
03:21:02 <SevenInchBread> so it would interpret a program off of a URL.
03:21:41 <bsmntbombdood> this needs a script to start i
03:21:42 <bsmntbombdood> t
03:27:34 <bsmntbombdood> there, mime types are better
03:29:47 * oerjan suddenly has a realization: mime types cannot possibly handle sound data.
03:37:22 <bsmntbombdood> oerjan: this configuration is equivalent to adding attributes to self
03:37:34 <bsmntbombdood> just now it's implicit
03:38:49 <oerjan> but what if an exec needs private local variables?
03:39:12 <bsmntbombdood> it can't
03:39:24 <oerjan> it could previously
03:39:26 <SevenInchBread> ...that's kind of a weird choice.
03:39:57 <SevenInchBread> now you're just moving the namespace to self.__dict__... when you could easily just keep a special self.localnamespace dictionary.
03:40:10 <bsmntbombdood> what?
03:40:14 <bsmntbombdood> that's what i'm doing
03:40:25 <bsmntbombdood> self.locals
03:40:28 <SevenInchBread> Python's scoping is very good for handling three scopes (a thread scope, a bot scope, and an all-bot scope)
03:40:35 <bsmntbombdood> you have the source
03:40:45 <bsmntbombdood> oh?
03:40:46 <SevenInchBread> er... isn't
03:40:48 <SevenInchBread> very
03:40:51 <SevenInchBread> good
03:40:57 <bsmntbombdood> oh, yeah
03:41:24 <SevenInchBread> Python basically just recognizes two scopes... I kind of wish it could use a list of scopes.
03:41:37 <SevenInchBread> localest scope all the way to globalest :)
03:41:51 <bsmntbombdood> that's how i did it in my mini lisp interpreter
03:44:06 <lament> SevenInchBread: you do realize you're completely wrong, right?
03:44:32 <SevenInchBread> >.> ...that sounded really arrogant. :)
03:48:25 <SevenInchBread> What am I wrong aboutZ
03:48:40 <lament> >>> def foo(x):
03:48:40 <lament> ... def bar(y):
03:48:40 <lament> ... def baz():
03:48:40 <lament> ... print x,y
03:48:40 <lament> ... return baz
03:48:42 <lament> ... return bar
03:48:45 <lament> ...
03:49:16 <lament> >>> foo(1)(2)()
03:49:16 <lament> 1 2
03:49:21 <SevenInchBread> Right.
03:49:44 <SevenInchBread> that's a closure... either way... a Python variable still only have two scopes it can be found in.
03:49:52 <lament> i see a bunch of scopes here.
03:50:09 <lament> x can be found in the scope of foo, the scope of bar and the scope of baz, and those are all different scopes.
03:50:11 <SevenInchBread> yeah... but only two are used to look up a variable.
03:51:17 <lament> to look up x from baz, we check baz, then bar, then foo.
03:51:40 <SevenInchBread> no... we check the functions closure... which is one namespace.
03:51:55 <SevenInchBread> it doesn't "slide upwards"... although that's the effect given.
03:53:12 <bsmntbombdood> huh?
03:57:13 <SevenInchBread> well no..
03:57:20 <SevenInchBread> I take that back... functions have -three- namespaces.
03:57:39 <SevenInchBread> still, that's not a list. :/
04:00:49 <bsmntbombdood> #raw names
04:01:00 <bsmntbombdood> ~raw names
04:01:02 -!- bsmnt_bot has quit (SendQ exceeded).
04:01:06 <bsmntbombdood> lol
04:01:22 -!- bsmnt_bot has joined.
04:01:41 -!- bsmntbombdood has changed nick to xor.
04:26:01 -!- calamari has joined.
04:32:35 <oerjan> xor: Do you know that the xor operation can be defined on ordinal numbers? ;)
04:32:43 <xor> heh
04:32:54 <xor> I wonder if there's a way to find xors non-bitwisely
04:33:28 <oerjan> Xor is "nimber" addition, and nimbers can be identified with ordinals.
04:33:41 <xor> nooooooo!
04:34:11 <xor> I know i^j = (j & i) - (j | i)
04:34:14 <oerjan> Alas, it also boils down to ordinals having base 2 representations.
04:34:49 <oerjan> Any base too... the omega base was the one previously mentioned as "Cantor normal form"
04:35:32 <oerjan> You mean i^j = (j | i) - (j & i)
04:36:15 <oerjan> And that works because the bits in the second part are all set in the first, so - requires no borrow and becomes bitwise.
04:38:38 <oerjan> Do you know Nim?
04:39:17 <oerjan> Basically if you have three heaps, of size x, y and z, then the first player loses iff x == y ^ z.
04:39:49 <oerjan> Which is equivalent to x ^ y ^ z == 0
04:40:33 <oerjan> It may not be practical, but there is no mention of bits in it :)
04:41:28 <oerjan> (Assuming both players play perfectly, as usual in mathematical game theory.)
04:42:18 <oerjan> And relax, ordinals are not mentioned either unless your heaps are infinite.
04:42:34 <xor> i don't get it
04:42:53 <xor> each turn you add one to a heap?
04:43:24 <oerjan> No, each turn the player takes as many iterms as he wishes from one heap.
04:43:28 <oerjan> *items
04:43:31 <xor> oh
04:45:36 <oerjan> It turns out there is a large class of games that can all be reduced to Nim and assigned nimbers to their positions.
04:46:02 <SevenInchBread> chess? :)
04:47:24 <oerjan> Not chess, at least not easily. The games should have the property that there are no fundamental differences between the players, each position can in principle occur for each, with the same allowed moves.
04:48:09 <oerjan> In addition, all games must end.
04:48:40 <oerjan> (Well-foundedness, through which the ordinals creep in if you have infinitely many positions)
04:49:55 <oerjan> The nimber of a position is easily defined recursively: It is the smallest natural number (from 0) that cannot be the nimber of the position after the player has moved.
04:50:15 <oerjan> *natural = ordinal, if games are infinite.
04:51:04 <oerjan> Oh, and one final property, the first player who cannot make a move loses.
04:51:14 <oerjan> And there are two players.
04:52:00 <oerjan> For Nim, the nimber of a single heap is its number of items, naturally.
04:52:27 <oerjan> For several heaps you can prove that it is the xor of the heap sizes.
04:53:40 <oerjan> The first player loses iff the nimber is 0.
04:55:50 -!- goban has quit (Read error: 60 (Operation timed out)).
04:56:07 -!- goban has joined.
05:13:23 -!- digital_me has quit ("Lost terminal").
05:29:19 -!- oerjan has quit ("leaving").
06:20:56 -!- Sgeo has quit (zelazny.freenode.net irc.freenode.net).
06:20:56 -!- meatmanek has quit (zelazny.freenode.net irc.freenode.net).
06:20:56 -!- sp3tt has quit (zelazny.freenode.net irc.freenode.net).
06:20:57 -!- ShadowHntr has quit (zelazny.freenode.net irc.freenode.net).
06:20:58 -!- cmeme has quit (zelazny.freenode.net irc.freenode.net).
06:20:58 -!- puzzlet has quit (zelazny.freenode.net irc.freenode.net).
06:20:59 -!- bsmnt_bot has quit (zelazny.freenode.net irc.freenode.net).
06:20:59 -!- SevenInchBread has quit (zelazny.freenode.net irc.freenode.net).
06:21:29 -!- bsmnt_bot has joined.
06:21:29 -!- ShadowHntr has joined.
06:21:29 -!- Sgeo has joined.
06:21:29 -!- SevenInchBread has joined.
06:21:29 -!- puzzlet has joined.
06:21:29 -!- meatmanek has joined.
06:21:29 -!- sp3tt has joined.
06:21:29 -!- cmeme has joined.
06:23:03 -!- nooga has quit (Remote closed the connection).
06:23:08 -!- nooga has joined.
06:57:30 -!- calamari has quit ("Leaving").
06:58:28 -!- ShadowHntr has quit ("End of line.").
07:05:25 -!- GreaseMonkey has joined.
07:06:17 -!- GreaseMonkey has quit (Client Quit).
07:06:41 -!- GreaseMonkey has joined.
07:59:59 -!- clog has quit (ended).
08:00:00 -!- clog has joined.
08:20:21 <nooga> about that: http://fukung.net/v/720/school.gif
08:20:25 <nooga> ruby kills u all
08:20:39 <nooga> 500.times {print "yadda yadda"}
08:24:30 -!- oklobot has joined.
08:24:52 <oklopol> !exec 500["yadda yadda"PrntNlDrp1SubDbl]
08:24:55 <EgoBot> Huh?
08:24:56 <oklobot> yadda yadda
08:25:00 <oklobot> yadda yadda
08:25:03 <oklobot> yadda yadda
08:25:07 <oklobot> yadda yadda
08:25:10 -!- oklobot has quit (Read error: 104 (Connection reset by peer)).
08:25:12 <oklopol> yeah yeah
08:28:21 <nooga> but in ruby it's more elegant :>
08:29:10 <oklopol> YOU are more elegant.
08:29:10 <nooga> !*",211yadda yadda,3500
08:29:13 <EgoBot> Huh?
08:29:23 <nooga> !sadol !*",211yadda yadda,3500
08:29:25 <EgoBot> BDSM: Invalid argument types for '*': string, integer (index: 1, row: 1, col: 2)
08:29:30 <nooga> heh
08:29:34 <nooga> old interpreter ;p
08:29:41 <oklopol> :)
08:30:05 -!- GreaseMonkey has quit ("gnight").
08:30:21 <oklopol> i added that to oklobot quite late to
08:30:22 <oklopol> *oo
08:30:47 <oklopol> it's still not turing complete :P
08:31:12 <oklopol> nooga i have a lot shorter quicksort than the page
08:31:19 <nooga> sow me
08:31:21 <nooga> show*
08:31:38 <oklopol> i'll search... no idea where it is
08:33:01 <oklopol> okay... was in a folder named posakdif
08:35:13 -!- Sgeo has quit (Remote closed the connection).
08:36:18 <oklopol> http://www.pastebin.ca/364621
08:37:05 <oklopol> i had a lot shoter one than that... put i did some very strange things
08:37:11 <oklopol> and it failed from time to time
08:37:15 <nooga> cool
08:37:37 <nooga> but you must admit that reversed quine is genious
08:37:43 <oklopol> something like using then same operator many times...
08:37:46 <oklopol> i don't remember
08:37:48 <oklopol> :D
08:38:04 <nooga> (7:C",228!R!C!"7822,"R:!R!"9822,"C:7(:R",228(7:C",2289"!R!:R",2287"!C!RR!C!"7822,"R:!R!"9822,"C:7(
08:38:11 <nooga> the beauty
08:38:24 <oklopol> yeah it's pretty cool :D
08:38:48 <oklopol> 7( in the end... eof can be there?
08:39:07 <nooga> it's within a string
08:40:09 <oklopol> hard to say, i can't read that anymore
08:40:15 <oklopol> :D
08:40:25 <nooga> need to make indents
08:40:25 <oklopol> ':' is?
08:40:42 <oklopol> where?
08:40:43 <nooga> what?
08:40:53 <oklopol> what's :
08:40:55 <oklopol> i forgot
08:40:59 <nooga> in that quine, to see the structure
08:41:05 <nooga> :ab --> a=b
08:41:30 <oklopol> haven't played with sadol after you were here last
08:41:42 <nooga> ow
08:42:14 <oklopol> !
08:42:15 <oklopol> ?
08:42:17 <EgoBot> Huh?
08:42:18 <oklopol> ! does?
08:42:21 <EgoBot> Huh?
08:42:25 <nooga> well.. bbl, classes start in 10 mins
08:42:36 <oklopol> ! first
08:42:39 <EgoBot> Huh?
08:42:49 <nooga> ! prints
08:42:51 <EgoBot> Huh?
08:42:57 <oklopol> though so
08:42:58 <oklopol> have fun
08:43:03 <nooga> rtfm ;p
08:43:20 <nooga> http://esolangs.org/wiki/SADOL here's the cheat sheet
08:49:30 <oklopol> haha
08:49:39 <oklopol> i just came up with trecursion :)
08:50:23 <oklopol> it's neat, gotta come up with a lang around it
09:43:13 -!- oklofok has joined.
09:43:14 -!- oklopol has quit (Read error: 104 (Connection reset by peer)).
09:57:20 -!- oklodok has joined.
09:57:22 <oklodok> olp.
09:57:39 <oklofok> pop.
09:57:43 -!- oklofok has changed nick to oklopol.
09:57:52 <oklopol> %out oklodok
09:57:56 -!- oklodok has left (?).
10:23:57 -!- nazgjunk has joined.
10:31:37 -!- ais523 has joined.
10:37:07 -!- UpTheDownstair has joined.
10:37:57 -!- nazgjunk has quit (Read error: 104 (Connection reset by peer)).
10:40:14 -!- UpTheDownstair has changed nick to nazgjunk.
10:51:30 -!- nazgjunk has quit ("Bi-la Kaifa").
11:08:17 -!- nazgjunk has joined.
11:16:32 <ais523> I was impressed with Keymaker's Underload interpreter in Brainfuck
11:16:56 <ais523> so I wrote a Brainfuck (minus input) to Underload compiler: http://pastebin.ca/364737
11:21:18 <ais523> !help daemon
11:21:21 <EgoBot> Use: daemon <daemon> <daemon-command> Function: start a daemon process.
11:21:48 <ais523> !daemon ul bf http://www.bf-hacks.org/hacks/uload.b
11:22:01 <ais523> !ul (Hello, world!)S
11:22:18 <ais523> !ps
11:22:21 <EgoBot> 2 ais523: ps
11:23:38 <ais523> !help bf
11:23:39 <EgoBot> To use an interpreter: <interpreter> <program> Note: <program> can be the actual program, an http:// URL, or a file:// URL which refers to my pseudofilesystem.
11:24:26 <ais523> !daemon ul bf http://www.bf-hacks.org/hacks/uload.b
11:24:30 <ais523> !ps
11:24:34 <EgoBot> 3 ais523: ps
11:24:38 <oklopol> "<program> can be the actual program" means you can write the binary there i assume?
11:24:55 <ais523> You can write the source code straight in, like this:
11:24:57 <oklopol> oh
11:25:02 <oklopol> it's not the interpreter
11:25:04 <ais523> !bf +++++++++++++++++++++++++++++++++++.+.+.+.+.
11:25:06 <EgoBot> #$%&'
11:25:07 <oklopol> :)
11:25:15 <oklopol> yeah
11:25:27 <ais523> but for some reason, daemoning the Underload compiler doesn't seem to take
11:25:28 <oklopol> i reada quickly, though program meant the interpreter
11:25:31 <oklopol> *read
11:25:36 <oklopol> !help
11:25:38 <EgoBot> help ps kill i eof flush show ls bf_txtgen usertrig daemon undaemon
11:25:40 <EgoBot> 1l 2l adjust axo bch bf{8,[16],32,64} funge93 fyb fybs glass glypho kipple lambda lazyk linguine malbolge pbrain qbf rail rhotor sadol sceql trigger udage01 unlambda whirl
11:26:22 <ais523> !daemon ul bf8 http://www.bf-hacks.org/hacks/uload.b
11:26:26 <ais523> !ps
11:26:30 <EgoBot> 4 ais523: ps
11:27:49 <ais523> !daemon dup bf >+[>,]<[<]>[>.]<[<]>[>.]
11:27:53 <ais523> !ps
11:27:56 <EgoBot> 5 ais523: ps
11:28:04 <ais523> !dup Hello, world!
11:28:26 <ais523> That's strange, there's no output but there isn't an error message either.
11:28:35 <ais523> !this makes no sense and should cause an error message
11:28:38 <EgoBot> Huh?
11:28:47 <ais523> !undaemon dup
11:28:50 <EgoBot> Process 4 killed.
11:29:55 <ais523> !daemon dup bf >++++++++++++++++++++++++++++++++[>,----------]<[<]>[++++++++++.>]<[<]>[>.]
11:30:05 <ais523> !dup Hello, world!
11:30:08 <EgoBot> *Hello, world!Hello, world!
11:30:42 <ais523> The problem seems to be that EgoBot is interpreting newline as newline (10), not EOF
11:31:03 <ais523> !undaemon ul
11:31:06 <EgoBot> Process 3 killed.
11:31:08 * oklopol slaps EgoBot
11:31:10 <ais523> !undaemon ul
11:31:24 <ais523> !ps
11:31:26 <EgoBot> 3 ais523: ps
11:31:40 <ais523> There are still two broken daemons lying around, it seems
11:31:49 <ais523> !undaemon ul
11:31:58 <ais523> !help eof
11:32:00 <EgoBot> Use: eof <pid> Function: send EOF to a process
11:32:07 <ais523> That looks promising
11:32:22 <ais523> !bf http://www.bf-hacks.org/hacks/uload.b
11:32:31 <ais523> !ps
11:32:34 <EgoBot> 3 ais523: bf
11:32:36 <EgoBot> 4 ais523: ps
11:32:48 <ais523> !i 3 (Hello, world!)S
11:32:51 <ais523> !eof 3
11:32:54 <EgoBot> Hello, world!
11:33:33 <ais523> !kill 1
11:33:34 <EgoBot> Process 1 killed.
11:33:36 <ais523> !kill 2
11:33:38 <EgoBot> Process 2 killed.
11:33:40 <ais523> !ps
11:33:42 <EgoBot> 1 ais523: ps
11:34:25 <ais523> !help usertrig
11:34:28 <EgoBot> Use: usertrig <command> <trig-command> Function: manage user triggers. <command> may be add, del, list or show.
11:34:57 <ais523> !bf-textgen +[]
11:35:00 <EgoBot> Huh?
11:35:06 <ais523> !bf-txtgen +[]
11:35:10 <EgoBot> Huh?
11:35:20 <ais523> !bf_txtgen +[]
11:35:50 <EgoBot> 45 +++++++++[>+++++>++++++++++>><<<<-]>--.>+.++. [473]
11:36:21 <ais523> I'm sure that >><< bit can be shortened
11:37:50 <oklopol> :P
11:40:54 <ais523> !bf http://www.bf-hacks.org/hacks/uload.b
11:41:55 <ais523> !i 1 (:aSS):aSS
11:41:57 <ais523> !eof 1
11:42:00 <EgoBot> (:aSS):aSS
11:42:09 <ais523> Underload is a good language for writing quines in
11:43:10 <oklopol> StringIO's eof check in python?
11:45:28 <ais523> I can't figure out the context of your last comment
12:02:16 -!- oklopol has quit (Read error: 104 (Connection reset by peer)).
12:02:26 -!- oklopol has joined.
12:36:30 <oklopol> i've asked this before
12:36:31 <oklopol> but
12:37:02 <oklopol> can i reach a var of the parent functions in a subfunction
12:37:10 <oklopol> in python
12:37:47 <oklopol> def oso:
12:37:48 <oklopol> a=""
12:37:48 <oklopol> def b:
12:37:48 <oklopol> a="adsf"
12:37:48 <oklopol> b()
12:37:48 <oklopol> print a
12:38:52 <oklopol> hmm... globals might be the answer, can a global be global in a function?
12:39:07 <oklopol> def oso:
12:39:08 <oklopol> a=""
12:39:08 <oklopol> def b:
12:39:08 <oklopol> global a
12:39:08 <oklopol> a="adsf"
12:39:08 <oklopol> b()
12:39:10 <oklopol> print a
12:43:24 <oklopol> i feel leetish when i write an interpreter and then close python without saving :)
12:43:42 <oklopol> "lol i can rewrite this in 5 min"
12:54:32 -!- helios24 has joined.
12:54:46 <oklopol> python 2.5 won't work... something about a refused connection...
12:54:49 <oklopol> :\
12:54:50 <oklopol> wtf
12:57:46 <oklopol> is there True?true_stuph:false_stuph in python?
12:57:54 <oklopol> cond?true_stuph:false_stuph in python?
12:58:39 <oklopol> python 2.5 works fine until i click ok on these all-ways-on-to error messages
12:58:51 <oklopol> after which it quits
12:59:03 <oklopol> *always-on-top
12:59:05 <oklopol> :)
12:59:21 <ais523> ~exec sys.stdout(true?"True":"False")
12:59:37 <ais523> seems as though Python doesn't have a ?: operator
12:59:52 <ais523> ~exec sys.stdout("The previous line would have worked if I had a ?: operator")
12:59:52 <bsmnt_bot> The previous line would have worked if I had a ?: operator
13:01:37 <oklopol> True
13:01:49 <oklopol> ~exec sys.stdout(True?"True":"False")
13:02:08 <oklopol> ~exec sys.stdout(("True" if True else "False"))
13:02:33 <oklopol> ~exec sys.stdout((if True then "True" else "False"))
13:03:19 <oklopol> ~exec sys.stdout((["True" for i in [True] if i]+["False"])[0])
13:03:20 <bsmnt_bot> True
13:03:27 <oklopol> ~exec sys.stdout((["True" for i in [False] if i]+["False"])[0])
13:03:27 <bsmnt_bot> False
13:03:38 <oklopol> handy, i must say -____-
13:07:55 <oklopol> def cond_to_for(cond,true,false):
13:07:56 <oklopol> ([true for i in [cond] if i]+[false])[0]
13:07:57 <oklopol> hmph
13:08:03 <oklopol> i don't know how to use exec it seems
13:16:34 <oklopol> http://www.pastebin.ca/364857
13:16:46 <oklopol> i have some serious mental problems :<
13:16:54 <oklopol> exec... wtf, this is metaproggin
13:17:44 -!- helios24 has quit ("Leaving").
13:39:17 -!- jix has joined.
13:39:20 <oklopol> (23)+(23,6424)+(23534,653) -> (23,23,6424,23534,653) <<<<<< how is that done?
13:39:23 <oklopol> in python
13:39:35 <oklopol> + is not right
13:49:58 -!- helios24 has joined.
13:54:11 -!- helios24 has quit (Client Quit).
13:54:43 -!- ais523 has quit ("/quit").
13:56:13 -!- helios24 has joined.
13:56:17 <nooga> y00
13:56:21 <nooga> sup?
14:03:33 <oklopol> is there something like StringIO in haskell?
14:03:40 <oklopol> it would be a cheat of course
14:03:49 <oklopol> but i suppose you have one anyway
14:04:07 <oklopol> python's StringIO, the one bsmntbombdood used
14:18:02 -!- helios24 has quit (Remote closed the connection).
14:22:23 -!- tgwizard has joined.
14:22:51 <nooga> huh
14:24:00 <nooga> well
14:24:37 <nooga> http://strlen.com/aardappel/index.html this might be interesting
14:25:08 -!- helios24 has joined.
14:26:01 <oklopol> yeah, wouter's a pro
14:26:28 <nooga> yeah, but false is not as good as sadol :d
14:28:33 <nooga> :X
14:29:08 <oklopol> sorry to say but it is :\
14:29:08 <oklopol> well, i like it more
14:29:15 <nooga> YEAH!
14:29:38 <nooga> what really lacks in sadol is classic higher order functions
14:30:30 <nooga> sadol is completely functional but not in the normal wa
14:30:34 <nooga> way
14:32:41 <nooga> when i designed it i didn't even know what is lambda ;d
14:34:26 -!- oklofok has joined.
14:34:32 -!- oklopol has quit (Read error: 104 (Connection reset by peer)).
14:36:49 <nooga> ;p
14:43:25 -!- oklofok has changed nick to oklopol.
14:43:48 <nooga> once i had an idea to write simple lisp interpreter in SADOL
14:43:55 <nooga> ;d
14:45:31 <oklopol> we all snap from time to tim
14:45:33 <oklopol> *time
14:46:38 <nooga> :D
14:46:44 <nooga> but it's possible
14:46:54 <nooga> and even not so hard
14:47:19 <nooga> but it requires enormous amoun of time I don't have
14:48:58 <oklopol> true
14:58:25 <nooga> g2g
14:58:26 <nooga> bbl
15:10:26 -!- oklopol has quit (Read error: 104 (Connection reset by peer)).
15:11:06 -!- oklopol has joined.
15:39:50 -!- goban has quit (Read error: 104 (Connection reset by peer)).
15:58:11 -!- goban has joined.
16:08:20 -!- goban has quit (Read error: 104 (Connection reset by peer)).
16:08:43 -!- goban has joined.
16:09:03 -!- oklopol has quit (Read error: 104 (Connection reset by peer)).
16:09:13 -!- oklopol has joined.
16:18:06 -!- goban has quit (Read error: 104 (Connection reset by peer)).
16:18:23 -!- goban has joined.
16:25:43 <SimonRC> My compiler lecturer is a bastard.
16:26:16 <SimonRC> Basically our assignment is: "This is a 1.24M-instruction machine code program. Make it faster."
16:29:56 -!- goban has quit (Operation timed out).
16:30:59 -!- crathman has joined.
16:31:53 -!- goban has joined.
16:34:35 <GregorR> SimonRC: He's really just a programmer using a class of students to cheat for his company :P
16:35:05 <oklopol> SimonRC that sounds fun imo
16:35:32 <GregorR> That sounds like quite possibly the least fun thing imaginable.
16:36:12 <GregorR> "Tedius" would be a better word.
16:37:02 <GregorR> Plus an o in there :P
16:37:25 <oklopol> well, if you do it manually
16:37:27 <oklopol> i wouldn't
16:37:40 <oklopol> i assume it's a metaprogramming task
16:45:45 <SimonRC> Ah, I forgot to mention...
16:45:51 <SimonRC> It is for a VM
16:45:56 <SimonRC> A 2200-year-old VM
16:46:06 <SimonRC> http://www.boundvariable.org/um-spec.txt
16:46:17 <SimonRC> oklopol: indeed it is
16:46:36 <SimonRC> After all, he has just taught us about optimisation.
16:47:34 -!- oklofok has joined.
16:47:35 -!- oklopol has quit (Read error: 104 (Connection reset by peer)).
16:51:18 <oklofok> yeah
16:51:23 <oklofok> then i'd find it fun
16:51:28 <oklofok> maybe i'm sick somehow
16:51:31 -!- oklofok has changed nick to oklopol.
16:52:05 <oklopol> my project in the uni is to create a jave class that can randomize a poker hand and check for straight and flush...
16:52:08 <oklopol> *java
16:53:23 <oklopol> basically a 20 minute job max, but it required a plan that has to be checked before implementation... plus a 5 page documentation
16:53:29 <oklopol> *requires
16:53:44 <oklopol> actually, the example documentation is 15 pages
16:55:05 <SimonRC> The assignment is supposed to be about 10h work.
16:56:23 <oklopol> maybe, would take longer for me, prolly
16:57:37 -!- SevenInchBread has quit (Read error: 145 (Connection timed out)).
17:01:59 -!- FabioNET has joined.
17:02:35 -!- FabioNET has quit (Remote closed the connection).
17:03:51 -!- sp3tt has quit (Read error: 54 (Connection reset by peer)).
17:08:28 -!- FabioNET has joined.
17:43:50 -!- sp3tt has joined.
17:46:50 -!- sp3tt has quit (Read error: 104 (Connection reset by peer)).
17:48:07 * SimonRC goes. (Bizarre coursework: http://www.dur.ac.uk/s.r.clarkstone/ASAM%20Compilers%20coursework.eml )
17:49:50 -!- ais523 has joined.
17:51:13 -!- sp3tt has joined.
17:54:18 -!- sp3tt has quit (Read error: 104 (Connection reset by peer)).
17:57:37 -!- sp3tt has joined.
18:01:17 -!- sp3tt has quit (Read error: 104 (Connection reset by peer)).
18:05:59 -!- sp3tt has joined.
18:29:36 -!- sebbu has joined.
18:31:54 <xor> dur
18:38:57 <SimonRC> hm
18:42:54 <ais523> I'll have to complain again about a lack of context, after reading the previous two lines and today's logs
18:47:52 <ais523> !bf http://www.bf-hacks.org/hacks/uload.b
18:48:21 <ais523> !i 1 (:*)(:::::::*******)^(*)~^S
18:48:23 <ais523> !eof 1
18:48:25 <EgoBot> ****************************************************************************************************************************************************************************************************************************************************************
18:50:26 <GregorR> .
18:50:32 <GregorR> ?
18:53:14 -!- sp3tt has quit (Read error: 54 (Connection reset by peer)).
18:55:52 <ais523> I was getting EgoBot to run Underload
18:56:11 * GregorR doesn't know what underload is ^^
18:56:23 <ais523> http://esolangs.org/wiki/Underload
18:56:58 <ais523> I can't daemon Keymaker's interpreter, though, because it expects EOF at the end of the program rather than newline
18:57:18 <GregorR> Aww :(
18:57:36 <GregorR> It could be modified ... but BF is sort of write-only coding ^^
18:58:18 <ais523> It shouldn't be too hard; the start of the program looks like a EOF-seeking routine to read the whole program, which could be modified independently
18:58:49 <ais523> Anyway, I was sufficiently impressed with the Underload interpreter in BF that I wrote a BF (minus input) to Underload compiler: http://pastebin.ca/364737
18:59:10 -!- sp3tt has joined.
19:03:39 <ais523> !daemon ul bf http://pastebin.ca/raw/365170
19:03:49 <ais523> !ul (Hello, world!)S
19:03:52 <EgoBot> Hello, world!
19:03:59 <GregorR> Whoot
19:04:00 <ais523> !ps
19:04:00 -!- sp3tt has quit (Read error: 104 (Connection reset by peer)).
19:04:04 <EgoBot> 1 ais523: ps
19:04:08 <GregorR> !ps d
19:04:12 <EgoBot> 1 GregorR: ps
19:04:21 <GregorR> OK, so it closes after receiving one line ;)
19:04:25 <ais523> The modified version ends after it runs one program, though
19:04:31 <ais523> Crossed messages...
19:05:18 -!- ais523 has quit ("I have to go home").
19:09:40 -!- sp3tt has joined.
19:22:49 -!- oklopol has quit (Read error: 104 (Connection reset by peer)).
19:25:13 -!- oklofok has joined.
19:42:50 -!- sp3tt has quit (Read error: 131 (Connection reset by peer)).
19:56:02 -!- sp3tt has joined.
20:00:12 -!- oklofok has changed nick to oklopol.
20:04:44 -!- voodooattack has joined.
20:28:13 -!- crathman has quit ("Chatzilla 0.9.77 [Firefox 2.0.0.1/2006120418]").
21:22:43 -!- wooby has joined.
21:39:29 -!- jix has quit ("Bitte waehlen Sie eine Beerdigungnachricht").
22:47:51 -!- sebbu has quit ("@+").
22:51:46 -!- goban has quit (Read error: 54 (Connection reset by peer)).
22:51:59 -!- goban has joined.
23:12:39 -!- nazgjunk has changed nick to na[zZz]gjunk.
23:15:30 <SimonRC> exercise: write a turing-machine evaluator in the lambda calculus.
23:15:50 <SimonRC> evil exercise: write a lambda-calculus evaluator for the turing machine
23:15:57 <SimonRC> :-P
23:16:00 * SimonRC goes for a bit
23:16:29 <xor> heh
23:16:42 * xor just wrote a ski calculus interpreter
23:19:01 <xor> unparse(simp(parse("```S`KKIx"))) ==> "`Kx"
23:22:35 -!- tgwizard has quit (Remote closed the connection).
23:22:45 <xor> unparse(simp(parse("```S``SI`KS`KKx"))) ==> "``xSK"
23:24:40 <xor> :)
23:25:18 * oklopol has nothing clever to say
23:25:19 -!- SevenInchBread has joined.
23:25:37 * oklopol leaves feeling embarrassed -->
23:25:54 <SevenInchBread> hmmm... interesting.
23:26:03 <SevenInchBread> Anyone heard of the term "rope" as a datatype?
23:26:22 <SevenInchBread> I just read about it.
23:26:26 <oklopol> <--
23:26:30 <oklopol> url
23:27:18 <SevenInchBread> It's basically a binary tree of arrays of characters (a tree of strings).
23:27:58 <oklopol> omg! -------------->
23:28:21 <SevenInchBread> so to concatenate ropes you just make a new node, with the two ropes being the branches.
23:29:19 <xor> ?
23:32:26 <SevenInchBread> IT apparently makes concatenation operations faster... at the expense of a few extra chunks of memory lying around.
23:36:56 <xor> I wonder how to make it reduce things like S(KK)I automatically
23:37:30 <xor> (using extensionality)
23:37:51 <SevenInchBread> hmm... well...
23:38:36 <SevenInchBread> let's see... I don't know if ropes would actually make anything faster. It lightens the burden of the concatenation operation... but in doing so it makes it less straightforeward to traverse.
23:38:58 <xor> concantenation of strings is only O(n)
23:40:27 <SevenInchBread> well... that adds up when you insert values onto strings continuously.
23:41:42 -!- FabioNET has quit (Client Quit).
23:47:48 -!- wooby has quit.
←2007-02-19 2007-02-20 2007-02-21→ ↑2007 ↑all