Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2008-05-13

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 mncharity joined #perl6
00:15 pravus left #perl6
00:17 mncharity vixey: a CL backend for elf would be delightful.  I'd be happy to help you get set up.
00:18 mncharity And to answer any questions you might have. :)
00:45 stevan_ joined #perl6
00:45 stevan_ joined #perl6
01:11 japhb joined #perl6
01:27 Ched joined #perl6
01:28 * mncharity stumbles wearily out of a forest of not-pretty trees, and stares in bemusement at successful self-compilation.
01:33 mncharity Anyone know what we currently have as ways to run the t/ tests?  The old make smoke stuff tended to require pugs to be built, always odd, and now problematic.  Any suggestions?
01:34 mncharity Could just use 5.10's prove... but it is missing some nice stats, and isn't as pretty as smoke.
01:43 pugs_svnbot r20413 | putter++ | [elf] Elf (elf_f) now self-compiles successfully on the new STD_red.
01:43 pugs_svnbot r20413 | putter++ | Added a ELF_STD_RED_RUN parser override to elf_e and elf_f.
01:44 alester_ joined #perl6
01:47 mncharity wolverian: A while back you mentioned a Moose compiler.  Could you glance at elf_f to see if it might help startup speed?  http://svn.pugscode.org/pugs/misc/elf/elf_f   It takes me almost 4 cpu seconds to do  ./elf_f --help .  Performance running t/ is dominated by this startup cost.
01:48 mncharity The 3+ seconds are all spent in moose land.
01:48 vixey mncharity, How do you build elf_f?
01:48 mncharity elf_f_src/README has the recipe
01:49 mncharity basically just  elf_f -x -o elf_f Elf.pm
01:49 vixey that line gives me some problem
01:49 vixey It's says, Can't locate autobox.pm in @INC
01:49 vixey I don't actually have autobox.pm
01:49 mncharity Need CPAN's autobox module.
01:49 vixey oh ok
01:50 mncharity Also... Class::Multimethods Moose Moose::Autobox
01:51 mncharity hmm, though I'm not sure we are really still using Moose::Autobox
01:51 wolverian mncharity, should help, if it doesn't break in glorious ways... see MooseX::Compile
01:52 wolverian stevan_ might be able to provide more information
01:52 mncharity oh, and  Perl6::Say. sigh.
01:53 mncharity wolverian: nifty.  will look.  800x4sec of motivation. :)
01:53 mncharity thanks
01:54 wolverian it might require one class per file
01:55 mncharity eeep
01:55 wolverian quite :)
01:55 * mncharity pictures hundreds of files... eeep
01:57 mncharity hmm, ok, that was exaggerated.  there are barely over a hundred.  in IRx1_Nodes and Prelude.  regex will had another order 10.
01:59 mncharity vixey: re autobox, I've been mulling over creating an autobox mutant.  It would be nice to have a variant which dispatches separately on STRING, INTEGER, FLOAT, rather than folding them together as SCALAR.
02:11 mncharity eh, probably want custom reporting anyway... sigh.  let's see...
02:11 mncharity vixey: how goes?
02:12 vixey trying to build elf_f is getting an error from elf_e, ../elf_e_src/STD_red/match.rb:121:in `+': can't convert Fixnum into String (TypeError)
02:14 vixey do you have to build elf_c, then d and so o ?
02:17 mncharity no.  in fact, you should be able to use the second half of the README which just uses elf_f, without elf_e.
02:17 mncharity still, that's odd
02:17 mncharity what is your  ruby --version ?
02:17 vixey ruby 1.8.6 (2007-09-24 patchlevel 111) [universal-darwin9.0]
02:18 mncharity ah.  you really want 1.9.  details in misc/STD_red/README
02:18 vixey elf/misc is actually empty here
02:19 mncharity top level pugs misc/
02:19 vixey oh sorry
02:19 mncharity np.  not documented ;)
02:22 lisppaste3 joined #perl6
02:36 alester_ joined #perl6
02:51 vixey mncharity: If I try running ../elf_f -x -o ../elf_f1 Elf.pm now with ruby 1.9.0, any idea why this going wrong? /pugs/misc/STD_red/prelude.rb:401:in `scan': target of repeat operator is not specified: /\.=/ (RegexpError)
02:51 rindolf joined #perl6
02:59 Eevee joined #perl6
03:00 mncharity vixey:  hmm...
03:01 mncharity vixey: you've svn up'ed recently?  elf_f working is something which has only happened in the last hour or few.
03:01 mncharity r20413
03:03 vixey yeah I'm up to date
03:04 mncharity :/  looking...
03:04 mncharity ruby --version ?
03:06 vixey ruby 1.9.0 (2008-05-13 revision 16399) [i686-darwin9.2.0]
03:07 mncharity hmm... I'm running  ruby 1.9.0 (2007-12-25 revision 14709) [x86_64-linux], the first 1.9.0 release.  I don't think there's been another release(?), so that's 1.9 HEAD?
03:08 vixey I just got the svn repo compiled and install that
03:09 mncharity how difficult would it be to try r14709?  http://www.ruby-lang.org/en/news​/2007/12/25/ruby-1-9-0-released/
03:09 lambdabot Title: Ruby 1.9.0 Released
03:10 mncharity my experience with 1.9 HEAD over the last, err, year+, is that it's kind of iffy.
03:10 mncharity which probably belongs in the STD_red/README...
03:13 mncharity oh, that should have been vixey++
03:13 pugs_svnbot r20414 | putter++ | [STD_red] README: Add link and greater detail, to the suggestion of which ruby version to use.
03:15 eternaleye perl6: my @array; print @array.WHAT
03:15 exp_evalbot kp6: OUTPUT[Array]
03:15 exp_evalbot ..pugs: OUTPUT[Array]
03:15 exp_evalbot ..rakudo: OUTPUT[List]
03:18 mncharity vixey: thanks for helping shake down the "getting started with elf" path.  the only person other than myself which I know of having pursued it has been pmurias.
03:18 vixey it's ok :)
03:18 vixey I hope it can work, I'm just compiling ruby now
03:19 mncharity :)
03:23 vixey success!
03:23 mncharity ! :)
03:26 mncharity for repeated self-compilation, note STD_red's  STD_RED_CACHEDIR environment variable.  ./STD_red_run --help .
03:26 mncharity I'd be interested in hearing how long a self-compilation takes you.  pmurias and I were seeing very different times.
03:27 mncharity btw, perl --version ?
03:27 vixey v
03:27 vixey v5.8.8
03:28 rindolf Hi all.
03:28 rindolf Hi vixey
03:29 vixey hey rindolf
03:30 rindolf vixey: sup?
03:31 vixey rindolf: I'm listening to Don Quixote now, how's it going?
03:31 rindolf vixey: I'm fine.
03:31 rindolf vixey: writing some emails.
03:31 rindolf And trying to see why @perl.org does not like me.
03:32 mncharity re v5.8.8, ah, ok.  I'm v5.10.0.  Not sure if it will be an issue or not.
03:32 * mncharity pictures a "Santa's elf" tilling at windmills... on a reindeer...
04:25 peepsalot joined #perl6
04:32 Psyche^ joined #perl6
04:55 Alias_ joined #perl6
05:17 meppl joined #perl6
05:19 justatheory joined #perl6
05:31 justatheory_ joined #perl6
06:00 penk joined #perl6
06:05 pugs_svnbot r20415 | putter++ | [elf_f] Kludged a Test.pm.  run-tests script created.  Bare blocks are now emitted, and hash vs block differentiation improved (but still a kludge).
06:27 pmurias joined #perl6
07:15 cosimo joined #perl6
07:24 masak joined #perl6
07:58 moritz_ @tell mncharity I have problems building elf_f: ../elf_e -x -o ../elf_f0 Elf.pm results in '../elf_e_src/STD_red/prelude.rb:441:in `require': no such file to load -- readline (LoadError)' - any ideas?
07:58 lambdabot Consider it noted.
08:40 IllvilJa joined #perl6
09:06 wknight8111 joined #perl6
09:06 chris2 joined #perl6
09:14 iblechbot joined #perl6
10:34 chris2 left #perl6
11:42 wknight8111 joined #perl6
12:04 pugs_svnbot r20416 | clkao++ | bump version for cpan reindex.
12:16 ispy_ joined #perl6
12:41 ruoso joined #perl6
12:51 pbuetow joined #perl6
12:55 eternaleye joined #perl6
13:01 cmarcelo joined #perl6
13:11 nnunley joined #perl6
13:15 cjfields joined #perl6
13:15 cjfields pugs: class Foo { has $.x; method boo { say $.x } }; class Bar is Foo { method set($v) { $.x = $v } }; my Foo $u .= new(x => 5); $u.boo; $u= Bar.new(Foo{ x => 12 }); $u.boo; $u.set(9); $u.boo;
13:15 exp_evalbot OUTPUT[5␤*** Must only use named arguments to new() constructor␤    Be sure to use bareword keys.␤    at /tmp/n0wxXZkBl4 line 1, column 132-159␤]
13:16 cjfields rakudo: class Foo { has $.x; method boo { say $.x } }; class Bar is Foo { method set($v) { $.x = $v } }; my Foo $u .= new(x => 5); $u.boo; $u= Bar.new(Foo{ x => 12 }); $u.boo; $u.set(9); $u.boo;
13:16 exp_evalbot OUTPUT[5␤Type check failed␤current instr.: 'die' pc 7364 (src/gen_builtins.pir:5066)␤called from Sub '!TYPECHECKEDASSIGN' pc 7480 (src/gen_builtins.pir:5206)␤called from Sub '_block10' pc 167 (EVAL_12:51)␤called from Sub 'parrot;PCT::HLLCompiler;eval' pc 785 (src/PCT/HLLCompiler.pir:458)␤called
13:16 exp_evalbot ..from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 106...
13:16 moritz_ cjfields: I think WHENCE closures aren't implemented yet
13:17 moritz_ cjfields: and I couldn't find a test for them anywhere
13:17 moritz_ if you feel like, go ahead and write one
13:17 cjfields This is a test script Jonathan had running with Rakudo at one point
13:17 cjfields of course, not as a one-liner
13:18 cjfields I need to test the one-line version using parrot r27447
13:19 moritz_ if it's a test script, check it into the pugs repo somewhere below t/
13:19 moritz_ so it won't get lost
13:21 cjfields moritz_: I don't have a commit bit.  We need to wrangle all of Jonathan's Rakudo examples together at some point
13:21 moritz_ cjfields: want a commit bit?
13:22 cjfields Sure!
13:23 moritz_ /msg (or just tell) me your email address and desired nick
13:23 [particle] please add new tests to t/spec, if you can
13:25 cjfields will do!
13:25 moritz_ cjfields: email is on its way. If it doesn't arrive within 5 minutes, please scream ;)
13:27 alanhaggai joined #perl6
13:27 cjfields Got it.  I'll add the test to t/spec as soon as I can (gotta catch the bus, be back soon)
13:34 nnunley joined #perl6
13:41 rdice joined #perl6
13:44 jan_ joined #perl6
14:09 moritz_ @tell Juerd I updated feather's openssl libs, but it still needs to regen host keys, see http://lists.debian.org/debian-sec​urity-announce/2008/msg00152.html
14:09 lambdabot Consider it noted.
14:26 ruoso joined #perl6
14:29 ispy_ left #perl6
14:31 ludan joined #perl6
14:38 IllvilJa joined #perl6
14:40 cjfields joined #perl6
14:42 justatheory joined #perl6
14:46 hidenowt joined #perl6
14:47 hidenowt left #perl6
14:49 ispy_ joined #perl6
14:56 meteorjay joined #perl6
15:12 Juerd Feather has new SSH keys: rsa => 44:88:fb:48:cb:79:72:da:67:bd:18:4f:84:d9:2a:cf, dsa => cf:8c:46:ff:41:f5:b5:e0:07:73:3d:6b:30:7c:2f:56
15:12 lambdabot Juerd: You have 1 new message. '/msg lambdabot @messages' to read it.
15:12 Juerd @messages
15:12 lambdabot moritz_ said 1h 3m 33s ago: I updated feather's openssl libs, but it still needs to regen host keys, see http://lists.debian.org/debian-sec​urity-announce/2008/msg00152.html
15:12 Juerd Right
15:12 Juerd moritz++  # fast
15:22 jhorwitz joined #perl6
15:23 lidden joined #perl6
15:24 TJCRI joined #perl6
15:33 peepsalot joined #perl6
15:39 wknight8111 joined #perl6
15:54 jan_ joined #perl6
16:12 armagad joined #perl6
16:13 silug joined #perl6
16:17 iblechbot joined #perl6
16:24 meppl joined #perl6
16:30 pugs_svnbot r20417 | cjfields++ | test for init. parent attributes (from Jonathan and dakkar)
16:32 moritz_ cjfields: please use the scripts in util/ to set the svn properties of added files
16:36 meppl joined #perl6
16:36 valkyrie-- joined #perl6
16:39 pugs_svnbot r20418 | moritz++ | [t] set some svn attributes
16:39 pugs_svnbot r20419 | cjfields++ | fix test to return value
16:39 cjfields moritz_: thanks (beat me to it)
16:40 moritz_ cjfields: np, there were (and are still) quite some files with missing attributes
16:41 * moritz_ now does a find t/ -type f -name '*.t' | xargs ./util/add-svn-props.sh and hopes it's not an extraordinarily stupid thing to do
16:45 pugs_svnbot r20420 | moritz++ | set svn properties on all .t files below t/
16:45 pugs_svnbot r20420 | moritz++ | find t/ -type -f name '*.t' | xargs ./util/add-svn-props.sh
16:45 pugs_svnbot r20420 | moritz++ | I hope this is sane :/
16:46 moritz_ cjfields: in that test file you don't compare the desired values in all tests
16:46 moritz_ $u= Bar.new(Foo{ x => 12 });
16:46 moritz_ is($u.boo, 'set parent attribute');
16:46 moritz_ should probably be is($u.boo, 12, ...);
16:46 moritz_ same for the third test
16:51 ruoso joined #perl6
16:54 spinclad cjfields: now you're an author, please add yourself to AUTHORS, as per tradition  :)
16:55 spinclad (traditional first commit to test your commit bit)
16:57 pugs_svnbot r20421 | moritz++ | [spec] fixed expected values in parent_attributes.t
16:58 cjfields moritz_: you are correct; the test fails with rakudo (passed until recent commits( so I didn't catch that
16:59 * moritz_ is too impatient today, sorry for that
17:01 cjfields s'okay, stepped away from the desk a bit so missed that
17:03 pugs_svnbot r20422 | cjfields++ | added me
17:03 cjfields spinclad: done
17:04 cjfields I need to update the test docs with something more meaningful, will do momentarily
17:05 eternaleye joined #perl6
17:11 fridim_ joined #perl6
17:15 dalek left #perl6
17:16 pugs_svnbot r20423 | cjfields++ | update docs (could merge these with other tests in the future)
17:18 dalek joined #perl6
17:19 dalek joined #perl6
17:28 peepsalot joined #perl6
17:44 pmurias joined #perl6
17:46 pmurias @tell mncharity elf_f dosn't correctly compile itself perl elf_f -I elf_e_src -x elf_e_src/Elf.pm -o elf_f2, the resulting file has syntax errors
17:46 lambdabot Consider it noted.
17:52 mncharity joined #perl6
17:55 pmurias swimming&
17:55 mncharity pmurias: hi
17:56 mncharity pmurias: re elf_f, the problem was that -I.
17:57 moritz_ mncharity: did you get my @tell from earlier today?
17:57 mncharity oh, wait.  your objective is to compile elf_e with elf_f and call it elf_f2 ?  /me confuzed
17:58 mncharity moritz_: just got it.  thought pmurias might still be here but on way out so responded to that first.
17:58 mncharity let's see...
17:59 mncharity ruby --version   of the ruby the #! line of STD_red_run invokes?
18:01 moritz_ ruby 1.8.6 (2008-03-03 patchlevel 114) [i486-linux]
18:01 araujo joined #perl6
18:01 moritz_ dammit, it doesn't use the ruby 1.9 in $PATH
18:02 mncharity elf_e is using it's own elf_e_src/STD_red/STD_red_run  at this point.  fyi.  so
18:03 mncharity if you edited misc/STD_red/STD_red_run's #! /bin/env ruby , you will also have to tweak that one.
18:03 mncharity #!/usr/bin/env ruby   rather
18:04 mncharity hmm.  now that ruby 1.9 is "strongly recommended", STD_red_run should check for it...
18:05 moritz_ mncharity: now I changed both to /usr/bin/ruby1.9 and still get the same error
18:07 mncharity s/strongly recommended/only supported/  the utf handling killed 1.8.
18:07 mncharity re same error,
18:07 mncharity ruby --version ?
18:07 moritz_ ruby 1.9.0 (2007-12-25 revision 14709) [i486-linux]
18:08 mncharity ruby -e 'require "readline"'  ?
18:09 moritz_ e:1:in `require': no such file to load -- readline (LoadError) from -e:1:in `<main>'
18:09 * moritz_ tries installing libreadline-ruby1.9
18:09 mncharity hmm.  why would ruby on a linux box not have been compiled with readline.  /me googles...
18:10 moritz_ because it's a separate module?
18:13 mncharity at least in 1.8, it's part of stdlib.  http://ruby-doc.org/stdlib/li​bdoc/readline/rdoc/index.html  in  http://ruby-doc.org/stdlib/  (all thought with an unfortunate lack of documentation).
18:13 lambdabot Title: readline: Ruby Standard Library Documentation
18:14 moritz_ it works now, with libreadline-ruby1.9 installed
18:16 mncharity ah, ok.  what os?  I'll add a note to README.
18:16 moritz_ Debian
18:16 mncharity ok.  thanks!
18:16 moritz_ testing aka "Lenny"
18:16 * moritz_ just did the ../elf_f2 -e 'say 3'
18:17 mncharity :)  elf_f2 should be identical to elf_f.  it's just part of the "are we at a self-compilation fixed point" check.
18:18 moritz_ mncharity: if you could somehow improve the startup time it might be worth adding an elf: target for evalbot ;)
18:20 mncharity :)  yeah.  in elf_e, I was often using elf_e_nomoose, which doesn't have the startup time issue.  dropped it to simplify getting elf_f working.  now that it is... need to do something.  the latency is a pain.
18:20 moritz_ mncharity: where is the output format of run-tests documented?
18:21 mncharity what's your   time elf_f --help  ?
18:21 moritz_ I did a time ../elf_f2 -e 'say 3'
18:21 moritz_ real    0m3.478s
18:22 mncharity the "way too late night hack" of run-tests isn't documented at all.  thought I'd look at it again today, now that it's run once.
18:22 mncharity ok.  about the same as me.  the diff between --help and -e 'say 3' is ~0.  all time spent in Moose init.
18:23 mncharity I'm likely doing some things wrong (repeatedly unfreeze/freezing classes).
18:24 mncharity though more limited than elf_e and elf_f, elf_e_nomoose can be used for timing comparison.
18:25 mncharity -/X means the parse worked.  C/d  means Compile failed (using "saw the test plan line" as a proxy for this), and d_ied (non-zero exist status).
18:26 mncharity -/X worked/didn't
18:26 mncharity *non-zero exist status after seening the plan line.
18:28 mncharity moritz_: what is the debian package name for 1.9?
18:28 moritz_ mncharity: ruby1.9
18:30 mncharity thanks
18:30 pugs_svnbot r20424 | putter++ | [elf] elf_f_src/run-tests.result added.
18:30 mncharity woo hoo 1%  :)
18:45 pugs_svnbot r20425 | putter++ | [STD_red_run] Ruby 1.8 is no longer supported.  Now checks for 1.9.
18:45 pugs_svnbot r20425 | putter++ | README: Added Debian install guidance.
18:45 pugs_svnbot r20425 | putter++ | STD_red_run: Load yaml.rb only if needed.  Marked it depreciated in --help.
18:45 pugs_svnbot r20425 | putter++ | moritz_++
18:47 araujo joined #perl6
19:06 rindolf joined #perl6
19:22 mncharity pmurias: If the objective was to compile elf_e with elf_f, that would be  ./elf_f -I elf_d_src -I elf_e_src -x elf_e_src/Elf.pm -o elf_xx.  If the objective was to self compile elf_f, that would be ./elf_f -I elf_f_src -x elf_f_src/Elf.pm -o elf_xx .
19:24 mncharity command lines would obviously be shorter in their respective _src directories, where the implicit -I . would serve.  elf_e uses a couple of files from elf_d, thus elf_e's -I elf_d_src.  If that's an issue, they would be easily copied.  There's a list in elf/README under elf_e "Linkage".
19:26 mncharity cd elf_e_src; ../elf_f -I ../elf_d_src -I . -x Elf.pm -o ../elf_xx #well, not much shorter.  and  cd elf_f_src; ../elf_f -x Elf.pm -o ../elf_xx
19:28 mncharity hmm, looks like that -I ordering is different than perl's.  fixing...
19:29 Eevee is perl 6 intended to treat everything as utf-8 by default?  I recall reading this somewhere in the docs years ago but it seems to have been delegated to a TBD syn15
19:29 dalek joined #perl6
19:29 Juerd Eevee: Depends on your defintion of "everything"
19:29 wknight8111 joined #perl6
19:30 Juerd Eevee: Reading files will probably default to reading raw bytes unless you indicate that these raw bytes represent text, in which case utf-8 would probably be a sane default indeed.
19:30 Eevee source code, variable names, constants, input, output, grandma's cake recipe, whatever
19:30 moritz_ Eevee: there will be some options to specify the encoding I think
19:31 mncharity ruby uses magic comments.  eh.
19:31 Eevee Juerd: isn't that a bit backwards from what we have now?  binmode and all
19:31 mncharity re source files, yes, my impression is utf-8 is the default.
19:32 pmurias joined #perl6
19:32 mncharity hi pmurias
19:32 Juerd Eevee: Well, yes and no.
19:32 Juerd Eevee: Perl 5 does not have types, so it has a single string form, instead of properly separated text and binary forms
19:32 pmurias mncharity: hi
19:33 Juerd Eevee: The default read mode in Perl 5 is a mixture of text and binary. The string you end up with can either be used as a byte string, in which bytes are just bytes, or as a text string (Perl will assumed the byte string was latin1 encoded)
19:33 pmurias typed the command from my head instead of the bash history (which suffers from screen)
19:33 mncharity ahhh
19:34 Juerd Eevee: "binmode" has a double function too: while it was originally there to specifically indicate that a file was *binary*, it can now also be used to indicate that it reperesents *text*...
19:34 Juerd Eevee: So it's kind of hard to answer that question.
19:34 Juerd Eevee: Mostly, it's a rather different philosophy towards data.
19:35 Eevee Juerd: *semantically* I have always taken a defaultly opened filehandle to be saying "this is latin-1 text, more or less, unless you treat it like it's not", and (original) binmode to mean "just bytes, period"
19:35 Juerd Eevee: Yes, that's the way Windows users will see it.
19:35 Juerd Eevee: As a Linux user, however, I never used binmode until encodings came around. So in my mind it is associated with text, and the default was raw.
19:36 mncharity I'm not sure what to do about elf's -I a -I b   having the opposite @INC order as p5's.  perl can collect them all and reverse them before unshifting them onto @INC, because it's only going to accept a single -e/file.  I strongly wish to avoid that limitation, so an "each -I x means @INC.unshift x" makes sense... but is unquestionably going to burn people. :/
19:36 Juerd Eevee: You should note, though, that it's the string type that is text/binary hybrid, not the file reading itself.
19:37 Eevee so
19:37 mncharity maybe collect until the next -e/file, and reverse+unshift them then...
19:38 Eevee could the default be to just have my Str @lines = =$fh; give me utf-8 lines, and my Bin (or Blob or Binary or whatever) @bytes = =$fh; give bytes?
19:39 Juerd Almost.
19:39 Juerd Not "give" but "make interpreted as"
19:40 pmurias mncharity: svk pulling fixed the problem, no trying with nomoose
19:40 Juerd It's likely that binary containers and binary streams will have a property indicating the character encoding for text that has to be coerced into this binary string.
19:40 Juerd And that will probably default to UTF-8.
19:40 Juerd This said, I hope you will get a nice warning if you try to read a text file without indicating that it is a text file.
19:43 mncharity perl6: my $a = [3,4,5]; say $a
19:43 exp_evalbot kp6: OUTPUT[3 4 5␤]
19:43 exp_evalbot ..pugs: OUTPUT[3 4 5␤]
19:43 exp_evalbot ..rakudo: OUTPUT[345␤]
19:43 Eevee would really rather have it the other way; utf8-compatible text has to be the most common type of file opened directly by perl code.  binary files are probably largely handled by modules anyway  (GD, im, etc)
19:44 * pmurias just hopes latin-1 won't be the default for anything
19:46 Juerd Eevee: Perhaps indeed the default mode should be text.
19:46 Juerd Eevee: Good point there.
19:46 Juerd Eevee: In any case, the default should be EITHER text OR binary, no magic or heuristics.
19:46 moritz_ right
19:46 Eevee yes
19:47 moritz_ perhaps it should be test, and encoding is detected by BOM and locales
19:49 Eevee hm, locale might be fair
19:49 pugs_svnbot r20426 | putter++ | [elf] elf_f -I ordering now more closely resembles perl's.  pmurias++
19:49 pugs_svnbot r20426 | putter++ | ./elf_f -I a -I b -e 3 -I c -I d -e 'say @*INC.flatten' #=> cdab.
19:50 Eevee well.  then I wonder about people writing perl 6 programs that read e.g. configuration files..  which will spectacularly break for anyone in another country
19:51 Eevee of course the opposite happens if perl 6 assumes utf-8 all the time and someone tries to open a shift-jis text file
19:51 Eevee well, that sucks
19:53 gbacon joined #perl6
19:54 Juerd moritz_: BOM is heuristics.
19:54 Juerd moritz_: There's no certainty with BOMs. Maybe the FE FF was really 2 iso8859 characters...
19:54 Juerd moritz_: So no BOM detection please :)
19:55 Eevee BOMs don't seem to be quite ubiquitous anyway
19:55 mncharity perl6: my $a = [3,4,5]; my $b = [6,$a,7]; say $a;
19:55 exp_evalbot kp6: OUTPUT[3 4 5␤]
19:55 exp_evalbot ..pugs: OUTPUT[3 4 5␤]
19:55 exp_evalbot ..rakudo: OUTPUT[345␤]
19:55 Juerd Quite the contrary :)
19:55 mncharity doh
19:55 moritz_ Juerd: how many real world texts do you know that are iso8859-* coded and start with what looks like a BOM?
19:55 pmurias mncharity: i didn't do anything to deserve the karma ;)
19:55 mncharity perl6: my $a = [3,4,5]; my $b = [6,$a,7]; say $b;
19:55 exp_evalbot kp6: OUTPUT[6 3 4 5 7␤]
19:55 exp_evalbot ..pugs: OUTPUT[6 3 4 5 7␤]
19:55 exp_evalbot ..rakudo: OUTPUT[63457␤]
19:55 Juerd moritz_: That's irrelevant.
19:56 Juerd moritz_: I don't want files to be read with detected encoding, ever.
19:56 Juerd moritz_: An exception can be made only for source code, because then you can still die if it turns out to be invalid data.
19:56 moritz_ Juerd: fact is that out-of-band signalling is too enerving for too many people
19:56 Juerd But once you're past compile time, please, no guessing!
19:56 Juerd moritz_: Other fact is that in-band signalling for this does not exist!
19:56 pugs_svnbot r20427 | pmurias++ | [elf_f]
19:56 pugs_svnbot r20427 | pmurias++ | added back the _nomoose variant
19:57 mncharity pmurias: re karma, if you hadn't asked the question, the issue would not have been noticed and resolved.  seemed sufficient. ;)
19:57 Juerd moritz_: A byte order mark is to indicate the byte order, not to indicate the encoding.
19:57 Juerd moritz_: That is: if you use UTF-16 (UCS-2), the byte order mark is relevant.
19:57 Juerd moritz_: Don't read "encoding mark" when it isn't that.
19:57 Eevee perl6: my $a = { foo => 42 }; my $b = [1, $a, 2]; say $b;
19:57 exp_evalbot kp6: OUTPUT[1 foo       42 2␤]
19:57 exp_evalbot ..pugs: OUTPUT[1 foo      42␤ 2␤]
19:57 exp_evalbot ..rakudo: OUTPUT[1_block152␤]
19:58 Eevee well.  at least _block15 is a little less intimidating than HASH(0x3484a6)
19:59 moritz_ Juerd: but if *know* that something is UTF-16 then you already had some meta information, meaning that you could have transported the byte order information just as well
19:59 Juerd moritz_: Yes.
19:59 Juerd moritz_: But some unicode consortium thingy thought UTF-16 would be used for small strings with no metadata. And it is, by Microsoft, but they don't use BOMS either.
20:01 pmurias mncharity: elf now does it differently than perl6
20:01 pmurias * perl5
20:02 moritz_ Juerd: the more I learn about all that charset and encoding stuff the more I begin to hate it ;)
20:02 pmurias mncharity: karma is sort of arbitrary, so it's ok
20:02 moritz_ Juerd: and I learn about more and more methods that they are not applicable where I thought they would, without learning good alternatives ;)
20:03 mncharity pmurias: "elf now does it differently than perl6", perl6?
20:03 mncharity ah, perl5
20:04 mncharity re differently, for command lines which are valid in both, -I behaves the same in both, no?
20:04 pmurias perl elf_e_nomoose -I a -I b -I c -e 'say @*INC.join(" ")'
20:04 pmurias versus
20:04 pmurias perl -I a -I b -I c -e 'print join(" ",@INC),"\n"'
20:04 Juerd moritz_: Well, if there's anything to hate, then it's the way the English speaking world has dealt with the issue so far: by ignoring it altogether.
20:05 mncharity looking...
20:05 pmurias sorry
20:05 Juerd moritz_: And since that community has invented most of the basic computer stuff, the problems are pretty thorough.
20:05 pmurias my mistake
20:05 Eevee 127 extra high-ascii characters and we used them for drawing box art
20:05 Eevee granted, it was pretty cool box art..
20:05 mncharity ah, np
20:06 moritz_ Juerd: they're not the only ones. Quite many Germans think that ASCII = Latin 1 and everything should work with that
20:06 Juerd moritz_: As for learning methods that you thought would be applicable: you're trying to solve the problems that history created, thinking they CAN BE SOLVED. Most can't. A simple (yet thorough) redesign is required, including the way you think :)
20:06 Eevee someone should probably write down whatever comes out of these discussions so they have a chance of affecting anything  :P
20:06 Juerd moritz_: Well, maybe it's the latin1 speaking countries then :)
20:06 Juerd The Dutch are equally guilty indeed.
20:07 Juerd moritz_: There are only a few (very few) basic principles that one has to learn
20:07 moritz_ Juerd: I tried to think of some systems that could solve the problem thoroughly, and I always ended in great complexity
20:07 Juerd 1. Text and binary are different kinds of string
20:07 Juerd 2. They're incompatible and can NEVER be mixed
20:07 Juerd 3. They can be converted: text can be expressed as binary with an /encoding/
20:08 Juerd 4. The encoding must be signalled out of band, or set in stone.
20:08 Juerd 5. No binary string can ever represent text without an encoding
20:08 Juerd That's it.
20:08 moritz_ agreed
20:08 Juerd But people try:
20:08 moritz_ but 4. allone is quite tough
20:08 Juerd a. To "detect" the encoding
20:08 Juerd b. To "signal" the encoding IN BAND
20:09 Juerd c. To mix text and binary, because they think character == byte
20:09 Juerd d. To mix text and binary, because they think there's a default way to convert that's suitable for every purpose
20:09 Juerd And they're wrong...
20:09 Juerd moritz_: 4 more or less implies the rest, yes.
20:10 moritz_ problem is that a utility as simple as 'cat' can break all of your system
20:10 moritz_ unless *every* string on your whole system is either assumed to be binary or of a fixed encoding
20:11 Juerd Yes.
20:11 Juerd That's part of the thoroughness of the problem.
20:11 Juerd "Text files" have no metadata that says which encoding it is.
20:11 moritz_ and most unix file systems don't have a handy way for out-of-band signalling
20:12 Juerd HTTP in common practice is a good example of how good and bad design meet.
20:12 Juerd Good design: HTTP has a Content-Type header with a charset attribute
20:12 Juerd Bad design: there's no way we can store these things on disk, in unix
20:12 Juerd So web servers do a lot of guessing, and let you manually hack in the values in the config
20:12 moritz_ Good design: it is *specced* that all HTTP headers themselfes are sent in ASCII
20:12 Eevee maybe when filesystems with arbitrary metadata catch on a bit more
20:13 Juerd Yes, that too is good design. That's the "set in stone" part, which is needed for arbitrary encoding signalling of course :)
20:13 schmalbe joined #perl6
20:13 Juerd Eevee: It doesn't have to be arbitrary. Really, people want to solve way too many problems at once.
20:13 moritz_ Eevee: it's a chicken-and-egg problem. You don't invest time in making a file system store meta data if you have no good way to use it
20:14 Juerd Only one part of metadata that is really important, is missing in common filesystems: content type (with charset)
20:14 Juerd That's ALL
20:14 Juerd Simply because we're used to using binary files with in-file metadata for everything.
20:14 moritz_ Eevee: for example if you can't add that metadata to a stream, 'cat' will still break even if the file system knows the encoding
20:14 Juerd We just need to know how to interpret the in-file metadata...
20:14 Eevee well, arbitrary or not; just saying arbitrary because people may want to add some other tag without patching every fs under the sun
20:14 Eevee moritz_: well, damn
20:15 pmurias Juerd: why not use a file attributes?
20:15 pugs_svnbot r20428 | putter++ | [elf_f] Inlined the Perl6::Say implementation, and tweaked it to flatten ARRAYs.  So 'say @*INC' works.
20:15 Juerd moritz_: Using "cat" that way is bad, though. It doesn't feel bad because we're so used to it, but it is.
20:15 Juerd pmurias: I don't know what you mean.
20:16 moritz_ another issue is system calls - they are nearly all binary
20:16 Juerd Yes
20:16 moritz_ but you don't think of, say file names, as binary data
20:16 icwiener joined #perl6
20:16 Juerd Pervasive replacement is required
20:16 moritz_ you want to *read* file names
20:16 Eevee Juerd: if you can't flag the content type of a stream, all pipelines are potentially broken
20:16 Eevee not just cat
20:16 Juerd Or re-consideration of the meaning of a nullbyte  :)
20:16 Juerd US-ASCII\0/etc/passwd\0
20:16 Juerd :)
20:16 pmurias it's possible to attach bits of that to files in linux (maybe with some sort of extension) never needed it myself
20:16 mncharity for some value of "works".  Looks like pugs/kp6 and rakudo/Perl6::Say differ on whether it should be join(" ") or join("").  elf wen't with the latter.
20:17 Juerd Eevee: Yes, but pipelines are for *content*. That's okay. Some *other* means, *out of band* indeed, can be created
20:17 Juerd Eevee: export PIPE_ENCODING=UTF-8 and the problem is fixed.
20:17 Juerd You then only need programs to look at this variable.
20:17 mncharity say() should be rewritten in p6 soon anyway.
20:17 Juerd In fact, s/PIPE/CONTENT/
20:17 pmurias Juerd: http://en.wikipedia.org/wiki/E​xtended_file_attributes#Linux
20:17 Juerd pmurias: I'll read that later. Thank you.
20:18 Eevee hm, true
20:18 mncharity bbiab &
20:19 rindolf joined #perl6
20:19 Juerd Eevee: This can work for one important reason: Unix utilities are often designed to do one thing well.
20:20 Juerd Eevee: Which often means they won't open two completely independent streams, where one should have a different encoding than the other.
20:20 Juerd Eevee: Except when the utility is built for specifically that purpose, in which case it becomes very acceptable to use command line arguments instead.
20:20 Juerd .oO( iconv )
20:24 icwiener_ joined #perl6
20:26 Lorn joined #perl6
20:28 kolibrie mncharity: S02 says: array interpolation, the elements are separated by a space
20:28 kolibrie mncharity: a list of pairs will interpolate with a tab between the key and value, and a newline after the pair
20:37 justatheory joined #perl6
20:41 mj41 joined #perl6
20:46 spinclad kolibrie: but  C<say @*INC>  isn't interpolating per se?
20:46 spinclad nor C<say @b>
20:47 spinclad perl6: my @a = [1,2,3]; say "@a"
20:47 exp_evalbot kp6: OUTPUT[@a␤]
20:47 exp_evalbot ..pugs: OUTPUT[@a␤]
20:47 exp_evalbot ..rakudo: OUTPUT[@a␤]
20:47 Eevee haha
20:47 Eevee consistent at least
20:47 spinclad perl6: my @a = [1,2,3]; say "{@a}"
20:47 exp_evalbot kp6: OUTPUT[{@a}␤]
20:47 exp_evalbot ..pugs: OUTPUT[1 2 3␤]
20:47 exp_evalbot ..rakudo: OUTPUT[{@a}␤]
20:47 spinclad pugs++ at least
20:47 moritz_ perl6: my @a = [1, 2, 3]; say "@a[]"
20:48 exp_evalbot kp6: OUTPUT[1 2 3␤]
20:48 exp_evalbot ..pugs: OUTPUT[1 2 3␤]
20:48 exp_evalbot ..rakudo: OUTPUT[@a[]␤]
20:48 moritz_ kp6 does this one right as well
20:48 spinclad oop, right, pugs--, kp6++
20:48 Eevee hm
20:48 moritz_ spinclad: why?
20:48 Eevee rakudo: my $a = 1; my $b = [2]; say "$a | {$a} | $b | {$b}";
20:48 exp_evalbot OUTPUT[1 | {1} | 2 | {2}␤]
20:48 moritz_ "{@a}" *should* interpolate, you know
20:48 moritz_ pugs++
20:49 moritz_ because {...} is an interpolating closure
20:49 moritz_ and @array[] and %hash{} should also interpolate
20:49 spinclad ESHORTOFCOFFEE
20:49 Eevee how often does evalbot update, out of curiosity?/
20:49 spinclad kp6: half marks
20:49 exp_evalbot r20428: OUTPUT[no method 'APPLY' in Class 'Undef'␤ at compiled/perl5-kp6-mp6/lib/Ki​ndaPerl6/Runtime/Perl5/MOP.pm line 345␤        KindaPerl6::Runtime::Perl5::MO​P::__ANON__('HASH(0x824bd4c)', 'APPLY') called at compiled/perl5-kp6-mp6/lib/Ki​ndaPerl6/Runtime/Perl5/MOP.pm line 169␤
20:49 exp_evalbot ..main::DISPATCH('HASH(0x824bd4c)', 'APPLY') called at compiled/perl5-kp6-mp6/lib/Kin...
20:51 moritz_ Eevee: I'm looking right now, don't know it off-hand
20:52 moritz_ 0-59/3 * * * *      cd pugs && /usr/bin/svn up >> /home/evalenv/pugs.log 2>&1
20:52 moritz_ 0 * * * *           sh /home/evalenv/build-parrot.sh >> ~/parrot.log 2>&1
20:52 moritz_ but I'm at loss which scripts actually *rebuilds* pugs, parrot and rakudo
20:53 moritz_ pugs: say %?PUGS_VERSION
20:53 exp_evalbot OUTPUT[*** Undeclared variable: ("%?PUGS_VERSION",MkPad (padToList [("$_",PELexical {pe_type = (mkType "Scalar"), pe_proto = <Scalar:0xb689db84>, pe_flags = MkEntryFlags {ef_isContext = True}, pe_store = <ref:0xb68a6bc8>}),("@_",PELexical {pe_type = (mkType "Array"), pe_proto = <Array:0xb689d020>,
20:53 exp_evalbot ..pe_flags = MkEntryFlags {ef_isContext = False}, ...
20:53 moritz_ pugs: say $?PUGS_VERSION
20:53 exp_evalbot OUTPUT[Perl6 User's Golfing System, version 6.2.13, October 17, 2006 (r18093)␤]
20:57 moritz_ rakudo: sub foo { say $^b, ' ', $^a }; foo(1, 2);
20:57 exp_evalbot OUTPUT[2 1␤]
20:57 moritz_ that's a feature from 2008-05-11 04:23:21 +0200
20:57 moritz_ Tene++ btw ;)
20:58 moritz_ Eevee: sorry, can't find the info. Never investigate a running system ;)
20:58 Eevee oh well
20:58 Eevee I will take this to mean "frequently"
20:58 Eevee caret-vars pull from the argument list in alphabetical order right
20:59 moritz_ daily or better
20:59 Eevee (can't wait to see what sort of tangled messes people make from that)
20:59 moritz_ Eevee: perl *always* allows gives you enough rope to shoot into your own foot ;)
21:00 Eevee that is some heavily-starched rope
21:01 moritz_ ;)
21:02 Eevee at least this is more the "obvious sane usage but be an ass if you want" type of rope rather than "let's tell everyone to create global things that are sorta like variables" rope  (p5 filehandles..)
21:10 kolibrie spinclad: yeah, I do not remember the spec mentioning specifics of pretty-printing variables that are not being interpolated in a string
21:11 Eevee imo it shouldn't be any different
21:11 Eevee especially now that arrays aren't flattened
21:13 kolibrie kolibrie: that is my thought, as well
21:14 Eevee actually.  I wonder if say() should act like python's print and add spaces between its arguments
21:14 Eevee if it doesn't already
21:14 Eevee perl6: say 1, 2;
21:14 exp_evalbot kp6: OUTPUT[12␤]
21:14 exp_evalbot ..pugs: OUTPUT[12␤]
21:14 exp_evalbot ..rakudo: OUTPUT[12␤]
21:17 moritz_ Eevee: nooo, that's what join() is for ;)
21:20 Eevee the point of say() in the first place is that \n is the common case  :P
21:20 Eevee is there still a top-level join, or just a list method?  (or a string method, but that's terrible and guido should feel very bad)
21:22 moritz_ there is @list.join($delim) and join($delim, @list)
21:23 Eevee hm
21:23 Eevee perl6: say [1, 2, 3].join(','), "\t", (1, 2, 3).join(',');
21:23 exp_evalbot kp6: OUTPUT[1,2,3       1,2,3␤]
21:23 exp_evalbot ..pugs: OUTPUT[1,2,3      1,2,3␤]
21:23 exp_evalbot ..rakudo: OUTPUT[1,2,3    1,2,3␤]
21:24 Eevee oh wow, I didn't think the latter would work
21:24 syle joined #perl6
21:25 Lunchy joined #perl6
21:37 ludan joined #perl6
21:39 dduncan joined #perl6
21:42 dduncan question - what is a good generic word/term to use to refer to operations where you are one-way mapping a larger domain of values to a smaller domain of values, for the purpose of doing soft comparisons of 2 values where you want some hard differences to be treated like they were identical ...
21:42 dduncan mainly I'm thinking of text strings here ...
21:43 moritz_ dduncan: hashing?
21:43 dduncan so specific examples of the operations are case folding to upper or lower ...
21:43 dduncan or trimming spaces
21:43 dduncan or removing accents
21:43 moritz_ canonicalize?
21:43 moritz_ canonize?
21:43 Eevee fuzzing?  consistent..izing?
21:43 moritz_ whatever
21:43 Eevee oh
21:43 dduncan I thought of using the term 'fold' or 'degrade', but I'm not sure if that's best
21:43 Eevee that's much better than making up words
21:43 moritz_ bring into a canonical form
21:44 dduncan maybe canonical might work?
21:44 moritz_ it's the best word I've found for it
21:44 pugs_svnbot r20429 | putter++ | [elf_f] 'use lib "x";' support.
21:44 moritz_ I used to calculate canonical forms of sudokus to be able to compare them
21:45 dduncan the context I'm asking in is that I'm creating a namespace in my Muldis D programming language to group together the casefolding and trimming etc functions, and I was wondering what to call the namespace ...
21:45 dduncan maybe Canonical or some such is it?
21:46 moritz_ Canonical or ComparisonFolding
21:46 moritz_ although I like "frobbing" much better than "folding" ;)
21:46 dduncan the rational for grouping such things is that the language's equality test operator always matches exactly, so eg different case means unequal ... but people often want to compare things with ignoring eg spaces or case or accents
21:46 Juerd joined #perl6
21:47 dduncan so then to do soft matching, one would not compare the originals, but the result of using these functions
21:47 moritz_ ... or in a certain unicode normalization
21:47 moritz_ ah, "normalization" is another good word
21:47 dduncan eg in some SQL dialects where you have to say upper(foo) = upper(bar) ... I don't support foo=bar matching different cases
21:48 dduncan I thought of Normalization too
21:48 moritz_ canonical sounds a bit mathematics-like and not very intuitive
21:48 dduncan but wasn't sure if that would confuse some concepts, eg unicode normalization form, which is an implementation detail, or normalizing tables
21:49 dduncan this all said, its not like I can't just pick something now and change it later, so "good enough" is good enough for today
21:49 moritz_ right, especiall the normalization forms might be a souce of confusion
21:50 dduncan also, rounding a number is a form of normalization too, but this namespace is specific to character strings
21:50 dduncan anyway, thanks for your help
21:51 dduncan I think I'll try Folding for now, and maybe change it later
21:51 dduncan that should at least evoke the case-change subset of the namespace
21:52 dduncan or Canonical or Normalize ... I can always document what I'm actually talking about
21:52 dduncan any votes between those then?
21:53 Eevee guess I'd vote for canonical[ize]?
21:53 dduncan okay
21:54 * moritz_ votes against Normalize
21:54 moritz_ can't decide between the other two
21:54 dduncan okay
21:55 dduncan narrows it down
21:55 lisppaste3 joined #perl6
22:09 dduncan as an update (I'm also talking on the dbix-class list), its looking like 'fold' is a better term, more specific ... also I was pointed to http://www.symbian.com/developer/techlib​/v70sdocs/doc_source/devguides/cpp/base/​BuffersAndStrings/Descriptors/Descriptor​sGuide1/FoldingAndCollating.guide.html
22:09 lambdabot Title: Folding and collation (comparing strings) in Descriptor concepts, http://tinyurl.com/6pgzdq
22:12 pmichaud dduncan:  the traditional term is "folding"
22:12 pmichaud as in "case folding"
22:12 pmichaud that's what Unicode uses, anyway.
22:15 dduncan yes, folding
22:30 meppl good night
22:33 cls_bsd joined #perl6
22:50 mncharity kolibrie: btw, re interpolation, thanks
22:50 pugs_svnbot r20430 | putter++ | [elf_f] Tolerate seeing pointy blocks.  <a b c> is no longer a string.
22:52 mncharity pmurias: thanks for elf_f_nomoose.  run-tests needs to be tweaked to run different elfen.  I'm tempted to rename elf_f_nomoose elf_f_faster or some such.
22:53 mncharity end of hacking day for me.  good night all &
22:54 moritz_ good night
23:17 cjfields joined #perl6
23:18 eternaleye joined #perl6
23:23 rafl joined #perl6
23:29 cjfields_ joined #perl6
23:31 Tene Eevee: yes, caret vars are alpha-sorted in rakudo, and colon-vars work too
23:32 Tene perl6: sub f { say $^b, $^a }; f(1,2)
23:32 exp_evalbot kp6: OUTPUT[␤]
23:32 exp_evalbot ..pugs: OUTPUT[*** Undeclared variable: ("$^b",MkPad (padToList [("$_",PELexical {pe_type = (mkType "Scalar"), pe_proto = <Scalar:0xb67b6d40>, pe_flags = MkEntryFlags {ef_isContext = True}, pe_store = <ref:0xb67bb480>}),("@_",PELexical {pe_type = (mkType "Array"), pe_proto = <Array:0xb67b8238>,
23:32 exp_evalbot ..pe_flags = MkEntryFlags {ef_isContext = False}, pe_store = ...
23:32 exp_evalbot ..rakudo: OUTPUT[21␤]
23:32 Eevee awesome, rakudo++
23:33 Tene perl6: sub f { say $:b, $:a }; f( :a(1), :b(2) )
23:33 exp_evalbot kp6: OUTPUT[error in Block at compiled/perl5-kp6-mp6/lib​/KindaPerl6/Grammar/Sub.pm line 362, <> line 1.␤*** Syntax Error in sub '': missing closing curly bracket ␤]
23:33 exp_evalbot ..pugs: OUTPUT[*** ␤    Unexpected ":b"␤    expecting "::"␤    at /tmp/rL4EuS8ffC line 1, column 14␤]
23:33 exp_evalbot ..rakudo: OUTPUT[21␤]
23:34 Tene also @_ and %_
23:34 armagad left #perl6
23:50 cmarcelo joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo