»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
shinobicl rakudo: my $D = DateTime.new(year=>2011,month=>12,day=>12); $D.day-of-year++; say $D.perl; 00:01
p6eval rakudo 922500: OUTPUT«DateTime.new(year => 2011, month => 12, day => 12, hour => 0, minute => 0, second => 0/1)␤»
00:02 impious joined
shinobicl rakudo: say $_ for DateTime.^methods>>.name; 00:03
p6eval rakudo 922500: OUTPUT«new␤check-time␤now␤clone␤clone-without-validating␤Instant␤posix␤offset␤truncated-to␤whole-second␤in-timezone␤utc␤local␤Date␤Str␤perl␤is-leap-year␤days-in-month␤daycount-from-ymd␤ymd-from-daycount␤get-daycount␤day-of-month␤day-of-week␤week␤week-year␤week-number␤week…
shinobicl how can i "move" a DateTime to the next (or previous) day? 00:04
rakudo: my $D = DateTime.new(year=>2011,month=>12,day=>32); say $D.perl; 00:06
p6eval rakudo 922500: OUTPUT«day of 2011/12 must be in 1..31␤␤ in 'check-value' at line 6915:src/gen/core.pm␤ in 'check-date' at line 6923:src/gen/core.pm␤ in 'DateTime::new' at line 7050:src/gen/core.pm␤ in main program body at line 22:/tmp/BJDZcc_Eun␤»
gfldex DateTime.Instant + 24 * 60 * 60
Instant gives you seconds since unix epoc
that may not work if you have leap seconds and cross the last day of the year 00:07
calendars are tricky
shinobicl rakudo: my $D = DateTime.new(year=>2011,month=>12,day=>12); my DateTime $D2 = $D.Instant + (24*60*60); say $D2;
p6eval rakudo 922500: OUTPUT«Type check failed for assignment␤ Container type: DateTime␤ Got: Instant␤ in '&infix:<=>' at line 1:src/metamodel/RoleToInstanceApplier.nqp␤ in main program body at line 22:/tmp/9eEKX0pAHN␤»
gfldex rakudo: my $D = DateTime.new(year=>2011,month=>12,day=>12); my DateTime $D2 = DateTime.new($D.Instant + (24*60*60)); say $D2;
p6eval rakudo 922500: OUTPUT«2011-12-13T00:00:00Z␤»
shinobicl so, to "move" a datetime i have to create a new one.... that's what i was trying to avoid. 00:08
gfldex perl6 tries to avoid mutator methods 00:09
shinobicl oh well.... is just a detail, i guess :) Thanks gfldex!
00:09 risou is now known as risou_awy, risou_awy is now known as risou
gfldex because we have $obj.=meth 00:09
sadly DateTime does not play well with .= 00:10
shinobicl i'm trying to make a "Workday" class... You just have to specify a calendar file with holidays 00:11
so i want a function to move to the next workday (or any amount of workdays) 00:12
well... go back to work then :) thanks again gfldex 00:13
s/go/going/
00:17 shinobicl left
gfldex rakudo: my $d = now; say $d; $d.=succ; say $d; 00:17
p6eval rakudo 922500: OUTPUT«Instant:2011-07-30T00:17:53.202019Z␤Instant:2011-07-30T00:17:54.202019Z␤»
gfldex rakudo: my $d = DateTime.new('2011-7-30'); say $d.succ; 00:19
p6eval rakudo 922500: OUTPUT«Invalid DateTime string; please an ISO 8601 timestamp␤ in 'DateTime::new' at line 7110:src/gen/core.pm␤ in main program body at line 22:/tmp/FAp3XXsa5z␤»
gfldex rakudo: my $d = DateTime.new('2011-07-30'); say $d.succ;
p6eval rakudo 922500: OUTPUT«Invalid DateTime string; please an ISO 8601 timestamp␤ in 'DateTime::new' at line 7110:src/gen/core.pm␤ in main program body at line 22:/tmp/PRjwIUo1Dp␤»
gfldex rakudo: my $d = Date.new('2011-07-30'); say $d.succ; 00:20
p6eval rakudo 922500: OUTPUT«2011-07-31␤»
gfldex rakudo: my $d = Date.new('2011-07-30'); $d.=succ; say $d
p6eval rakudo 922500: OUTPUT«2011-07-31␤»
dalek kudo/nom: 965540e | jonathan++ | t/spectest.data:
Run recurse.t after fixes by pmichaud++.
00:24
ast: 3a7b996 | jonathan++ | S06-advanced_subroutine_features/recurse.t:
Unfudge a test now Rakudo implements &?ROUTINE.
00:25
tadzik jnthn: yep
I probably shouldn't :)
jnthn tadzik: me either :) 00:30
tadzik: Was pondering a bit. Thing is, not every routine will have docs... 00:31
tadzik: Maybe best thing is we create an is doc('...') trait handler, which mixes in an (anonymous if you like) role with a has $.docs 00:32
tadzik: Then we only make doc storage for documented things.
tadzik: Then you can also use $*ST.apply_trait ... which will handle serialization stuff properly too. 00:33
00:38 RandalSchwartz joined
RandalSchwartz waves at the channel 00:38
are rakudo star questions welcome here, or is there a better channel?
tadzik sounds not bad
RandalSchwartz: it's a perfect place
RandalSchwartz does the current or immediate future star support exceptions, and in particular, have the introspection available to support continuations? 00:39
sorear I can't speak for continuations, but general exceptions absolutely 00:40
RandalSchwartz separate question, but equally important - how about green threads?
tadzik not at all
RandalSchwartz so that's still a ways out?
tadzik aye
sorear it would be helpful to know your use case
jnthn Current Rakudo master supports exceptions. We've some breakage in nom development branch, but will fix that for sure before it becomes master and goes into the next release. 00:41
RandalSchwartz I want to know if the trickiest parts of call-cc are in there, so I can implement a seaside in Perl.
Seaside from Smalltalk
sorear Perl 6 has (and implemented in Star) all the primitves you need to implement green threads, except nonblocking IO
RandalSchwartz: lisp people tend not to distinguish between call-cc and coroutines. Which do you need?
do you need to be able to "rewind" execution by invocing the same continuation more than once? 00:42
RandalSchwartz i need to be able to throw an exception deep in a call stack, catch it at the top, serialize all the local stack frames, then reanimate that later
yes, it needs to be repeatable
sorear there is no way to make a sub return more than once in general Perl 6 00:43
RandalSchwartz right - I don't need that
the sub hasn't "returned" yet
we're just in the exception handler
sorear but you said it needs to be repeatable
RandalSchwartz yes - from serializations
sorear we are having a communication gap here
RandalSchwartz clone the serialization, activate it into real stack frames, restart it
at least, that's how Seaside does it in smalltalk 00:44
tadzik jnthn: that way the subs get actually documented at runtime, when the traits are applied, right?
sorear Perl 6 (in general) is probably never going to support such a messy thing
00:44 drbean joined
RandalSchwartz so no call-cc either? 00:44
since call-cc is essentially that
sorear no
call-cc is not the same as serializing stack frames 00:45
RandalSchwartz yea - that's an implementation deal
detail
sorear call-cc in Perl 6 is implemented by the &take primitive, and it has nothing to do with the exception mechanism
(what became of 'merlyn'?)
RandalSchwartz on Freenode, I've always been RandalSchwartz 00:46
sorear oh.
RandalSchwartz I need to research "take" I guess
to figure out if it'll do what I need
jnthn tadzik: trait application is BEGIN time.
RandalSchwartz maybe I don't need repeatability either
tadzik mebbe 00:47
sorear If you need to be serializing stack frames, then you probably need to write C code.
RandalSchwartz too bad Smalltalk has that beat then
I was hoping Perl would be as flexible as smalltalk
I guess you can't write a nice debugger in Perl either then. not like smalltalks
jnthn tadzik: Certainly. I implemented it. :P
tadzik: There are other ways we could do it, but this is by far the easiest. 00:48
sorear ... RandalSchwartz trolling? */me's brain breaks*
RandalSchwartz not at all
I have a need
Smalltalk fills it perfectly, but I was hoping to use Perl6 instead 00:49
sorear smalltalk fills it perfectly *today*
smalltalk is also older
RandalSchwartz Smalltalk could fulfill it shortly after it was developed
Smalltalk started with "thisContext" in the 1980 release 00:50
via "thisContext", everything I said above is possible
sorear RandalSchwartz: did Smalltalk start with the ability to serialize thisContext to a string of bytes and restore it later?
RandalSchwartz Yup
there's nothing new in the VM to support that
sorear I still think you're trolling us. But OK.
RandalSchwartz the VM could always do that, because the debugger needed to be able to get at all the stack frames
have you seen the 1980 Smalltalk debugger?
sorear No 00:51
I was born in 1990
RandalSchwartz I wrote the Camel book in 1990. :)
sorear Perl 6 has &callframe, which does most of what you want, except the object graph serialization stuff 00:52
jnthn sorear: So far as I'm aware, everything RandalSchwartz has said about Smalltalk is true.
RandalSchwartz if every object can be serialized, that's enough
we can build it from theat 00:53
as long as we can also restore it, including a call stack frame
sorear RandalSchwartz: Rakudo Star doesn't have anything like Storable
RandalSchwartz in smalltalk, those are all objects which can be reified.
there's .perl and .eval, right?
close enough for now
sorear Perl 6 has reified stack frames too
rakudo: say callframe.perl
p6eval rakudo 922500: OUTPUT«Method 'perl' not found for invocant of class 'ParrotInterpreter'␤ in <anon> at line 1317:src/gen/core.pm␤ in 'Any::join' at line 1:src/metamodel/RoleToInstanceApplier.nqp␤ in 'Mu::attribs' at line 1318:src/gen/core.pm␤ in 'Mu::perl' at line 1322:src/gen/core.p…
RandalSchwartz ahh - that's not good :) 00:54
ash__ doesn't tardis do a lot of this stuff your talking about already?
RandalSchwartz is that for me?
jnthn RandalSchwartz: We probably have the meta-programming capabilities to write a serializer for objects already. The callframe stuff is rather trickier.
RandalSchwartz I don't know tardis.
sorear jnthn: trolling, imo, is making deliberately inflammatory remarks because you like seeing people angry or defensive. it doesn't require lying.
ash__ its a perl6 debugger masak++ wrote
RandalSchwartz ok - looking 00:55
ash__ with a nice feature of being able to step forward and backwards through a program
github.com/masak/tardis
jnthn ash__: Yes, but he also wrote his own runtime for a small subset of Perl 6, which could handle such things.
RandalSchwartz ahh - time travelling. yeah, if you can capture execution state, then rewind, that's enough
ash__ ah, I wasn't sure how he implemented it, i just know its a perl6 debugger :P
RandalSchwartz I just want to know how to be inside 17 levels of method call, on item 7 of a 1..10 loop, and save that associated with a UUID, then restore it later so I'm still on item 7. 00:56
sorear I imagine RandalSchwartz needs something a bit more featureful than masak's runtime, which is only barely powerful enough to emulate a Minsky machine.
jnthn Aye.
RandalSchwartz which is what Seaside essentially does
I'd also accept a full-on greenthread for each invocation, and temporarily park the thread. 00:57
as long as I could restart it later from a master thread
sorear RandalSchwartz: more interesting question is how to save all the values of each lexical variable
RandalSchwartz that's how the Perl5 "continuation" framework works, with full forks
sorear RandalSchwartz: and all the classes and code fragments work.
RandalSchwartz sorear - that's handled in Smalltalk. :)
00:58 cschimm1 left
RandalSchwartz each stack frame is an object with accessors for all lexicals and referenced objects 00:58
from there, you can build a serialization of the frame
and you can then store that, and fetch it later.
and rebuild it from before.
sorear I still feel like your goal is to demoralize us by making unflattering comparisons to 30 year old languages
anyway, gather/take can emulate green threads 00:59
RandalSchwartz sorear - you don't know me very well then.
I'm just a practical guy
trying to make perl6 popular by building cool things with it
and then telling the world about that
and in the process, perhaps making some money for me and a bunch of other people
if that's trolling, you have an odd definition. :)
ash__ perlcabal.org/syn/S04.html#The_gath...ent_prefix is gather/take 01:00
RandalSchwartz but yes, it's sad that not enough was taken from Smalltalk over the years.
sorear dinner&
01:00 noganex_ joined
tadzik Routine:D 01:01
dalek kudo/nom: 0657b85 | jonathan++ | src/Perl6/Actions.pm:
Fix bug in PAST::Block arity calculation; fix bug in hash vs block detection.
kudo/nom: 09d8b34 | jonathan++ | t/spectest.data:
Run S06-other/anon-hashes-vs-blocks.t.
tadzik A defined routine is a happy routine
jnthn RandalSchwartz: It's nice you want to do that. If you can get gather/take to do what you want it may be viable. If not, I don't think Rakudo (and maybe Perl 6) can easily provide what you're after *yet*. I suspect part of the issue is that you either need VM co-operation, or at least to have things like stack frames be first class. That's not the situation we have today, unfortunately. 01:02
At lesat, not without more work than it should be. 01:03
01:04 noganex left
RandalSchwartz it *is* one of the remarkable things that they said turned smalltalk 72 in 76... realizing that stack frames should be first-class. 01:04
from there, the debugger could be easily written in smalltalk, and that led to "compile this code and restart in the middle" as a trivial event.
jnthn Yes, it's attractive in many ways. 01:05
tadzik hmm
jnthn: could you peek at this? wklej.org/id/569556/
that feels right, but how do I get around this to get what I want? 01:06
jnthn tadzik: You're overcomplicating things :)
tadzik am I? :)
jnthn $docee does role { method WHY() { $docs } }
No need to play with the MOP
:)
tadzik just. Ok :)
trait_mod:<does> plays with the MOP, it looked so alone 01:07
ash__ doesn't parrot support coroutines? I know there is the CoroutinePMC
I guess there is no bridge to rakudo though?
jnthn ash__: gather/take are coroutine-powerful
ash__ oh
got ya
tadzik jnthn: but that doesn't fix the issue :(
jnthn ash__: May even be implemented using Parrot's Coroutine PMC under the hood
tadzik '$docs' is still not predeclared in WHY
jnthn tadzik: oh, I ran into that bug the other day 01:08
tadzik gah
jnthn my $d = $docs; # then use $d in the role
tadzik uff
jnthn tadzik: Yeah, my fault...it's on my todo list.
Hopefully trivialish to fix.
tadzik no problem, thanks for the workaround :) 01:09
jnthn nom: sub foo($a) { my $a; }
p6eval nom: OUTPUT«Redeclaration of symbol $a at line 1, near "; }"␤current instr.: 'nqp;HLL;Grammar;panic' pc 23611 (src/stage2/gen/NQPHLL.pir:6348) (src/stage2/gen/NQPHLL.pm:329)␤»
jnthn hm
nom: sub foo($a) { my $a; BEGIN say "got here?!" }
p6eval nom: OUTPUT«Redeclaration of symbol $a at line 1, near "; BEGIN sa"␤current instr.: 'nqp;HLL;Grammar;panic' pc 23611 (src/stage2/gen/NQPHLL.pir:6348) (src/stage2/gen/NQPHLL.pm:329)␤»
jnthn oh, hm 01:10
RandalSchwartz well - I need to go do some more looking to see if there's another angle to do what I want, so thanks for the pointers.
consider this also a strong request to make stack frames a first class object, at least when request.
requested.
01:11 soh_cah_toa joined
RandalSchwartz many things become possible at that point, including very fancy edit-n-go debuggers. 01:11
jnthn tadzik: ah, I found what's going on with the bug you just hit on. Wasn't what I expected it to be... 01:16
tadzik jnthn: when do you need :build($true) to apply_trait?
jnthn tadzik: Bit tired to fix it now, but at least I understand what's going on.
tadzik: When you want to pass that to the trait mod 01:17
tadzik: you want :docs($true) I guess
hang on wait what
:)
tadzik trait_mod<will> uses build(true)
jnthn multi trait_mod:<doc>(Routine:D $docee, Mu:D $docs_text, :$docs!) {
You need a required named arg to indicate the trait mod do hit 01:18
tadzik scratches head
jnthn So you'd need to call apply trait with the declarand, the doc object and :docs($true)
tadzik s/do/to?
jnthn yes :)
That's how they're disambiguated.
multi trait_mod:<doc> 01:19
shoulda been
tadzik okay
jnthn multi trait_mod:<is>
:)
tadzik ee
oh, is doc()\
jnthn right :)
tadzik brr
okay :)
jnthn
.oO( is 3:20am() )
01:20
Think I'll sleep a bit :)
tadzik sleep? Gentleman, there's Perl 6 going on! :) 01:21
jnthn That happens 24/7! :P
tadzik oh shush :)
oh 01:22
01:22 impious left
tadzik if there's .WHY maybe the trait_mod should be 'because' 01:22
sub foo because('foo') {}
&foo.WHY :P
jnthn nom: multi trait_mod:<is>(Routine:D $r, $doc_obj, :$docs!) { my $do = $doc_obj; $r does role { method docs() { $do } } }
p6eval nom: ( no output )
jnthn nom: multi trait_mod:<is>(Routine:D $r, $doc_obj, :$docs!) { my $do = $doc_obj; $r does role { method docs() { $do } } }; sub foo is doc('oh lol vodka') { }; say &foo.docs 01:23
tadzik jnthn: how about 'because' instead of 'is doc'?:)
p6eval nom: OUTPUT«No applicable candidates found to dispatch to for 'trait_mod:<is>'. Available candidates are:␤:(Attribute $attr, Any $rw)␤:(Attribute $attr, Any $readonly)␤:(Routine $r, Any $rw)␤:(Parameter $param, Any $readonly)␤:(Parameter $param, Any $rw)␤:(Parameter $param, Any $copy)␤:…
01:23 RandalSchwartz left
jnthn hmm 01:23
nom: multi trait_mod:<is>(Routine:D $r, $doc_obj = 'default', :$doc!) { my $do = $doc_obj; $r does role { method docs() { $do } } }; sub foo is doc { }; say &foo.docs 01:24
p6eval nom: OUTPUT«Segmentation fault␤»
jnthn eek!
tadzik e ke ke ke :)
jnthn nom: multi trait_mod:<is>(Routine:D $r, $doc_obj = 'default', :$doc!) { my $do = $doc_obj; $r does role { method docs() { $do } } }; sub foo is doc('lol wut') { }; say &foo.docs
p6eval nom: OUTPUT«Segmentation fault␤»
ash__ o.0
jnthn nom: multi trait_mod:<is>(Routine:D $r, :$doc!) { my $do = 'foo'; $r does role { method docs() { $do } } }; sub foo is doc { }; say &foo.docs 01:25
p6eval nom: OUTPUT«Segmentation fault␤»
jnthn nom: multi trait_mod:<is>(Routine:D $r, :$doc!) { my $do = 'foo'; $r does role { method docs() { $do } } }; sub foo is doc { };
p6eval nom: OUTPUT«Segmentation fault␤»
tadzik nom: multi trait_mod:<because>(Routine:D $r, $doc_obj = 'default') { my $do = $doc_obj; $r does role { method docs() { $do } } }; sub more because('moar!'); say &more.docs
p6eval nom: OUTPUT«Malformed block at line 1, near "because('m"␤current instr.: 'nqp;HLL;Grammar;panic' pc 23611 (src/stage2/gen/NQPHLL.pir:6348) (src/stage2/gen/NQPHLL.pm:329)␤»
jnthn nom: multi trait_mod:<is>(Routine:D $r, :$doc!) { my $do = 'foo'; say "here" }; sub foo is doc { };
p6eval nom: OUTPUT«Segmentation fault␤»
jnthn ok, wtf. 01:26
01:26 Chillance left
tadzik nom: multi trait_mod:<is>(Routine:Dr, :$doc!) { my $do = 'foo'; say "here" }; sub foo is doc { }; 01:26
p6eval nom: OUTPUT«Segmentation fault␤»
tadzik ee
jnthn nom: multi trait_mod:<is>(Routine:D $r, :$doc!) { say "here" }; sub foo is doc { }; 01:27
p6eval nom: OUTPUT«here␤»
tadzik nom: multi trait_mod:<because>(Routine:D $r, $d) { say "bigos" }; sub just because("I wanted") {};
p6eval nom: OUTPUT«Malformed block at line 1, near "because(\"I"␤current instr.: 'nqp;HLL;Grammar;panic' pc 23611 (src/stage2/gen/NQPHLL.pir:6348) (src/stage2/gen/NQPHLL.pm:329)␤»
tadzik oh, 'because' does not even parse
jnthn no :) 01:28
tadzik shows parser a tounge
jnthn I got the segv in the debugger.
Sadly...that doesn't help a lot.
oh, wait a second...
nom: BEGIN { my $a = 'hi'; say $a } 01:29
p6eval nom: OUTPUT«Segmentation fault␤»
jnthn Got it.
colomon \oi/
wait, did I just grow a third arm?! 01:30
tadzik okay, my code segfaults too, so there's a chance it's correct :P
jnthn But I'm *really* too sleepy to fix that one.
tadzik that means I'll get some sleep too :)
jnthn *sigh* 01:31
Guess the lexpad refactor I thought I'd get away with for a while, I actually won't.
jnthn gets some rest so he has hackenergy for tomorrow :) 01:32
tadzik I'm resting too then :)
jnthn night o/
tadzik jnthn++
01:32 ab5tract left
tadzik 'night! 01:32
colomon \o 01:35
01:40 molaf_ left 01:54 kboga left 02:01 bluescreen10 joined 02:05 bluescreen10 left 02:13 Trashlord left, cosimo left, TiMBuS left 02:15 skangas left, pernatiy_ joined, pernatiy left, literal left, literal joined, pnu joined, skangas_ joined, skangas_ is now known as skangas, [particle] left 02:16 [particle] joined 02:17 Trashlord joined, cosimo joined, TiMBuS joined
sorear What happened to communication? 02:17
Stack frames ARE first class objects!!
it's like merlyn or me has lost the ability to speak/understand English 02:18
or both
ash__ is english your first language? 02:20
sorear yes 02:27
merlyn's too
I'm bemoaning a breakdown of communication here 02:28
02:41 jimmy1980 left 02:48 jimmy1980 joined 02:54 tokuhirom joined 03:01 whiteknight left 03:14 soh_cah_toa left 03:24 kaare_ joined 03:25 tokuhirom left 03:26 tokuhirom joined, Su-Shee left 03:27 soh_cah_toa joined 03:28 Su-Shee joined 03:30 tokuhirom left 03:35 robinsmidsrod joined 03:51 soh_cah_toa left
sorear I feel bad about earlier. Like somehow all those problems were my fault. 03:53
04:06 shinobicl joined
TimToady don't sweat it 04:11
Randal isn't the sort of person who keeps score 04:12
sorear TimToady: would it be horrible if $x."A::b"() were interpreted the same as $x.A::b ? 04:14
ie, interpreting the part before :: as a symbolic reference to a class name
TimToady maybe, especially if $x is a foreign object that assigns a different meaning to :: 04:15
part of the reason for putting the quote form there is to allow communication with foreign dispatchers 04:16
however, it would be okay if Perl's dispatcher treated it like a type prefix 04:17
the parser can't assume that, though
(sans type inference)
sorear My least favorite thing about J is the shared commuity opinion, "There are two kinds of programmers: those that use J, and those that would if they were smart enough to" 04:18
TimToady yes, Haskell has tendencies to that as well, though they're not expressed so succinctly :) 04:19
sorear is it worse now than three years ago when I left in disgust?
TimToady dunno 04:20
but it's a tendency I'm always bearing in mind when designing the fancier bits of p6, so as to keep it accessible to mere mortals 04:21
[Coke] J == ASCIIAPL, neh?
TimToady basically
[Coke] wonders if apl on parrot even compiles anymore.
[Coke] will find out lazzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz. 04:22
TimToady not much to an APL compiler...well, parser, anyway...
sorear it's not the mere mortals stuff that bothers me, but the arrogance of it all...
[Coke] t/spec/S05-substitution/subst.rakudo sure does like the taste of CPU.
TimToady my brother-in-law wrote an APl interpreter for his undergrad honors project
sorear J is one of those fun languages that don't have a compiler in any sense of the word 04:23
TimToady in PDP-11 assembler
sorear I don't know about APL though
TimToady it's pretty much the same language with different symbols
sorear but the J interpeter executes while parsing, and the language is set up such that it would be hard for it not to
TimToady .u ⌽ 04:24
phenny U+233D APL FUNCTIONAL SYMBOL CIRCLE STILE (⌽)
TimToady is J precedence-less like APL?
I think J's syntax rules are a bit fancier than APL's in some ways though 04:25
sorear J gives binary metaops higher precedence over normal ops
1 * 2 + 3 means 1 * (2 + 3) as in APL though
04:26 cryptographrix joined
TimToady Oh, I didn't realize J was also by Iverson 04:27
sorear I don't think it has anything to do with "genius" versus "mortal" 04:29
as I see it, the community selection is "can you tolerate arrogant jerks?"
04:30 cryptographrix left
TimToady we can tolerate them as long as they don't behave that way :) 04:30
some arrogant jerks are trainable, some are not :) 04:34
our official minimum bar on perl6.org is "know how to be nice to people", not a requirement that you manage it 100% of the time :) 04:36
but people who know how to be nice are usually willing to listen when someone points out that they've been less nice than strictly necessary 04:37
sorear yeah. what I'm saying is it feels like the J community is exactly the opposite
TimToady well, yeah...it can be a self-reinforcing cult/cultural dynamic when you get a barricade mentality 04:39
it's not just the intelligencia that fall into that trap 04:40
the higher the barricade, the more shibboleths develop
it's one thing when a shibboleth is used to tell when someone is an outsider, so you know to be gentle; it's quite another when it's used (as in the original sense) to decide whether to kill someone 04:41
if someone comes in here and says PERL, we know they're not really in the know 04:42
but we can have compassion for them :)
'course, if they come in here and tell us it *has* to be PERL because it's an acronym, then maybe they're just an arrogant jerk :) 04:43
so it kinda works as a filter, similar to Camelia, for telling the jerks from the jerkoids
maybe we're just arrogant about *not* being jerks :) 04:46
04:46 kaare_ left
[Coke] dalek? 04:49
ugh, zz 04:50
04:51 Mowah joined
dalek kudo/nom: 39931fd | Coke++ | t/spectest.data:
track spectest failure modes.
04:52
05:03 lefthandman joined
TimToady sorear: what is your definition of "first class"? Do you mean "on the heap", or something else? 05:06
05:06 benabik left 05:12 tokuhirom joined
sorear TimToady: on the heap as a Perl 6 object, ~~Mu, with .HOW .WHAT .WHO 05:18
returned by &callframe
TimToady but when the stack unwinds, and you keep a ref to it, does it stay valid, such that you could continue it, is the other part, or is the heap object just epiphenomenal? 05:20
that might currently be implementation dependent
05:20 meteorjay joined, meteorjay left
TimToady sorry, now my English is coming sideways out... 05:21
sorear Hehe 05:22
I don't think it's currently possible to 'go to' a allFrame object 05:23
TimToady must be those continuations in my brane
that might be part of Randal's question
and part of his def of 1st class
sorear I think Randal's real question is "Can I implement Continuity in Perl 6?"
05:24 meteorjay joined
TimToady Randal has liked Smalltalk even longer than he's liked Perl 05:24
but it's one of those things that I just try to design close to, not necessarily to mandate it, but to perhaps make it possible in the future 05:25
but I suspect it might impede portability to mandate it
or optimizability
otoh there are some pretty snappy Smalltalk implementations 05:26
Ruby is basically Smalltalk underneath 05:27
but also I don't think Smalltalk scales very well into the real world 05:28
sorear What do you mean by that? 05:31
TimToady it's just a general feeling that I get for "workspace" languages; I always feel a bit claustrophobic, like I'll be in trouble if I do anything outside of the little toy world 05:34
sorear I like to think of Unix as a workspace language
TimToady I dunno, Unix is a bit more outward looking, i think 05:35
and it's a very big toybox, if toybox it is
but toybox has always been an anti-pattern to Perl; we want Perl to talk to everything else 05:36
so it's sort of ironic that Perl culture has become a bit of an echo chamber 05:37
sorear echo chamber? 05:38
TimToady we talk to each other more than we talk to outsiders
mberends if Unix is a toybox, at least the toys are made of the metal of your CPU, and you can drill, saw and weld them 05:39
TimToady Unix is more like a rather cluttered garage
sorear every toybox language I've played with has had a built-in assembler 05:40
* this means ['Forth']
TimToady wonders if we should reserve {'foo','bar','baz'} for set notation, as a hash without values 05:43
probably would be too much ambiguity 05:44
sorear I wonder if it makes sense to allow $::("!foo")
TimToady how come Unicode has bag delimiters but not set delimiters? 05:45
.u ⟅
phenny U+27C5 LEFT S-SHAPED BAG DELIMITER (⟅)
TimToady .u ⟆
phenny U+27C6 RIGHT S-SHAPED BAG DELIMITER (⟆)
sorear I've always seen sets typeset with { }
TimToady it's bad enough to overload { } with => inside...
05:47 nymacro joined
TimToady 'foo' ∪ 'bar' ∪ 'baz' works, I suppose 05:47
assuming we have (Any,Any) as a variant
probably a level violation though 05:48
'foo' ∪ 'bar' ∪ (1 ∪ 2 ∪ 3) would not do the right thing
set theory wants sets that contain sets 05:49
perl6: say set 1,2,3 05:50
p6eval rakudo 922500: OUTPUT«123␤»
..pugs: OUTPUT«*** No such subroutine: "&set"␤ at /tmp/O8N8XGq87X line 1, column 5 - line 2, column 1␤»
..niecza v8-4-g2c56dcb: OUTPUT«===SORRY!===␤␤Undeclared routine:␤ 'set' used at line 1␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 685 (CORE die @ 2) ␤ at /home/p6eval/niecza/src/STD.pm6 line 1136 (STD P6.comp_unit @ 36) ␤ at…
TimToady rakudo: say set(1,2,3).kv
p6eval rakudo 922500: OUTPUT«011223␤»
TimToady what I thought 05:51
that should make 11 21 31 in some order 05:52
or 1True2True3True
05:52 djanatyn joined
djanatyn Hey guys. 05:52
TimToady that's why I added Object hash to the features lists to be with Sets
howdy 05:53
djanatyn I've been messing with Perl 5 for quite a while now.
TimToady is that why it's a mess?
djanatyn I've been checking out both Perl 6 and Python.
TiMBuS lol
djanatyn Nah, looks like some other guys got there first.
TimToady snorts
djanatyn Can you guys tell me why I should join the Perl 6 revolution instead of becoming a Pythonista?
I really liked hacking in Perl 5. It's the first language that I actually started making Cool Stuff with. 05:54
But, Python seems pretty awesome too. I haven't used Moose very much, but I'
*I've been getting used to the standard OOP in Perl 5.
TimToady Python is in the business of making features look like hammers so that problems look like nails, which is fine when your problems look like nails
djanatyn Perl 6 seems a *lot* more object oriented
TimToady it is
it's more OO than Python
more on a par with Ruby 05:55
djanatyn Heh
I checked out Ruby, too.
05:55 sshc joined
TimToady Ruby has different problems, though there's some overlap with Python 05:55
djanatyn Is everything an object in Perl 6 as well?
TimToady perl6: say 1.WHAT
p6eval pugs: OUTPUT«Int␤»
..rakudo 922500, niecza v8-4-g2c56dcb: OUTPUT«Int()␤»
TimToady does that answer your question? :) 05:56
djanatyn yep ;)
Tene djanatyn: Yeah, pretty much, depending on what angle you look at native attributes and packed arrays from.
djanatyn I was looking at ruby's main website
I got really confused at first, when I saw some simple code:
TimToady now, we do have native types specced, which force the type info onto the container instead
djanatyn 1.times { print "hello world" }
TimToady we don't think .times belongs in the Int class 05:57
Tene Yeah, I still think that that's pretty horrible.
djanatyn I thought there was a function, "times", that took it's argument as a prefix followed by a period
which shows how much I know about object oriented programming.
so, Perl 6 will fix me up?
mberends djanatyn: a nice you'll notice here is the community, over here language implementers and users mix freely, there is no elite.
djanatyn I have to admit, the whole culture of perl 6 is pretty enticing. 05:58
TimToady at least, the elite pretend not to be :)
djanatyn you guys seem really friendly and helpful, and dedicated to the language in general.
TimToady well, you have to be a little bit bonkers to keep working at the same goal for 11 years
djanatyn I like writing stuff :)
I'm not exactly the best at it, though
TimToady we all have our strengths and weaknesses
djanatyn (people like me are the reason perl has a reputation for looking like line noise) 05:59
TimToady it will be a little harder to do that in p6, but only a little :)
Tene djanatyn: Haha, no, not so much.
TimToady there's lots of wiggle room
the obfuscation tends to come out a little differently
djanatyn Tene here knows me pretty well
He always fixes up my perl code for me ;) 06:00
Tene Yeah, and you still don't listen to me about using bareword filehandles. :P
djanatyn gotta work on that ^_^
let's write something in perl 6 :D
with no bareword filehandles. 06:01
djanatyn installs parrot and rakudo
Tene sweet; let's do it
TimToady for example, you can compare the two solutions in rosettacode.org/wiki/Constrained_ra...cle#Perl_6
the second one is "functional", but arguably less readable 06:02
sorear djanatyn: Python's competition is the Perl 5 revival led by Moose and company. Perl 6 wants to obsolete both of them someday :D
TimToady Python's main problem right now is that they defined a small incompatibility with 3.0, and can't get anyone to adopt it
I think we made the right choice to go for a large incompatibility, since the pain of crossing will be about the same 06:03
djanatyn I'm on debian - should I actually go through building the compiler from source, or is there a convenient package out there? 06:04
TimToady best to build from source for now, probably
moritz you need to build from source
Tene djanatyn: rakudo was recently added to debian unstable, I hear
sorear I think a lot of newbies overstate the importance of choosing a language to learn
moritz debian packages are being worked on
sorear I've been programming for about 13 years. Last weekend I learned J in 4 days. It's not hard at all to pick up more, once you have one 06:05
TimToady yes, but you are one of those elite that are pretending not to be :P
djanatyn I've been programming...well. That's hard to say.
I've been messing around with computers and languages as long as I can remember.
I've actually started sitting down, reading books and documentation, and writing stuff for about...6 months, I'd say?
But before that, I did a lot of experimentation with programming languages, and a lot of learning my way around unix. 06:06
And for some weird reason, I've always known a bunch of C. not sure exactly where I picked that up.
TimToady if you want to see how Perl 6 stacks up (no pun intended) against other languages, rosettacode.org is a nice site
sorear (incidentally, everyone needs to check out J. At the very least, it will make whatever language you're using now seem much more readable. :) 06:07
Tene aw, c'mon, you can say "stacks up" and not mention factor. :P
TimToady well, all the APLish languages hold brevity to be one of the highest goals
sorear also the J implemententation makes Perl 5 look pretty 06:08
TimToady we're trying to get most of the power, without sacrificing readability
so our metaops look very different from normal ops
we also believe in precedence :)
djanatyn :D 06:09
so, rakudo-star has lots of documentation and stuff, but rakudo is just the compiler?
TimToady certainly, the docs are still shakier for P6
moritz djanatyn: right, docs and modules 06:10
djanatyn runs Configure.pl 06:13
TimToady you probably want --gen-parrot 06:14
djanatyn Umm, do I need to install parrot first?
TimToady not if you ^^
djanatyn Yep, added that to the end
cool :D
and should that be run as root?
TimToady nah
it does a local install in your directory
you can make a symlink to that if you like
06:15 araujo left
sorear TimToady: do you think $::("!attr") makes sense? 06:19
06:19 molaf joined
TimToady not particularly 06:19
sorear hmm
TimToady unless it's a pure textual macro that slurps the surrounding token
but that's not how it is in my head 06:20
sorear How is it in your head?
TimToady my head wants ::() to only occur on normal :: boundaries 06:21
not between sigil and twigil
06:21 mattp_ left
TimToady if you want to do any token gluing, it should be inside the () 06:21
::() is specced to reparse for :: though, unlike ."" 06:22
FOO::{} doesn't reparse, since it's direct stash lookup
sorear What do you think of my $var; $::("var") ? 06:23
TimToady that's okay-ish to me, but a bit of a no-op
perl6: my $foo = 42; say $::foo 06:24
sorear of course I would never write it with a string literal
p6eval niecza v8-4-g2c56dcb: OUTPUT«===SORRY!===␤␤Cannot make a compile time reference to the semantic root package at /tmp/eiik5xxEZs line 1 (EOF):␤------> my $foo = 42; say $::foo⏏<EOL>␤␤Potential difficulties:␤ $foo is declared but not used at /tmp/eiik…
..pugs, rakudo 922500: OUTPUT«42␤»
TimToady ^^
same thing, really
djanatyn Configure.pl takes a long time :)
sorear (as you can see the niecza name handling needs this rewrite badly)
TimToady any initial :: is really a no-op 06:25
except in a type capture
sorear djanatyn: it's downloading, compiling, and installing Parrot
djanatyn tell me more about why perl 6 is better than perl 5, please? ;)
sorear: yeah, I suspected it might take a while
sorear djanatyn: surely that depends on how you define "better"
djanatyn Well, it's apparently more object oriented 06:26
sorear betterness space is many-dimensional, the answer depends on exactly which covector you mean..
djanatyn that sounds pretty awesome to me
06:26 uvtc joined
TimToady it retains all of the essence of Perl while cleaning up a lot of the cruft, and becomeing much more powerful too 06:26
djanatyn And I've heard it's a lot more "functional".
sorear the best thing about Perl 6 is that it has muliple implementations
djanatyn what exactly does that mean (if it's true?)
moritz we really need a "what does Perl 6 provide over $language" page
TimToady it's more FP if you want it to be
uvtc TimToady: earlier you were talking about potential unicode delimiters for sets. 06:27
djanatyn I spent a while with haskell
uvtc TimToady: Since sets usually use curlies, maybe the next best thing is wavies?
$s = ⌇ a b c ⌇
U+2307
TimToady FP is about programming more with definitions than with side effects, basically
sorear perl 6 has more potential for higher-order programming in the basic language
anonymous subs are more concise (this helps a LOT)
TimToady all operators are really just normal functions 06:28
Tene uvtc: when I wrote a set module a long time ago, I used circumfix:<⦃ ⦄>
moritz multi dispatch!
uvtc Tene: oooh, pretty. :) 06:29
Tene and for bags, I used circumfix:<⟅ ⟆>
TimToady perl 6 allows the user to be confused about the difference between numbers and strings, but unlike Perl 5, is not confused itself
Tene .u ⦃ ⟅
phenny U+2983 LEFT WHITE CURLY BRACKET (⦃)
U+0020 SPACE ( )
U+27C5 LEFT S-SHAPED BAG DELIMITER (⟅)
TimToady SPACE, the final frontier...
djanatyn hey, phenny? isn't that python? :D 06:30
Tene yep
TimToady you wanna rewrite in p6, go ahead :)
djanatyn that actually sounds like it might be fun!
but phenny has tons of stuff, would be pretty difficult.
Writing an IRC bot in p6 sounds like a fun task.
One of my goals is to write an IRC client and an IRC server in p5. 06:31
Well, technically, I wasn't sure exactly what language I wanted to do it in ;)
Tene yeah, unfortunately Perl 6 is missing a lot of support that would make that reasonable. :(
djanatyn aww. :\
TimToady soon now
djanatyn Well, how unreasonable would it be?
Tene network IO is awkward, rakudo doesn't have threading or async IO, etc.
djanatyn Oh, I see. 06:32
TimToady niecza has async
djanatyn That would make it a bit unreasonable.
Tene and niecza has threading
TimToady but not async IO, I expect
djanatyn Cool, parrot is installed and my Makefile is configured
djanatyn makes
Tene Haha, yeah, I misread. :(
sorear niecza is on the CLR, a fairly mature (but not Perl-focused) runtime system which has threading and async I/O 06:34
djanatyn the most compelling and the least attractive reason for me to learn perl 6 seems to be the same.
It's at an early stage, so a lot of the stuff in otherl languages doesn't seem to be there yet
(if I understand correctly)
sorear if you want to write an app using async I/O for niecza, you can probably do it, with hacks
TimToady yes, but we have 350 examples of running code on rosettacode.org
sorear with Rakudo it will be a lot harder
there was a GSoC last year (failed) to add threads to Parrot 06:35
the main thing stopping niecza from having async I/O is a user
you can't just design something like this without use cases, you'll make something unintentionally useless 06:36
TimToady Uri was just asking me about async IO at dinner
sorear I would be eager to work closely with someone wanting to use async I/O, to make it happen in a useful way
TimToady since he was one of the people who originally wrote an RFC for it in 2000 :)
sorear then we can write a spec for it 06:37
TimToady dev.perl.org/perl6/rfc/47.pod
djanatyn Is there an emacs mode for perl6? 06:39
TimToady I think so, but many of us are vimpy
vimpacious?
viminators? 06:40
06:40 JimmyZ joined
sorear I usually use vim with :syntax off 06:40
perl6.vim is unusably slow and doesn't work anyway
djanatyn Whenever I turn the syntax off, I usually spend more time debugging.
TimToady I usually have it on?
*.
but my machine is pretty speedy, and I mostly look at short examples 06:41
djanatyn I'm really talented at creating stupid syntax errors.
I'm on a netbook! :D
If all goes well, I should be getting a ThinkPad next week.
I'm a poor high school student, so I've been saving up.
Is there Curses support in Perl 6?
Or a Curses library or something? 06:42
TimToady I thought parrot had something once
I usually just use ANSI codes :)
sorear yeah the cutoff for perl6.vim being unusably slow is around 500 lines for me 06:43
uvtc djanatyn: modules.perl6.org/ lists a number of modules currently available
But curses seems to be on the most-wanted list (linked to from that page) 06:44
djanatyn I haven't been using perl for very long, but it's pretty obvious that CPAN is *huge*.
sorear djanatyn: most of us are pretty young here.
djanatyn was there a CPAN before perl 5?
TimToady some of us just act young
djanatyn: not really 06:45
perl 4 didn't have an extension mechanism
djanatyn nice try, mr. wall :D
sorear me, I've been using the same computer since I was in middle school
TimToady instead we got variant versions like oraperl and sybperl
I could see that wouldn't scale, so P5 had an extension mechanism
sorear TimToady: why? lack of DynaLoader?
TimToady that was part of the P5 design 06:46
djanatyn Interesting.
sorear: I anticipate using this new ThinkPad for quite a long time.
TimToady ThinkPads are generally pretty solid workhorses 06:47
djanatyn would it be possible to use the Template::Toolkit in Perl 6?
I've been working on a little project in perl 5 to create a personal website.
Tene uvtc: Several years back, I started a roguelike in Perl 6, using Curses from parrot, until i gave up on being the only one fixing HLL interop in rakudo. I've mentioned several times in here, though, that a Curses module that just wrapped the Parrot Curses module would be pretty trivial, with a small bit of embedded PIR.
sorear you'd need to port it.
djanatyn it uses the template toolkit to generate a bunch of html pages.
sorear no Perl 6 implementation has a Perl 5 compatibility layer yet 06:48
djanatyn it takes a bunch of input files, processes them, and spits out a static website.
sorear and (by design) no Perl 5 module can accidentally parse as Perl 6
Tene djanatyn: There's a small workalike to Template::Toolkit in the web.pm repo
djanatyn I was having a lot of fun with it, and learned a lot of perl 5 quirks writing it.
Tene called... uh... Ratel, I think.
sorear wait what am I talking about I wrote just such a compatibility layer last year
djanatyn I also saw HTML::Template, which might be just what I need.
sorear I'm young but sometimes I act old :D 06:49
djanatyn Heh.
uvtc Tene: would make an interesting tutorial if you could explain how you created your Curses module. (BTW, where does one even find a list of available "Parrot modules"?) 06:51
TimToady you have to be initiated into the inner mysteries :)
sorear try looking in parrot/runtime/library
Tene uvtc: in the 'library' dir of... yeah, that 06:52
sorear hmmm, Uri's RFC advocates ithreads
sorear wonders if ithreads will be part of Perl 6 06:53
06:53 sshc left, sshc joined
sorear it seems to make a big difference whether the system can assume single-threaded access to all objects 06:53
djanatyn I feel like I'm compiling the language of the future :D
Tene uvtc: All i did back then was: use Curses:from<parrot>; 06:54
TimToady djanatyn: we'd like to think so
sorear use Curses:from<parrot> doesn't work anymore
this might be my fault
Tene uvtc: an equivalent Curses.pm for Rakudo would just load the Curses.pbc file and then copy the relevant namespace. 06:55
sorear: No, it isn't.
sorear Tene: so it started before I disabled the PDD21 implementation while making Blizkost work?
TimToady sorear: the PROCESS vs GLOBAL split is there in case we decide we want ithreads
sorear TimToady: I don't understand how that would work 06:56
uvtc sorear: Ah, `/runtime/parrot/library`. Thanks.
sorear TimToady: surely any object can be bound to a PROCESS::<$x> variable
TimToady each interpreter would have its own GLOBAL but share PROCESS
06:56 daxim joined
sorear which means any object can potentially be accessible from multiple interpreters 06:56
Tene sorear: It was working and broken several times long before blizkost was around.
TimToady the PROCESS space would likely be readonly to interpreters by default
sorear what if I do $PROCESS::IN does role { has $.x }; $PROCESS::IN.x = $unshared? 06:57
uvtc Tene: Still might make a great blog post. Walk a user through how to use libs in runtime/parrot/library from your Perl 6 source code file. 06:58
TimToady sorear: what if it doesn't let you? 06:59
Tene sorear: see blogs.gurulabs.com/stephen/2009/05/...ading.html
djanatyn It looks like if I stick with learning Perl 6, I might actually get the chance to write some modules.
Tene So, 2009/05
djanatyn How difficult is that?
And does learning Perl 6 currently include learning how Parrot works?
Oh, awesome!
perl6 is compiled :D
TimToady whatever that means 07:00
daxim ↑ what he said
sorear Except for Tcl and J, every language I've played with has had a compiler, and I've played with quite a few. 07:01
djanatyn I mean to say, the "make" command has finished for rakudo-star.
sorear ah.
TimToady ah, we misunderstood completely :) 07:02
sorry, it's a hot button question in Perl culture :)
djanatyn: I hope it doesn't, because I don't currently know how Parrot works
djanatyn ...that's a good sign, I think. 07:03
For me. Maybe.
djanatyn jumps right into perl6!
TimToady well, someone has to know how it works...
djanatyn let's get a hello world or something.
TimToady perl6: say "hello, world"
p6eval pugs, rakudo 922500, niecza v8-4-g2c56dcb: OUTPUT«hello, world␤»
sorear not knowing how Parrot works is probably a good sign 07:04
djanatyn ...huh. 07:05
Well, running a one-line "hello world" program took several seconds.
Is that just because it takes a while for parrot to start up, or is perl6 really really slow? :)
sorear djanatyn: I also encourage you to apt-get install mono-complete and take a look at github.com/downloads/sorear/niecza/niecza-8.zip
djanatyn: what you're seeing is constant factors 07:06
moritz djanatyn: rakudo is slow, but usually not that slow
sorear djanatyn: Rakudo Perl 6 *is* very slow, it takes 0.05 seconds per line or so
TimToady rakudo/parrot has historically been slow, but the new rakudo "nom" is about five times faster
djanatyn moritz: I'm on a really slow EeePC.
TimToady niecza is pretty zippy, except when it isn't 07:07
moritz a "hello, world" takes < 1s here, nearly all of it startup
TimToady anyway, that will improve greatly over time
parrot has forced rakudo to do some silly things in the past 07:08
and rakudo has done a few silly things all on its own
but it's getting better fast
sorear djanatyn: ls -lh perl6.pbc
djanatyn: think about "several seconds to start up" in the context of the size of that file 07:09
that file contains the parser and code generator
djanatyn Oh, snap.
sorear djanatyn: I'm curious how long niecza takes to start for you 07:10
djanatyn well, I suppose I could install it.
uvtc Once Rakudo has done its job of compiling a Perl 6 source file, is the execution speed thereafter entirely dependent upon Parrot?
moritz uvtc: no 07:11
uvtc: eval() needs to call back into the compiler
sorear uvtc: no, because Rakudo controls what instructions are generated
TimToady nom would not be five times faster if it was dependent entirely on parrot speed
nom generates many fewer temp objects 07:12
uvtc sorear: So, of course, the better Rakudo can optimize its output, the faster execution will be.
sorear uvtc: for instance, rakudo compiles $lexical to find_lex $P0, '$lexical'; runtime would be faster if it were a direct reference, rather than a string-indirect reference
07:13 Jackneill joined
moritz the nice thing is that with nom we have enough information at compile time to make such optimizations 07:13
07:14 wamba joined
uvtc Has compilation speed also increased approx 5x in nom? (Aside from execution speed.) 07:14
TimToady it might once pmichaud++ finishes his qregex integration
sorear if you manage to speed up compilation more than 2x I'll have major catching up to do :( 07:15
or is that :)?
TimToady well, the choice is yours... 07:16
djanatyn *yawn*
I'll be back tommorow.
TimToady what TZ are you in?
djanatyn See you guys, and thanks for the information :D 07:17
EST. It's 3:17am over here right now.
TimToady yow
good night
djanatyn Also, my battery on the netbook is down to 10%.
Tene Sleep well.
djanatyn So, see you tommorow.
Thanks.
uvtc Sounds promising. Gah, what am I doing up so late? Thanks for the info, all. (Can't find a "going to sleep unicode symbol ... improvising) ⛺
Tene Yeah, that netbook has a pretty small battery, iirc.
.u ⛺
phenny U+26FA (No name found)
TimToady won't be on tomorrow much; 12 hours of driving to get back home...
uvtc U+26FA (TENT) 07:18
djanatyn Tene: around 3 hours with the brightness down to the minimum value, it seems.
07:18 uvtc left
Tene ahh, I never tried turning down the brightness, I don't think. 07:18
TimToady should turn in soon too, being an old geezer 07:19
sorear djanatyn: what, no AC adapter? 07:20
djanatyn sorear: too lazy to get up 07:21
sorear dares not think how much energy his PC is using... "P4 Northwood, plugged in most of the time"
djanatyn usually uses his netbook in his bed
that way I can just tuck it away and fall asleep at 3am.
Or, I can chug nasty energy drinks that ruin my body and just continue to use it until I pass out :D 07:22
I'm all natural tonight.
sorear my bed is 2 ft behind me.
good night, djanatyn 07:23
07:44 timbunce joined
sorear o/ timbunce 07:46
08:06 JimmyZ left 08:17 mattp_ joined 08:23 Kivutarrr joined 08:26 JimmyZ joined 08:29 araujo joined, araujo left, araujo joined 08:33 masak joined
masak morning, #perl6. 08:33
sorear o/ masak
mberends greetings
08:36 birdwindupbird joined
masak shinobicl: hm, I'd suggest adding Duration to your DateTime, but... sometimes adding a fixed number of seconds is not what one wants. oftentimes it's more like "one month after this", or "three years prior to this", and the conversion isn't obvious. 08:39
shinobicl: S32/Temporal is silent when it comes to such a class, mostly because we tried to be conservative at the time. I think there's room for one, though.
biggest problem is that Duration is taken. :)
sorear clearly, it should be DateTime::Duration *ducks* 08:42
masak that's not half-bad, actually.
because it is a duration of datetimes. 08:43
08:47 masak left 08:50 masak joined
masak by the way, the assessment "only barely powerful enough to emulate a Minsky machine" will probably feature in the next Yapsi release announcement somehow. :) 08:51
moritz what does "one year before 2012-02-29" mean? 08:52
or s/before/prior to/
masak moritz: I would make it "2011-02-28", but YMMV. it doesn't follow algebraical laws, of course. 08:55
dalek kudo/nom: 8f3f2cb | moritz++ | src/core/terms.pm:
Merge pull request #31 from kboga/special-vars

  $*PROGRAM_NAME
masak in particular, transitivity gets broken here.
moritz nom: my @a = a => 1, b => 2; say @a.perl; say a.hash.perl; say @a.perl;
p6eval nom: OUTPUT«Array.new("a" => 1, "b" => 2)␤Could not find sub &a␤current instr.: '_block1002' pc 161 ((file unknown):156) (/tmp/uREO7JGT99:1)␤»
JimmyZ rakudo: multi sub infix:<april>(Int $day where { 0 < * < 31 }, Int $year){ return DateTime.new(:year($year), :month(4), :day($day));}; my $data = 2 april 2011
p6eval rakudo 922500: ( no output )
moritz nom: my @a = a => 1, b => 2; say @a.perl; say @a.hash.perl; say @a.perl; 08:56
p6eval nom: OUTPUT«Array.new("a" => 1, "b" => 2)␤("a" => 1, "b" => 2).hash␤Array.new("a" => 1, "b" => 2)␤»
masak JimmyZ: that's a wicked infix :P
JimmyZ rakudo: multi sub infix:<april>(Int $day where { 0 < * < 31 }, Int $year){ return DateTime.new(:year($year), :month(4), :day($day));}; my $data = 2 april 2011; say $data;
p6eval rakudo 922500: OUTPUT«2011-04-02T00:00:00Z␤»
masak JimmyZ++
08:56 timbunce left
JimmyZ masak: I saw it from gfldex.wordpress.com/2011/07/29/toy...-in-perl6/ 08:56
gfldex++; actually 08:57
masak ah. gfldex++
JimmyZ make infix:<april> into S32 seems wicked 09:00
But I like the usecase
09:03 timbunce joined 09:07 mj41 joined
JimmyZ thinks the really reason that Perl6 use butterfly as mascot is Perl6 wants butterfly effect in the further ;) 09:10
masak hah :) 09:11
well, if a butterfly wing flap exhibits the butterfly effect, surely Perl 6 has done so now, many times over.
JimmyZ but not big enough? 09:12
masak well, the thing about big enough butterfly effects is that they still start small, because of their origin.
JimmyZ nods 09:13
masak also, the thing about exponential growth is that most of it looks like relative standstill at a low level.
bacteria grow in a vat, doubling every minute. it's full at 60 minutes. at 50 minutes, not even a thousandth is fill. at 59, already half. 09:16
jnthn morning, #eprl6 09:25
...pre-coffee typing skills: not good
masak jnthn! \o/ 09:26
jnthn masak! \o/
masak weekend, bad enough weather, all-day hacking Perl 6. what more could you ask for? :) 09:27
09:27 Mowah left
sorear can only hack in good weather 09:27
masak do you go for design-mulling walks in bad weather? 09:29
sorear in bad weather, I sleep, because I'll overheat if I do anything else
I need a better heatsink for my brain 09:30
jnthn cools his with cold beer from the fridge :)
...though not at this time of day :)
oh heh, what a thing to wake up to... 09:31
last night I left my debugger open, broken at a nom segfault.
masak "good morning! regards, me from last night." :P
jnthn yeah...last night me musta thunk I'd appreciate this somehow :P 09:32
sorear sleep 09:36
09:37 Vlavv left 09:38 im2ee joined 09:39 im2ee left, Vlavv_ joined, im2ee joined 09:41 im2ee left
masak I want to talk more about $x."A::b"() 09:48
09:48 Jackneill left
masak specifically, what's A? I think that matters for the answer. 09:49
jnthn To me that doesn't interpolate anything 09:50
masak I've only ever used $x.A::b when A is a role whose .b method has been overridden by the class I'm just declaring.
jnthn You can use it to get to parent classes too.
masak I wouldn't mind if $x."A::b"() meant that.
jnthn But iirc you can't use it for unrelated classes
masak jnthn: ok, then I wouldn't mind if $x."A::b"() meant parent classes too.
jnthn: right.
and that's my point, I guess.
jnthn masak: Well, I only don't find if it's the MOP that does it 09:51
masak I'd like for it to mean the same. :)
jnthn But the MOP just gets a string method name
And I'd rather it didn't have to go parsing it every time.
JimmyZ morning, jnthn
jnthn hi, JimmyZ
JimmyZ hello
masak jnthn: surely performance can't be the issue here -- the used has explicitly chosen to make an interpolated method call. 09:52
user*
tadzik good morning
masak tadzik! \o/
jnthn < jnthn> But the MOP just gets a string method name 09:54
tadzik masak! \o/
jnthn As in, it doesn't know it's interpolated
That currently all happens outside of the MOP
moritz I think there are two questions we need to ask
jnthn It just gets asked "here's a string method name, look it up"
(Yes, we can do something different if need be.)
moritz if :: is interpolated, how would I call a method with :: in its name?
(might be important for language interop) 09:55
and if it's not interpolated, how do I call $obj.Class::$computed_name()
?
jnthn moritz: I think that's why we looked at putting the handling in the meta-object
masak actually, the syntax $x.A::$method() should probably work too, yes. 09:56
jnthn moritz: $obj.$(Class.^find_method($computed_name))
masak std: my $obj; my $computed_name; class Class {}; $obj.$(Class.^find_method($computed_name))
p6eval std 516268a: OUTPUT«ok 00:01 121m␤» 09:57
moritz masak: if so, either $x.A::"$method"() or $x.A::($methodname)()
masak moritz: oh! right. meant the former.
I found an interesting (ex-)exploit in SOAP::Lite yesterday based exactly on the Perl 5 handling of interpolated method calls. 09:58
jnthn nom: class A { method m() { 1 } }; class B is A { method m() { 2 } }; my $obj = B.new; say $obj.$(A.^find_method('m'))()
p6eval nom: OUTPUT«Non-declarative sigil is missing its name at line 1, near "$(A.^find_"␤current instr.: 'nqp;HLL;Grammar;panic' pc 23611 (src/stage2/gen/NQPHLL.pir:6348) (src/stage2/gen/NQPHLL.pm:329)␤»
jnthn aww
masak so it was amusing to me to see them brought up in the backlog, too.
thinking of blogging about that exploit; it was so exquisite :)
also, at some point I'll be making a talk called "Exploit-driven development" :) 09:59
jnthn Anyway, in general I'd give -1 to re-parsing interpolated strings.
(as method names)
And we find a proper interpolation syntax - or tell people to go play with the MOP - if they want to other thing. 10:00
masak jnthn: what was it about the parsing of the "A::b" that you didn't like? I'm not sure I grok'd. 10:01
jnthn masak: We probably agree the parser can't handle it (or we break interop), so then the MOP has to, which means that for efficiency it in turn needs to know when it has a call it has to parse, so that's another extension there. And quotes don't normally make :: mean anything, so we'd be giving them extra semantics just in one context. 10:03
Getting the MOP to do string parsing inside of it also feels icky. It's not really its job. 10:04
moritz agrees with jnthn++ after reading these points
jnthn We've gone to lengths in Perl 6 to stop making everything type-y be about strings. Parrot still suffers from a legacy of doing so.
masak ah, that last point I can appreciate. 10:05
"don't put magic behaviour into mere strings".
jnthn I'd rather we find a way to make something like $obj.A::($m_name)() work if we want short syntax for this.
masak essentially, mere strings being too magical form both of the steps in the SOAP injection attack we talked about yesterday. 10:06
jnthn: agreed.
jnthn Indeed.
I'd rather people only have to worry about mere strings going boom on them in a small number of places. e.g. eval.
moritz speaking of injection attacks 10:07
masak that said, having pipes in &open is a wicked cool thing. I'd like to have something similar in Perl 6 :)
moritz I love it that nom makes built-in types inheritable
so I can do thing like
jnthn inheritable?
moritz class HTMLStr is Str { }
masak o.O
jnthn We couldn't do that in master?
masak decidedly not.
jnthn oh.
moritz and then I can write a template system that automatically escapes Str, but not HTMLStr 10:08
jnthn: how would you instantiate that in master?
masak :P
jnthn moritz: How do you do it in nom? :)
moritz jnthn: pir::repr_box_str($source, HTMLStr)
jnthn oh, using the op
OK :)
masak eeew.
jnthn Was gonna say... :) 10:09
moritz it might need a better API someday :-)
jnthn s/might/will/ :)
moritz but if it allows me to get rid of XSS in my templates I'm willing to go with the ugly API for now :-)
masak my mini-challenge still stands: irclog.perlgeek.de/perl6/2011-07-29#i_4187188
no-one has stepped up to the challenge yet. :)
jnthn cooks bacon and ponders how to refactor static lexpads
moritz creates a mini-challenge to masak: motiviate people to participate in your mini-challenge! 10:10
10:10 birdwindupbird left
masak read that as "jnthn ponders how to bacon static lexpads" and rubs eyes 10:10
moritz jnthn: isn't bacon better fried?
jnthn fry ~~ cook, no? :P
moritz I mean, cooked bacon... come on
jnthn is going to fry it :) 10:11
moritz jnthn: might be a language barrier thing
jnthn moritz: I suspect so :)
masak moritz: I would've thought the price of one beer would be enough motivation. of course, there's also plenty of prestige involved. :P
jnthn I consider "cook" as generic. "fry" is just an implementation of that :)
moritz to me there's a difference between "prepare a meal" and "cook a meal"
10:11 amkrankruleuen joined
moritz and fry ~~ prepare, but fry !~~ cook 10:12
masak I think moritz thinks cook === boil.
moritz ah yes
masak not so.
boil ~~ cook, but cook !~~ boil.
jnthn then I see the confusion 10:13
wtf, you can boil bacon?!
jnthn never tried that but doesn't really want to either 10:14
masak *lol*
moritz you can boil anything that fits into a pot and doesn't evaporate too soon
masak TimToady: [∪] <foo bar baz> 10:17
TimToady: it's perfect :)
(also, I guess, it's synonymous to 'set <foo bar baz>') :)
tadzik why is token comment:sym<#=(...)> "(...)" (whatever that means), and accepts a <quote_EXPR>? 10:20
masak djanatyn: hi! welcome!
moritz tadzik: the sym:<...> can contain any thing 10:21
tadzik: and only if you use <sym> in the regex, it gains some meaning
tadzik++ # gist.github.com/1114044 10:22
tadzik moritz: there are tests for that now :) 10:23
very basic yet, github.com/rakudo/rakudo/blob/podp.../pod/why.t
moritz \o/
tadzik documenting routines gives a segfault so far, but jnthn++ is onto that. I'm now investigating the variables case 10:24
masak oh, TimToady agrees in the backlog with what moritz, jnthn and I just painstakingly reasoned ourselves towards with the MOP not interpolating method names with "::" in them :) 10:25
TimToady++
10:26 nymacro left
jnthn tadzik: I didn't do variable traits just yet, I'm afraid. 10:31
tadzik jnthn: attributes documenting will be trate-ish too, si?
okay, still on the roadmap?
jnthn tadzik: Probably can be
Attribute traits already work.
tadzik okay
jnthn It's only variable ones that are missing.
Yes, you should be able to mix into Attribute. 10:32
tadzik I can probably wait for them, no problem with that
moritz I suspect in the long run .WHY wants to return something Pod::-ish 10:38
so that you can say
#= B<fast> implementation of the fourier transform
masak agreed. as long as there is also a reasonable way to get a text-only form. 10:40
tadzik moritz: once pod_string is there (so: formatting codes are done), .WHY will probably use those and return arrays, yes 10:41
10:42 JimmyZ_ joined
moritz masak: there's always .Str and .gist 10:44
10:45 JimmyZ left
tadzik it still bothers me that every string that we have in $=POD now will end up being an array of some sort 10:45
10:45 JimmyZ_ is now known as JimmyZ
moritz does it have to be? 10:46
tadzik I worry that bringing something like "it's an array, unless when it isn't" will bring more harm than good to parsing and to processing later 10:47
maybe not
moritz in Haskell terms, we could write PodStr = Str | List[chunks]
dunno if something can be accomplished sanely in p6 10:48
masak tadzik: ah -- the name of that "data structure", apparently, is "twine".
tadzik oh?
masak tadzik: not "rope" as I claimed.
tadzik: see XML::Easy and subclasses for the use of it.
it occurs often enough in these kinds of hierarchical-text use cases.
10:49 MayDaniel joined
masak goes hunting for bacon & 10:49
tadzik reads metacpan.org/module/XML::Easy::NodeBasics#Twine
moritz wow, planet.haskell.org has sent more vistors to perl6.org than planetsix.perl.org 10:52
10:53 molaf left
TiMBuS * sorear wonders if ithreads will be part of Perl 6 10:53
:/ 10:54
id prefer not...
moritz and the features page has had > 4k visitors
10:58 Instil left 11:01 Instil joined 11:22 Jackneill joined 11:31 DarthGandalf left
masak moritz: was it au++'s translation of TimToady's Dec 24 post to 中國傳統? that's the only reference to perl6.org on planet.haskell.org that I find. 11:37
dalek atures: 5ca311b | masak++ | features.json:
[features.json] reordering

