Camelia, the Perl 6 bug

IRC log for #perl6, 2014-10-31

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs

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

All times shown according to UTC.

Time Nick Message
00:00 Alula joined #perl6
00:37 grettis joined #perl6
00:38 fhelmberger joined #perl6
00:54 legrady left #perl6
00:59 thou joined #perl6
01:16 erkan joined #perl6
01:16 erkan joined #perl6
01:44 TimToady m: say [=>] <a b c d>
01:44 camelia rakudo-moar 315ec6: OUTPUT«"a" => "b" => "c" => "d"␤»
01:44 TimToady S-EXPR in a can...
01:45 TimToady m: say [=>] <a b c d>, Nil
01:45 camelia rakudo-moar 315ec6: OUTPUT«"a" => "b" => "c" => "d"␤»
01:45 TimToady m: say [=>] <a b c d>, Mu
01:45 camelia rakudo-moar 315ec6: OUTPUT«"a" => "b" => "c" => "d" => Mu␤»
01:46 TimToady if you want everyhing in the CARs
01:56 jfredett joined #perl6
02:04 hypolin joined #perl6
02:08 jack_rabbit joined #perl6
02:12 chenryn joined #perl6
02:33 dayangkun joined #perl6
02:39 davido__ joined #perl6
02:47 thou joined #perl6
03:07 gfldex joined #perl6
03:08 tinyblak joined #perl6
03:12 noganex_ joined #perl6
03:22 davido_ joined #perl6
03:52 vendethiel- joined #perl6
03:57 rmgk joined #perl6
04:06 mauke_ joined #perl6
04:07 anaeem1_ joined #perl6
04:29 chenryn joined #perl6
04:35 thou joined #perl6
04:37 tinyblak joined #perl6
04:49 Alina-malina joined #perl6
04:49 dj_goku joined #perl6
04:55 dj_goku I brought this up awhile back, but I want to take what is on rosetta code and add it to perl6/roast
05:07 chenryn joined #perl6
05:19 gtodd joined #perl6
05:22 kaare_ joined #perl6
05:24 anaeem___ joined #perl6
05:27 tinyblak joined #perl6
05:31 tinyblak_ joined #perl6
06:12 anaeem1 joined #perl6
06:15 moritz +1
06:24 thou joined #perl6
06:28 kaleem joined #perl6
06:39 fhelmberger joined #perl6
06:57 vendethiel joined #perl6
07:06 masak mornin', #perl6
07:07 timotimo http://blogs.perl.org/users/brad_gilbert/20​14/10/perl6-pi-and-continued-fractions.html
07:10 erkan joined #perl6
07:10 timotimo especially that last loop that wants to find out what the most precise rat representation of pi is should be much, much easier with a ...
07:12 timotimo but i don't understand the line "last unless $current.Rat"; probably has to do with the exact way pi-fraction is implemented
07:13 timotimo also, why start the calculation of pi-fraction from the start each time; should be doable with a lazy list, too
07:16 FROGGS joined #perl6
07:18 masak it's quite good code.
07:19 masak m: sub prefix:<1/>($x) { "it works!" }; say 1/ "test"
07:19 camelia rakudo-moar 315ec6: OUTPUT«it works!␤»
07:20 masak m: multi prefix:<1/>(Rational ::R $rat) { R.new($rat.denominator, $rat.numerator) }; multi prefix:<1/>(Int $integer) { FatRat.new(1, $integer) }; say 1/ 3/4; say 1/ 42;
07:20 camelia rakudo-moar 315ec6: OUTPUT«0.083333␤0.023810␤»
07:21 masak m: multi prefix:<1/>(Rational ::R $rat) { R.new($rat.denominator, $rat.numerator) }; multi prefix:<1/>(Int $integer) { FatRat.new(1, $integer) }; say (1/ 3/4).perl; say (1/ 42).perl;
07:21 camelia rakudo-moar 315ec6: OUTPUT«FatRat.new(1, 12)␤FatRat.new(1, 42)␤»
07:21 masak m: say (3/4).perl
07:21 camelia rakudo-moar 315ec6: OUTPUT«0.75␤»
07:21 timotimo ah, precedence too tight?
07:21 masak oh!
07:21 masak m: multi prefix:<1/>(Rational ::R $rat) { R.new($rat.denominator, $rat.numerator) }; multi prefix:<1/>(Int $integer) { FatRat.new(1, $integer) }; say (1/ (3/4)).perl; say (1/ 42).perl;
07:21 camelia rakudo-moar 315ec6: OUTPUT«<4/3>␤FatRat.new(1, 42)␤»
07:22 masak indeed.
07:22 masak timotimo++
07:22 darutoko joined #perl6
07:22 timotimo that's exactly what brad gilbert was worried about :)
07:22 masak heh :)
07:22 * masak .oO( unfounded, I tell you! unfounded! )
07:23 timotimo the rosettacode on continued fraction has a pretty sweet bit of code that makes a lazy list for the continued fraction
07:23 timotimo http://rosettacode.org/wiki​/Continued_fraction#Perl_6 - at the bottom of this section
07:24 timotimo mapping .($x) over the triangle-reduction of the composition operator is a bit brainfucky if you're not familiar with continued fractions :D
07:25 timotimo map { @a[$_] + @b[$_] / * } - this is supposed to create a WhateverCode for every step of the way?
07:25 masak stability as a deliverable -- http://blog.rust-lang.org/​2014/10/30/Stability.html -- interesting.
07:26 timotimo that is quite crafty, but close to "obscure", IMO
07:27 abraxxa joined #perl6
07:30 abraxxa joined #perl6
07:36 immortal joined #perl6
07:47 virtualsue joined #perl6
07:47 rindolf joined #perl6
07:49 Sqirrel joined #perl6
07:51 masak timotimo: hm yes. not so obvious, IMO.
07:52 jack_rabbit joined #perl6
07:56 [Sno]_ joined #perl6
07:57 [Sno]_ joined #perl6
08:11 rindolf joined #perl6
08:12 thou joined #perl6
08:19 gfldex joined #perl6
08:26 denis_boyun_ joined #perl6
08:28 sergot hi o/
08:31 tgt joined #perl6
08:37 FROGGS hi sergot
08:38 FROGGS sergot: do we want to start working on server support based on HTTP::UserAgent code?
08:38 FROGGS because... HTTP::Easy is not that reliable
08:38 FROGGS nor fast...
08:39 zakharyas joined #perl6
08:51 sqirrel_ joined #perl6
08:55 masak hi sergot
08:59 timotimo i'd also like to find out at what places in the server code and farabi6 itself we can apply async i/o and concurrency
09:02 grondilu joined #perl6
09:02 grondilu say Blob.new but role {};
09:02 grondilu m: say Blob.new but role {};
09:02 camelia rakudo-moar 315ec6: OUTPUT«This REPR cannot change type␤  in any mixin at src/gen/m-Metamodel.nqp:1178␤  in sub infix:<but> at src/gen/m-CORE.setting:18615␤  in block <unit> at /tmp/ndgTcgM7NT:1␤␤»
09:02 brrt joined #perl6
09:03 grondilu p: say Blob.new but role {};
09:03 camelia rakudo-parrot 315ec6: OUTPUT«Representation does not implement change_type␤  in any mixin at gen/parrot/Metamodel.nqp:1173␤  in sub infix:<but> at gen/parrot/CORE.setting:18736␤  in sub infix:<but> at gen/parrot/CORE.setting:18731␤  in block <unit> at /tmp/DzTxL_ZNoI:1␤␤»
09:03 grondilu n: say Blob.new but role {};
09:03 camelia niecza v24-109-g48a8de3: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Undeclared name:â�¤       'Blob' used at line 1â�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/camelia/niecza/boot/lib/CORE.setting line 1502 (die @ 5) â�¤  at /home/camelia/niecza/src/STD.pm6 line 1147 (P6.comp_u…»
09:03 grondilu can't Blob be mixed in?
09:03 moritz nope
09:05 kjs_ joined #perl6
09:15 ptc_p6 joined #perl6
09:19 arnsholt r-m: say Blob.new.REPR
09:19 camelia rakudo-moar 315ec6: OUTPUT«VMArray␤»
09:20 arnsholt VMArray is the REPR that implements packed arrays. Adding fields to that wouldn't be a good idea, I think
09:26 bjz joined #perl6
09:30 rurban joined #perl6
09:33 mls joined #perl6
09:41 fhelmberger joined #perl6
09:45 davido__ joined #perl6
09:45 kjs_ joined #perl6
09:51 spider-mario joined #perl6
09:58 dalek Perlito: 629bbbe | (Flavio S. Glock)++ | TODO-perlito5:
09:58 dalek Perlito: Perlito5 - TODO update
09:58 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/629bbbed2e
09:58 kjs_ joined #perl6
10:00 thou joined #perl6
10:06 simcop2387 joined #perl6
10:14 dalek Perlito: 2417608 | (Flavio S. Glock)++ | / (2 files):
10:14 dalek Perlito: Perlito5 - parser - VSTRING tweak
10:14 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/2417608b39
10:15 dalek Perlito: 4d5d7c5 | (Flavio S. Glock)++ | TODO-perlito5:
10:15 dalek Perlito: Perlito5 - parser - VSTRING tweak
10:15 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/4d5d7c54ef
10:19 abraxxa joined #perl6
10:25 virtualsue joined #perl6
10:26 dalek Perlito: 1b95122 | (Flavio S. Glock)++ | TODO-perlito5:
10:26 dalek Perlito: Perlito5 - TODO update
10:26 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/1b95122682
10:26 onur joined #perl6
10:26 onur Hi guys. I am wondering why $fh.say ("something"); is different than $fh.say("something");
10:28 moritz onur: background is that in perl 5,   print (1 + 2) * 3  will print 3, not 9
10:28 moritz onur: that's because it allows whitespace between the routine name and the parameter list
10:29 pecastro joined #perl6
10:29 moritz onur: to avoid that pitfall, Perl 6 disallows the whitespace
10:29 masak parentheses-as-argument-list-container versus parentheses-as-grouping-circumfix-operator
10:30 onur I see, I am used to space after routine names. Need to change this habit.
10:31 masak yes :)
10:31 moritz though for methods, you can also the colon
10:31 moritz $fh.say: 'something'
10:31 moritz onur: also, Perl 6 uses it disambiguate subruotines and keywards
10:31 moritz *keywords
10:31 masak and for subs you can `say\    ("something");`
10:31 moritz m: sub if() { 42 }; say if()
10:31 camelia rakudo-moar 315ec6: OUTPUT«42␤»
10:32 masak m: say\    ("something");
10:32 camelia rakudo-moar 315ec6: OUTPUT«something␤»
10:32 moritz that way later-introduced keywords won't break your function calls
10:32 masak or just not use the parens, of course.
10:32 masak m: say    "something";
10:32 camelia rakudo-moar 315ec6: OUTPUT«something␤»
10:33 onur thats great. tyvm for explanation.
10:33 masak yvw.
10:34 sergot FROGGS: I'm in! :)
10:41 masak .tell lizmat getting a deprecation warning (in one of my in-production tools) for this line in the setting: https://github.com/rakudo/rakudo/​blob/nom/src/core/Grammar.pm#L16
10:41 yoleaux masak: I'll pass your message to lizmat.
10:42 lizmat messages, please
10:42 yoleaux 10:41Z <masak> lizmat: getting a deprecation warning (in one of my in-production tools) for this line in the setting: https://github.com/rakudo/rakudo/​blob/nom/src/core/Grammar.pm#L16
10:42 lizmat masak: what is the warning (more precisely?)
10:42 masak Method slurp (from IO::Handle) called at: src/gen/m-CORE.setting, lines 14114,14116
10:42 masak Deprecated since v2014.10, will be removed with release v2015.10!
10:43 masak Please use IO::Path.slurp instead.
10:43 sergot FROGGS: btw. can't we apply timotimo's PR (https://github.com/supernovus/​perl6-http-easy/pull/17/files) to the HTTP::UserAgent module as well?
10:43 ghostlines joined #perl6
10:43 prevost joined #perl6
10:45 masak I don't really see why one'd need to do open/slurp/close there instead of just slurp.
10:45 masak we don't even take in a filehandle, we take in a string.
10:45 lizmat testing this diff now:
10:45 lizmat -        my $fh    := open($filename);
10:45 lizmat -        my $match := self.parse($fh.slurp, |%opts);
10:45 lizmat -        $fh.close;
10:45 lizmat +        my $match := self.parse($filename.IO.slurp, |%opts);
10:45 masak lizmat++
10:46 masak is `$filename.IO.slurp` preferable to `slurp($filename)`?
10:46 lizmat Stage parse      : moar(22247,0x7fff7bf29310) malloc: *** error for object 0x7ff92d0efd10: pointer being freed was not allocated
10:46 lizmat *** set a breakpoint in malloc_error_break to debug
10:46 lizmat grrrr
10:46 masak :(
10:46 lizmat (sorry Grrrr)
10:46 lizmat sometimes this happens...  could be just a matter of adding some whitespace to not have that anymore
10:47 lizmat did I mention that rakudo feels less stable lately ?
10:49 masak dunno, but that's something to take seriously.
10:49 Grrrr :)
10:49 masak can this be traced back to some point?
10:49 FROGGS sergot: hmmm, but then we should also profile it... so that we can be sure it is a speedup for HTTP::UA
10:49 masak maybe even worth doing a bisect to try to find what introduced the instability.
10:49 lizmat but what to bisect?
10:50 FROGGS you cannot bisect a Heisenbug
10:50 lizmat Moar?  nqp?  rakudo?  we don't really have bisect tool that works on all 3 parts
10:51 lizmat FROGGS: this is not a Heisenbug: it reliably fails with the same error
10:51 FROGGS that's not the problem... the problem is that this is likely to be a bug in moarvm (or rakudo's extops), and you can't just build a very old moar
10:51 FROGGS (because current rakudo uses nqp::closefh_i, which is just a few days old)
10:52 FROGGS and that's just one recent example
10:52 FROGGS lizmat: to me a Heisenbug is something that changes its behaviour when you poke it...
10:53 FROGGS so when you add diagnostics to the setting for example, it is likely that it will vanish
10:53 lizmat to me a Heisenbug is different results *without* poking
10:53 FROGGS or remove unrelated stuff for that matter
10:53 FROGGS "In computer programming jargon, a heisenbug is a software bug that seems to disappear or alter its behavior when one attempts to study it."
10:53 FROGGS wikipedia - always right :P
10:53 lizmat hehe
10:53 lizmat ok, fair enough
10:55 FROGGS if I had an osx box I'd probably build the setting under valgrind
10:55 FROGGS though, it could also mean that it works out in that combination
10:56 lizmat yeah
10:56 lizmat in this case, adding a dummy method, makes it work  :-(
10:56 dalek Perlito: 5946b0f | (Flavio S. Glock)++ | src5/lib/Perlito5/Javascript2/Runtime.pm:
10:56 dalek Perlito: Perlito5 - js - overload wip
10:56 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/5946b0f7ed
10:58 * lizmat gets valgrind
10:59 lizmat masak: slurp $filename will just do the $filename.IO.slurp for you
11:01 dalek rakudo/nom: 6fc0d5e | (Elizabeth Mattijsen)++ | src/core/Grammar.pm:
11:01 dalek rakudo/nom: Simplify .parsefile, spotted by masak++
11:01 dalek rakudo/nom:
11:01 dalek rakudo/nom: Please note there is a dummy method in there, as without it, the settings
11:01 dalek rakudo/nom: would not compile: instead you would get:
11:01 dalek rakudo/nom:
11:01 dalek rakudo/nom: Stage parse      : moar(22277,0x7fff7bf29310) malloc: *** error for object 0x7fda5c32bf40: pointer being freed was not allocated
11:01 dalek rakudo/nom: *** set a breakpoint in malloc_error_break to debug
11:01 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/6fc0d5e980
11:06 sergot FROGGS: when do you want to start working on this HTTP server?
11:10 TuxCM joined #perl6
11:14 Ulti another second off of my little benchmark :) so that's a 12.5% speedup in a couple of days! I assume it's the changes I noticed to Grammar?
11:26 FROGGS sergot: maybe this evening?
11:27 lizmat alas, valgrind doesn't build for me  :-(
11:27 lizmat make[2]: *** No rule to make target `/usr/include/mach/mach_vm.defs', needed by `m_mach/mach_vmUser.c'.  Stop.
11:27 sergot FROGGS: ok :)
11:31 kurahaupo joined #perl6
11:38 kaleem joined #perl6
11:38 lizmat putting a symlink in /usr/include to XCode's mach dir, brings me a lot further
11:38 kaleem joined #perl6
11:39 lizmat now problems in linking  :-(
11:43 * lizmat gives up on valgrind for now
11:48 thou joined #perl6
11:49 bjz joined #perl6
11:58 tinyblak joined #perl6
11:59 dalek rakudo/nom: 4187566 | (Elizabeth Mattijsen)++ | src/core/IO/Dir.pm:
11:59 dalek rakudo/nom: Initial version of IO::Dir
11:59 dalek rakudo/nom:
11:59 dalek rakudo/nom: Not used anywhere yet
11:59 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/41875662b1
12:02 * timotimo didn't notice changes to Grammar
12:04 moritz we really are running in circles
12:04 tinyblak_ joined #perl6
12:05 moritz we had IO::File and IO::Dir objects in the path, and unified them to IO::Path; now we have IO::Path and IO::Dir again :-)
12:05 lizmat so, are you saying I should stop working on this ?
12:06 moritz I'm not
12:06 lizmat I mean, if we really are running in circles, it just show we haven't found the real solution yet
12:06 lizmat *shows
12:06 moritz I'm merely remarking that we had that in the past, and it turned out to be not beneficial
12:06 moritz maybe the version you are writing will be, though
12:06 lizmat what was the reason for getting rid of it in the past ?
12:07 moritz 1) there was a big overlap between IO::Path and IO::Dir
12:07 moritz 2) it was a hassle to always generate the right one (Path vs. Dir), with not much benefit
12:07 moritz 3) it put the hassle of creating the right type onto the user too
12:07 lizmat not much benefit from a perfomance point of view ?
12:08 lizmat fwiw, I would never put that in the hands of the user, unless they really want to
12:08 moritz I didn't benchmark it; I argued from a conceptual and ease-of-use PoV
12:08 lizmat I'm trying to make it easier to use *and* get better performance
12:09 lizmat the user need not know whether it is an IO::Dir or an IO::Path that got created
12:09 lizmat or returned from e.g. a dir()
12:09 moritz but if dir() returns a list of either, there should be a common role with the common functionality
12:10 leont joined #perl6
12:10 masak lizmat++ # doing really good work which incidentally has similarities to some good (but superseded) work from the past
12:10 lizmat not sure of a common role yet
12:10 lizmat but yes, I'm thinking of usurping the IO role for that
12:10 moritz both should support file tests, at the very least?
12:10 lizmat which would make perfect sense in light of the .IO coercer
12:11 lizmat yes, they wouild
12:11 lizmat of course, .d on IO::Dir would just be True  :-)
12:11 ggoebel111111118 joined #perl6
12:12 timotimo the common role would be like FileTestable?
12:12 moritz ... which lizmat++ killed at the start of the month :-)
12:13 lizmat yes, and which may get resurrected after all
12:13 lizmat shit happens  :-)
12:13 moritz well, IMHO they should both also have in common that there's an absolute path and a basename
12:13 moritz luckily, 'git revert' is very easy
12:15 lizmat absolute path I agree with, basename I'm not sure yet  :-)
12:15 lizmat indeed :-)
12:18 ghostlines joined #perl6
12:28 PerlJam greetings Perl people!
12:29 timotimo hello PerlJam
12:29 timotimo thanks again for doing the release :)
12:33 mauke_ joined #perl6
12:35 PerlJam timotimo: welcome :)
12:36 Woodi hallo #perl6 :)
12:36 PerlJam hey Woodi
12:36 masak gureetings, PerlJam, Woodi
12:36 timotimo saluton Woodi
12:36 Woodi is it possible in Perl 6 to use scalar as "base" of the class (like in Perl5) ?
12:37 timotimo "the class"?
12:37 masak Woodi: what do you want to accomplish? :)
12:37 Woodi in v5 you usually use blessed hash refference, but using plain scalar was possible too..
12:37 masak Woodi: what do you want to accomplish? :)
12:38 Woodi masak: just consider using strings as base for io::dir_or_something :)
12:38 Woodi but question is general
12:38 masak ah, so subclassing Str?
12:38 lizmat m: my $s = Set; $s.new(<a b c>).perl.say
12:38 camelia rakudo-moar 315ec6: OUTPUT«set("a","b","c")␤»
12:38 PerlJam masak:  IF you ever give the "goto" talk again (or just talk about your pause feature), consider mentioning pause as a testing or upgrade feature  (you pause the execution and transport the cont to another machine for testing or you can upgrade software in place while it's paused)
12:38 Woodi no, just give methods to scalar
12:39 kaleem joined #perl6
12:39 masak PerlJam: good point.
12:39 lizmat m: my $s = "Set"; ::($s).new(<a b c>).perl.say
12:39 camelia rakudo-moar 315ec6: OUTPUT«set("a","b","c")␤»
12:39 lizmat Woodi: something like that?  ^^
12:39 masak Woodi: my $s = "foo"; $s does role { method foo { say "OH HAI" } }; $s.foo
12:39 anaeem___ joined #perl6
12:39 masak m: my $s = "foo"; $s does role { method foo { say "OH HAI" } }; $s.foo
12:39 camelia rakudo-moar 315ec6: OUTPUT«OH HAI␤»
12:39 Woodi lizmat: I do not know :)
12:39 masak Woodi: something like that? ^^
12:40 timotimo m: my $s = "foo"; $s.VAR does role { method foo { say "OH HAI" } }; $s.foo; $s = "bar"; $s.foo
12:40 camelia rakudo-moar 315ec6: OUTPUT«OH HAI␤Cannot assign to an immutable value␤  in block <unit> at /tmp/aRXvvr19NP:1␤␤»
12:40 timotimo hmm.
12:41 Woodi masak: probably...
12:41 moritz m: my $s; $s := $s but role { method foo { say "OH HAI" } }; say $s.foo
12:41 camelia rakudo-moar 315ec6: OUTPUT«OH HAI␤True␤»
12:41 moritz m: my $s; $s := $s but role { method foo { say "OH HAI" } }; $s.foo; $s = 42; $s.foo
12:41 camelia rakudo-moar 315ec6: OUTPUT«OH HAI␤Cannot assign to an immutable value␤  in block <unit> at /tmp/pIy_t_P2h_:1␤␤»
12:41 moritz hah, it becomes immutable by mixing in
12:43 timotimo strange
12:44 moritz actually I'm surprise that containers don't have an optimized representation
12:45 timotimo as in: why doesn't this say "this repr cannot change type"?
12:45 mls joined #perl6
12:48 moritz m: my $s; $s := $s but role { method foo { say "OH HAI" } }; $s.foo; say $s.VAR.^name
12:48 camelia rakudo-moar 315ec6: OUTPUT«OH HAI␤Any+{<anon>}␤»
12:49 moritz uhm
12:49 moritz it didn't mix into the container :(
12:49 timotimo ah, hmm
12:49 Woodi but about IO::thingies, what we realy want ?  end effect ~~ user experience...  becouse for me it looks we want to _allow_ users to program exactly like in sh and in Perl5. and _this_ destroys clean api design...
12:49 moritz m: my $s; say $s.VAR.^name
12:49 camelia rakudo-moar 315ec6: OUTPUT«Scalar␤»
12:49 timotimo so "but" will decont
12:49 timotimo which makes sense
12:50 * moritz notices he has no idea how VAR works
12:50 Woodi C and Java do not care about users like sh, they just give api, user must use it :)
12:50 moritz and there are reasons we want to program in Perl 6 instead of C and Java :-)
12:51 mls joined #perl6
12:51 Woodi moritz: that's not explaining anything ;)
12:52 masak no, it's more of a recommendation ;)
12:52 Woodi so sh like user experience ?  @a = dir "/etc"; for @a { chmode 000, $_ } # ? :)
12:53 lizmat dir("/etc")>>.chmod(0)
12:53 Woodi it's perlish way, I like it :)
12:53 ugator joined #perl6
12:54 PerlJam Woodi: Perl is glue still.  Also, TMTOWTDI is about not constraining the user into some paradigm.  IF the problem has more of a "sh-feel", then why not let the programmer have easy access to all the power Perl has to offer *and* let them code in a sh-way?
12:54 Woodi but that convenience sugar must be wrapper over c/java-like apis
12:54 Woodi in c you have struct DIR an you readdir it
12:55 lizmat Woodi: also on WIn32 ??
12:56 dalek rakudo/nom: 3f0f5ce | (Elizabeth Mattijsen)++ | src/core/IO/Dir.pm:
12:56 dalek rakudo/nom: Add chdir/open, handle //unc/
12:56 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/3f0f5ce1bf
12:57 Woodi lizmat: c is just an example....... we _create_ our own api...
12:57 moritz Woodi: right; and that's why we try to make them usable and so that they make sense
12:58 Woodi but in c and java you have some object like Path or File or DIR and in sh you have just strings everywhere... what our api need to use ?
12:58 Woodi and c/win/java/ whatever is all the same just use other names...
12:59 moritz Woodi: https://github.com/perl6/doc​/blob/master/htmlify.p6#L88
12:59 moritz if we just used strings, file tests wouldn't be so easy
12:59 moritz and you'd have to worry about absolute vs. relative paths
13:00 moritz there are dozens of questions on perlmonks why some custom recursive directory traversal isn't working, and the answer is always "because readdir returns relative paths, and you have to prepend the current path"
13:00 moritz with IO::Path, those worries are all gone
13:01 moritz not to mention platform-specific path manipulations, which are a real PITA to get right
13:01 huf it's a pita even in unix-only stuff
13:01 moritz aye
13:01 timotimo fwiw, i hate paths :P
13:01 huf "did i add the trailing slash? can i concat to this string?"
13:01 timotimo you *never* concat paths as strings unless you *are* the path implementation :)
13:02 huf that's because they're a separate datastructure but we always use them in their string-serialied format
13:02 huf which is weeeeeird :)
13:02 jfredett joined #perl6
13:02 huf the syscalls expect strings instead of path objects too :)
13:03 huf it's a bit like not having arrays, and just using csv-strings instead...
13:03 moritz tcl, I'm looking at you :-)
13:04 PerlJam heh
13:04 timotimo huf: that's a very, very apt comparison
13:05 huf ... i've seen similar solutions when someone wanted to store arrayesque data in a mysql column :D
13:05 timotimo yes, of course
13:05 PerlJam ... or multi-level data structures in Perl 4  ;)
13:06 guru joined #perl6
13:06 Woodi moritz: with IO::Path you worry about directories... so you don't like 'sh'-like code:  @a = dir; ?
13:07 moritz Woodi: I don't understand your question
13:07 moritz m: my @a = dir
13:07 camelia rakudo-moar 315ec6: ( no output )
13:07 moritz that's how it can work with and without IO::Path
13:08 Woodi which one we need to implement ? :)
13:08 PerlJam moritz: I think he's assuming a dichotomy between "objects" and "strings" there.
13:08 Woodi PerlJam: maybe I see difference in usage
13:09 PerlJam Woodi: Then please elaborate :)
13:11 dalek Perlito: 4b51a26 | (Flavio S. Glock)++ | / (3 files):
13:11 dalek Perlito: Perlito5 - js - 0+ overload
13:11 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/4b51a26695
13:13 PerlJam It should be light outside but a passing storm makes it look like it's still early morning just before the sun comes up.
13:15 ajr joined #perl6
13:17 ptc_p6 joined #perl6
13:17 ajr joined #perl6
13:17 mls_ joined #perl6
13:19 ajr joined #perl6
13:19 lizmat cycling&
13:19 Woodi PerlJam: for me: a) we have IO::namehere package (or few of it) using objects like struct DIR in C and wrappers for users returning strings to allow shell like programming; b) grammar-like magical and complex objets; c) strings everywhere... which one is prefered ?
13:22 ajr_ joined #perl6
13:26 Grrrr joined #perl6
13:26 PerlJam Woodi: Are you differentiating a) and b) based on efficiency concerns?  Because I'd like to think that we can achieve something akin to a) *and* b)    (simple, low-level-ish objects that can wield complex magic if needed)
13:30 Util #ps time
13:32 moritz there's still a parrotsketch?
13:33 PerlJam heh ... that's exactly what I was thinking :)
13:34 moritz and judging from the logs, it's even active-ish
13:36 thou joined #perl6
13:47 thou joined #perl6
13:51 Woodi PerlJam: I think that first part is user question: "how to use that thing ??". traditional or XXII-century like :)  second: different implementation;  and next is performance question. for now I have problems with using Match objects. and they are slow right now ?
13:51 timotimo hmm, not sure match objects are much slower than they should be
13:52 timotimo of course if you iterate over the list part, that's a GLR thing
13:53 dalek Perlito: 2263d03 | (Flavio S. Glock)++ | / (3 files):
13:53 dalek Perlito: Perlito5 - js - fix scope in "if" statement
13:53 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/2263d03b75
13:53 Woodi timotimo: so it's just my invalid "hunch" from gigantic output from 'say Match.perl' :)
13:54 timotimo if perlito6 is not going to be developed further, should we just get rid of the dalek notifications?
13:54 timotimo Woodi: .perl is slow, yes :(
13:54 timotimo also it's kind of weird to see a "tree" of Match objects that all have the orig string set
13:55 moritz well, that's what they all
13:55 moritz have
13:55 timotimo right
13:55 moritz .perl isn't supposed to be pretty, it's supposed to be exact
13:55 timotimo in theory, the perl output could have a local $foo that gets set once and referenced over and over again :P
13:56 moritz amusing fact: .perl on a match could just return "'abc' ~~ /(b)/" or so (that is, original string + regex that reproduces this match object)
13:56 timotimo right, could :)

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

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs