←2008-04-15 2008-04-16 2008-04-17→ ↑2008 ↑all
00:03:46 <Slereah> Ahah!
00:03:48 <Slereah> Gato works.
00:03:56 <Slereah> Maybe I can write the Andrei Machine 9000!
00:04:10 <ehird> Slereah: zgoshmgz
00:05:49 <Slereah> I am full of hope.
00:06:01 <Slereah> I really don't want to write it in Python.
00:06:13 <ehird> Slereah: whuts gato
00:06:46 <ehird> http://gato.sourceforge.net/http://gato.sourceforge.net/?
00:06:49 <Slereah> It's a program to write algorithms on graphs.
00:06:55 <Slereah> Yes, that one.
00:06:59 <ehird> Slereah: im sorry but that code is python
00:07:01 <ehird> they just embed it
00:07:05 <ehird> and add their own functions
00:07:25 <Slereah> Yes.
00:07:37 <Slereah> But what I mean is, I don't want to build everything
00:07:57 <Slereah> I am terrible at coding, so I really don't want to write the whole graph gestion myself
00:08:27 <Slereah> Plus, all my interpreters have some way of seeing what happens to the machine, and I don't want to make an exception.
00:09:19 <ehird> Slereah: Cool.
00:14:17 -!- timotiis has quit ("rebloodybooting! They said I wouldn't have to do this on linux!").
00:14:27 <ehird> hah
00:16:41 -!- timotiis has joined.
00:18:20 <ehird> timotiis: sorry
00:18:45 <timotiis> hehe
00:39:46 <AnMaster> http://rafb.net/p/dUgDuS45.html
00:39:53 <AnMaster> looks like ccbi is broken Deewiant ^
00:50:03 -!- Sgeo has joined.
00:53:14 -!- timotiis has quit (Connection timed out).
01:01:58 -!- Sgeo has quit (Read error: 104 (Connection reset by peer)).
01:05:20 -!- Sgeo has joined.
01:17:05 <Sgeo> On Fark:
01:17:06 <Sgeo> "There are actually people named null, and yes, I've actually seen this cause problems in production database code. 'Null' was the last name where I saw it however."
01:26:31 <ehird> hmm
01:27:10 <ehird> public class Closure<T,U> { public Closure(Object... vars); public U apply(T arg); }
01:27:15 <ehird> e.g.
01:27:45 <ehird> new Closure<Integer,Integer>(a, b, c) { public Integer apply(Integer n) { return n + (Integer)this.vars[0]; } }
01:27:51 <ehird> this.vars={a,b,c}
01:28:01 <ehird> maybe nice if you are compiling a language to jvm
01:55:14 <oklofok> hah! ehird: i was not there!
01:55:25 <oklofok> *here
01:55:29 <ehird> oklofok: heh
01:57:13 <ehird> oklofok: but ... yeah
01:57:22 <ehird> that's also why you shouldnt compile oklotalk-- to the jvm, btw
01:57:25 <ehird> it doesn't like closures
02:00:10 <oklofok> i would probably make the compilation at a bit lower level
02:00:29 <oklofok> but python bytecode might be nicer
02:00:47 <oklofok> also, as i don't really like java, i don't really wanna use it's bytecode
02:00:48 <oklofok> :o
02:00:55 <oklofok> anyway, /me goes back
02:01:04 <oklofok> before you start asking again :-)
02:01:06 <oklofok> ->
02:27:05 -!- Quendus has quit (Read error: 113 (No route to host)).
02:27:42 -!- Quendus has joined.
02:30:10 <ehird> quendus
02:30:12 <ehird> haven't seen that name
02:30:13 <ehird> hi
04:06:47 -!- ehird has quit (Read error: 104 (Connection reset by peer)).
04:25:02 <Sgeo> The Security Manager is vetoing my using Firebug in Fx3..
04:25:26 <Sgeo> >>> 2+2
04:25:26 <Sgeo> commandLine.evaluate FAILS: [Exception... "Security Manager vetoed action" nsresult: "0x80570027 (NS_ERROR_XPC_SECURITY_MANAGER_VETO)" location: "JS frame :: chrome://firebug/content/commandLine.js :: <TOP_LEVEL> :: line 100" data: no]
04:26:35 -!- fizzie has quit (Remote closed the connection).
04:26:39 -!- fizzie has joined.
04:38:56 -!- adu has joined.
05:00:34 <Sgeo> lol at http://youtube.com/watch?v=g3KufmUlF5M
05:00:39 <Sgeo> (I'm commented SJGster)
05:38:45 -!- calamari has joined.
05:38:50 <calamari> hi
05:39:36 <Sgeo> Hi calamari
05:39:41 <Sgeo> http://youtube.com/watch?v=g3KufmUlF5M == fail
05:44:37 <adu> hi
06:20:58 -!- calamari has quit ("Leaving").
06:38:41 <Deewiant> AnMaster: cheers, I'll take a look tonight
06:45:44 -!- olsner has joined.
06:47:42 -!- Sgeo has quit ("Ex-Chat").
07:14:01 -!- GregorR-L has joined.
07:14:03 <GregorR-L> http://www.cafepress.com/bizarregeek.255291006
07:14:55 <GregorR-L> (For those who like CAs :P )
07:42:46 <AnMaster> Deewiant, not that mine works perfectly either so far
07:43:08 <AnMaster> Deewiant, it fails when using garbage collector for unknown reason
07:59:59 -!- clog has quit (ended).
08:00:00 -!- clog has joined.
08:10:35 -!- adu has quit ("Bye").
08:34:12 -!- olsner has quit ("Leaving").
08:36:00 -!- Iskr has joined.
09:02:45 <AnMaster> Deewiant, actually the issue seems to depend on how you interpret the PERL fingerprint docs... hm...
09:03:29 <AnMaster> "-e print 'A',eval(%s)" or "-e print 'A';eval(%s)"
09:03:34 <AnMaster> where %s is the popped string
10:16:42 -!- GregorR-L has quit (Read error: 110 (Connection timed out)).
10:20:48 <oklofok> okokoko
10:20:51 <oklofok> ->
11:06:50 -!- timotiis has joined.
11:28:09 <Deewiant> AnMaster: okay, so we want the Perl program to be able to use the std streams as normal, but how do we get the eval result out then?
11:28:36 <Deewiant> I'm confused as to how that would be possible
11:32:35 <Deewiant> would just "$x = eval(%s); print 'A',$x" work? can the %s mess with a variable called $x in some way? (I'm unaware of the limitations of eval in Perl)
11:43:23 -!- dbc has joined.
11:56:57 <Deewiant> and hmm, even that wouldn't work, since %s might print A and $x might contain A
12:02:17 <AnMaster> hm ok
12:02:37 <AnMaster> Deewiant, I'm no perl expert either
12:02:40 <AnMaster> far from
12:03:24 <AnMaster> bbl
12:03:27 <Deewiant> I'd say the simplest solution here is to say that accessing stdout is undefined
12:03:37 <Deewiant> alternatively make it stderr for more convenience
12:07:49 -!- Sgeo has joined.
12:36:13 -!- jix has joined.
12:59:32 <AnMaster> Deewiant, I capture both stdout and stderr
12:59:34 <AnMaster> that isn't hard
13:00:28 <Deewiant> AnMaster: yes, but how do you get the eval result
13:01:42 <AnMaster> Deewiant, just int fds[2]; pipe(fds); pid = fork() if (pid == 0) { /* in child */ dup2(fds[1], 1); dup2(fds[1], 2); .... execvp("perl", arguments); } else { ... read(fds[0], ...) ... }
13:01:54 <Deewiant> yes, capturing stderr is trivial
13:01:55 <Deewiant> I know this
13:01:56 <AnMaster> Deewiant, well a good question
13:02:16 <AnMaster> the specs are unclear on what to exactly capture I think?
13:02:21 <AnMaster> what exactly to*
13:02:24 <Deewiant> no, I think it's clear
13:02:28 <AnMaster> hm
13:02:33 <Deewiant> it's the value of the expression evaled
13:02:41 <AnMaster> hm
13:02:52 <Deewiant> e.g. eval 2+2 and get 4.
13:02:54 <AnMaster> what about loading libperl.so, I think you can do something like tht
13:02:56 <AnMaster> that*
13:03:40 <Deewiant> possibly... but it shouldn't be necessary
13:03:51 <AnMaster> true
13:03:54 <Deewiant> based on what the docs say, as well
13:04:05 <AnMaster> anyway then S would get a lot more complex
13:04:09 <Deewiant> "It pushes a 1 on the stack otherwise, indicating that the Perl language will be shelled when needed.
13:04:11 <AnMaster> say "isn't loaded yet"
13:04:25 <AnMaster> hm true
13:04:40 <Deewiant> that speaks explicitly of shelling, so libperl.so is a no-go ;-)
13:04:58 <fizzie> I haven't read the whole discussion, but based on what I've seen: no-one says you need to limit yourself to STDOUT and STDERR, why not just open a pipe for file descriptor 3, and in Perl do open FD3, ">&3"; print FD3 eval(...);
13:05:11 <AnMaster> anyway, now I really understand why ppl don't use read() but use fread() instead
13:05:27 <AnMaster> it a lot easier to work with
13:05:54 <AnMaster> fizzie, interesting
13:06:08 <Deewiant> fizzie: isn't it possible for the perl code to always be using FD3 itself, though
13:06:26 <AnMaster> fizzie, that would print both the result of the eval as well as any print statements inside the eval?
13:06:29 <Deewiant> not very likely, but possible?
13:07:16 <Deewiant> and hmm, I wonder if that's possible on windows
13:07:32 <fizzie> Well, you'd get stdout, stderr and that eval result via three different pipes. But sure, the Perl code could use file descriptor 3 for something.
13:07:46 <AnMaster> hm
13:10:33 <AnMaster> also I wonder why I get a segfault with boehm-gc if I use execlp after fork(), execvp works
13:10:49 <AnMaster> it makes no sense to me
13:14:59 <AnMaster> even more interesting is using valgrind (GC disabled then)
13:15:16 <AnMaster> using --trace-children=yes cause things to fail if I use execvp, but they work with execlp
13:15:22 <AnMaster> only under valgrind that is
13:17:36 <AnMaster> Deewiant, btw, does windows have vfork()?
13:17:43 <Deewiant> windows doesn't have fork
13:17:44 <Deewiant> of any kind
13:18:08 <AnMaster> so how do you start another process without replacing the current one
13:18:22 <Deewiant> CreateProcessA/CreateProcessW
13:18:27 <Deewiant> don't ask me about the details
13:18:35 <Deewiant> I just use what Tango provides
13:19:07 <AnMaster> as far as I can see you need to fork() then { in child: dup2 and exec } { in parent: waitpid and read }
13:19:14 <AnMaster> hm
13:19:22 <Deewiant> windows doesn't use the fork/exec model
13:19:30 <AnMaster> I see
13:19:53 <AnMaster> hm actually I spend most code at doing read and trying to handle all the error conditions/results from it
13:20:05 <Deewiant> yep, same here
13:20:06 <AnMaster> ie, "do we need to realloc and read some more or are we done yet"
13:20:09 <Deewiant> just running the program is 2 lines :-P
13:20:24 <AnMaster> well a bit more for building arguments and such here
13:20:36 <AnMaster> but the read code is really a mess
13:22:13 <AnMaster> I think doing read into same buffer and keeping extending it may be the wrong way, read and then append the buffer to another buffer would be way easier, and, due to \0 termination, faster
13:22:17 <Deewiant> I think it'd be fair to just disallow stderr for PERL
13:22:26 <Deewiant> there's no way to write to stderr in Befunge otherwise either
13:22:29 <AnMaster> hm? well capturing it isn't an issue
13:22:38 <Deewiant> no
13:22:43 <Deewiant> but then you can reserve it for the eval result
13:22:51 <AnMaster> anyway I use a perror() after forking
13:22:52 <Deewiant> i.e. print stderr eval(%s)
13:23:08 <AnMaster> in case of exec fails
13:23:22 <Deewiant> and then you can pass the perl script's stdout through to the interpreter's stdout
13:23:31 <Deewiant> whilst capturing the stderr and reading the eval result from it
13:23:52 <AnMaster> Deewiant, hm and what about print stderr eval(print stdout "foo")?
13:23:58 <AnMaster> hm
13:24:01 <Deewiant> 2008-04-16 15:23:21 ( Deewiant) and then you can pass the perl script's stdout through to the interpreter's stdout
13:24:09 <AnMaster> Deewiant, not sure if that is a good thing or not
13:24:19 <Deewiant> I think it's the least error prone option
13:24:26 <Deewiant> + simple to implement :-P
13:25:43 <Deewiant> because it allows the PERL script to do output if it so wishes
13:25:58 <AnMaster> Deewiant, btw where do you close the fd in eval in perl.d
13:26:06 <AnMaster> or is D handling that for you?
13:26:12 <Deewiant> Tango does it
13:26:26 <Deewiant> in p.execute(); I would guess
13:26:50 <AnMaster> read = p.stdout.input.read(buf);
13:26:52 <AnMaster> hm
13:26:57 <AnMaster> stdout.input?
13:27:13 <Deewiant> the input stream of the process's stdout
13:27:32 <AnMaster> err, stdout is just output, it isn't bi-directional
13:27:50 <Deewiant> but if another program is writing to it what are you going to do
13:27:54 <Deewiant> you are going to read from it, no?
13:27:55 <Deewiant> so it's input
13:28:08 <Deewiant> similarly stdin is an output stream
13:28:09 <AnMaster> hm... yeah
13:28:19 <AnMaster> Deewiant, but then is stdout.output invalid?
13:28:28 <AnMaster> when done on another process
13:28:32 <Deewiant> yes, I think so
13:29:02 <fizzie> You could also in Perl do something like: open(REALERR, ">&STDERR); open(STDERR, ">&STDOUT); print REALERR eval(...); if you wanted to have all the eval'd piece outputs (both stdout and stderr) mixed in the stdout of the executed process, leaving the real stderr for the eval result. Of course the eval'd code could still get to the real stderr if it really wanted to.
13:29:10 <AnMaster> Deewiant, what is the print A bit about really btw
13:29:25 <Deewiant> AnMaster: it took me a while to figure out, too ;-)
13:29:40 <AnMaster> Deewiant, well you do it, I don't see why thoug
13:29:41 <Deewiant> AnMaster: the idea being that if %s prints to stdout, we take only the eval result.
13:29:41 <AnMaster> though
13:29:46 <Deewiant> I think.
13:29:49 <AnMaster> ah I see
13:29:59 <AnMaster> fizzie, heh
13:30:00 <Deewiant> but of course that doesn't work if the eval result contains A so it's crap. :-P
13:30:26 <AnMaster> fizzie, I know about 0 perl, I do know hello world in perl and I do know PCRE (by libpcre)
13:30:29 <AnMaster> but that's about it
13:30:33 <Deewiant> fizzie: hm, that might be a good idea actually.
13:30:59 <AnMaster> fizzie, so forgive me if I'm ignorant, but the quotes seem mismatched?
13:31:12 <AnMaster> open(REALERR, ">&STDERR); <-- as in that
13:31:24 <fizzie> Yes, there's two "s missing. I was about to metion it, but then didn't bother. Should be ">&STDERR".
13:31:30 <AnMaster> thanks
13:31:51 <Deewiant> fizzie: and then just tell the eval'd code not to mess with a stream called REALERR? Or is there another way it can subvert the whole thing?
13:32:28 <fizzie> Well, the eval'd code could use open(WHATEVER, ">&2"); and use WHATEVER to print to the real stderr file descriptor.
13:32:57 <Deewiant> Darn. There's no way to hide the real stderr completely?
13:33:20 <fizzie> I don't think there is, except of course closing it, but that kind-of defeats the purpose.
13:34:04 <Deewiant> Alright. Hmh.
13:34:58 <fizzie> Perl might have some sandbox-y functions (probably as CPAN modules) for limiting the things the eval'd code can do. And it might be possible to hook into Perl's "open" call behaviour somehow, but that would mean even more Perl-guts.
13:35:41 <Deewiant> ugh.
13:36:59 <AnMaster> hm
13:37:05 <AnMaster> killall perl? ;)
13:38:02 <AnMaster> fizzie, would calling it say, CFUNGE_REALERR work
13:38:17 <AnMaster> then I could just say "your own fault, cfunge is my namespace"
13:38:19 <Deewiant> AnMaster: unless the code uses something called CFUNGE_REALERR.
13:38:26 <Deewiant> AnMaster: or opens ">&2".
13:38:53 <AnMaster> point is, is _ valid or not
13:39:04 <Deewiant> sure
13:39:17 <AnMaster> well considering it's perl, it is bound to have some special meaning
13:39:18 <Deewiant> if not, call it CFUNGEISMYNAMESPACEYOUDORKREALERR
13:39:18 <Deewiant> :-P
13:39:28 <Deewiant> it's a lot like C lexically.
13:39:56 <AnMaster> well iirc it does have packages, ie use foo; not #include <foo.h>
13:40:08 <AnMaster> thought they provided kind of C++ namespaces
13:40:14 <AnMaster> I may totally wrong
13:40:38 <Deewiant> yes, not 'the same as C', just 'like C'.
13:40:52 <fizzie> Actually you could open(my $realerr, ">&STDERR); open(...); eval(...); which I _think_ would mean that the eval'd code wouldn't be able to access the filehandle directly, since there's no symbol table entry for it, just the reference in $realerr. (Can't remember details about lexically scoped "my" vars and eval, but at least with some minor changes.)
13:41:11 <fizzie> Still won't help with the open(FOO, ">&2"); problem.
13:41:36 <AnMaster> hm.
13:41:40 <fizzie> (With open my $realerr you'd then do print $realerr eval(...);)
13:42:14 <AnMaster> wait a second, is $ same as in bash or something else?
13:42:30 <fizzie> $ is just the prefix for a scalar variable.
13:42:44 <AnMaster> mhm same as in bash more or less then
13:42:56 <Deewiant> fizzie: perl -e 'my $x = 2; print eval($x+$x);' prints 4, at least.
13:43:23 <AnMaster> is that evaluated lexically like a pre-processor first?
13:43:49 -!- atsampson has quit (Read error: 113 (No route to host)).
13:43:54 <AnMaster> in bash you would need to escape the \$x in an eval statement
13:44:08 <AnMaster> because of order of expanding
13:44:41 <AnMaster> (however I will not write a perl escaper in C or something like that)
13:47:20 <fizzie> Well, if nothing else works, you can always use print $realerr eval {$realerr = undef; %s}; but that's butt-ugly. I'm pretty sure there is a better way for making a variable that doesn't leak into eval; lexically scoped vars evidently do.
13:48:34 <AnMaster> fizzie, there probably is indeed, it's perl after all
13:48:41 <fizzie> Actually more like eval { local $realerr = undef; %s } to avoid gobbling the real $realerr, but then it can't be a "my" variable.
13:48:59 <AnMaster> it is probably something like z having a special meaning in a special context *runs*
13:49:09 <AnMaster> remember, perl DOES have a entry on the esolang wiki
13:49:58 <AnMaster> I think someone said that instead of "foo" you could do q/foo/ in perl.
13:50:02 <AnMaster> or something like that
13:50:08 <Deewiant> you can do that in D 2.0 as well. :-)
13:50:25 <AnMaster> Deewiant, s/)/(/
13:50:45 <Deewiant> :-P
13:50:55 <AnMaster> and that was sed not perl!
13:51:17 <AnMaster> I have no problems using sed or awk
13:51:19 <Deewiant> it's also perl.
13:51:29 <AnMaster> Deewiant, yeah I thought so
13:51:31 <fizzie> Actually, if you're really doing string-substitution in the Perl code itself, you don't need eval, and this should work: my $code = sub { %s }; open my $realerr, ">&STDERR"; open STDERR, ">&STDOUT"; print $realerr $code->();
13:51:45 <AnMaster> fizzie, eh?
13:51:56 <Deewiant> fizzie: unfortunately the specs say that it should be an eval(). :-)
13:51:57 <AnMaster> "E ('Eval') pops a 0gnirts string and performs a Perl eval() on it, possibly (or not) shelling Perl as indicated by S above. The result of the call is pushed as a 0gnirts string back onto the stack."
13:52:07 <AnMaster> fizzie, from http://catseye.tc/projects/funge98/library/PERL.html
13:53:11 <fizzie> Oh. Well, my $code = sub { return eval('%s'); } ... then.
13:53:44 <Deewiant> in fact, isn't eval(%s) equivalent to %s always?
13:54:10 <Deewiant> where %s isn't wrapped in "" or '' or whatever of course
13:54:13 <AnMaster> Deewiant, hm... couldn't you pass a string to eval, read from say stdin?
13:54:50 <Deewiant> yes, but I'm just pondering.
13:55:06 <fizzie> I don't think eval(%s) really does much, since the %s is evaluated normally, and the result is then passed to the 'eval' function.
13:55:26 <Deewiant> eval(my $x = 1; print $x) versus my $x = 1; print $x
13:55:53 <Deewiant> ah
13:55:55 <Deewiant> "Alternatively, if given a block of code - that is, the code is known at compile time - eval traps run-time exceptions."
13:56:08 <AnMaster> what does that mean Deewiant ?
13:56:14 <fizzie> Actually "eval(my $x = 1; print $x)" shouldn't be syntactically right at all.
13:56:16 <AnMaster> divide by zero or?
13:56:18 <Deewiant> I don't know
13:56:23 <Deewiant> something like that probably
13:56:30 <AnMaster> fizzie, it shouldn't?
13:56:31 <Deewiant> fizzie: only expressions?
13:56:35 <fizzie> Eval takes either a string or a block of code and evaluates it.
13:56:45 <AnMaster> hm
13:56:50 <fizzie> perl -e 'eval(my $x = 1; print $x);' gives syntax error at -e line 1, near "1;"
13:57:08 <AnMaster> fizzie, perl -e 'eval(print "bar");' works though, hm
13:57:12 <Deewiant> alright
13:57:27 <Deewiant> AnMaster: that's an expression. you can pass the result of printf to a function in C just fine as well.
13:57:34 <AnMaster> hm
13:57:39 <AnMaster> right
13:58:10 <fizzie> Since the spec speaks of strings, I think it means one should do something like eval('%s'); but that would need escaping the 's in the string.
13:58:16 <fizzie> (Or reading it from stdin or some-such.)
13:58:31 <AnMaster> um
13:58:34 <AnMaster> perl -e 'print eval(4 + 5)'
13:58:42 <AnMaster> is not same as perl -e '4 + 5'
13:58:53 <AnMaster> and with multistatement just adding a print doesn't work
13:59:43 <AnMaster> you said something about code block?
14:00:34 <AnMaster> and then there is the question of non-matching ( and ) in the input hm...
14:00:41 <Deewiant> perl -e 'print eval("my $x = 1;")' prints nothing
14:00:49 <Deewiant> but it doesn't error out either
14:01:12 <AnMaster> "print eval(%s)", "10); something here(blah"
14:01:18 <AnMaster> yay perl injection?
14:01:22 <fizzie> perl -e 'print eval("my \$x = 1;")' however prints "1".
14:01:49 <Deewiant> argh, the shell goes inside "" inside ''
14:02:06 <Deewiant> stupid bash, just do what I mean
14:02:08 <AnMaster> Deewiant, err? bash doesn't at least
14:02:17 <Deewiant> well evidently it does
14:02:19 <AnMaster> perl -e 'print eval("my \$x = 1;")' works here
14:02:25 <fizzie> I think it's actually the Perl that does mess the $x inside a ""-string.
14:02:27 <Deewiant> or no, is that perl mucking it up
14:02:34 <AnMaster> Deewiant, indeed it is perl
14:02:35 <Deewiant> ayeh
14:02:39 <Deewiant> makes sense
14:02:54 <AnMaster> fizzie, so given the specs, how would you do it?
14:03:09 <Deewiant> I think sub { return eval('%s'); } is the best idea so far
14:03:22 <Deewiant> need to do escaping in %s though
14:03:26 <Deewiant> which is tricky
14:03:31 <AnMaster> yeah something I don't want to mess with
14:03:45 <AnMaster> considering the syntax of perl probably could escape escaping
14:03:48 <Deewiant> so, instead, return eval(%s);
14:03:58 <Deewiant> and statements are disallowed thus.
14:04:08 <AnMaster> hm doesn't that break the specs?
14:04:17 <fizzie> But eval(%s) makes really no sense. The '%s' part is evaluated before even passing the result to 'eval'.
14:04:17 <Deewiant> how?
14:04:37 <AnMaster> fizzie, hm ok
14:04:47 <Deewiant> then the specs are confused or PERL is practically impossible to implement without writing the interpreter in perl.
14:05:06 <AnMaster> fizzie, could you read the stuff for eval from stdin?
14:05:18 <AnMaster> because then perl would escape it itself kind of
14:05:33 <fizzie> Well, you could. Then you'd just use eval($s); after reading into $s.
14:05:42 <AnMaster> ie, $variable = read(); eval($variable)
14:05:49 <AnMaster> I don't know the needed syntax
14:06:03 <AnMaster> fizzie, and how would you read that?
14:06:10 <Deewiant> AnMaster: and if the perl script wants to read stdin?
14:06:17 <AnMaster> Deewiant, hm true
14:06:25 <fizzie> Well, you'd probably need to have some sort of length-prefix before the code, so that you can keep the stdin open for further reads.
14:06:38 <Deewiant> aye.
14:06:56 <AnMaster> also it need to be blocking read
14:07:15 <AnMaster> so if it get to read before the parent got to write, it would wait
14:08:24 <AnMaster> fizzie, well if you can write the needed perl code to read like that, I could do the C bit
14:08:33 <AnMaster> I wouldn't be able to do the perl bit sadly :/
14:08:39 <Deewiant> perl is trivial to learn
14:08:47 <Deewiant> for short stuff like that I mean
14:08:49 <fizzie> If you don't want to use a prefix, you could use that file descriptor 3, read the code-to-evaluate and then close it.
14:08:57 <AnMaster> fizzie, prefix could work
14:09:03 <Deewiant> prefix is fine
14:09:10 <AnMaster> I guess just write(fd, strlen(perlcode))?
14:09:20 <Deewiant> however you choose to implement it
14:09:28 <Deewiant> I guess that'd work the easiest
14:09:30 <AnMaster> or if you want as a string
14:09:43 <fizzie> Well, it's easier to "read until eof" in one line of Perl than it is to "read at least this many bytes".
14:09:50 <AnMaster> ie snprintf("%d", strlen...")
14:10:07 <AnMaster> hm EOF isn't a special char is it
14:10:09 <Deewiant> it's easier in most languages without scanf.
14:10:15 <Deewiant> EOF isn't a char.
14:10:25 <Deewiant> or even with scanf, I guess.
14:10:55 <AnMaster> fizzie, well, input would be a pipe created with pipe() in C in my case
14:10:55 <fizzie> my $code = ''; open FD3, "<&3"; $code .= $_ while <FD3>; close FD3; might do it.
14:11:12 <Deewiant> using just stdin makes that a bit easier.
14:11:16 <AnMaster> not sure how I would send a EOF that way
14:11:23 <Deewiant> my $code = ''; $code .= $_ while <>;
14:11:29 <Deewiant> or what
14:11:37 <Deewiant> AnMaster: you send EOF by closing the pipe.
14:11:42 <Deewiant> or file descriptor, or whatever.
14:11:45 <AnMaster> hm ok
14:11:57 <AnMaster> Deewiant, well a pipe is a set of two connected fd's in this case
14:12:14 <fizzie> If you close the write end, the read end should get an eof.
14:12:17 <Deewiant> well you close the input stream.
14:16:32 <AnMaster> fizzie, then print eval($code) or?
14:16:39 <AnMaster> or "$code"?
14:17:25 <Deewiant> no difference in perl, just like in bash :-)
14:17:32 <fizzie> Yep.
14:17:43 <AnMaster> Deewiant, there is a difference in bash
14:17:49 <AnMaster> foo="bar quux"
14:17:53 <AnMaster> echo $foo
14:17:55 <Deewiant> nope, no difference.
14:17:55 <AnMaster> echo "$foo"
14:18:01 <Deewiant> ?
14:18:03 <AnMaster> the difference is that $foo will expand to two parameters
14:18:09 <Deewiant> yes
14:18:10 <AnMaster> while "$foo" won't
14:18:21 <AnMaster> for echo it doesn't matter
14:18:23 <Deewiant> but the string itself is the same, it's just the way it's passed to another program that differs
14:18:28 <AnMaster> for say grep on a filename it would
14:18:33 -!- timotiis has quit (Connection timed out).
14:18:33 <AnMaster> if the filename contains spaces
14:18:38 <Deewiant> since eval() is a builtin function, not another program, it makes no difference.
14:18:49 <Deewiant> I would assume that it's the same for any builtin function of bash.
14:18:51 <AnMaster> Deewiant, for bash it matters for builtins too
14:18:59 <Deewiant> example? O_o
14:19:35 <AnMaster> echo will do the same, but say: foo="echo bar"
14:19:36 <AnMaster> then
14:19:40 <AnMaster> $foo
14:19:43 <AnMaster> and "$foo"
14:19:47 <AnMaster> would be different
14:19:50 <AnMaster> the first would echo bar
14:19:51 -!- timotiis has joined.
14:20:06 <AnMaster> the second would likely say "echo bar" not such command or something like that
14:20:36 <AnMaster> Deewiant, and say test -f $file and test -f "$file" would differ when $file contains spaces
14:20:53 <AnMaster> test is a builtin yes
14:21:33 <AnMaster> Deewiant, oh and: foo="bar quux"; for i in $foo; do echo "$i"; done
14:21:43 <AnMaster> is different from: foo="bar quux"; for i in "$foo"; do echo "$i"; done
14:21:50 <fizzie> Bash is indeed prone to splitting things at spaces; but in Perl I think there's a difference only if $foo doesn't happen to be a string.
14:22:16 <AnMaster> fizzie, well there are exceptions:
14:22:23 <AnMaster> foo="abc def"
14:22:26 <AnMaster> bar=$foo
14:22:33 <AnMaster> would be the same as:
14:22:35 <AnMaster> bar="$foo"
14:22:37 <AnMaster> in that case
14:22:40 <AnMaster> however...
14:22:50 <AnMaster> foo="abc def" is not the same as foo=abc def
14:23:05 <AnMaster> the latter would try to run def with foo=abc in the environment
14:23:15 <AnMaster> Deewiant, enough examples?
14:23:17 <AnMaster> ;P
14:24:33 <AnMaster> fizzie, would this mean something like:
14:24:45 <AnMaster> my $code = ''; $code .= $_ while <>; open(CFUNGE_REALERR, ">&STDERR"); open(STDERR, ">&STDOUT"); print CFUNGE_REALERR eval($code)
14:24:45 <AnMaster> ?
14:25:39 <fizzie> Yes, if you don't mind losing the use of STDIN in the Perl code. (And of course you can avoid the CFUNGE_REALERR "problem" with a bit more trickery.)
14:26:26 <AnMaster> well how would I then save and restore the stdin?
14:26:38 <AnMaster> or actually I could just use fd3 I guess
14:26:46 <Deewiant> or just pass the length first.
14:26:54 <Deewiant> and then read only <length> bytes to $code.
14:27:09 <fizzie> Yes, but with the length-prefix the reading is more complicated. (Of course with fd3 the writing is a bit more complicated.)
14:27:20 <AnMaster> "my $code = ''; $code .= $_ while <FD3>; close FD3; open(CFUNGE_REALERR, \">&STDERR\"); open(STDERR, \">&STDOUT\"); print CFUNGE_REALERR eval($code)"
14:27:33 <AnMaster> assuming the \ is due to the whole thing is inside a C string
14:27:43 <AnMaster> and I'm being too lazy to remove it this time ;)
14:27:47 <Deewiant> fizzie: with fd3 I'm screwed on Windows, so I prefer the length-prefix method. ;-)
14:28:24 <AnMaster> oh wait
14:28:26 <AnMaster> no open
14:28:32 <AnMaster> "my $code = ''; open FD3, \"<&3\"; $code .= $_ while <FD3>; close FD3; open(CFUNGE_REALERR, \">&STDERR\"); open(STDERR, \">&STDOUT\"); print CFUNGE_REALERR eval($code)"
14:28:34 <AnMaster> hm?
14:29:22 <fizzie> Well, it looks correct, assuming the Perl code won't try opening &2, or using CFUNGE_REALERR.
14:30:00 <Deewiant> fizzie: wouldn't heredoc be the easiest way of making $code directly?
14:30:04 <Deewiant> just came to mind
14:30:35 <Deewiant> because you can always pick a heredoc string not contained within the program script
14:30:50 <AnMaster> Deewiant, finding such a string may not be that simple?
14:30:57 <fizzie> Hmm, yes; that's possible.
14:31:31 <Deewiant> AnMaster: start with "THIS_IS_MY_FOOBAR_HEREDOC_STRING" and append that to itself until the prog no longer contains it or it exceeds the prog's length, whichever comes first. :-P
14:31:55 <AnMaster> Deewiant, you need to search over the prog, linear search
14:32:02 <AnMaster> for a long program that could be an issue
14:33:30 <AnMaster> hm, closing the fd doesn't flush it it seems
14:33:40 <AnMaster> at least not if it is a file, may be different with pipe
14:33:43 <Deewiant> AnMaster: you need to write it to the file descriptor as well, which takes linear time?
14:34:16 <AnMaster> Deewiant, hm what about vectored io? oh wait that won't work for a pipe
14:34:51 <Deewiant> but I think you're right, in-memory fd writing is probably faster overall
14:34:55 <AnMaster> Deewiant, anyway that just means O(n), while searching to see if the program contains a string means at least searching it twice if you hit it
14:35:11 <Deewiant> AnMaster: which is still O(n), no matter how many times you do it. ;-)
14:35:29 <AnMaster> hm true
14:35:38 <fizzie> If you feel like doing the heredoc thing, it probably makes sense to keep in mind that Perl does variable interpolation in my $code = <<FOO; but not in my $code = <<'FOO';
14:36:38 <fizzie> Even better than heredoc would be to use Perl's magic 'DATA' filehandle, but I'm not sure how well that works when passing the program as a command line argument.
14:36:40 <Deewiant> I'm not going to do it, just wondered how well it would work. Good to know that, though.
14:39:19 <fizzie> Doesn't seem to me that reading from <DATA> returns anything after the '__END__' marker when the script is passed with the -e argument. Otherwise it could've been much like the heredoc thing but without the suitable-string-finding issues.
14:42:30 <AnMaster> seems it works with FD3
14:42:31 <AnMaster> :)
14:43:36 <AnMaster> Deewiant, so what will you do then?
14:44:02 <Deewiant> stdin with the length passed first
14:45:39 <fizzie> A normal person would've just used print eval { %s }; which might not match the letter of the spec, but does match the spirit: takes the string and gives it to the 'eval' function. Of course it's not _exactly_ the same, the code is parsed at a different time and there might be other differences.
14:45:50 <Deewiant> that's what I originally did
14:45:58 <Deewiant> and then AnMaster came complaining :-P
14:46:07 <AnMaster> Deewiant, err? you didn't use {
14:46:09 <AnMaster> you used )
14:46:10 <AnMaster> err
14:46:10 <AnMaster> (
14:46:18 <AnMaster> auto p = new Process("perl", "-e print 'A',eval(" ~ s ~ ")");
14:46:25 <AnMaster> and I didn't complain before about it
14:46:32 <Deewiant> only difference is that one accepts only expressions, I think
14:46:45 <Deewiant> if I had used {} you'd still have complained about the same issue ;-)
14:47:13 <AnMaster> fizzie, if I passed this in stdin then, should it work?: $x = "Hello world"; print $x
14:47:13 <fizzie> Well, it really isn't the same thing at all: the expression isn't evaluated by "eval", it's evaluated just like the outer code, and then the result is passed to eval.
14:48:07 <fizzie> For example, perl -e 'eval(die "foo");' will die, while perl -e 'eval { die "foo" };' won't.
14:48:57 <fizzie> File descriptor 3, not stdin, I guess. But yes, it looks like valid Perl code to me, although traditionally there's a newline after the string.
14:49:01 <AnMaster> I know I pass it on right FD
14:49:08 <AnMaster> yeah 3 was what I did
14:49:13 <AnMaster> because other stuff work
14:49:18 <AnMaster> say 4+5
14:49:21 <AnMaster> "my $code = ''; open FD3, \"<&3\"; $code .= $_ while <FD3>; close FD3; open(CFUNGE_REALERR, \">&STDERR\"); open(STDERR, \">&STDOUT\"); print CFUNGE_REALERR eval($code)"
14:49:29 <AnMaster> that is escaped for C
14:50:29 <fizzie> Oh, I just figured out an embarrassingly easy way to pass the code to the Perl interpreter.
14:50:37 <AnMaster> fizzie, oh?
14:50:53 <fizzie> Just do print eval($ARGV[0]); and append the code to the argument list of your "perl -e" call.
14:51:13 <AnMaster> $ARGV[0] == "perl" probably?
14:51:20 <fizzie> No, $0 == "perl".
14:51:25 <fizzie> $ARGV[0] is the first "real" argument.
14:51:30 <fizzie> Perl Does It Differently(TM).
14:51:32 <Deewiant> the first one after the program after -e?
14:51:33 <AnMaster> as in argument for script?
14:51:57 <fizzie> perl -e 'print $ARGV[0], "\n";' foo prints "foo".
14:52:06 <Deewiant> yays.
14:52:28 <Deewiant> that makes things somewhat simpler.
14:52:40 <Deewiant> although I wonder if there's a maximum limit on the length of an argument.
14:53:25 <fizzie> Well, the code was already being passed in the '-e' at some point, it's not a new problem.
14:53:42 <Deewiant> true.
14:54:01 <fizzie> Of course the code itself can't "use" the @ARGV array, but looking at the spec it doesn't seem to say anything what @ARGV should look like.
14:55:01 <fizzie> Besides, it's then especially easy to write a Perl quine; print $ARGV[0]; will do it, if you start it in that environment.
14:56:37 -!- RedDak has joined.
14:57:38 <Deewiant> AnMaster: alright, now your little test proggy prints 'hi 161'. :-P
14:58:03 <AnMaster> well I don't have the same version around any longer
14:58:05 <AnMaster> I extended it
14:58:19 <AnMaster> http://rafb.net/p/VFZ2St69.html
14:58:21 <AnMaster> is what I use now
14:58:52 <Deewiant> alright, win.
14:59:04 <AnMaster> and it works here too
14:59:10 <AnMaster> just checking valgrind and such
14:59:27 <AnMaster> fizzie, want to put you in a thanks to comment, what name should I use?
15:00:24 <fizzie> Uh, what sort of names have other people used? :p
15:00:52 <fizzie> ...er, that sounds wrong.
15:01:33 <fizzie> I'm not trying to pick a name, I just was curious about the type of names traditionally used for this sort of thing. IRC-nicks, realnames, something-else.
15:02:01 <AnMaster> fizzie, I just want to know if you want some real name, or just "fizzie on #esoteric on freenode"
15:02:01 <Deewiant> up to you. do you want your real name in the source code of befunge interpreters? :-P
15:02:15 <AnMaster> Deewiant, hahah
15:02:29 <Deewiant> I'd think deep and hard on that if I were you. ;-)
15:02:53 <AnMaster> Deewiant, well you got your one all over the source of ccbi
15:03:00 <fizzie> I think I already have my real name in the sadly defunct GLfunge98, which didn't really get up the ground. (I think googling for my realname finds, thankfully way down in the list, HP-UX packages for that Befunge interpreter.)
15:03:36 <Deewiant> AnMaster: I know, I've plunged off the deep end. :-)
15:03:46 <Deewiant> aye, GLfunge98 looked promising.
15:04:02 <fizzie> There were lots of good intentions but lack of real motivation.
15:04:04 <AnMaster> Deewiant, I'm not familiar with that proverb
15:04:16 <fizzie> So since I'm already quite a lost cause, feel free to use the real name, 'Heikki Kallasjoki'. Although I don't object to 'fizzie' either.
15:04:38 <AnMaster> well believe it or not, but some want their real names
15:05:21 <AnMaster> fizzie, you got to choose though
15:05:34 <Deewiant> AnMaster: "take the plunge, to enter with sudden decision upon an unfamiliar course of action, as after hesitation or deliberation: She took the plunge and invested her entire savings in the plan."
15:05:45 <AnMaster> hm
15:05:53 <fizzie> Er, well, just use the realname, then.
15:05:54 <AnMaster> anyway why would it matter?
15:06:31 <fizzie> There it is, on the third results page, the HP-UX packages for a Befunge interpreter. Hopefully no prospective employers will bother reading that far.
15:06:33 <Deewiant> fizzie: oh, you're the /author/ of GLfunge98? Didn't expect to find you alive with the program dead ;-)
15:07:14 <AnMaster> fizzie, well how old were you? they can hardly think something you did while you were at university would matter for example
15:07:29 <AnMaster> or that you did in your free time
15:07:36 <Deewiant> I proudly display CCBI on my CV :-)
15:07:52 <AnMaster> hm fizzie, you are from Finland?
15:07:53 <fizzie> I still from time to time get occasional pangs of regret over not continuing to play with GLfunge98, but not oftener than once every couple of months.
15:07:56 <Deewiant> and even got a summer job in the building fizzie works in, if I read google correctly.
15:08:30 <AnMaster> Deewiant, uhu?
15:08:31 <fizzie> If you mean the CIS lab at HUT, you've read correctly.
15:09:02 <Deewiant> yeah, I'm just wondering if the building is in fact the same, or not.
15:09:23 <Deewiant> I guess it's all in the same CS building so yes, I do believe so.
15:10:31 <fizzie> Actually I did have to give a 15 minute explanation about Befunge in a job interview for Nokia Research Centre (since I had "esoteric programming languages" in the CV) for a summer job in 2006, too, and got the place. Seems like it might even not be a negative thing.
15:10:44 <fizzie> (Although they were more interested in any Perl experience.)
15:10:53 <Deewiant> Yeah, ditto. I wonder whether it was positive or negative. ;-)
15:11:11 <AnMaster> fizzie, it shows a keen interest in programming on your free time?
15:11:15 <AnMaster> probably a good thing then
15:11:22 <Deewiant> I talked about Befunge, D, and Haskell whilst interviewing for a job which is probably mostly going to involve shell scripting, heh. :-)
15:11:33 <Deewiant> And C, I suppose.
15:11:46 <AnMaster> Deewiant, well you need to learn quotes in bash a bit then ;P
15:12:05 <Deewiant> AnMaster: rather, I need to learn how they interact with builtin functions.
15:12:13 <Deewiant> AnMaster: I'd just use them just in case anyhow, so it doesn't matter. ;-P
15:12:35 <AnMaster> Deewiant, apart from in [[ ]], where quotes can sometimes be harmful
15:12:47 <AnMaster> in [ ] they work as in normal context though
15:13:02 <Deewiant> I don't use such esoteric syntax. ;-)
15:13:04 <AnMaster> [ ] is same as test
15:13:10 <AnMaster> Deewiant, hm?
15:13:20 <Deewiant> [[ -f foo ]]
15:13:22 <Deewiant> &c.
15:13:25 <AnMaster> you use them in if [ "$foo" = bar ] say
15:13:36 -!- atsampson has joined.
15:13:41 -!- Sgeo has quit ("Ex-Chat").
15:13:43 <AnMaster> of course if grep foo works too
15:13:53 <AnMaster> if <command>; then foo...
15:13:58 <AnMaster> it is just about exit code
15:14:05 -!- Sgeo has joined.
15:14:16 -!- Sgeo has quit (Client Quit).
15:14:21 <AnMaster> Deewiant, and [ ] as well as [[ ]] is just a test command
15:14:33 -!- Sgeo has joined.
15:14:33 <AnMaster> but, [[ ]] got special quoting rules sometimes
15:14:41 <AnMaster> and is extended from [ ] in other ways
15:15:01 <fizzie> What I think funny is that there's a /usr/bin/[ -- in a file name it looks ugley.
15:15:19 <AnMaster> for example: both [ -z "$foo" ] and [[ -z "$foo" ]] test if $foo is" empty or unset"
15:15:33 <AnMaster> [[ -z $foo ]] works too
15:16:03 <AnMaster> [ -z $foo ] does NOT work, will be a syntax error if $foo is unset, or if it contains several words
15:16:25 <AnMaster> oh and then there is the special issue of the regex =~ match that only exists in [[ ]]
15:16:46 <AnMaster> bash 3.1 and 3.2 handles quoting differently in it
15:17:09 <AnMaster> the 3.1 behaviour was buggy
15:17:14 <AnMaster> but more logical IMO
15:17:21 <fizzie> And yet you think Perl's not-so-clear. :p
15:17:31 <AnMaster> in 3.2 it forces a literal match if the regex is quoted
15:18:00 <AnMaster> fizzie, well at least bash doesn't make every single ASCII char be an operator
15:18:08 <AnMaster> perl is close to that
15:18:29 <Deewiant> and befunge much closer. :-)
15:18:37 <fizzie> Actually Perl 6 goes and makes some Unicode chars operators, too. :p
15:18:49 <AnMaster> Deewiant, indeed
15:18:53 <fizzie> Like the single-character versions of the '<<' and '>>' quotes.
15:19:00 <AnMaster> eww
15:19:19 <Deewiant> eww? I think it's rather nice actually
15:19:22 <AnMaster> fizzie, UTF-8, or UTF-16 or what?
15:19:24 <Deewiant> get some decent looking code
15:19:32 <Deewiant> AnMaster: Unicode. UTF-* is just the encoding.
15:19:35 <AnMaster> Deewiant, well my keyboard lacks such keys
15:19:44 <AnMaster> Deewiant, yes I know, but what one does perl read source as
15:19:53 <Deewiant> probably any.
15:20:00 <fizzie> I would guess Perl 6 defaults to Unicode.
15:20:02 <AnMaster> well how could it know what one
15:20:02 <Deewiant> AnMaster: then you can type '<<' if you don't have the key.
15:20:09 <Deewiant> byte order markers exist
15:20:16 <AnMaster> hm
15:20:17 <Deewiant> you can always tell UTF-* apart
15:20:28 <Deewiant> the only problem is UTF-8 versus legacy encodings like ISO-8859-*
15:21:19 <fizzie> Recent versions of Perl 5 have a "use utf8;" pragma for writing identifiers-that-have-Unicode-chars, and also 'use encoding "foo"' for any supported encoding.
15:21:30 <AnMaster> well that's the point of UTF8, old programs being able to read the same file
15:21:49 <Deewiant> a point, yes.
15:21:57 <AnMaster> Deewiant, one important one
15:22:01 <Deewiant> yes.
15:22:35 <AnMaster> on unix you could make, say, /etc/fstab utf8 in comments, and it would not break old apps reading the file
15:23:33 <AnMaster> or /etc/passwd GECOS field could be able to contain names with åäö in them
15:24:06 <AnMaster> or as long as I don't use non-ascii here on irc, anyone that can read ASCII can read what I say, even though my client sends utf8
15:25:13 <Deewiant> but if you send UTF-8 and the receiving end assumes it's ISO-8859-1 it gets garbage.
15:25:27 <Deewiant> that's a tradeoff.
15:25:28 <fizzie> Perl 6 operators grepped from my irclogs, might be outdated: there's ^_= and »+^« and ^..^
15:25:36 <Deewiant> :-)
15:26:38 <fizzie> ^..^ is the current ".." range operator but excluding the endpoints; (5 ^..^ 9) is (6 .. 8).
15:28:11 <fizzie> But these were back in 2004. Haven't been following the Perl 6 saga since then, they might have sensiblized it.
15:28:23 -!- timotiis has quit (Connection timed out).
15:28:48 <AnMaster> Deewiant, it gets even more garbage, with, say, UTF-16
15:29:19 <Deewiant> AnMaster: but, with UTF-16, you can tell from the BOM that it is, in fact, UTF-16.
15:29:42 <AnMaster> also utf-16 got more overhead when the data is mainly in ASCII range
15:29:46 <AnMaster> as is common on irc
15:29:51 <AnMaster> or config files for *nix
15:30:59 <Deewiant> true that
15:49:56 -!- RedDak has quit ("Killed (NickServ (Comando GHOST usato da DIO))").
16:29:33 -!- ehird` has joined.
16:29:46 <ehird`> oklofok: ANOTHER DAY, ONE TO WORK ON OKOHIRD--
16:56:16 <AnMaster> ehird`, "okohird--"?
16:56:19 <AnMaster> what is that
16:56:51 <ehird`> AnMaster: my implementation of oklotalk--
16:56:57 <AnMaster> ah
16:57:06 <AnMaster> what differs between the normal one and --?
16:57:33 <ehird`> -- has not muh syntax
16:57:34 <ehird`> and sucks
16:57:40 <ehird`> he has not made oklotalk yes
16:57:41 <ehird`> just oklotalk--
16:57:42 <ehird`> *yet
17:01:32 <AnMaster> k
17:01:44 <AnMaster> ehird`, is the syntax that hard to parse?
17:02:18 <ehird`> AnMaster: Yes, there are no syntax errors
17:02:30 <ehird`> ({{{]) is valid
17:03:47 <AnMaster> ehird`, and what would it do?
17:04:24 <AnMaster> anyway befunge technically got no syntax errors either, it is perfectly valid to use an non-implemented instruction to reflect
17:04:31 <ehird`> AnMaster: I *think* ({{{[]}}})
17:04:48 <ehird`> oklofok: am I right?
17:07:31 <oklofok> whuaa
17:09:00 <oklofok> { has a lower precedence than (, it would actually be ({{{([])}}})
17:09:23 <ehird`> okay then oklofok
17:09:34 <oklofok> the rationale is to be able to do { ptrn -> ( expr expr expr }
17:11:02 <ehird`> oklofok: surely { ptrn -> expr expr expr } should be valid!
17:11:14 <ehird`> { x -> func x $hello }
17:11:25 <ehird`> { outn "wooty"; x -> func x $hello; outn "wotty" }
17:11:33 <ehird`> ambigious
17:11:34 <ehird`> but..
17:12:28 <oklofok> it should know whether you mean (x -> func x $hello) outn "wotty"; or x -> (func x $hello; outn "wotty";) based on which is better.
17:14:21 <ehird`> oklofok: well, i am thinking
17:14:27 <ehird`> that you can introduce another seperator comma ,
17:14:31 <ehird`> which has a lower precedence
17:14:32 <ehird`> so
17:14:43 <ehird`> { outn "wooty"; x -> func x $hello; outn "wotty" }
17:14:43 <ehird`> is
17:14:52 <ehird`> { outn "wooty"; x -> (func x $hello); outn "wotty" }
17:14:52 <ehird`> but
17:15:02 <ehird`> { outn "wooty"; x -> func x $hello, outn "wotty" }
17:15:02 <ehird`> is
17:15:07 <ehird`> { outn "wooty"; x -> (func x $hello; outn "wotty") }
17:15:16 <ehird`> oklofok: seems natural to me, and fits with english puncutation
17:15:18 <oklofok> well, comma exists already.
17:15:45 <oklofok> it works exactly like that for side-effects, but is in fact a third way to make a list
17:16:18 <ehird`> oklofok: oh. well i think you should drop commas for lists
17:16:19 <ehird`> because
17:16:20 <ehird`> a, b
17:16:21 <ehird`> [a b]
17:16:27 <ehird`> it's not that much different
17:16:28 <ehird`> and
17:16:30 <ehird`> a, b, c, d
17:16:31 <ehird`> [a b c d]
17:16:33 <ehird`> is shorter
17:16:38 <oklofok> a,b,c,d
17:16:40 <oklofok> is shorter
17:16:42 <ehird`> oklofok: and my way means stuff can be shorter
17:16:46 <ehird`> ok
17:16:46 <ehird`> but
17:16:47 <oklofok> anyway, true, it's not much use
17:16:49 <ehird`> which do you do more often
17:16:50 <ehird`> make a list
17:16:52 <oklofok> and i haven't used it much.
17:16:55 <ehird`> or have multiple exprs in a function
17:17:01 <oklofok> yeah, yeah, i know your point
17:17:05 <oklofok> i'll think about it
17:17:12 <ehird`> and [...] is nicer because with ,
17:17:17 <ehird`> its hard to pick out where hte list starts and ends
17:17:21 <oklofok> hmm
17:17:29 <oklofok> there are elaborate rules for it
17:17:34 <oklofok> anyway, south park time :)
17:17:36 <oklofok> ->
17:18:11 <ehird`> oklofok: ok :)
17:31:12 * ehird` is sticking linux on this old crusty machine
17:31:29 <ehird`> I poked the distro chooser for a laugh. It's telling me Arch Linux, Slackware, OpenSuSE, Gentoo, edora
17:31:46 <ehird`> Arch and Gentoo seem the most likely ones I'd consider installing.
17:31:56 <ehird`> AnMaster: If you want to hype Gentoo, now would be the time.
17:32:06 <ehird`> Especially if you can convince me I'll have an installed system in hours rather than days.
17:35:00 <Deewiant> depends on your processor speed. :-)
17:35:19 <ehird`> Deewiant: Slow. This is not my main machine.
17:35:24 * ehird` checks
17:35:44 <ehird`> Deewiant: 1.8ghz.
17:35:48 <ehird`> Some kind of AMD Smepron shit.
17:36:00 <ehird`> Windows says I have 480mb of ram, but that doesn't sound right.
17:37:26 <Deewiant> might be a day then, but not day_s_. :-)
17:37:41 <Deewiant> if you can leave it to compile the base system overnight it shouldn't be that bad.
17:38:28 <ehird`> Deewiant: Isn't there a fancy type of install that's precompiled?
17:38:30 <ehird`> Stage 3 or something.
17:38:42 <ehird`> I mean, ideally I'd like to be using it before the day's up. I know that's not particularly realistic, but
17:38:44 <Deewiant> possibly, I'm not sure.
17:39:40 <Deewiant> in 6 hours with that processor, certainly not from stage 1, I don't think.
17:39:45 <Deewiant> depends on how big a base you want I suppose.
17:39:54 <ehird`> Deewiant: I would probably go for stage 3. That's the most compiled, isn't it?
17:40:06 <ehird`> I am not '-funroll-loops man', so :)
17:40:07 <Deewiant> I'm not sure about how the later stages work.
17:40:13 <Deewiant> :-)
17:41:26 <ehird`> Deewiant: Well, I don't see what other distro would work well.
17:41:31 <ehird`> Ubuntu sucks on here.
17:41:45 <ehird`> And the rest are either dead, related to Ubuntu or extremely minimalist.
17:42:10 <Deewiant> Slackware is fine.
17:42:41 <ehird`> Deewiant: never really liked the feel of Slackware.
17:42:52 <ehird`> I like things such as, say, *dependency management*
17:43:13 <Deewiant> :-)
17:45:21 <AnMaster> <ehird`> AnMaster: If you want to hype Gentoo, now would be the time.
17:45:22 <AnMaster> what?
17:45:24 <ehird`> I guess I could just do Debian.
17:45:27 <ehird`> AnMaster: you use gentoo.
17:45:33 <AnMaster> ehird`, gentoo and arch are both good
17:45:35 <AnMaster> I prefer gentoo
17:45:52 <ehird`> AnMaster: Right, right, just convince me that I can coerce gentoo into giving me a system _today_
17:45:54 <AnMaster> but well, gentoo, freebsd top the list, followed by arch
17:46:02 <AnMaster> ehird`, well what is your CPU?
17:46:05 <AnMaster> cpu[1 x AMD Sempron(tm) Processor 3300+ (AuthenticAMD) @ 2.00GHz w/ 128 KB L2 Cache]
17:46:08 <AnMaster> is what I got here
17:46:59 <AnMaster> ehird`, from first boot to KDE (base system, I never install games and such) installed about 5 hours iirc
17:47:02 <ehird`> AnMaster: amd sempron 1.8ghz. This is not my main computer, before you scream in horror
17:47:05 <AnMaster> actually less maybe
17:47:11 <AnMaster> ehird`, amd64 or?
17:47:18 <ehird`> AnMaster: No way! This is a lame 32-bit machiine.
17:47:24 <ehird`> And none of the hardware agrees with the ohter hardware.
17:47:26 <AnMaster> hm ok
17:47:34 <AnMaster> ehird`, oh? how do you mean?
17:48:10 <ehird`> AnMaster: its all incompatible in subtle ways that make it crash and creak
17:48:18 <AnMaster> anyway about system today, depends on several things: local time, (if you start just before midnight, of course not), how much time you spend chatting on irc and so on
17:48:26 <ehird`> it was upgraded in a very cobbled-together fashion
17:48:29 <AnMaster> ehird`, what components got issues with what ones?
17:48:33 <ehird`> AnMaster: and: time is 17:48
17:48:41 <ehird`> AnMaster: and, just about all of them
17:49:21 <AnMaster> well I would start in the morning
17:49:37 <AnMaster> ehird`, also I would do a stage3
17:49:45 <AnMaster> first time you will need to read the manual
17:49:47 <ehird`> AnMaster: I need a system today, so unless you can convince me I'll install debian today and consider gentoo tomorrow
17:49:51 <ehird`> Yeah, i was thinking stage3.
17:49:58 <AnMaster> ehird`, then go for arch
17:50:07 <AnMaster> arch is good for being binary
17:50:17 <ehird`> AnMaster: Hmm. How does it differ from, say, debian unstable
17:50:29 <AnMaster> ehird`, being sane
17:50:38 <ehird`> AnMaster: Debian's pretty sane
17:50:57 <AnMaster> well last I checked they used *old* pre-release compilers in stable for example
17:51:17 <ehird`> AnMaster: Nobody uses stable.
17:51:46 <AnMaster> ehird`, anyway arch is quite fast too on x86
17:51:58 <AnMaster> and last I checked rather easy to install
17:52:09 <ehird`> AnMaster: I can install Debian in under an hour.
17:52:11 <ehird`> What about arch?
17:52:28 <AnMaster> ehird`, it was quite some time ago I tried it, but I think less than half an hour
17:52:46 <AnMaster> ehird`, however this may have been about 1-1.5 years ago
17:52:52 <AnMaster> but shouldn't be worse I guess
17:52:54 <ehird`> AnMaster: that was a modern system presumably
17:53:08 <AnMaster> ehird`, it was a p4 at 1.something GHz
17:53:12 <AnMaster> 512 MB RAM
17:53:18 <AnMaster> IDE 80 GB drive
17:53:37 <ehird`> AnMaster: but the hardware was all compatible, I assume.
17:53:53 <AnMaster> ehird`, can't check exactly as I no longer have the system in question, the power supply went for a smoke and I salvaged the bits that worked
17:54:12 <AnMaster> ehird`, well I still don't see how they would be incompatible
17:54:19 <AnMaster> you haven't given any example
17:54:21 <ehird`> I don't know. This machine is a demon.
17:54:27 <ehird`> It is pure evil itself
17:54:33 <AnMaster> you got no examples then?
17:55:02 <ehird`> Not really except that it crashes for no reason and drops data because it feelsl ike it
17:55:20 -!- timotiis has joined.
17:55:27 <AnMaster> ehird`, tried memtest?
17:55:50 <AnMaster> apart from that I'd recommend trying to disable acpi
17:56:03 <ehird`> AnMaster: I should leave memtest running at one point.
17:56:14 <ehird`> Not sure what ACPI is, though. heard the term, but I don't know what it is. I'm silly,
17:56:32 <AnMaster> ehird`, it is something for power managment, as well as "find out what the computer can do"
17:56:35 <AnMaster> and a few other things
17:56:49 <AnMaster> http://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface
17:56:56 <AnMaster> ehird`, however it can cause issues sometimes
17:57:56 <ehird`> interesting
17:58:16 <ehird`> AnMaster: I think I will go for Debian, I don't really care about this system, I just can't bear Windows any more
17:58:31 <AnMaster> ehird`, well windows probably cause the lockups then...
17:58:36 <AnMaster> ehird`, give arch a try
17:58:39 <ehird`> AnMaster: Nah, I've used Linux on here before.
17:58:43 <ehird`> It's actually less stable.
17:58:50 <AnMaster> ehird`, what distro did you use on it?
17:58:51 <AnMaster> debian?
17:58:55 <ehird`> various
17:58:59 <AnMaster> ehird`, list?
17:59:06 <ehird`> AnMaster: lesse...
17:59:09 <AnMaster> and was debian included in it?
17:59:17 <ehird`> FreeBSD, debian, ubuntu, fedora, slackware, and others
17:59:36 <AnMaster> then maybe time to try arch
17:59:41 <AnMaster> and see if it is more stable
18:00:33 <ehird`> Maybe.
18:00:36 <AnMaster> ehird`, anyway my system is quite stable, even though I got quite a mix of components
18:01:50 <AnMaster> ie, a sound card with midi from 2003 or so, a new geforce card from last year, and so on
18:01:56 <AnMaster> I did try suse, it was quite unstable under it, same for debian, but gentoo did turn out to be stable
18:02:05 <AnMaster> only tried arch later, on another computer
18:02:44 <AnMaster> ehird`, but since gentoo does need some patience at first install, it is probably best to try arch
18:03:34 <AnMaster> ehird`, oh and download time for cd was not included in the "half hour" for arch
18:03:40 <AnMaster> I don't know how long it took to download
18:03:50 <AnMaster> but I had a bad connection back then 512 kbps down
18:03:55 <AnMaster> so quite long I suspect
18:10:40 <ehird`> AnMaster: woot, 600kB/sec
18:10:43 <ehird`> i love my internet connection
18:10:50 <ehird`> it is made of love
18:10:53 <ehird`> and hugs
18:10:57 <ehird`> ^^ TRUTH
18:11:43 <AnMaster> well I got 8 mbit down, that means about 450-550 kilobyte / sec here
18:12:51 <fizzie> And this university student village 100Mbps connection means around 9 megabytes / sec from many places.
18:14:19 <ehird`> AnMaster: ditto
18:17:51 <AnMaster> ehird`, well arch it is then? :)
18:18:25 <ehird`> AnMaster: No, Debian. I will probably try Gentoo tomorrow.
18:18:28 <ehird`> But for today, this is fastset.
18:18:32 <ehird`> I've already downloaded it.
18:18:41 <AnMaster> ehird`, arch is good if you want binary
18:18:56 <ehird`> Too late.
18:19:01 <ehird`> It's burning now
18:19:36 <AnMaster> gentoo need a bit more patience, but things are easy to fix if they break, and they don't break often
18:19:38 <AnMaster> much easier to fix than when say debian breaks
18:20:44 <ehird`> Ohw Ell.
18:20:46 <ehird`> It's burned.
18:20:50 <ehird`> See you in $TIME
18:22:05 -!- ehird` has quit (Read error: 104 (Connection reset by peer)).
18:26:01 <fizzie> Personally my experiences wrt. the fixability of Debian and Gentoo have been exactly the opposite, but on the other hand I haven't touched Gentoo since 2003 or so.
18:28:19 -!- ehird` has joined.
18:28:58 <ehird`> eh
18:29:01 <ehird`> need to get a bigger one
18:29:23 <ehird`> AnMaster: did I mention that the 600kB/sec speed was on wireless
18:29:31 <fizzie> The people who send me spam can probably help.
18:30:01 <AnMaster> ehird`, hm?
18:30:08 <AnMaster> bigger what?
18:30:12 <AnMaster> ehird`, cd? arch then
18:30:17 -!- ehird has joined.
18:30:24 <ehird> but yeah.
18:30:26 <ehird> that was just wireless
18:32:20 -!- ehird has quit (Read error: 104 (Connection reset by peer)).
18:42:46 -!- timotiis has quit (Connection timed out).
18:45:35 -!- olsner has joined.
18:49:13 -!- ehird` has quit (Read error: 113 (No route to host)).
18:55:10 -!- jix has quit (Nick collision from services.).
18:55:20 -!- jix has joined.
19:00:11 -!- jix has quit (Nick collision from services.).
19:00:15 -!- jix has joined.
19:10:06 -!- ehird has joined.
19:10:09 <ehird> hello from a new debian system
19:10:20 <ehird> it works, basically.
19:10:27 <ehird> is debian's gnome meant to feel non-smooth?
19:10:30 <ehird> oh wait, maybe i need gfx drivers
19:44:37 <AnMaster> ehird, KDE may work better
19:44:50 * AnMaster runs
19:44:54 <ehird> AnMaster, Don't feel like KDe today.
19:44:55 <ehird> oklofok, Hi.
19:52:35 <ehird> oklofok, Ping
19:53:05 <oklofok> ölonmg
19:54:23 <ehird> yay
19:54:39 <ehird> oklofok, ehird@debian:~/src/oklotalk$ python okofficial/cli.pyc
19:54:39 <ehird> RuntimeError: Bad magic number in .pyc file
19:54:39 <ehird> ehird@debian:~/src/oklotalk$ python -V
19:54:39 <ehird> Python 2.4.4
19:54:52 * ehird installs 2.5
19:57:36 <AnMaster> oklofok, btw you got the pyc files for me? I don't have python 2.5
19:57:39 <AnMaster> only 2.4
20:02:05 <ehird> AnMaster, just install 2.5
20:02:43 <ehird> class DisregardThat(object): # I considered appending 'ISuckCocks' to the name of this lass
20:02:45 <ehird> *class
20:05:05 <Deewiant> :-D
20:05:45 <ehird> bah
20:05:49 <ehird> my parser is broken
20:05:53 <ehird> it can't handle comments nicely
20:06:27 <ehird> oklofok, can you show me your parser src :(
20:13:24 <ehird> oklofok, haha, my interp's thing->string shows the actual code
20:13:25 <ehird> :D
20:16:28 <AnMaster> ehird, can't you disassemble the pyc
20:16:52 <ehird> AnMaster, yes but only to the bytecode instructions
20:16:54 <ehird> which are stack-based
20:17:00 <ehird> and thus very unhelpful for reading
20:17:19 <AnMaster> ah I see
20:17:33 <AnMaster> oklofok, why not open source
20:19:03 <ehird> AnMaster, its for a school project
20:19:08 <ehird> so he doesn't want to release it until the
20:19:20 <ehird> incidentally this is the 3rd time you've bugged him about it being closed source
20:19:34 <ehird> can you simply not accept the fact that closed source software exists?
20:19:56 <AnMaster> :(
20:20:28 <ehird> some of it is even *good*
20:20:59 <ehird> oklofok, scoping question
20:21:03 <ehird> if i have a var A in another scope
20:21:08 <ehird> then we have a nested scope inside that
20:21:09 <ehird> and set A
20:21:12 <ehird> is the outer scope's A mutated,
20:21:19 <ehird> or is it just created in the inner one
20:21:22 <ehird> and shadowed
20:34:01 <ehird> oklofok, qutie important
20:37:58 <oklofok> ehird: comments are trivial to do
20:38:08 <oklofok> just keep the sum of open comments or soemthing
20:38:10 <ehird> oklofok, yeah
20:38:14 <ehird> oklofok, oh crap
20:38:15 <ehird> i don't do nesting
20:38:16 <ehird> heh
20:38:17 <oklofok> inc on <--, dec on -->
20:38:18 <oklofok> oh
20:38:24 <oklofok> well then ofc even more trivial :P
20:38:24 <ehird> oklofok, and yeah, its just that i have a method
20:38:26 <ehird> .parse_one()
20:38:31 <oklofok> okay
20:38:31 <ehird> which is expected to return a value
20:38:34 <ehird> and is called in a loop
20:38:34 <ehird> BUT
20:38:40 <ehird> i can't just recurse after a comment, .parse_one()
20:38:42 <oklofok> and comments return nothing so boom?
20:38:44 <ehird> because if the comment is at the end..
20:38:49 <ehird> i have to pretend i was never called
20:39:04 <oklofok> whhhell, i'm sure you can fix that on your own :P
20:39:08 <ehird> so my hack is: .parse_many() gives a special param, after a comment, if the src is over and it is set, we return none
20:39:10 <ehird> otherwise, unexpected EOF
20:39:14 <ehird> and parse_many() checks for None
20:39:18 <oklofok> "parsing is trivial", a guy once told me
20:39:24 <oklofok> you know who taht was?
20:39:26 <oklofok> *that
20:39:31 <ehird> :)))
20:39:38 <oklofok> indeed!
20:40:06 <oklofok> okay, back to watching!
20:40:10 <ehird> oklofok, but
20:40:10 <oklofok> i'm leaving you
20:40:11 <oklofok> ->
20:40:12 <ehird> what about scoping
20:40:15 <oklofok> ...but? :|
20:40:16 <ehird> i asked a question about it
20:40:16 <ehird> :(
20:40:19 <oklofok> oh
20:40:22 <ehird> <ehird> oklofok, scoping question
20:40:22 <oklofok> aaand hmm
20:40:22 <ehird> <ehird> if i have a var A in another scope
20:40:22 <ehird> <ehird> then we have a nested scope inside that
20:40:22 <ehird> <ehird> and set A
20:40:22 <ehird> <ehird> is the outer scope's A mutated,
20:40:23 <ehird> <ehird> or is it just created in the inner one
20:40:25 <ehird> <ehird> and shadowed
20:40:25 <oklofok> lessee
20:40:27 <ehird> <ehird> oklofok, qutie important
20:40:38 <oklofok> only created in inner one
20:40:52 <ehird> oklofok, so how do i mutate outer variables
20:41:08 <oklofok> there will be other ways to set vars, but i'm not gonna tell you what they are, because you'd implement them, and i'd then have to do that too.
20:41:11 <oklofok> you don't.
20:41:15 <oklofok> or make setters
20:41:25 <ehird> oklofok, actually, could you give me a basic scoping stress-test
20:41:28 <ehird> so i can verify i get it right
20:41:33 <oklofok> asd
20:41:48 <oklofok> you know the chick i was talking about
20:41:53 <oklofok> she's threatening me
20:41:59 <oklofok> i have to watch an episode now
20:42:01 <ehird> hahaha
20:42:02 <oklofok> perhaps after taht :|
20:42:04 <oklofok> *that
20:42:08 <ehird> goodbye
20:42:12 <oklofok> bye
20:55:30 -!- Slereah has quit (brown.freenode.net irc.freenode.net).
20:56:05 -!- Slereah has joined.
21:01:10 <ehird> Slereah, hello
21:02:57 <Slereah> Hai.
21:03:39 -!- Iskr has quit ("Leaving").
21:08:08 <ehird> AnMaster, look at me! I just installed non-free software!
21:08:17 <AnMaster> ehird, oh?
21:08:19 <ehird> good to know debian is no longer run by idealist idiots
21:08:22 <ehird> ;)
21:08:48 <ehird> AnMaster, Yeah, enabled the etch non-free repo and installed the Sun Java JDK. It is the only one that supports the newest stuff.
21:08:54 <ehird> Most of the compilers don't even get 1.5 right.
21:08:58 <ehird> So the apps I use in java won't work
21:14:54 <ehird> cute:
21:14:56 <ehird> enum TinyHelloWorld{T;System s;{s.out.println("Hello, world!");s.exit(0);}}
21:15:04 <ehird> that, as far as I can tell, is the shortest java hello world you can get
21:15:07 <ehird> vs:
21:15:33 <ehird> public class HelloWorld{public static void main(String[]a){System.out.println("Hello, world!");}}
21:24:54 -!- jix has quit ("CommandQ").
21:33:46 -!- ais523 has joined.
21:34:20 <ehird> hello ais523
21:34:31 <ais523> hello ehird
21:35:52 <ais523> wow, there was actually more discussion about BackFlip
21:36:01 <ais523> I've been thinking about it a bit recently
21:36:34 <ais523> I think it would be TC if you repeated the program as a cylinder, so that the left and right sides of the program were identified, and the program was repeated vertically an infinite number of times
21:38:02 <ehird> ais523, I think I am going to implement one of your rewriting languages in somethiing silly.
21:38:13 <ais523> like Underlambda in m4?
21:38:27 <ehird> No, that's for you :P
21:38:54 <ehird> ais523, Maybe Forte in Thutu.
21:39:05 <ais523> ehird: I already did that, more or less
21:39:16 <ais523> the only Forte interp I know of was written in wimpmode Thutu
21:39:29 <ais523> (where I extended it to allow easy arithmetic)
21:39:47 <ehird> OK, then 1cnis
21:39:55 <ehird> Though it looks complex.
21:40:07 <ehird> Actually.
21:40:11 <ehird> Underload in Thue.
21:40:28 <ais523> Underload in Thue sounds good
21:41:00 <ehird> ais523, I don't think I can do output though
21:41:03 <ais523> 1cnis would probably be harder due to the need to synchronize things so that they happen effectively simultaneously
21:41:18 <ehird> Well, I mean literal output
21:41:18 <olsner> ah, this means you can soon have underload in mod_rewrite using my thue-to-mod_rewrite compiler
21:41:22 <ehird> I could probably REWRITE output.
21:41:30 <ehird> olsner, I need to see that!
21:41:32 <ais523> and although it isn't mine, a Xigxag in Thue would be interesting too
21:41:34 <ehird> Though it's pretty trivial
21:41:54 <ais523> ehird: you could use Underlambda-style output, where S outputs a function not a string
21:41:58 <olsner> yeah, four lines of sed and a few bootstrap rewriting rules in an apache config
21:42:24 <ehird> ais523, No, I mean, Thue can't output text from the initial rule.
21:42:26 <ehird> Just hardcoded
21:42:34 <ais523> olsner: why noy use cat as the CGI script that shows the final output
21:43:01 <ehird> Beh. Thue is too primitive for this.
21:43:01 <ais523> ehird: with Underlambda-style output you only need to be able to output the command characters, not all characters
21:43:11 <olsner> hmm, the final results is in the query string, and I don't think that comes on standard input
21:43:17 <ehird> ais523, Have you tried Oklotalk-- by the way?
21:43:24 <ehird> olsner, redirect on PATH_INFO
21:43:29 <ehird> /rewrite.cgi/FOO
21:43:34 <ehird> rewrite.cgi:
21:43:36 <ais523> olsner: you're right, it comes in an environment variable for GET, and on stdin for POST
21:43:38 <ehird> #!/usr/bin/env perl
21:43:44 <olsner> otoh, maybe you can rewrite things into post variables
21:43:45 <ehird> print $ENV["PATH_INFO"];
21:43:47 <ehird> i think.
21:43:59 <ehird> ais523, But yeah -- oklotalk--
21:44:02 <ais523> ehird: your Perl is atrocious
21:44:07 <ais523> ehird: I've seen bits of it but not used it
21:44:07 <ehird> And yes!
21:44:07 <ehird> It is!
21:44:10 <ais523> it looked interesting
21:44:16 <ehird> my Perl is totally atrocious
21:44:19 <ais523> and that Perl statement should have used curly brackets
21:44:20 <ehird> Because I don't know Perl
21:44:23 <olsner> ehird: in this case, I have a php script that does echo $_SERVER['QUERY_STRING'] or whatever the actual names are
21:44:25 <ehird> Oh yes, that.
21:44:26 <ais523> $ENV{"PATH_INFO"}
21:44:36 <ehird> Make it a MODERN reference!
21:44:45 <ehird> $self->env->{"PATH_INFO"}
21:44:59 <ais523> ehird: I think that can be done with blessed objects
21:45:11 <ehird> ais523, yes it can
21:47:22 <ehird> ais523, Hmm. I want to make a Lambda Calculus macro system
21:47:24 <ehird> Might be interesting
21:47:57 <ais523> or write a lambda-calculus-to-Underload-compiler in Thue or some similar language
21:48:05 <ehird> lambda calculus to underload
21:48:07 <ehird> hmmm
21:48:14 <ehird> not for thue
21:48:20 <ehird> ais523, thue can only deal with very restricted formats
21:48:20 <ais523> I tried to do one as rewrite rules as a way to specify how lambdas worked in Underlambda
21:48:34 <ais523> ehird: well, I limited variable names to x, y, and z
21:48:45 <ais523> possibly w as well, I forget
21:49:16 <ehird> ais523, But with placeholders, I bet.
21:49:20 <ehird> Thue is just string->string.
21:49:35 <ais523> well, I've been designing a new rewriting language that I haven't told anyone about yet
21:49:44 <ais523> it's interesting, but likely to be very hard to implement efficiently
21:50:01 <ehird> i'd be interested in having a go
21:50:24 <ais523> the rewriting is done on graphs rather than on strings
21:51:24 <ais523> making it a sort of 2D Thue
21:51:57 <ais523> I was going to call it Eodermdrome, and it looks like someone may have to ask me what it means because neither Google nor Wikipedia seems to know
21:52:13 <ehird> ais523, sounds like graphica
21:52:15 <ais523> I'll have to track down the book I learnt the word from, so I can use it as a source to write about it
21:52:27 <ais523> ehird: quite possibly it's been done before
21:52:29 <olsner> hmm, graph rewriting = haskell (in some abstract sense... according to what I hear)
21:52:36 <ais523> the lang looks more like Haifu, though
21:52:44 <ais523> except mostly using nonsense words, or nonsense sentences
21:52:47 <ehird> ais523, graphica is oklofok
21:52:48 <olsner> if you're talking nodes+vertices graphs rather than x/y graphs
21:52:50 <ais523> and I kept the comma=comment idea
21:53:30 <ehird> i have always wanted to make a language which is JUST powerful enough to be non-trivial (very low barrier) and powerful enough to represent all of its own model in itself
21:53:37 <ehird> so it can represent the interpreter, call stack, etc.
21:53:43 <ehird> but there must not be one unexposed bit
21:53:50 <ehird> call it Ouroboros
21:54:10 <ais523> so it can self-interpret, but isn't TC?
21:54:19 <ehird> ais523, not what i meant
21:54:20 <ehird> not self-interpret
21:54:21 <ehird> but
21:54:28 <ehird> imagine a language where the call stack was a first-class object
21:54:31 <ehird> smalltalks have them
21:54:34 <ehird> it's called CallStack or similar
21:54:44 <ehird> well, that's a bit of the interpreter 'eaten up' by the language it hosts
21:54:51 <ehird> now, the idea is to have EVERY SINGLE PART eaten up
21:54:56 <ehird> even the parts that do the eating up
21:56:04 <ais523> some sort of massive reflection, then
21:57:47 <ehird> ais523, except it's not reflection
21:57:49 <ehird> it's THERE
21:57:52 <ehird> you don't need a mirror
21:57:54 <ais523> yes
22:00:30 <ehird> ais523, wow, g++'s error messages just rock
22:00:32 <ehird> XD
22:00:49 <ais523> ehird: which one in particular did you like? gcc's are quite good, are g++'s even better?
22:01:05 <ehird> it was a joke
22:01:23 <ehird> you get used to seeing many<nested<types,oh<yes<indeed>>,abc>>
22:01:27 <ehird> on even the most basic errors
22:02:08 <ais523> ehird: I'd say that's being kind to the programmer by providing lots of information to help them track down the problem
22:02:23 <ehird> ais523, No -- you can literally have one basic error in a 10-line program
22:02:31 <ehird> and it will quote 15 STL templates
22:02:39 <ehird> with an unhelpful error message
22:02:45 <ais523> ehird: but they're part of your program too, they were just written by someone else
22:03:04 <ehird> ais523, You don't understand: STL templates use each other to depths exceeding 100.
22:03:13 <ehird> They are *never* helpful to know.
22:03:29 <ais523> ehird: your last two statements contradict each other
22:03:37 <ehird> ais523, try coding c++ some time.
22:03:44 <ehird> actually don't
22:03:45 <ehird> it's awful
22:03:49 <ais523> templates using each other to depths exceeding 100 is a great sort of thing for esolangers to like
22:03:56 <ais523> and I learnt C++ before I learnt C
22:04:02 <ais523> but it was old-style C++
22:04:10 <ais523> before it had STL or even namespaces
22:04:16 <ais523> the string class was nice, though
22:05:00 <ehird> ais523, default arguments with the magic setter stuff is so much fun...
22:05:09 <ehird> you never have to write a function body again!
22:05:13 <ais523> yay default arguments
22:05:24 <ehird> Actually, you never have to write values again, since C++ templates are turing complete
22:05:27 <ehird> Not only that,
22:05:30 <ehird> they're a lazy functional language.
22:05:38 <ehird> About 10x nicer than C++ itself.
22:05:58 <ais523> ehird: see, /that's/ what the error messages are for!
22:06:01 <ehird> ais523, Not only are they a lazy, turing complete, functional language, they're a lazy, turing complete, strongly-typed functional language.
22:06:14 <ais523> ehird: in other words, Haskell
22:06:23 <ehird> ais523, Exactly!
22:06:36 <ehird> But there's no meta-templates, so you can't use parametized types in the code. I don;'t think so at least.
22:07:07 <ehird> ais523, http://reddit.com/info/6fasr/comments/c03p4mn Maybe monad in C++ templates
22:07:13 <ehird> http://reddit.com/info/6fasr/comments/c03oswa Translation for LC->C++ templates
22:07:32 <ehird> ais523, And finally, a translation of lambda calculus church numerals to C++: http://reddit.com/info/6fasr/comments/c03ongu
22:07:46 <ehird> As for Peano numerals:
22:07:48 <ehird> struct Zero {};
22:07:48 <ehird> template <typename T>
22:07:48 <ehird> struct Succ { T v; };
22:10:24 <ehird> ais523, A toy C++ program I just wrote to refresh my memory (It's easy to forget everything about C++ in a few months)
22:10:28 <ehird> contains this wonderful constructor
22:10:28 <ehird> Greeter(std::ostream &output = std::cout) : out (output) {}
22:10:38 <ehird> note: no function body
22:10:40 <ehird> that is actually (pseudo-code):
22:10:55 -!- oerjan has joined.
22:10:55 <ehird> Greeter(std::ostream &output = std::cout) { this.out = output; }
22:11:00 <ais523> ehird: that still looks strange to me, I learnt C++ before the typename keyword was invented (they used to use 'class' back then, which was confusing because the same keyword was used for two things, and it could refer to non-classes too)
22:11:04 <ehird> wonderfully esoteric
22:14:07 <ehird> ais523, Actually, it startles me how clean you can make lambda calculus stuff with templates.
22:14:11 <ehird> It's not unpleasant, really.
22:14:20 <ais523> ehird: templates are lambda calculus, more or less
22:14:36 <ehird> ais523, Nicer actually - they have arithmetic and everything
22:14:57 <ehird> If using them without C++ underneath wasn't considered esoteric, I'd be coding in them :p
22:15:06 <ehird> boost is cool though
22:16:45 <ais523> why do so many people hate C++?
22:16:58 <ais523> it has lots of features that some people don't like, but nobody's forcing you to use them
22:17:10 <ais523> I can write C++ which is just C + the string class if I like
22:17:23 <ehird> ais523, C++ pretends C is something it's not.
22:17:27 <ehird> I personally hate it, but it's fun.
22:17:58 <ais523> C++ is a continuum of languages, from C to some sort of crazy OO template thing and everything in between
22:18:08 <ais523> so it's a good language for writing things which are slightly object-oriented
22:18:25 <ehird> lambda.cc:8: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<template<class> class<template-parameter-3-1> > class<template-parameter-2-1> > class T’
22:18:32 <ehird> ais523, error messages are fun
22:18:55 <ais523> ehird: that looks like a really informative error message to me, and I'm not being sarcastic
22:19:21 <ais523> in this case, it's an argument type mismatch, so it's saying you have to pick an argument which really does have that crazy type, not some other crazy type
22:19:24 <ehird> ais523, yes
22:19:28 <ehird> sidenote:
22:19:37 <ehird> templates TOTALLY fuck up 'declaration-as-usage' :D
22:19:39 <ehird> usage:
22:19:45 <ehird> T -> typename T
22:19:53 <ehird> T<U> -> template <typename> class T
22:20:08 <ehird> T<U<V>> -> template <template <typename> class> class T
22:20:46 <ehird> actually
22:20:49 <ehird> 'class' is the return value
22:20:50 <ehird> fun
22:21:31 <oerjan> usagi:
22:21:33 <ehird> wait, no
22:21:33 <ehird> hmm
22:21:34 <oerjan> =:)
22:22:12 <ais523> oerjan: is that a smiley, or cise code?
22:22:18 <ehird> ais523 wins
22:22:24 <oerjan> a smiley
22:22:34 <oerjan> what is cise?
22:22:43 <ehird> template <template <typename> <template <typename> class> T>
22:22:45 <ehird> not right
22:22:46 <ehird> unfortunately
22:22:51 <ehird> oerjan, cise is oklofok's official concise language
22:22:54 <ais523> a language that someone in here was designing, I've forgotten who
22:22:58 <oerjan> aha
22:23:03 <ehird> he has an implementation of binary brainfuck in it that is less than 80 characters
22:23:09 <ehird> much less
22:23:14 <ehird> more like 55
22:23:25 <ais523> its operator precedences are flexible; operators are grouped according to what allows the data types to match up best
22:23:50 * oerjan recalls some of it now
22:26:08 <ais523> maybe it should do what Cyclexa does in terms of lexing
22:26:13 <lament> ais523: that's very clever and how come haskell doesn't have that
22:27:08 <ais523> many of the operators overlap characterwise (thus ??? could mean ??@? or ?@?? where @ is syntax the user can use to manually separate tokens if needed), but there are precedence rules to determine what each sequence of characters lexes as, according to what makes sense
22:27:15 <GregorR> Not having seen it in action, it sounds like the operators would be a bit nondeterministic from a human standpoint ...
22:27:52 <ehird> Hmm. I cannot get this type right.
22:27:56 <ehird> GregorR, You know C++ templates?
22:28:02 <ehird> What's the type of a template that is used:
22:28:04 <ehird> T<U><V>
22:28:06 <ehird> where U and V are typenames.
22:28:40 <GregorR> Uh, T<U><V>
22:29:30 <oklofok> don't talk about cise when i'm trying not to program!
22:29:44 <GregorR> CISECISECISECISECISECISECISECISE
22:30:00 <oklofok> unless someone here likes doing database+java homework
22:30:03 <GregorR> LIKE THE TIDE, IT WILL DRAG YOU IN
22:30:06 <GregorR> (And drown you)
22:30:11 <lament> brainfuck interpreter is 1 char in my language!
22:30:16 <oklofok> :D
22:30:44 <Slereah> lament : Is that the ESCO LANGUAGE?
22:31:04 <oklofok> lament: bbq9?
22:31:19 <lament> my language is based on lazy library loading
22:31:24 <oklofok> :D
22:31:37 <oerjan> lament: this a HQ9+ dialect? :D
22:32:03 <oklofok> oerjan: my joke was funnier cuz it had barbeque
22:32:30 <oerjan> omgwtf
22:32:31 <ais523> there are 0x10FFFF chars available in Unicode, that's 21 bits
22:32:32 <lament> it's a Haskell dialect
22:32:43 <lament> with lazy library loading
22:32:59 <ais523> if someone could get a BF interp down to 21 bits in a genuine language without cheating, then the program could be said to be 1 char long
22:33:01 <oklofok> oerjan: omq9+
22:33:13 <ais523> oh, 20 bits, because it isn't 0x1FFFFF
22:33:18 <lament> you don't have to include a library to use its functions; you don't have to have written it either
22:33:46 <oerjan> so lazy, clairvoyant library loading
22:33:50 <oklofok> lament: that is the cleverest thing anyone has ever come up with
22:34:00 <lament> it's convenient
22:34:01 <oklofok> you are a fucking god
22:34:02 <oerjan> a DWIM dialect then
22:34:15 <oklofok> holy shit how can i concentrate on my homework after this
22:34:18 <oklofok> god i'm tired
22:34:21 <oklofok> i'll continue now
22:34:23 <oklofok> !sdfj
22:34:25 <oklofok> ->
22:34:27 <EgoBot> Huh?
22:34:36 <oerjan> !never mind
22:34:39 <EgoBot> Huh?
22:35:33 <lament> it's imperative programming
22:35:36 <lament> DWIMOE
22:35:41 <lament> do what i mean or else
22:36:14 <ehird> GregorR, No
22:36:19 <ehird> I mean the template-level type
22:36:28 <ehird> template <typename> class T
22:36:30 <ehird> corresponds to the usage
22:36:31 <ehird> T<U>
22:37:03 <ais523> lament: Chris Pressey already implied that joke, when describing TURKEY BOMB as a 'peer-pressure' language
22:37:24 * oerjan realizes DWIMP is a perfect abbreviation for a certain other dialect
22:38:15 <oerjan> (do what i mean. please?)
22:38:35 <ehird> MDWIMDOTMC
22:38:40 <ehird> maybe do what i mean depending on the moon cycle
22:39:23 <oklofok> DWIMBTA
22:39:30 <oklofok> do whatever i mean by this acronym.
22:39:40 <oerjan> DWIMPPWSOT
22:39:59 <lament> TIMTOWTDWIM
22:40:09 <ehird> lament, haha
22:43:22 <ais523> that could be the name of a wiki package written in Perl
22:44:13 <ehird> use T::I::M::T::O:::W::T::D::W::I::M
22:44:17 <ehird> ais523, those are acronym namespaces
22:44:23 <ehird> A-Z, recursive
22:44:27 <ehird> :D
22:44:40 <ehird> you could use cpan as a keyboard if it could list subnamespaces
22:44:41 <ais523> the ::: is presumably a typo, rather than deliberate?
22:45:03 <ehird> oops, yes
22:45:14 <ehird> ais523, I had an idea for a package
22:45:15 <ehird> 'Cme'
22:45:20 <ehird> it is a class
22:45:29 <ais523> like Acme:: without the A?
22:45:30 <ehird> and it exports Acme
22:45:33 <ehird> which is a provided instance of Cme
22:45:42 <ehird> Cme is of course just a mirror into the acme namespace
22:45:49 <ehird> my $cme = new Cme;
22:45:56 <ehird> $cme->Cme
22:45:58 <ehird> is Acme::Cme
22:46:15 <ehird> (advert: 'Contains reproductive organs!')
22:46:36 <ehird> ais523, it would do actual evil so that Acme is-a Cme
22:48:09 <ais523> does that require actual evil, or just a tweak to @ISA?
22:48:43 <ehird> ais523, dunno
22:48:50 <ehird> packages arent objects are they?
22:48:55 <ais523> good point
22:49:32 <ais523> you could put the string "Acme" in @ISA, but you'd have to then tweak everything else to stop Perl actually trying to load it as a class...
22:49:53 <lament> i thought "actual evil" was mandatory?
22:51:06 <ehird> ais523, i cannot figure out T<U><V> type
22:51:10 <ehird> T = typename T
22:51:16 <ehird> T<U> = template <typename> class T
22:51:24 <ais523> ehird: I don't know enough about modern C++ template metaprogramming
22:51:25 <ehird> T<U,V> template <typename,typename> class T
22:51:28 <ehird> T<U><V> = ????
22:51:53 <ehird> ais523, mm
22:51:57 <ais523> it would have been a very simple template <class a><class b> when I learnt C++, but the syntax seems to have complicated since then
22:51:59 <ehird> i think its something to do with the class
22:53:44 <ehird> GregorR, Ideas?
23:02:26 <GregorR> Oh? Uh, nested templates?
23:02:31 <GregorR> Idonno :P
23:02:33 <GregorR> GTG! :P
23:05:53 <ehird> ais523, Almost got template SKI
23:06:33 -!- atsampson has quit (Read error: 104 (Connection reset by peer)).
23:07:31 -!- atsampson has joined.
23:17:17 <ehird> ais523, Hmm.
23:17:25 <ehird> ais523, I will then do template lisp.
23:17:31 <ehird> ais523, And then -- finally -- template $esolang
23:19:26 <lament> template templates?
23:19:34 <lament> <<<>><>><<<>><>><><>><>>>>
23:25:16 -!- ais523 has quit ("(1) DO COME FROM ".2~.2"~#1 WHILE :1 <- "'?.1$.2'~'"':1/.1$.2'~#0"$#65535'"$"'"'&.1$.2'~'#0$#65535'"$#0'~#32767$#1"").
23:25:41 <ehird> I was just about to say something to ais..
23:30:19 <ehird> lament, They're fun
23:41:15 <oklofok> looks like nopol
23:41:25 <oklofok> i've always loved <>'s
23:41:34 <oklofok> i've also always hated xml
23:41:57 -!- oklofok has changed nick to oklohot.
23:42:02 <oklohot> the h and t are for HaTe
23:42:28 <ehird> oklohot, you should invent an awesome xml
23:42:40 <ehird> and then when oklotalk is released it can have a web lib plugged into that
23:42:46 <ehird> but you'd have to write a okloxml->xml
23:44:29 <oklohot> sexps are already an awesome xml
23:44:53 <oklohot> but perhaps we should just take the < and > characters from xml, and find a whole new purpose
23:45:07 <oklohot> perhaps nopol 2
23:45:19 <oklohot> i have some awesome ideas for it
23:46:09 <ehird> lambda.cc:9: error: type ‘T<V>’ is not derived from type ‘S<T>::S1<U>::S2<V>’
23:46:39 <oklohot> you know how nested lists are always context-free and shit, like, [a [b c] d] can't match a list with 4 elements no matter what b and c are...
23:46:43 <oklohot> well not in nopol!
23:46:49 <oklohot> NEGATIVE DEPTH LISTS!!
23:47:15 <ehird> oklohot, I love you
23:47:20 <ehird> That idea is oklo-hot.
23:47:23 <oklohot> turns out their semantics are serious brainfuck to figure out... but god they're hot.
23:47:32 <oklohot> yes, nopol owns.
23:47:47 <oklohot> also, nopol has the revolutionary idea of being based on no-operations, ofc
23:48:06 <oklohot> (TURING COMPLETE NOTHING! it's so clever i wanna cry my pants out.)
23:48:58 <oklohot> why did you bring nopol into this... please at least leave graphica out of this.
23:49:36 <oklohot> this and this, i suck
23:50:40 <oklohot> (<<a b c>> -> <a b c> -> a b c -> >a b c< -> >>a b c<< -- OH NO SHE DIN'T)
23:51:13 <ehird> oklohot, meanwhile i am about to infinite loop a C++ compiler
23:51:17 <oklohot> :)
23:51:18 <ehird> and it won't be a bug
23:51:25 <ehird> it'll be a real honset to god FEATURE
23:51:38 <oklohot> yarrr
23:52:07 <oklohot> ski ready yet?
23:54:34 <ehird> oklohot, the C++ ski?
23:54:36 <ehird> well, they were
23:54:41 <ehird> but i think sii-sii is untypeable
23:54:43 <ehird> :(
23:54:49 <oklohot> hmm
23:54:52 <oklohot> how's that?
23:54:55 <ehird> C++ template type system is less powerful than haskells
23:54:59 <ehird> and haskells doesn't type it
23:55:04 <oklohot> haskell fail at it too, no?
23:55:06 <ehird> oklohot, well, what's the type of sii
23:55:08 <ehird> it's
23:55:10 <oklohot> hmm
23:55:14 <ehird> (a = a -> b) -> b
23:55:15 <oklohot> n -> n n
23:55:18 <ehird> because it takes ITSELF as an argument
23:55:24 <oklohot> yeah
23:56:10 <oklohot> anyway, isn't that problem also apparent in haskellö
23:56:13 <oklohot> ä'¨'åä
23:56:36 <ehird> yeah
23:56:36 <ehird> so
23:56:38 <ehird> i'll try another ski
23:57:28 <ehird> lambda.cc:23: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<class> class T> template<template<template<class> class U> template<template<class> class T> template<class> class U> struct S<T>::S1’
23:57:29 <ehird> best
23:57:29 <ehird> error
23:57:30 <ehird> ever
23:58:00 <ehird> oklohot, SKI are pretty useless in a strongly-typed environment
23:58:58 <oklohot> yeah it's prolly an fsm
23:59:07 <ehird> oklohot, err, no, C++ templates are turing complete
23:59:24 <ehird> itsproven
23:59:43 <oklohot> i meant stronly typed ski
23:59:45 <ehird> ah
23:59:46 <ehird> yeah
23:59:47 <ehird> probably
←2008-04-15 2008-04-16 2008-04-17→ ↑2008 ↑all