sin, .pick, and .fmt aren't really operators, they're built-ins.
11:43
11:57 timbunce left, timbunce_ joined
TiMBuS is there a reason hashes in perl6 arent just bags containing pairs? too much breakage? 11:58
12:00 timbunce_ left, timbunce joined
masak TiMBuS: I don't think Bags do what you think they do. 12:09
TiMBuS: a hash cannot contain the same key twice. a Bag is like a Set, except that it can contain multiple copies of the same element. 12:10
TiMBuS whu 12:14
oh
well then, a set
masak a Set could still contain two distinct Pairs with the same key; a Hash can't. 12:30
12:30 MayDaniel left
masak niecza: class C { has $.x }; (my %h){C.new(:x(42))} = "OH HAI"; say %h.perl 12:34
p6eval niecza v8-4-g2c56dcb: OUTPUT«{"C()<instance>" => "OH HAI"}.hash␤»
dalek atures: 56279ad | masak++ | features.json:
[features.json] added hashes with non-str keys
12:35
masak hm, but that test for Niecza was unfair, I realize.
(becuase Str is the default)
12:36 Chillance joined
masak niecza: class C { has $.x }; (my C %h){C.new(:x(42))} = "OH HAI"; say %h.perl 12:36
p6eval niecza v8-4-g2c56dcb: OUTPUT«{"C()<instance>" => "OH HAI"}.hash␤»
masak niecza: class C { has $.x }; (my C %h){C.new(:x(42))} = "OH HAI"; %h{C.new(:x(5))} = "OH NOES"; say %h.perl
p6eval niecza v8-4-g2c56dcb: OUTPUT«{"C()<instance>" => "OH NOES"}.hash␤»
masak right.
12:37 wamba left
flussence did that qregex stuff happen yet? 12:49
jnthn flussence: The "get nqp and Rakudo parsed using it" stuff? No, sadly not yet. 12:50
flussence aww
jnthn On features, nom now has currying 12:51
(We runn the same .assuming tests as master)
flussence Files=313, Tests=8899! 12:52
jnthn \o/
We can break 9000 today I expect.
Anyone who wants to help with that, there's some LHF in the LHF.markdown ;)
masak rakudo: say trim " foo " 12:53
p6eval rakudo 922500: OUTPUT«foo␤»
flussence perl6: 'a,b' ~~ /<?after ','>/; # this work yet?
p6eval niecza v8-4-g2c56dcb: ( no output )
..rakudo 922500: OUTPUT«Method 'after' not found for invocant of class 'Cursor'␤ in <anon> at line 22:/tmp/OPeNdw7K2c␤ in 'Cool::match' at line 2684:src/gen/core.pm␤ in 'Regex::ACCEPTS' at line 6418:src/gen/core.pm␤ in main program body at line 1:/tmp/OPeNdw7K2c␤»
..pugs: OUTPUT«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {␤ unshift @INC, '/home/p6eval/.cabal/share/Pugs-6.2.13.16/blib6/pugs/perl5/lib';␤ eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;␤}␤'Pugs::Runtime::Match::HsBridge'␤"␤*** '<HANDLE>' trapped b…
flussence nom: 'a,b' ~~ /<?after ','>/; 12:54
p6eval nom: OUTPUT«Method 'after' not found for invocant of class 'Cursor'␤current instr.: '_block1010' pc 445 ((file unknown):25669379) (/tmp/dzEYHHDxws:1)␤»
tadzik wow, so podparser is on 8900! :) 12:55
jnthn tadzik: You've been working ALL SUMMER and you only pass one extra test?!?! :P
(teasing, of course :)) 12:56
tadzik: I'm guessing a bunch of the other tests you have a spectest material eventually, though?
tadzik: I mean, we'd need tests for $=POD and .WHY and so on.
tadzik probably, the t/pod stuff 12:57
more tests are working, podparser on master did pass some todos rakudo didn't 12:58
jnthn ah, ok
tadzik I guess they're yet commented out in nom 12:59
flussence er... in src/core/Any.pm:166, are infix:<min> and infix:<max> really supposed to be identical? 13:00
13:00 Reaganomicon left
jnthn nom: say 1 min 2; say 1 max 2; 13:00
p6eval nom: OUTPUT«1␤1␤»
jnthn bwaha
flussence: no :)
Fixing :) 13:01
masak let's see... 'given' is a topicalizer but not a loop, right?
so, specifically, I can't 'redo' one, right? :)
jnthn masak: afaik, no
masak: Use for item ... :) 13:02
masak perl6: given "OH HAI" { .say; redo }
p6eval rakudo 922500: OUTPUT«OH HAI␤ in <anon> at line 22:/tmp/Zb1m4DeNh1␤»
..pugs: OUTPUT«OH HAI␤*** Cannot use this control structure outside a 'loop' structure␤ at /tmp/uJZZXqeEXR line 1, column 24-29␤»
..niecza v8-4-g2c56dcb: OUTPUT«OH HAI␤Unhandled exception: Illegal control operator: redo␤ at /tmp/rB9D6ktKro line 1 (MAIN mainline @ 5) ␤ at /home/p6eval/niecza/lib/CORE.setting line 1933 (CORE C906_ANON @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 1934 (CORE module-CORE @ 56) …
13:02 thundergnat left
masak implementations agree. also, Rakudo master LTAs. 13:02
nom: given "OH HAI" { .say; redo }
p6eval nom: OUTPUT«OH HAI␤Warning␤»
masak shys back 13:03
won't do it again, I promise!
jnthn :P
Should be improved really.
masak suddenly imagines the nom branch as a stern robot nanny 13:04
13:04 soh_cah_toa joined
masak soh_cah_toa: every time you join the channel, I get a little bit of repetition in trigonometry. :) 13:04
soh_cah_toa++
soh_cah_toa ha!
jnthn OK, time to redesign static lexpads... 13:05
tadzik I don't get the trigonometry joke 13:08
soh_cah_toa tadzik: soh cah toa is a mnemonic for remebering trig functions 13:09
TiMBuS he probably knows that, i think hes just being obtuse..
soh_cah_toa ah ;) 13:11
masak TiMBuS: no, it might simply be that it's not widespread in Poland. 13:12
tadzik no, I don't know that mnemonic! :)
masak it's not widespread in Sweden.
soh_cah_toa tadzik: soh = sin is opposite of hypotenuse, cah = cosine is adjacent of hypotenuse, toa = tangent is adjacent over hypotenuse
s/of/over/
tadzik hmm, interesting ;)
flussence just discovered tools/progress-graph.pl
masak I had an easier time in school with trig than most people seem to have had. much thanks to BASIC, where I had already explored and understood the behaviour of sin/cos/tan et al. 13:13
soh_cah_toa trig itself is easy. trig + calculus is not 13:14
for me anyways...
TiMBuS i was just being punny. sorry, didnt mean to send the chat off into a different tangent 13:15
masak enough "fooling around" with what I later learned was called "differential equations" in BASIC taught me how these trig functions essentially fall out of equations involving derivatives.
TiMBuS: ah! both puns belatedly appreciated :P
soh_cah_toa shudders when he hears the word "differentials" 13:16
masak maybe I should make a few blog posts sometime about how fooling around with things like $Δx = $y; $Δy = -$x; can give a greater understanding of math.
soh_cah_toa: they weren't real differentials, just discrete approximations, as above.
soh_cah_toa yeah 13:17
masak but such blog posts would really need to be tied to some maths package or other.
hmmm, Perl 6 + Paper.js... :)
jnthn Paper.js? 13:18
oh, neat 13:19
:)
masak yes! 13:20
13:20 MayDaniel joined
jnthn That Keyboard Interaction example looks, er.. :) 13:21
jnthn goes back to his lexical refactors :)
masak jnthn: a lot of little animals look like sperm. :) 13:22
sorear: I want to use Niecza v8. was there ever a point release or something to the reported build problems of niecza-v8? I see nothing on the github repo page.
jnthn masak: Heh, at least it wasn't just me who thought it looked like that :P 13:23
13:26 mj41 left
masak sorear: nvm, Niecza 8 works fine here. sorear++ 13:27
13:27 JimmyZ left
masak jnthn: I did think that, yes. but even if I hadn't, I'd probably'd been able to guess what you thought it looked like. :P 13:27
dalek ast: f555c5c | moritz++ | / (7 files):
rakudo unfudges
13:29
tadzik I feel a sudden need for a huge, magnetic whiteboard for my room
masak tadzik: whiteboards suck. get yourself a blackboard.
niecza: sub foo { -> { foo } }; say foo()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()
p6eval niecza v8-4-g2c56dcb: OUTPUT«Block()<instance>␤» 13:30
masak niecza++
tadzik masak: you think so?
but where do I buy white markers then? :)
jnthn Chalk! 13:31
masak tadzik: in my last $owrkplace, our office was the only one with a blackboard -- because we specifically asked for one when we moved.
tadzik why do you prefer blackboards?
13:31 JimmyZ joined
masak because the relative net "convenience" gotten from whiteboards is negative. 13:32
jnthn masak: Less chalk dust everywhere is negative? :)
tadzik I don't get it
masak jnthn: if you get chalk dust everywhere, your doin it rong.
also, chalk dust is nothing compared to the failure modes of whiteboard markers.
you can always trust a piece of chalk. 13:33
the same cannot be remotely said of a whiteboard marker.
soh_cah_toa what does that -> syntax do when it's the first argument of a subroutine? like `grep(-> $_ {self.HOW.can(self, $_)}`
masak then there's the failure modes of the whiteboard itself.
soh_cah_toa: the -> makes the {} not execute there and then.
soh_cah_toa: rather it's used as a value. 13:34
tadzik -> STORE
jnthn masak: Whatever happened between you and a whiteboard to make you so bothered about them? :)
masak soh_cah_toa: the variable(s) after the -> but before the {} are parameters, like to a sub.
jnthn: nothing in particular. just thousands of small incidents.
soh_cah_toa parameters to the { } block? 13:35
masak jnthn: are you seriously telling me you've never put a marker to a whiteboard, only to discover they're "incompatible" and the pen was really meant for paper, and the whiteboard will now have to be cleaned with alcohol because the markings just won't come off? :(
jnthn nom: my $a = -> $b, $c { say "$b and $c" }; $a(1,2)
p6eval nom: OUTPUT«1 and 2␤»
masak soh_cah_toa: exactly.
soh_cah_toa ponders this 13:36
jnthn masak: No, but I agree it's a waste of alcohol.
masak jnthn: it's a waste of everything.
jnthn: there are no "incompatible" pieces of chalk.
there are no blackboards that can't be cleaned.
the proverbial tabula rasa must've been a blackboard :P 13:37
soh_cah_toa masak: are there any docs or maybe a blog that describe the -> ? i sorta understand your example but not the grep() one 13:39
masak soh_cah_toa: well, S06 probably mentions it. 13:41
soh_cah_toa looks
masak soh_cah_toa: the grep() example looks odd to me too :)
moritz soh_cah_toa: -> $x { ... } is nearly the same as sub ($x) { ... } 13:42
masak soh_cah_toa: it seems to grep out the method names that self can do from some list or other.
moritz ie the -> introduces a signature, and the whole thing is a "block", which is something like a small subroutine
jnthn If it helps, read -> as "lambda" 13:43
soh_cah_toa what's the advantage over just doing sub ($x) { }?
jnthn soh_cah_toa: It's transparent to return, plus a bit shorter. 13:44
It can also go anywhere a block can
moritz there are other differences
jnthn Which isn't true of a sub.
moritz for example only subs have separate $/ and $! variables
jnthn That also.
moritz so those in blocks are shared with the outer sub
soh_cah_toa what do you mean "transparent to return"? 13:45
masak soh_cah_toa: if you do 'return' in a -> {}, that block doesn't see the return.
soh_cah_toa: instead, the surrounding sub does.
moritz consider 13:46
sub f() { for @a -> $x { return if $x eq 3 } }
masak that's another point to consider, that the {} in a for loop are just "ordinary blocks", that can also accept a -> and parameters. 13:47
that's one of my absolute favorite unifications of Perl 6.
also, if statements. <3 13:48
moritz if computation() -> $x { say "computation succeeded, $x was the return value" }
nom: say (:5<x>).key 13:49
p6eval nom: OUTPUT«Invalid character 'x' in number literal␤current instr.: 'nqp;Perl6;Actions;_block1835' pc 31584 (src/gen/perl6-actions.pir:10597) (src/Perl6/Actions.pm:3669)␤»
13:49 drbean left
moritz nom: say (:a<x>).key 13:49
p6eval nom: OUTPUT«a␤»
moritz nom: say (:a<x>).value
p6eval nom: OUTPUT«x␤»
soh_cah_toa hmm... 13:51
i don't see what's so special about the sub f() example
moritz it just demonstrates that it makes sense for return() to be tied to subs intead of blocks 13:52
soh_cah_toa ok 13:53
and how does `if computation() -> $x` differ from `if $s = computation()` though?
masak scoping. 13:54
$x is bound to the insides of the if block. $s is visible outside it.
soh_cah_toa ah, yes. right
masak in a very real sense, $x doesn't "exist" unless the condition is true.
soh_cah_toa oh interesting 13:55
moritz thinks he could use that in Str.match
masak Ruby's syntax { |vars_here| ... } is more "honest" in the sense that it's clearer how the parameters are scoped.
soh_cah_toa right 13:56
alright, i think i understand a little
masak soh_cah_toa++ # level up :)
soh_cah_toa ah yes. the "pointy blocks" section in s06 does explain it. i always thought it was just a new syntax for the `for` loop 13:58
masak right. the nice thing is how general it is. 13:59
it's almost like you could take the -> {} part of a for loop and walk away with it :D
jnthn Well, we kinda do at compile time :) 14:00
It just becomes an argument to map.
masak yeah :)
"This Just In: Perl 6 Eliminates The For Loop"
soh_cah_toa yeah, ok
i kinda like that idea. cool 14:01
masak perl6: say [+]($_ when $_ %% 3|5 for ^1000) 14:02
p6eval rakudo 922500: OUTPUT«166838␤»
..niecza v8-4-g2c56dcb: OUTPUT«===SORRY!===␤␤Unable to parse argument list at /tmp/7lym7ryYCc line 1:␤------> say [+](⏏$_ when $_ %% 3|5 for ^1000)␤Couldn't find final ')'; gave up at /tmp/7lym7ryYCc line 1:␤------> say [+]($_ ⏏when $_ %…
..pugs: OUTPUT«*** ␤ Unexpected "when"␤ expecting operator, ":" or ")"␤ at /tmp/6X5Se45YF9 line 1, column 12␤»
masak niecza: say [+] ($_ if $_ %% 3|5 for ^1000) 14:03
p6eval niecza v8-4-g2c56dcb: OUTPUT«0␤»
masak sorear: ^^
moritz rakudo: ^1000 ==> grep 3|6 ==> [+] ==> say
p6eval rakudo 922500: OUTPUT«===SORRY!===␤Confused at line 22, near "^1000 ==> "␤»
masak that's seriously pretty. 14:07
masak thinks [==>] and his head asplodes
jnthn rakudo: ^1000 ==> grep 3|6 ==> reduce &infix:<+> ==> say 14:08
p6eval rakudo 922500: OUTPUT«any(3, 6)␤»
jnthn er :)
masak rakudo: ^1000 ==> grep * %% 3|5 ==> reduce &infix:<+> ==> say
p6eval rakudo 922500: OUTPUT«(timeout)»
masak aww
14:08 wamba joined
jnthn nom: ^1000 ==> grep * %% 3|5 ==> reduce &infix:<+> ==> say 14:09
p6eval nom: OUTPUT«166838␤»
masak '^1000 ==> grep { so $_ %% 3|5 } ==> reduce &infix:<+> ==> say' works locally. 14:10
nom: ^1000 ==> grep { so $_ %% 3|5 } ==> reduce &infix:<+> ==> say
p6eval nom: OUTPUT«499500␤»
masak hm, but that's the wrong answer :)
14:11 Jackneill left
masak ah. there is some precedence problem in master. 14:12
rakudo: ^1000 ==> grep * %% (3|5) ==> reduce &infix:<+> ==> say 14:13
p6eval rakudo 922500: OUTPUT«(timeout)»
masak locally, 233168
(!)
jnthn hands masak some parens :)
masak rakudo: ^1000 ==> grep(* %% (3|5)) ==> reduce &infix:<+> ==> say 14:15
p6eval rakudo 922500: OUTPUT«(timeout)»
masak still 233168. 14:16
jnthn masak: Does nom get it right? 14:17
masak nom: ^1000 ==> grep(* %% (3|5)) ==> reduce &infix:<+> ==> say 14:20
p6eval nom: OUTPUT«(timeout)»
masak gives the same: 233168 14:22
hey, maybe that *is* the right answer... :) 14:23
rakudo: my $s; for ^1000 { if $_ %% 3 || $_ %% 5 { $s += $_ } }; say $s
p6eval rakudo 922500: OUTPUT«233168␤»
masak oh what do you know. :)
flussence anyone know what commit the nom branch started at? 14:24
flussence wants to make a new docs/spectest-progress.csv
masak flussence: bab8369282c1f58302e76d2101c20b9a449e64f9 14:25
that's the first commit in the nom branch, from Feb 8 2011.
dalek kudo/nom: efb679b | jonathan++ | src/core/Any.pm:
Fix infix:<max> (flussence++).
14:27
kudo/nom: 6846753 | jonathan++ | / (3 files):
Sketch out a StaticLexPad class.
kudo/nom: 5acf3d6 | jonathan++ | src/pmc/perl6lexinfo.pmc:
Add a way to associate a Perl 6 StaticLexPad object with the Perl6LexInfo (eventually, a chunk of Perl6LexInfo will go away, as we move the data it holds into StaticLexPad).
kudo/nom: 33755a6 | jonathan++ | src/Perl6/SymbolTable.pm:
Sketch out static lexpad creation and block association; untested as of yet.
kudo/nom: cf45eac | jonathan++ | src/core/Any.pm:
Turns out Any.max was missing; add it.
jnthn masak: heh, the document added int hat commit has muchly come true :)
masak \o/
masak loves it when a plan comes together 14:28
jnthn hits an amusing circularity 14:33
The setting imports a bunch of stuff from Perl6::Metamodel::BOOTSTRAP. One of them is now StaticLexPad. Apart from we need that to create a static lex pad in order to install the stuff we're importing. :) 14:34
14:35 birdwindupbird joined
tadzik well, that's like writing a Perl 6 compiler in Perl 6 :) 14:36
masak well, duh :)
oh come on, no-one would ever attempt THAT.
:P
masak loves how bootstrapping never ceases to make his brain revolt a little 14:37
14:39 Mowah joined
jnthn hopes a two-pass approach is enough to saw this one. 14:43
moritz Ronja now tries to reach for the keyboard... don't be surprised if you read garbage from me occasionally 14:46
I mean, more often than usual :-)
masak Ronja++ 14:48
moritz she level-ups quiet often these days :-)
tadzik :) 14:49
Ronja needs karma :)
phenny: pl en "karma"?
phenny tadzik: "karma" (pl to en, translate.google.com)
tadzik it means "food" in Polish :) 14:50
moritz she sure needs both :-)
tadzik Ronja++
masak phenny: en pl "food"? 14:51
phenny masak: The en to pl translation failed, sorry!
masak phenny: is it just me, or are you getting worse at translating?
tadzik "food" was a second guess of google translate 14:52
Dog Food was the next one :)
it is more widely used as an animal kind of food, yes 14:53
masak .oO( you put your karma in your dogma? )
tadzik giggles 14:55
colomon How's the module hacking coming? 14:56
14:58 Tedd1 joined
tadzik is it this weekend? 14:58
masak supposed to be. 14:59
tadzik /o\
I thought this was going to be something just before the YAPC 15:00
masak we could always do it twice. :) 15:01
or simply save it till next weekend.
something tells me that there's enough to do for two weekends...
jnthn At the very least, it would be worth taking some of the key modules this weekend and seeing why they don't compile and/or work. 15:02
And putting those things into nommap.
moritz it's really, really hard to do that with a compiler tha can't be installed
tadzik I suppose I can write a Pies implementation that would use the not-installed perl6 15:03
then possibly we could automate the process, as emmentaller did
moritz nonono 15:04
colomon moritz: can't be installed in the sense that it cannot be run from any other directory?
moritz making nom installable is the real fix
masak +1 15:05
tadzik I should still have the patch that made nom run when instlaled somewhere
it broke running from within the build dir though
colomon +1
actually, +100 15:06
15:07 Mowah left 15:09 birdwindupbird left
moritz just tried it - nom's perl6 binary can't be run outside the build dir 15:10
I've tried to fix that in nom-install, but got stuck 15:11
colomon anyone know how to set @path in niecza?
jnthn moritz: Is there a branch with the latest effort on that? 15:14
moritz jnthn: yes. nom-install. 15:15
jnthn moritz: OK. I'm a bit consumed with the static lexpad stuff at the moment, but can try and look at that later.
15:18 xinming_ joined 15:19 Kivutarrr left 15:21 xinming left
colomon Hmmm: my @bin := $x, @xs Z?^ @bin; 15:28
doesn't seem to actually work in master 15:29
moritz colomon: regarding your recent changes in roast: it would be more readable if you commit the generated files in a separate commit 15:30
colomon moritz: good point
15:32 MayDaniel left
flussence argh, why doesn't `git rev-list bab836928..HEAD` DWIM? 15:32
15:33 ash__ left
moritz which part of it dosn't DWYW? 15:33
soh_cah_toa <moritz> Eclesia: are these contracts more declarative (like types), or can they be arbitrary runnable code? 15:34
<E
flussence it doesn't start at commit bab836928 or anything even close
soh_cah_toa what the heck? copy/paste error i guess
flussence oh, maybe it does
I want a $start..$end, but it's giving me $start ^.. $end :( 15:35
moritz so you must write it as bab836928^..HEAD :-) 15:36
flussence doesn't seem to work :( 15:37
pmichaud good morning, #perl6 15:38
flussence maybe I'm just blind...
jnthn morning, pmichaud :)
dalek kudo/nom: 36d0329 | jonathan++ | src/Perl6/SymbolTable.pm:
Break import into a two-pass process to hopefully pre-empt a circularity problem.
kudo/nom: 1e69c1e | jonathan++ | src/Perl6/Grammar.pm:
A little more circularity sawing in prep for the static lexpads refactor.
moritz flussence: works here 15:40
flussence: note that the commit mentioned first is at the bottom
15:40 tokuhirom left
flussence yeah, but it's not. 15:40
I found a workaround anyway: bab836928~1..HEAD seems to show it
15:40 tokuhirom joined
moritz $ git rev-list bab836928^..HEAD|tail -n 1 15:40
bab8369282c1f58302e76d2101c20b9a449e64f9
pmichaud commit 8f3f2cb looks wrongish 15:41
flussence oh, it probably didn't work before because I was on the wrong branch
pmichaud I don't think we can reliably grab $PROGRAM_NAME from the IGLOBALS ARGV LIST 15:42
gist.github.com/1115659 15:45
15:45 tokuhirom left 15:46 jimmy1980 left
masak niecza: my ($a, $b) = 42, "OH HAI"; .say for «foo $a $b» 15:47
p6eval niecza v8-4-g2c56dcb: OUTPUT«foo␤42␤OH␤HAI␤»
15:47 jimmy1980 joined
masak niecza++ 15:47
niecza: my ($a, $b) = 42, "OH HAI"; .say for «foo$a bar$b» 15:48
p6eval niecza v8-4-g2c56dcb: OUTPUT«foo42␤barOH␤HAI␤»
15:48 molaf joined
dalek atures: 0fc8137 | masak++ | features.json:
[features.json] another one: interpolating word list
15:51
15:52 Jackneill joined, Jackneill left, Jackneill joined
flussence well, here's attempt 1: gist.github.com/1115667 15:52
(it doesn't seem to work yet)
mberends has just used Debian Testing to install Rakudo 2011.04 and Parrot 3.3.0 in less than a minute o/ 15:53
moritz pmichaud: agreed, it needs to work differently 15:57
presumably src/main.nqp or Perl6::Compiler must capture the program name somehow 15:59
shinobicl hi 16:01
sjn hi, shinobicl
shinobicl i'm still making my workdaycalendar class, but i would like some "ideas" about the implementation...
pastebin.com/m0pNn8qL 16:02
moritz shinobicl: from the description it seems you're only dealing with days, so Date might be a simpler base than DateTime 16:03
shinobicl ok, noted :) 16:04
sjn well, try implementing it. spec'ing the API is nice, but you should really try to _use_ it to figure out if it's any good. :)
sjn assumes that there's no code :-P 16:05
shinobicl i wonder if a current_day attribute would be nice.. sou you could do $calendar++ and get the next workday from the current_day
yes, i have some code
but i'm a litle shy :D
moritz shinobicl: well, you could have a Calendar and a Day object
shinobicl thse functions are implemented and tested
moritz so you can do $day++, not $calendar++
sjn shinobicl: ah :) 16:06
sjn prefers reading code before any documentation, especially when it comes to Perl 6
shinobicl ok 16:07
give me a sec
github.com/shinobi/TaskScheduler
sjn Perl 6 is so crazy easy to read, I'm beginning to doubt the usefulness of API documentation o_O
shinobicl workday class.. mmm, But the calendar is the central part of all this. Maybe the calendar can generate Workday objects :). Those Workdays would still be bound to their parent Calendar 16:09
sjn shinobicl: are you open for crazy suggestions, or does this code have to "stay nice" (no experimenting)? :) 16:11
16:12 Mowah joined
shinobicl i mostly want new questions to ask to the calendar :) (lines 63 - 65 in the README) 16:12
and crazy suggestions too :) 16:13
sjn well, my first thought was that move_by could a multi method
shinobicl but you can only move by an integer ammount 16:14
sjn hm 16:15
shinobicl that amount could be days or weeks or months but always integers
sjn multi move_by (Second $seconds) {}
multi move_by (Minute $minutes) { ... }
16:16 jaldhar left
sjn multi move_by (Hour $hours) { ... } 16:16
16:16 jaldhar joined
sjn us just throwing out some ideas here 16:16
shinobicl well... moving by anything less than a day of out of scope, i think.
one thing that worries me is, for example 16:17
16:17 elledge joined
sjn I see that you accept seconds as input 16:17
but you don't claim in the code that you can only move_by a minimum of 3600 seconds 16:18
3600*24
shinobicl oh, is the only way i know y can calculate the nexy day. COnverting date time to Instant and adding (or substracting) 3600*24 to that instant 16:19
sjn shinobicl: are you trying to recreate another existing API, or are you free to change the API as you want?
16:20 elledge left
shinobicl i want to create a TaskScheduler than can be told "Run this task the 1st monday of the month ar certain time". This "Weekday calendar" is one part of that. So, as long as this Weekday calendar can support this, i have no problem changing anything 16:21
so, is free-to-change
right now, i want to do a function that can answer "How many workdays are until 2011-12-12" 16:23
and another that can answer "how many workdays until 3 months from $date"
in the latter, i have a problem, on how much days are 3 months. the workday closer to 90 natural days from now? or (as for today) should i try to reach October 28? 16:24
the question is a valid one... but i don't know which path to take to reach the "3 months from now" 16:25
sjn thinks shinobicl should try to model the basics first (Second, Minute, Hour, Day, Week, Weekday, Weekend, Month, Year) 16:26
when you have described the basics, you can add the custom stuff (e.g. LeapYear) 16:27
and when you have that ready, figuring out how many days a given month has, should be trivial (well, you should make that trivial, at least ;)
shinobicl rakudo: say DateTime.^methods>>.name.perl
p6eval rakudo 922500: OUTPUT«("new", "check-time", "now", "clone", "clone-without-validating", "Instant", "posix", "offset", "truncated-to", "whole-second", "in-timezone", "utc", "local", "Date", "Str", "perl", "is-leap-year", "days-in-month", "daycount-from-ymd", "ymd-from-daycount", "get-day…
shinobicl DateTime has lots of that stuff done 16:28
sjn great
shinobicl rakudo: say Date.^methods>>.name.perl
p6eval rakudo 922500: OUTPUT«("get-daycount", "new", "new-from-daycount", "today", "truncated-to", "clone", "succ", "pred", "Str", "perl", "is-leap-year", "days-in-month", "daycount-from-ymd", "ymd-from-daycount", "day-of-month", "day-of-week", "week", "week-year", "week-number", "weekday-of-m…
sjn you're not using those, are you? 16:29
shinobicl More than implementing all that stuff, is a matter on how to use it. Seconds, Minuts, Hours, Weeks... all that is done already by perl6 :)
haven't needed to use them, yet
except for day-of-week
sjn well, that's because you're counting Integers, and calling them "seconds" 16:30
seems like you're not very keen on using other peoples code, perhaps? </wild-guess> :)
(sorry, I'm assuming a lot today :-P) 16:31
shinobicl haha ok, no problem.... but why seconds... adding seconds is just a workaround. I just want to move by days. And skipping the non-working days when doing so 16:32
gfldex DateTime does not provice much to work with dates, it's a (fairly wide) bridge between ISO time stamps and seconds since the unix epoch
shinobicl brb soon! 16:33
sjn shinobicl: I'm talking about seconds because you're already using them in your methods :-P
well, claiming to use them :)
gfldex if you want to express 'DateTime(now) + 3 days' you have to build a new DateTime object 16:34
sjn make a WorkDay class :) 16:35
and when you add any day to that, the result should be another WorkDay? :)
shinobicl that's another thing. A workday can not exist without a calendar. So, maybe i should use the workdaycalendar as a workday generator. But, would be that useful? I already have a funtion that returns a datetime after adding or substracting a certaing ammount of workdays 16:36
sjn isn't entirely sure how to do that though. can operator overloading check the Types of it's operands?
dalek kudo/nom: 7e9102f | jonathan++ | src/Perl6/SymbolTable.pm:
Add new static lexpad handling in SymbolTable alongside the old, to start migrating from one to the other.
kudo/nom: 8489bbb | jonathan++ | src/pmc/perl6lexpad.pmc:
Start to prepare Perl6LexPad for using the new StaticLexPad for static lexical values and configuration, not Perl6LexInfo.
kudo/nom: 4189ea6 | jonathan++ | src/pmc/perl6lex (2 files):
Switch Perl6LexPad over to new static lexicals model. Seems to work.
shinobicl sjn: i think yes...
kudo/nom: df5a10b | jonathan++ | src/pmc/perl6lexinfo.pmc:
Remove some now-unused properties in Perl6LexInfo.
gfldex DateTime got a .succ method 16:37
you could subclass from DateTime and skip in the .succ method if you would return a day that's not a workday
sjn shinobicl: If I were you, I'd start at the bottom, with the basics (WorkDay is a special kind Role for a Day, perhaps?) and then make a Calendar of that. 16:38
shinobicl rakudo: my $D = DateTime.new(year=>2012,month=>12,day=>12); my $D2 = $D.succ; say $D.perl;
sjn forget the Calendar for a while, until the basics are clear
p6eval rakudo 922500: OUTPUT«Method 'succ' not found for invocant of class 'DateTime'␤ in main program body at line 22:/tmp/18KZwLvSxr␤»
gfldex then you can feed any function with workdays that would like to have DateTime
shinobicl but without the calendar, there are not workdays. 16:39
sjn no, a without a _Day_ there's no _WorkDay_
gfldex ohh, the .succ method is in Date, not DateTime
shinobicl rakudo: my $D = Date.new(year=>2012,month=>12,day=>12); my $D2 = $D.succ; say $D.perl; 16:40
p6eval rakudo 922500: OUTPUT«Date.new(2012, 12, 12)␤»
shinobicl rakudo: my $D = Date.new(year=>2012,month=>12,day=>12); my $D2 = $D.succ; say $D2.perl;
p6eval rakudo 922500: OUTPUT«Date.new(2012, 12, 13)␤»
shinobicl :D
sjn you absolutely must have a concept "Day" to be able to claim that there's something called "WorkDay"
shinobicl sjn: is called "Date" :)
sjn the Calendar is just a nice system on top of the days :)
to keep track of them 16:41
shinobicl mmm
gfldex sjn: i do not agree on that
a calendar is a system that sits ontop of _irregular_ planet movement
sjn remember, those cavemen 30000 years ago thought about "Days" waaay before they thought about "Caledars" :)
gfldex it's more definition that anything else
sjn Calendars* 16:42
gfldex most Calendars invanted over the last 30000 are not used anymore
sjn gfldex: sure, the Calendar concept has changed a lot through history
gfldex: you're missing my point :-P 16:43
gfldex: my point is that a Calendar is one (of many, asy you imply) way of keeping track of days and months and years and such
but whatever the Calendar is today, there's one thing that won't change: It consists out of Days 16:44
anyhoo, maybe this is a bit besides shinobicl's needs :-P 16:45
shinobicl yes, i need to keep track of workdays. My TaskScheduler is intended to be for the "enterprise" :) 16:46
but i like the concept of WorkDay (or WorkDate?)
i'll see how it fits in my idea of the calendar
gfldex it might very well be that a calendar that is consisting of days is over engeneering for a taskscheduler 16:50
for the taskscheduler The Nextish Thing should be enough
shinobicl all depend on what is needed to ask certain questions.
im my taskscheduler, i shluld be able to say "run this task on the 1st monday of Jan, Feb and March" and have another secondary date to run. That might be "3 days from the previous try" 16:51
all this expresses in a xml 16:52
expressed*
16:53 aindilis joined
shinobicl well... going back to work, thanks for the feedback moritz, sjn and gfldex! :) 16:53
sjn shinobicl: np :) 17:00
17:02 soh_cah_toa left
dalek kudo/nom: d2676e8 | jonathan++ | src/ (2 files):
Stop generating a bunch of code that we no longer need after the static lexpad refactor.
17:04
kudo/nom: 4655200 | jonathan++ | src/Perl6/SymbolTable.pm:
Now that we build the static lexpad up as we compile, we don't need to do re-install stuff in it at fixup time. This should be a modest win for run-immediately mode (not least because it results in a smaller PAST tree and less to do).
djanatyn *yawn* 17:07
good morning!
jnthn morning djanatyn 17:08
masak djanatyn! \o/ 17:09
djanatyn masak: Hey!
I was reading about you last night!
I saw lots of perl 6 modules that I was checking out, and you were the face on the github page
masak djanatyn: I was reading things you said in the backlog this morning! :) 17:10
djanatyn: I like you already :)
djanatyn oh, cool :D
well, I like myself too
but you seem pretty cool as well.
masak steepest descent into the Perl 6 community in quite some time, I might say.
congrats.
djanatyn Really?
masak yup.
djanatyn I would thihk that people would be diving into the perl 6 community all the time.
masak they do, but they usually nose around the edges of it for a while. 17:11
sometimes for years.
djanatyn the people at the IRC channel I hang out like to say that Perl 6 will be the best language ever...in ten years.
masak depends on what you mean by "be".
to me, it already is ;) 17:12
djanatyn I dunno.
I was kinda shocked at how slow hello world ran ;)
masak that's not the language's fault, though.
(and yes, that kind of reasoning sounds really phony until you've been around a while.) :P
djanatyn: if you want a faster Perl 6 implementation, I suggest looking at Niecza. 17:13
djanatyn Yeah, a lot of people suggested that.
Are perl 6 modules currently only usable on a specific implementation? 17:14
like, the HTML::Template module that I saw on github.
17:14 birdwindupbird joined
masak to a first approximation, yes. 17:14
djanatyn Will that only work on parrot, or niecza too?
masak but we're sort of building ourselves towards implementation independence.
for smaller scripts, it's trivially true. 17:15
for modules, it's harder.
dalek kudo/nom: 28424c4 | jonathan++ | src/Perl6/SymbolTable.pm:
Fix up usage of variables in BEGIN; should deal with the issue tadzik++ ran into recently.
17:16
masak partly due to features being differently distributed between the impls; partly because of lowlevel "cheats" available on one VM and not another.
jnthn tadzik: ^^ Nech sa páči. :-)
masak guesses "páči" is a sound loan 17:17
JimmyZ ah... ./perl6 --setting=NULL --target=pir --output=src/gen/CORE.setting.pir src/gen/CORE.setting
tadzik oh, cool!
JimmyZ Segmentation fault
tadzik Just when I finished winowódka :)
jnthn masak: literally, "let it please"
masak oh!
17:17 jack-ji joined
tadzik not as in "patrzy? 17:17
masak phenny: sk en "Nech sa páči."? 17:18
tadzik "
phenny masak: "Here you are." (sk to en, translate.google.com)
tadzik o
I mean, oh
JimmyZ Segmenation fault on nom
jnthn masak: Yeah, that's the main usage of it.
masak jnthn: I thought it had to do with "patch". /me blushes
jnthn masak: Often said by nice waitress who gives you your noms.
masak: Hey! I don't pun *all* the time! :D
masak: Though it...woulda been a good one. :P 17:19
masak now I am disappoint. :P
phenny: pl en "patrzy"?
phenny masak: "looks" (pl to en, translate.google.com)
tadzik that looked like "ah, see for yourself" 17:20
masak phenny: sk en "Nech"?
phenny masak: "May" (sk to en, translate.google.com)
masak ah, as in "let".
jnthn Right.
OK, there's another slightly delicate last step in the static lexpad refactor, but I need a break first. :) 17:22
masak djanatyn: so, what are your plans now? are you going to write something, or are you still in study-phase? 17:23
djanatyn Well, probably the biggest thing that I've written in perl 5 was a kind of blog engine.
17:23 alfplayer joined
pmichaud blog engine! 17:23
masak :)
djanatyn: my blog engine is in Perl 6 :) 17:24
djanatyn It took text files following a really simple syntax (title in the first line, tags in the second, etc.) and turned those into a fully working static website.
tadzik I wrote mine in Dancer once, it had like 30 lines or so :)
djanatyn I want to write it again, but this time in Perl 6 :D
tadzik mine used mysql
djanatyn tadzik: The only thing is, I want mine to be completely static.
Like the one I implemented in Perl 5.
tadzik I see 17:25
djanatyn I used the Template::Toolkit library for the perl 5 version.
I'll use HTML::Template for the perl 6 version :D
masak mine is completely static. 17:26
also, it's only 250 lines long.
djanatyn Nice :D
mine is...well, let me check.
masak github.com/masak/psyde/blob/master/psyde
djanatyn I named it blackbox, but then remembered that was the name of a window manager >_>
tadzik yes :) 17:27
djanatyn github.com/djanatyn/blackbox
masak name it blogbox :P
djanatyn the actual perl script is 90 lines, 74 sloc
flussence "soapbox"
djanatyn and...the template is 22 sloc
masak nice.
djanatyn and the css file is 20 sloc :) 17:28
masak mine's probably bigger :)
djanatyn It's reaaaaaaaally kinda lame, though.
It only has support for one tag for each entry :D
masak djanatyn: I think you're doing the right thing writing something in Perl 6, be it a blog engine or something else. that's the way to learn a language.
djanatyn That's the main way I learned perl 6. 17:29
masak oh, mine doesn't do tags at all.
djanatyn I was...well, in a weird state of affairs last month. I spent a lot of the time just reading "Programming Perl" and not really writing anything.
flussence (ok, I got this script working. 57 revisions done, about 1000 to go...)
djanatyn So, then I just sat down and wrote a bunch of stuff later.
masak :) 17:30
djanatyn: it took me a long time to get to really start writing Perl 6. something like 4 or 5 years.
djanatyn 4 or 5 years? 17:31
pmichaud it's taken me 4 or 5 years to write perl 6 as well. :-)
tadzik years since?
djanatyn Well, I'm guessing it wasn't as easy to write perl 6 back then compared to how it is now.
tadzik writing was always easy. Now, executing... 17:32
djanatyn And I wasn't really writing anything useful when I was 11 or 12 anyway :P
pmichaud Me either. I didn't start writing useful stuff until I was 15. :P
djanatyn Yeah, that's about the time that I started writing stuff.
tadzik hmm
masak tadzik: I consider my actual entry into the community to be ~2008. but I was lurking and sniffing around already in 2005.
tadzik now, the definition of 'useful stuff' :)
djanatyn github.com/djanatyn/roguelike/blob...ter/main.c <-- this is the first cool thing I did :SD 17:33
pmichaud tadzik: Yes, there are some people who might claim I've yet to write anything useful :)
djanatyn I started writing a roguelike.
masak ooh
tadzik pmichaud: I'm just wondering what was the first useful thing I did write :)
djanatyn You could walk around, bump into stuff, go to different levels, and collect gold that appeared randomly around the map
17:33 alfplayer left
tadzik I remember a paintbrush-like program written in middle school, but I didn'd allow you to save images 17:33
djanatyn except sometimes the gold would cause segfaults, and once you went to a different level, you couldn't go back ;)
17:34 Trashlord left
pmichaud Other than the occasional game, the first useful set of things I wrote were accounting packages for my dad's business. :) 17:34
converted a 4-day process into a 4-hour one :)
17:34 JimmyZ left
colomon :) 17:34
masak nice.
pmichaud: which language?
pmichaud BASIC 17:35
17:35 Trashlord joined
colomon I wrote an amortization program for my dad's office. BASIC, running on a CP/M system with 8 inch floppies. :) 17:35
tadzik hmm 17:37
pmichaud My dad didn't want me to have a computer... he thought it would end up in the closet and never amount to anything useful. :-P
colomon ah, my parents were very supportive. 17:38
djanatyn My parents make it difficult for me to program :P
colomon even got a Commodore 64 for us at the original price.
pmichaud well, he completely changed his tune once we had the accounting systems in place 17:39
djanatyn I bet the only reason they let me write perl is because they saw me blessing some object :D
tadzik mine set a rule for "no computer in the work week" The effect was that I rushed like crazy to do computer on the weekends, and I still feel the subconcious need to sit in front of the computer anytime possible :/
djanatyn tadzik: my parents had the same rule
until I got a laptop and had to do homework with it :D
tadzik :) 17:40
pmichaud yeah, Perl is one of the few languages where blessings outnumber the curses. Unless you consider the heavily punctuated syntax as a form of swearing. :)
masak I don't even notice the sigils anymore. nowadays I just see blonde, brunette, redhead...
pmichaud wonders about that mapping. 17:41
17:41 jack-ji left
flussence I didn't even have a PC until about 10 years ago... good thing I'm a quick learner I suppose. 17:41
masak flussence: oh, you finished learning already? :P
flussence nope, still catching up :) 17:42
tadzik oh, the computer came early in here :) I remember drawing in paintbrush when being <=6 or so
my sister's one. My sister's 18 years older than me :) 17:43
17:44 clintongormley joined
tadzik jnthn: still segfaults for me :/ 17:45
17:46 clintongormley left
tadzik I'll paste a patch 17:46
jnthn: gist.github.com/1115781 17:48
the segfaulting code in a comment
patch is against the current podparser branch 17:49
dalek Heuristic branch merge: pushed 23 commits to rakudo/podparser by tadzik 17:50
jnthn nom: sub foo { }; &foo does role { method WHY() { 'abc' } }; say &foo.WHY 17:51
p6eval nom: OUTPUT«Rebuild in progress␤»
jnthn That bit works here 17:53
hm
tadzik 0x00007ffff3e31000 in Rakudo_cont_decontainerize () from dynext/perl6_ops.so 17:54
sorear good * #perl6 17:55
tadzik hello sorear 17:56
17:56 kaare_ joined
masak sorear! \o/ 17:57
sorear masak: my C %h declares a hash with Str keys and C values 17:59
masak: niecza's behavior on those tests was correct
masak oh! 18:00
my %h{C} declares a hash with C keys?
hm, seems so. 18:01
niecza: class C { has $.x }; my %h{C}; %h{ C.new(:x(42)) } = "OH HAI"; say %h.perl
p6eval niecza v8-4-g2c56dcb: OUTPUT«===SORRY!===␤␤Postconstraints, and shapes on variable declarators NYI at /tmp/9eqfZWwSKB line 1:␤------> class C { has $.x }; my %h{C}⏏; %h{ C.new(:x(42)) } = "OH HAI"; say %h␤␤Unhandled exception: Check failed␤␤ at /hom…
sorear masak: what are you pointing me to 5h-ago? 18:02
masak the fact that it gave 0 when Rakudo didn't?
masak checks
yes, I think that should give a non-zero sum. 18:03
sorear colomon: what do you mean by '@path'?
colomon sorear: Unhandled exception: Unable to locate module ABC::Header in @path 18:04
sorear o/ djanatyn
colomon I was just mucking about and trying to run the ABC module on niecza.
18:05 Mowah left
colomon should be working on $work instead, and then working on trig, but I got curious. ;) 18:05
sorear ah. -Idir 18:07
colomon Is that an upper case i there?
sorear yes
colomon groovy
sorear++
sorear like the cc -I option
colomon nods
18:10 envi left
djanatyn hey sorear 18:11
sorear hi djanatyn 18:13
djanatyn I'll be right back, gotta do some things first. 18:14
Then I want to get started on that Perl 6 static website generator.
tadzik you may want to look at supernovus' whitenoise repo, maybe
github.com/supernovus/whitenoise/
masak huh. whitenoise and blackbox. 18:16
obviously I should've named my blog software "greygoblin" :)
flussence (on closer inspection, all this script's done is miscompile rakudo 100 times in a row...) 18:22
18:22 pernatiy_ is now known as pernatiy
colomon sorear: any quick guess why the line if %key_signature.exists($pitch<basenote>.uc) would fail? 18:27
Missing block at /Users/colomon/tools/ABC/lib/ABC/Grammar.pm line 144:
------> ey_signature.exists($pitch<basenote>.uc)⏏;
moritz colomon: niezca uses %h{$key}:exists 18:28
masak sorear: I want to use Niecza to parse Perl 6 code and operate its AST. would you recommend (1) writing an ordinary Perl 6 script that somehow reaches into Niecza and calls it, or (2) starting from Niecza itself and picking away compilation steps until I have what I need?
colomon moritz: !!!!
masak easier to see why when you realize that it's STD-based. 18:30
whereas Rakudo is more "heavily STD-inspired".
sorear niecza: my %key_signature; my $pitch; %key_signature.exists($pitch<basenote>.uc) 18:37
p6eval niecza v8-4-g2c56dcb: OUTPUT«Unhandled exception: Unable to resolve method uc in class Any␤ at /tmp/vdiMeJOyuA line 1 (MAIN mainline @ 1) ␤ at /home/p6eval/niecza/lib/CORE.setting line 1933 (CORE C906_ANON @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 1934 (CORE module-CORE @ 5…
moritz runtime error
whereas your error was a compile-time error
sorear masak: hmm. what kind of AST do you need?
colomon: the problem is the end-of-line } 18:38
colomon: lines 143-144 are parsed as $a ~= %b{$c}; if (%b.exists($c)); 18:39
colomon sorear: oh!
sorear maybe an unspace would help
colomon rewriting to if cond { block } looks like it works 18:42
Hmmm, next issue is 18:44
Two definitions found for symbol ::GLOBAL::ABC::Duration::&duration-from-parse
first at ??? line ???
second at ??? line ??? at /Users/colomon/tools/ABC/lib/ABC/Duration.pm line 10:
masak I think any kind would be a really good start.
sorear: for a couple years I've been looking for a realiable way to transform Perl 6 source to AST.
18:47 molaf left 18:48 wamba left
moritz masak: what about viv? 18:49
masak: it seems to be as reliable as STD itself
masak yes, mebbe. 18:54
trick is to get the text output into Perl 6 somehow. 18:55
is it still YAML 1.1?
moritz it's called parsing
masak moritz: yes, I've heard of it...
moritz masak: it might be easier to patch viv to produce something that's easier to parse 18:56
masak: something like JSYNC
masak mmm.
sorear masak: to get a useful ASTification of files, you'll need a large chunk of niecza 19:02
mainly because of 'use'
masak ah.
sorear niecza's grammar alone can parse CORE.setting, but to parse *other* files, you need to reload the symbols
and there's messy integration between the grammar, the actions, and the metamodel in order to make stuff like pi + 2 work 19:03
the grammar has to call back into the compiler to find out that "pi" is a constant and doesn't take arguments
masak *nod* 19:04
dalek ecza: 0cd0f42 | sorear++ | / (3 files):
Name unification part 1, suboids use process_name
sorear to answer your question, I'd start by copying src/niecza and src/NieczaCompiler.pm6, and try to hack NieczaCompiler.compile to add a "just return the parsed unit 19:07
" option
masak thanks. I'll try that. 19:09
moritz niecza: constant $x = 3 + 4; say $x 19:13
p6eval niecza v8-4-g2c56dcb: OUTPUT«7␤»
moritz niecza: constant $x = 3 + 4; say $x; $x = 9
p6eval niecza v8-4-g2c56dcb: OUTPUT«7␤Unhandled exception: assigning to readonly value␤ at /tmp/t23WRGUb8e line 1 (MAIN mainline @ 1) ␤ at /home/p6eval/niecza/lib/CORE.setting line 1933 (CORE C906_ANON @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 1934 (CORE module-CORE @ 56) ␤ at /h…
moritz niecza: constant $x = 3 + 4; say $x; $x := 9 19:14
p6eval niecza v8-4-g2c56dcb: OUTPUT«7␤»
moritz niecza: constant $x = 3 + 4; say $x; $x := 9; say $x
p6eval niecza v8-4-g2c56dcb: OUTPUT«7␤9␤»
moritz that should be forbidden, no?
sorear probably 19:15
moritz submits nieczabug 19:16
masak moritz++
19:17 Chillance left
moritz RFC: I'd like to reduce the size of README, and move most of the installation instructions to a separate INSTALL file 19:17
(in rakudo, that is)
background is that in binary distributions that part is pretty much useless 19:18
masak +1
moritz I'll go ahead if I get another +1 from jnthn|pmichaud 19:19
sorear Illegal redeclaration of symbol 'self' (see line 93) # aiiiiieeee 19:20
dalek ast: 993a659 | moritz++ | S03-operators/assign.t:
unfudge max= tests for rakudo, now that infix:<max> propelry works again
19:22
19:28 birdwindupbird left
jnthn Now it shoots out the answer! 19:28
masak with a twisting motion. 19:29
19:33 nbrown joined
flussence (I think I've got this thing to compile rakudo properly now, but at this rate it's probably going to be running for at least a week...) 19:34
moritz flussence: what are you doing? 19:35
flussence trying to get data from the nom branch to use tools/progress-graph.pl on 19:36
using this: gist.github.com/1115667
masak rakudo: my $s = "zebras."; for ^5 { $s = [~] (my $p = <he she I you we they>.roll), " ", ($s eq "zebras." ?? "like" !! <think assume believe hope>.roll), ($p eq "he"|"she" ?? "s" !! ""), " ", $s }; $s.=ucfirst; say $s
p6eval rakudo 922500: OUTPUT«He hopes you hope I believe they believe we like zebras.␤»
masak :)
19:37 soh_cah_toa joined
jnthn mind = blown 19:37
masak the plot got too thick, I guess.
jnthn flussence: You could always just sample every n commits. :)
dalek kudo/nom: 7a3a394 | moritz++ | t/spectest.data:
more passing test files, jnthn++
19:38
flussence that'd probably be not quite as stupid as what I'm doing, yes :)
moritz flussence: or let others do parts of the work for you
flussence I suppose I don't *need* to do all these in sequence on one machine, the output file has commit IDs and their timestamps anyway 19:40
19:41 Chillance joined
flussence ooh, it actually produced one data point! 19:42
"2011-02-08 15:48:05",bab8369,17559,3106,583,20,21249,22014,544 19:43
jnthn flussence: I guess that's before things were taken apart :) 19:44
moritz looks like it :-) 19:45
flussence hm, if I skip 40 commits or so, that should put me right into can't-run-any-spectests territory, that should be a lot faster...
moritz it would indeed 19:46
dalek ecza: 9a4bec8 | sorear++ | src/Niecza (2 files):
Use lower-level MOP routines for categoricals, not ::($name)
19:47
19:52 nbrown left, jrockway joined
dalek ast: baa7d6f | moritz++ | S12-introspection/meta-class.t:
another rakudo unfudge
19:54
19:57 nbrown joined 20:02 sivoais left 20:05 pernatiy left, sivoais joined, pernatiy joined
dalek odel: 74a549e | (Martin Berends)++ | c/ (9 files):
odel/c] add hashtable and a few tests (works only on Linux)
20:12
20:14 Jackneill left 20:15 kaare_ left 20:20 xinming_ left, xinming joined 20:37 wamiks joined
pmichaud moritz: +1 to splitting stuff out of README if you want 20:39
20:50 soh_cah_toa left 20:53 mikehh joined
moritz does it. 20:59
21:00 benabik joined, molaf joined 21:01 noganex_ left
masak is there a method for invoking a Routine? besides postcircumfix:<( )>, I mean? 21:02
jnthn rakudo: sub foo($a) { say $a }; &foo.callwith(42)
p6eval rakudo 922500: OUTPUT«42␤»
moritz why do you need anything besides .() ? 21:03
jnthn That's what I thought when I saw .callwith :)
masak oh, interesting, .callwith without being in a call already :)
21:03 noganex joined
dalek kudo/nom: 90f996e | moritz++ | / (2 files):
move most of the build instructions into a separate INSTALL file
21:03
masak moritz: I don't, I'm just thinking ahead :) 21:04
jnthn masak: It's no relation to callwith fwiw
(in a deep way)
masak what has no relation to callwith? .() ? 21:05
jnthn Code.callwith(...) has no relation to callwith(...)
masak oh! 21:06
jnthn I dunno if the first is even tested, fwiw.
masak that's... unfortunate...
jnthn I guess if we have it it's spec
masak huh? :)
jnthn But it seems kinda...well...pointless.
ooh, we get quite a way through autothreading.t now :) 21:07
masak hm, yes. S06:1146 mentions something of the sort.
"Use of C<callwith> allows the routine to be called without introducing an official C<CALLER> frame." 21:08
that seems to be why.
should've been named .gotowith :P
jnthn oh
well, we don't do that. :)
masak submits rakudobug
jnthn doesn't bother re-adding it to nom :) 21:09
oh, but we don't do CALLER yet
hey, prove that Rakudo bug :)
mikehh the parrot PDS is on in #parrotsketck on irc.parrot.org if anyone is interested
#parrotsketch sorry 21:10
moritz masak: use callframe() to prove it :-)
masak rakudo: sub foo { &bar.callwith() }; sub bar { say callframe.perl }; foo 21:12
p6eval rakudo 922500: OUTPUT«Method 'perl' not found for invocant of class 'ParrotInterpreter'␤ in <anon> at line 1317:src/gen/core.pm␤ in 'Any::join' at line 1:src/metamodel/RoleToInstanceApplier.nqp␤ in 'Mu::attribs' at line 1318:src/gen/core.pm␤ in 'Mu::perl' at line 1322:src/gen/core.p…
masak hrm.
how do I use callframe?
rakudo: sub foo { &bar.callwith() }; sub bar { say callframe }; foo
p6eval rakudo 922500: OUTPUT«CallFrame()<0x5044b20>␤»
21:13 benabik left
jnthn It says CALLER frame, not anything about CallFrame ;) 21:13
masak dålight.
jnthn CallFrame includes all the intermediate blocks too, iirc.
21:13 benabik joined
masak s/h// 21:13
jnthn dålightful!
masak mikehh: irc.perl.org, surely? 21:14
mikehh masak: either or
masak aha.
moritz: how can I show it with callframe? I'm looking at the class, but it seems all I can do with it is .my 21:16
rakudo: sub foo { my $foo; &bar.callwith() }; sub bar { my $bar; say callframe.my }; foo 21:18
p6eval rakudo 922500: OUTPUT«$bar 3__CANDIDATE_LIST__ 35$_ 43call_sig 59$/ 63$! 71␤»
masak that's good enough.
masak adds that to the ticket
cognominal_ rakudo: grammar A { token a { a } }; "a" ~~ /<A::a>/ 21:19
p6eval rakudo 922500: OUTPUT«===SORRY!===␤regex assertion not terminated by angle bracket at line 22, near "::a>/"␤»
masak fwiw, I can see how a Block can have a .my, but not really how a Routine can have a .my 21:20
21:22 soh_cah_toa joined
moritz why not? 21:26
it also has curlies that introduce a lexical scope
21:27 wamiks left
jnthn Also, Routine ~~ Block 21:27
moritz -> sleep
masak night, moritz. 21:28
moritz, jnthn: you make valid points. :)
21:32 wamba joined 21:38 hanekomu joined 21:39 MayDaniel_ joined
jnthn oh noes 21:45
INSTALL conflicts with the directory install on case-insensitive OS. 21:46
so...
error: Updating 'INSTALL' would lose untracked files in it
could not detach HEAD
:(
Anyone with a Rakudo commit bit able to renmae that? :)
tadzik: Good news: I found the segfault, I think. And shoulda fixed it. Bad news: there's another thing not quite right yet. 21:47
21:48 Patterner left, soh_cah_toa left
Tene jnthn: something wrong with rakudo repo? 21:48
jnthn Tene: yeah...don't worry, can fix.
Tene Oh, okay.
jnthn Tene: Case-sensitive filesystem assumption causes problem on case-sensitive one :) 21:49
Tene oops
21:49 Psyche^ joined, Psyche^ is now known as Patterner
dalek kudo/nom: 0aacf70 | jonathan++ | src/Perl6/SymbolTable.pm:
Refactor BEGIN handling now that we have improved static lexpads. Note, this lets you write stuff that won't yet work out well with pre-compilation - beware. :-)
21:51
kudo/nom: fd68c86 | jonathan++ | INSTALL (2 files):
Rename INSTALL to INSTALLME (better names welcome) since on case-insensitive OS it conflicts with install directory made by --gen-parrot.
21:54 hanekomu left 21:55 soh_cah_toa joined
jnthn tadzik: ah, actually I think it will work out :) 21:57
masak std: class A { method foo { $.bar: "OH HAI" } }
p6eval std 516268a: OUTPUT«===SORRY!===␤Illegal use of colon as invocant marker at /tmp/x7FNvtQEPg line 1:␤------> class A { method foo { $.bar:⏏ "OH HAI" } }␤Check failed␤FAILED 00:01 121m␤»
masak I see. 21:58
jnthn tadzik: Aww, no, not quite...too much scope sharing.
masak $cake.have ^ $cake.eat :)
22:06 MayDaniel_ left
shinobicl hi 22:07
jnthn tadzik: When you're about, feel free to try your patch again, and let me know if the segfault is gone. Also feel free to push it somewhere either way, so I can play with it.
shinobicl i don't quite the "roles" feature yet... I have a role that i want to apply to Dates, and replace succ and pred 22:08
is parametric, and requires an existing "calendar" object to work 22:09
github.com/shinobi/TaskScheduler/b...alendar.pm
the role is at line 107
when i use a .succ method, it goes in a loop with this error: in 'succ' at line 108:WorkdayCalendar.pm 22:10
in <anon> at line 81:WorkdayCalendar.pm
in 'WorkdayCalendar::move-by-workdays' at line 1:src/metamodel/RoleToInstanceApplier.nqp and is goes and goes that way
masak shinobicl: that error message says only where things went wrong, not what went wrong. 22:11
shinobicl: how are you applying the role? 22:12
shinobicl it goes in an infinite recursiom when using .succ
give a sec..
diag "Testing Workday role, using $FILE_CAL_CORRECT";
my $w_date = Date.new(year=>2011, month=>07, day=>01) does Workday[$calendar];
is( #--- Friday to Monday
$w_date.succ,
Date.new(year=>2011, month=>07, day=>04),
"Workday role: Skipping weekends (Friday + 1 = Monday)"
);
masak looks like it could work. 22:14
sorear masak: as I understand it, the method is literally named 'postcircumfix:<( )>'
niecza: class Foo { method postcircumfix:<( )> ($x) { say $x } }; Foo.new.(24) 22:15
p6eval niecza v8-6-g9a4bec8: OUTPUT«24␤»
masak sorear: yes. I was just curious; the .[] and .{} methods seem to have evolved helper methods, maybe .() had too without my noticing it...
sorear ah.
masak tadzik: ping 22:21
22:21 drbean joined
sorear how evil is the 'factory object' pattern? 22:22
shinobicl i know.: i'm redefining 'succ' in my role. My new 'succ' uses a function that is intended to use the original 'succ'.
somehow, i should be able to call the "base class" succ function
masak sorear: I've always had a hard time putting my finger on that one. I know what it's for and why it's needed, but I can't determine whether the need is genuine or stems from restrictions in the language.
jnthn shinobicl: nextsame 22:23
shinobicl nextsame.succ ?
jnthn or nextwith(args)
Tene masak: Here's an interesting presentation of that question: what's the difference between a factory object and class objects?
jnthn no, just nextsame to defer with the same arguments, nextwith to specify
Tene What more than the name in .new() vs .give-me-an-instance() ?
jnthn There's callwith and callsame which are similar but let you get and play with the return value 22:24
sorear masak: I'm thinking of changing Op::CallMethod.new(|node($/), receiver => ..., name => ..., args => [...]) to $*op-factory.call-method($/, ..., ...., ...)
masak: in the name of dependency injection and a bit of terseness
masak sorear: sounds good to me, from my pattern-n00b perspective. 22:26
Tene: I *think* that factory methods are usually a bit more involved than .new methods.
Tene: though I'm not really sure.
Tene masak: You can add additional "constructor methods" to a class. I certainly often do. 22:27
22:27 cottoo left
masak Tene: oh, sure. 22:28
22:28 cotto joined
sorear Tene: I am speaking of one object which has constructors for *many* classes 22:28
masak Tene: the Factory pattern sometimes involves a whole different object, though... right.
Tene: we might be talking about different patterns.
Tene masak: I thought that we were talking about a large range of patterns and their relative tradeoffs. 22:31
masak Tene: what made you think that? :)
Tene: sorear opened up with mentioning 'factory object'. 22:32
shinobicl jnhtn: The problem is that i am not calling the old 'succ' directly from the new 'succ'. The new succ calls another method that uses the 'old' succ instead.
22:33 am0c joined
Tene masak: sorear is trying to decide how to implementsomething, and considering the factory pattern as one option. You expressed that you don't feel you fully understand the nature of the need for that pattern. 22:33
shinobicl i think i can avoid to use the old 'succ' at all... but it just seem right the way how is implemented now. (except for this 'infinite recursion' error) 22:34
Tene So the entire point of my question was for you to compare the fatory pattern against other things to see what the factory pattern actually offers, or whether language features could fill the same role. 22:35
jnthn shinobicl: Oh, that's awkwarder.
shinobicl: Maybe quality if explicitly if you know the class that has the old one. 22:36
$obj.ClassName::succ
masak Tene: in pattern lingo, a "factory" is a reified constructor, i.e. an object which handles the construction for some other class.
shinobicl oh... i'll try that
Tene masak: Right.
masak Tene: one factory can sometimes create several different types of objects.
Tene Presumably using some internal state to govern their creation. 22:37
masak Tene: from Wikipedia: "Factory objects are used in situations where getting hold of an object of a particular kind is a more complex process than simply creating a new object."
Tene: I'm unsure about the use of this pattern, because I don't often find myself in that situation.
probably because I don't use Dependency Injection that heavily yet.
I am under the impression that as DI increases in one's system, the need/want for factories will, too. 22:38
jnthn hasn't found that in practice.
Tene Right. For many uses of that, I've just added additional constructors to the class itself, and passed around classes.
masak jnthn: interesting.
jnthn masak: Unless you consider a DI container to be a factory :)
masak Tene: I tend to do something like that as well.
jnthn: maybe it is; I don't know. 22:39
22:39 wamiks joined
Tene masak: especially if your factory class doesn't use any attributes. 22:39
masak jnthn: I don't tend to use DI containers either :P
sorear I don't think I've ever used a formal DI container 22:40
but DI is one of my favorite pattterns, go figure
shinobicl IT WORKS! Thanks, jnhtn!! 22:42
masak sorear: it's getting to be one of mine, too. or IoC in it's various forms, really.
eugh, s/it's/its/ 22:43
I spell like an American!
22:43 wamba left, wamiks left
masak (no offense) 22:43
Tene ;_;
sorear doesn't 22:44
jnthn fwiw, when I teach DI then DI containers are something I introduce as a convenience and later on, not as a starting point.
Tene $*offense-factory-factory.create-offense-factory.create-offense.offended(); 22:45
masak Tene: I see you code according to all the latest fashions.
sorear for me DI is something that emerges naturally from the framework of a larger app; I haven't yet understood how to wedge my ideas into premade DI containers
masak it's important to keep one's factory factories well factored. 22:46
sorear (yes, I count niecza as a larger app. kinda sad.)
Tene masak: You've read "Why I Hate Frameworks" of course, yes?
masak Tene: is it the one with the hammers? 22:47
felher Can one have a sub that pattern-matches on a list with head $x and a tail $xs? Just like in haskell? Would one use [A
Tene masak: yeah
masak sorear: I was so happy when I managed to explain DI to myself. I made a diagram :)
sorear: it was one of my first blog posts on use.perl
felher *Would one use ($head, *@tail)?
Tene felher: yes
felher: you'd use []
felher: en.wikipedia.org/wiki/Perl_6#Quicksort
masak sorear: this is the one: strangelyconsistent.org/blog/ill-call-you-back
felher Tene: k, thnx. 22:48
Is there a way to get $start and $last? (*@start, $last) is not possible i think.
jnthn nom: "abc".split('b').say 22:49
p6eval nom: OUTPUT«a c␤»
jnthn nom: split('a', 'abc').say
p6eval nom: OUTPUT«Nominal type check failed for parameter '$pat'; expected Regex but got Str instead␤current instr.: 'split' pc 539704 (src/gen/CORE.setting.pir:128315) (src/gen/CORE.setting:1140)␤»
masak wow, that *is* a long time ago. in the blog post, I'm actually *grateful* that Rakudo didn't *crash* when I used a callback :P
jnthn git diff 22:53
oops
Tene jnthn: there are questions about 6model plans in #parrotsketch right now, btw. 22:54
jnthn ah
Tene: joined in case I can help with any of them
dalek kudo/nom: 5c6ac4f | jonathan++ | src/ (3 files):
Implement auto-threading in the $junc.meth case.
23:01
kudo/nom: 7c8ab31 | jonathan++ | src/core/Cool.pm:
Liberalize sub form of split, leave type handling to methods.
jnthn OK, pass all but 3 tests of S03-junction/autothreading.t now :) 23:02
flussence waitwaitwait - is that *real* threading?
jnthn No :) 23:03
w/in 16
Tene flussence: Rakudo doesn't run on any other VMs yet, and Parrot's threading has been broken for years. 23:06
jnthn rakudo: say (1 < all(2,3,4)).WHAT
p6eval rakudo 922500: OUTPUT«Junction()␤»
jnthn rakudo: say (1 ne all(2,3,4)).WHAT
p6eval rakudo 922500: OUTPUT«Bool()␤»
23:17 timbunce left 23:18 PacoLinux joined 23:20 control-alt-coke left
sorear flussence: "autothreading" is a technical term and doesn't have anything to do with OS threads 23:24
(there are some people who think junctions can use OS threads. IMHO, they are just deluding themselves.) 23:25
s/can/could eventually/
23:25 sftp left
masak it's unusual for humble opinions to express that people are just deluding themselves :P 23:26
23:27 timbunce joined
flussence well yeah, I get that using threads all over the place isn't a magical speed up thing... 23:28
masak but yes, I agree with the sentiment. even if junctions ever got to use threads, I don't see a very big gain from that.
mostly, I use junctions for very small scopes, like comparisons, or in the middle of a chain of method calls.
23:28 sftp joined
flussence (and I just had to deal with a bunch of thread-induced headache at $dayjob last week!) 23:33
masak ok, my github.com/masak/farm is "finished" now. it ended up quite a bit bigger than sorear++'s.
dalek kudo/nom: 886f677 | jonathan++ | src/core/Str (2 files):
ne should behave just like !eq
kudo/nom: 87ab44f | jonathan++ | t/spectest.data:
We now pass all of S03-junctions/autothreading.t.
masak but I like this factoring, and I think it'll be a beeeze to plug it into a harness for automated players. 23:34
I've been playing at it, and there's some bug in there wherein the stock gives me all of its rabit instead of the 6 I asked for. can't seem to find why that is.
will probably blog about this way of using OO and testing tomorrow. 23:35
'night, #perl6.
23:35 masak left, timbunce left 23:42 stepnem left 23:47 molaf_ joined 23:48 stepnem joined 23:50 molaf left
dalek ast: bcd4217 | jonathan++ | S02-builtin_data_types/undefined-types.t:
Update test to latest spec; remove a Rakudo fudging.
23:50
kudo/nom: 018c561 | jonathan++ | src/Perl6/Actions.pm:
Fix sink prefix.
23:52
kudo/nom: 6f9747c | jonathan++ | t/spectest.data:
Another passing test file.
flussence hm, well this graph script's going nowhere - none of these old revisions can --gen-nqp because they're using a configure switch that got renamed later and the git revision wasn't pinned down like it is for --gen-parrot :/ 23:53
23:58 Trashlord left