»ö« 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.
00:16 thou left 00:25 thou joined
sorear good * #perl6 00:26
00:29 aindilis joined 00:37 icwiener left 00:43 thou left 00:48 whiteknight joined 00:53 PacoAir joined 00:57 PacoAir left
colomon o/ 01:11
01:13 scott_ joined, scott_ is now known as Guest93514
sorear o/ colomon 01:14
colomon how's school going? 01:15
01:33 benabik joined
sorear ok 01:35
01:45 raoul left 01:54 tokuhir__ joined 01:57 tokuhir__ left 02:17 pomysl left 02:21 isBEKaml left 02:23 raoul joined, wolfman2000 joined 02:35 pomysl joined, pomysl left, pomysl joined 02:38 lestrrat left 02:40 lestrrat joined 02:47 raoul left 03:02 whiteknight left 03:04 pomysl left, pomysl joined, pomysl left, pomysl joined 03:09 replore joined 03:33 orafu left, orafu joined 03:41 sftp_ left 03:57 xinming joined 04:04 awoodland left 04:10 xinming left 04:11 xinming joined 04:18 jferrero left 04:51 dj_goku joined
dj_goku I ran make rakudo-spectest with 2012.1 rakudo-star on osx lion , and I have failures: paste.scsys.co.uk/182331 I googled, but didn't see anything. 04:54
Teratogen nom: 1+1 04:56
p6eval nom f9fcb2: ( no output )
Teratogen nom: say 1+1 04:57
p6eval nom f9fcb2: OUTPUT«2␤»
Teratogen good, that works
sorear dj_goku: this isn't necessarily a problem 05:00
dj_goku: most of those test files use is_run, which is known to be fragile 05:03
Teratogen nom: say e**(pi*i)
p6eval nom f9fcb2: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&i' called (line 1)␤» 05:04
Teratogen baw
05:04 replore left, replore__ joined
geekosaur nom: say e**(pi*1i) 05:04
p6eval nom f9fcb2: OUTPUT«-1+1.80886962109647e-09i␤»
geekosaur ...
sorear what, geekosaur? 05:05
nom: say sin pi 05:06
p6eval nom f9fcb2: OUTPUT«3.58979347393082e-09␤»
geekosaur mmm, point
rather, *floating* point. feh
sorear nom: say atan(1)*4
p6eval nom f9fcb2: OUTPUT«3.14159265358979␤»
sorear nom: say atan(1)*4 - pi
p6eval nom f9fcb2: OUTPUT«3.58979335146614e-09␤»
sorear nom: say pi
p6eval nom f9fcb2: OUTPUT«3.14159265␤»
sorear nom: say pi.WHAT 05:07
p6eval nom f9fcb2: OUTPUT«Num()␤»
sorear so... it looks like nom's pi doesn't even have double precision
niecza: say e**(pi*i)
p6eval niecza v14-42-g1d02da9: OUTPUT«-1+1.2246063538223773E-16i␤»
geekosaur closer at least
sorear easy fix I'm sure to get the precision of pi closer to machine epsilon
dj_goku sorear: alright, I'll take your word. :D Just thought I would ask anyways. 05:08
sorear dj_goku: I'm not certain what all of those errors are, it might be worth putting a full log up someone for a rakudo person to look at 05:10
dj_goku alright. by rakudo person, you mean someone in here? 05:12
sorear yeah 05:14
like pretty much anyone who isn't me :p
dj_goku haha
paste.scsys.co.uk/182332 05:18
05:22 s1n left 05:25 hypolin joined 05:26 kaleem joined 05:56 alvis left 06:01 woosley joined 06:11 replore__ left 06:23 pat_js joined, amirite joined
pat_js hi 06:24
sorear Hello, and welcome, pat_js. 06:26
pat_js i had written a solution for the knapsack1-0 problem for rosettacode last October and now it doesn't work anymore.
(with an more actual rakudo) 06:27
can someone hint me what's wrong with it?
rosettacode.org/wiki/Knapsack_problem/0-1#Perl_6
sorear hrm, I remember TimToady was doing lots yesterday with knapsacks 06:28
moritz o\
sorear o/
pat_js yeah i wrote a solution for the unbounded problem and he made it work with niecza and tweaked the style 06:29
rakudo says a type check failed 06:31
moritz my @skip := func(...) 06:33
but one of the cases returns $v, which is an integer
06:33 REPLeffect joined
araujo looks in 06:33
moritz and it was a bug in older rakudos that you could bind an Int to an @-sigiled variabled 06:34
pat_js yeah, func returns an Int and a @ary of strings 06:35
moritz then you should just assign its return value to @skip, not binding to it 06:36
how long should a run of that script take?
pat_js it took like forever 06:37
06:39 GlitchMr joined
pat_js ah ok but it's really just that binding, if i replace it with an assingment it works 06:39
with a smaller dataset.
I just thought binding would be faster than assingning 06:40
06:40 MayDaniel joined, MayDaniel left
pat_js is there a way to profile perl6 code? i really would like to know what exactly take so long 06:44
sorear so would I 06:48
moritz pat_js: use the --profile option to rakudo 06:49
though maybe we should reduce the problem size a bit
06:54 birdwindupbird joined 06:56 pomysl left
pat_js yeah i did that (smaller problem size and --profile) is there a formatter for the output? 06:56
06:56 pomysl joined
moritz pipe stderr into a file, and then run kcachegrind $file 06:56
about 40% run time in the list iteration code 06:57
pat_js first i'd need kcachegrind
moritz correct
06:58 wtw joined, alvis joined
sorear get kcachegrind 06:58
it's not as scary as you think 06:59
pat_js funny thing is heared about it at the last perlmongers thing and thought about installing it some time, but forgot about it 07:00
sorear for some reason a lot of people come here thinking that installing kcachegrind requires switching your system to use KDE 07:01
pat_js it does not, but installing kcachegrind requires a lot of kde programms to be installed 07:02
07:07 tarch joined
pat_js what's <cycle 3> in there? 07:14
in kcachegrind?
could it be that the list dispatching is slow? 07:19
bonsaikitten sorear: hrm. I'm trying to build niecza for fun, you apparently don't have any source archives on the github page 07:27
sorear source archives? 07:34
bonsaikitten sorear: yes, so that I can build a release and not have to abuse git
07:34 Tyrskaegg joined
bonsaikitten for head it's ok, but I don't want precompiled sauce but also don't like to use git for static checkouts 07:35
sorear I think there is an option on the download page for getting any branch head or tag as .tar.gz
07:35 snearch joined
sorear and all the releases are tagged 07:35
bonsaikitten hrmkay, let's see if I can motivate github without wanting to get drunk again 07:36
sorear warning: when you type "make", the Makefile will automatically download and install the latest binary release, because niecza requires itself to build
s/latest/matching/
bonsaikitten that I can patch (seen that in the build instructions) 07:37
sorear patch?
bonsaikitten <-- distro maintainer 07:38
I'm used to making bad makefiles play nice
no worries, I play a doctor on the internet
sorear ahahaha. 07:39
If you're trying to make a source-only niecza ebuild, I look forward to seeing what you come up with. 07:40
I can't say I'm entirely a fan of this bootstrapping thing, but Perl 6 rules are the only sane way to parse Perl 6...
bonsaikitten I guess the proper way is a niecza-bin ebuild and then depend on || ( niecza niecza-bin ) 07:41
same way you used to bootstrap icedtea and ghc
sorear you should...right
I'm a ghc user, I have some familiarity with how they do things 07:42
(I am *not* a gentoo user)
bonsaikitten you should be
much less effort :)
bonsaikitten dislikes compiling
sorear switching would be effort. I've been using debian since 2003, and all the options I (knew I) had were slackware, debian, and red hat 07:43
bonsaikitten mmh yes
I dislike having to recompile almost everything to get sane defaults on debian - like the bash that used to not have netdevices
apart from that it's an okish distro 07:44
sorear I'm a weird special case anyway 07:46
(like, "I'm using a WM I co-wrote" levels of weird special)
bonsaikitten ya, I'm more of a "released software is stale" person that hits every bug, and I'm lazy
sorear for some irrational reason I'm disgusted with how much xmonad has been popularized 07:48
bonsaikitten I'm a silly KDE user, I do not understand xmonad 07:49
same way I'm unable to play vi
pat_js rakudo: multi foo(0){say "o!"}; multi foo(Int $x){say $x}; foo(); 07:52
p6eval rakudo f9fcb2: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'foo' will never work with no arguments (line 1)␤ Expected any of:␤ :(Int )␤ :(Int $x)␤»
07:52 Trashlord left
pat_js sorry 07:53
sorear sorry?
pat_js rakudo: multi foo(-1){say "-1!"}; multi foo(Int $x){say $x}; foo(-1)
p6eval rakudo f9fcb2: OUTPUT«===SORRY!===␤Malformed parameter at line 1, near "-1){say \"-"␤»
sorear you did nothing to warrant an apology
pat_js for abusing the public channel for chatting with the evalbot 07:54
is it a bug or a feature that you cant have negative literals in parameter declarations
i think it might be because - being an unary prefix op and not some magical maybe a constructor 07:55
sorear "Malformed parameter" means that the parser itself is confused 07:56
I think that it is a prefix thing
rakudo: :(-1)
p6eval rakudo f9fcb2: OUTPUT«===SORRY!===␤Malformed parameter at line 1, near "-1)"␤»
sorear rakudo: :(1)
p6eval rakudo f9fcb2: ( no output )
sorear std: :(-1)
p6eval std 52f3895: OUTPUT«===SORRY!===␤Malformed parameter at /tmp/LITABtwBz9 line 1:␤------> :(⏏-1)␤ expecting any of:␤ name␤ parameter␤ signature␤ statement end␤ statement list␤Parse failed␤FAILED 00:01 109m␤»
sorear std rejects it, so it can't be a bug
anything std does it not a bug 07:57
unless Larry says it is a bug. which happens sometimes...
pat_js ah… 07:59
makes sense
08:00 scott__ joined, Guest93514 left
jnthn Yeah. -1 is not a literal. 08:01
morning btw :)
sorear o/ jnthn 08:02
jnthn: I need your help understanding OKness.
jnthn sorear: Then you're going to have to wait until I understand it. :) 08:04
jnthn spent a good chunk of his train journey to Stockholm yesterday pondering it. 08:05
At one point I was wondering whether scalar containers and OKness may be two versions of some underlying primitive, but that got uncomfy pretty fast.
Now I'm on to wondering if it's after the same primitives one would want for making objects from one langauge behave like those of another... 08:06
...and whether TimToady is thinking of a flattening mechanism or something really delegational.
jnthn normally goes to the park to do design work, but it's -12C out. :) 08:07
...plus I have to teach a class for the next couple of days :)
sorear wonders whether to be happy or annoyed that here it's also a very cold day ~ +5C 08:09
sorear imagines jnthn setting sleep dep records while teaching said class 08:10
jnthn meh, +5 isn't cold! :P
bonsaikitten jnthn: all a matter of perspective
jnthn: if you have no heating it's frustratingly cold!
jnthn bonsaikitten: Very true!
bonsaikitten doesn't appreciate the lack of central heating in Shanghai 08:11
sorear also depends on latitude
and elevation
I live on the coast at 34N 08:12
jnthn remembers being in Shanghai, some years ago. :)
sorear the widest span of temps I've seen is +2 to +40 or so 08:13
jnthn +40 is...outside the range of temperatures I can cope with. :)
sorear me too.
part of why I like the idea of moving to Sweden so much.
jnthn +35 in Beijing last summer was more than enough.
sorear: We're hiring! ;) 08:14
sorear although a couple years ago a Finnish friend of mine was complaining about +38 weather
which, I hear, is a little out of the ordinary for .fi
jnthn Yes, sounds like. 08:15
bonsaikitten I like ~30C, that's when life becomes happy 08:17
sorear part of the problem is doubtless the fact that my house has no insulation to speak of
I guess the builders wanted people to fully experience the famous San Diego weather 08:19
bonsaikitten sorear: most of the world isn't up to german standards ;) 08:22
08:23 mj41 joined
jnthn German Perl Workshop soon :) 08:24
bonsaikitten bit far away for me ...
jnthn Not so far from here :) 08:26
Though enough to fly it rather than take the train.
08:30 jferrero joined
jnthn ah, folks are here. time to teach 'em stuffs :) 08:36
sorear Bit far for mee too :'( 08:41
08:42 mucker joined 08:49 Trashlord joined 09:08 woosley left 09:09 ab5tract joined 09:13 am0c joined 09:18 lestrrat left 09:19 lestrrat joined 09:35 pat_js left
moritz jnthn: what's the difference between PAST::Stmt and PAST::Stmts ? 09:50
09:51 GlitchMr left
masak morgningz. 09:51
moritz: PAST::Stmts can contain several PAST::Stmt?
moritz masak: it seems that both can contain multiple PAST nodes. 09:52
masak yes. I didn't say they couldn't. 09:53
09:53 dakkar joined
moritz I've thought more about adding &sink calls 09:54
there are basically two approaches
whitelisting and blacklisting
thing is, we don't want &sink calls to the result of assignment, binding, and literals (for example) 09:55
currently I lean towards whitelisting, because the blacklist might get long
what do we call &sink on?
subroutine calls, method calls, variables 09:56
anything else?
masak in the field of security, blacklisting is frowned upon, not just because the blacklist may get long, but because omissions in the blacklist translate to security holes. 09:57
here I would guess it translates to wrong semantics, which isn't so good either.
moritz well, both blacklisting and whitelisting lead to wrong semantics if done wrong
masak ...but not worse than omitting something from the whitelist. :) hm.
10:00 xinming left, tarch left, tarch_ joined 10:01 xinming joined 10:04 hypolin left
moritz meh. 10:08
what happens when you add code to add &sink calls, and then compile the setting?
the quiz is open.
ok, I'll solve it for you. There's no &sink defined yet. 10:13
nom: &sink.() 10:15
p6eval nom f9fcb2: OUTPUT«===SORRY!===␤Symbol '&sink' not predeclared in <anonymous> (/tmp/GO_fsyjBXL:1)␤»
masak d'oh!
jnthn moritz: Stmt is newer, and also a register allocation boundary
So any temps are freely re-used afterwards 10:16
moritz jnthn: ok, thanks
masak oh! 10:19
masak guessed completely wrong, then :)
jnthn ;)
moritz ok, I'm now trying to emit &sink only if &sink is in lexical scope during comp_unit 10:20
jnthn
.oO( my $*SINKING_FEELING; )
10:21
moritz the work is done in Perl6::Sinker :-)
jnthn moritz: Thing is that by the end of compiling the setting...it will be :)
But I guess you know that and are setting it in comp_unit in teh grammar, after setting loading is done. 10:22
moritz I wasn't aware of it
jnthn moritz: ah, ok 10:23
then yeah, chekcing in comp_unit action would be too late :)
I guess you'll use $*W.find_symbol, wrapped in a try block...
moritz I'm trying $*W.is_lexical
jnthn oh 10:24
that'll work fine too
better in fact :)_
moritz and it does seem to work... except that I now get an infinite recursion
jnthn not that it needs the &
*note
moritz I know
jnthn ouch...where? :)
moritz I've added a sub sink($x) { $x.?sink; Nil } 10:25
gist.github.com/f2e6456a406fe0db0956 is what I get
maybe I'm adding sink calls to the insides of the sink?
so, the approach of checking in the actions really doesn't seem to work 10:26
hm
so I do need to make the check in grammar earlier 10:27
jnthn yes, or you'll be sunk 10:28
10:30 birdwind1pbird joined
moritz I wonder if literals in sink context should warn 10:30
jnthn probably yes :) 10:31
moritz I also wonder if variables should be put in sink context
jnthn Not sure on that one
moritz it feels unnecessarily magic if my @a = ...; @a; does somethinge else than just my @a = ...; 10:32
you *can* write sink @a; if that's what you mean.
10:34 JimmyZ joined
jnthn lunch here 10:37
masak interesting read about the scales of data access for a CPU: plus.google.com/112493031290529814...vhVwngPqSC 10:43
10:51 aindilis left 10:54 birdwind1pbird left 11:01 xinming left 11:07 xinming joined, mtths left 11:08 tarch_ left 11:15 am0c left
jnthn masak: Thus why hitting on the cache is so important. :) 11:15
11:16 scott__ left
masak .oO( "hey cache, you come here often?" ) 11:17
11:18 [particle] left 11:20 [particle] joined
jnthn er, s/on// 11:20
what was I thinking...
11:25 Siddy joined 11:26 Trashlord left 11:28 pernatiy left
masak nom: my @a = 1 xx 10; for ^10 { say @a; my @b = 1; for @a[2..*] { push @b, $_ + @b[*-1] }; @a = @b } 11:29
p6eval nom f9fcb2: OUTPUT«1 1 1 1 1 1 1 1 1 1␤1 2 3 4 5 6 7 8 9␤1 4 8 13 19 26 34 43␤1 9 22 41 67 101 144␤1 23 64 131 232 376␤1 65 196 428 804␤1 197 625 1429␤1 626 2055␤1 2056␤1␤»
masak (yup, still thinking about balanced strings) :)
moritz are those the right numbers?
masak yes. 11:30
and that's the simplest way I know to construct them.
moritz neat
11:32 Siddy is now known as Trashlord 11:34 PZt left 11:35 daxim joined 11:39 tarch_ joined 11:42 PZt joined
flussence whoa, rakudo has a --profile option? how long's that been there? 11:46
11:56 am0c joined 12:07 snearch left, fsergot left 12:08 Trashlord left 12:14 pernatiy joined
jnthn flussence: months :) 12:15
12:29 ilogger2 joined, ChanServ sets mode: +v ilogger2, literal joined
dalek kudo/sink: 21e7425 | moritz++ | src/Perl6/Sinker.pm:
no need to visit children of PAST::Op
12:31
kudo/sink: d17935e | moritz++ | src/ (4 files):
Only sink if we know about &sink

Doesn't quite work it seems.
moritz somhow in github.com/rakudo/rakudo/commit/d17935ed6a $*HAS_SINK is always false, even when not compiling the setting, and I can't understand why 12:32
it's declared outside of comp_unit (in TOP), and initialized inside the comp_unit grammar rule, so it should persist to the comp_unit action method, no? 12:33
jnthn $*HAS_SINK := $*W.is_lexical('&sink'); 12:34
I think that line may come too early
$/.CURSOR.unitstart();
Think it needs to come after unitstart.
12:34 MayDaniel joined
moritz what does unitstart do? 12:34
jnthn iirc, call SET_OUTER_CTX
moritz ah. 12:35
indeed
12:35 fsergot joined 12:45 raoul joined
moritz $ ./perl6 -e 'sub sink($) { say "sunk!" }; 1; 1;' 12:46
sunk!
flussence \o/
moritz it's... still mostly wrong 12:47
colomon but not entirely! ;)
dalek kudo/sink: 48005a5 | moritz++ | src/Perl6/Grammar.pm:
fix $*HAS_SINK. jnthn++
12:48
12:51 leprevost joined
jnthn ponders that QAST nodes should have a :dba so we can set the semantic role that the node is playing, independent of wrapping 12:58
So we can :dba('literal') whether it's a QAST::Val or a lookup in the SC constants table... 12:59
moritz that sounds sane 13:00
jnthn occasionally comes up with sane things :) 13:01
13:21 danishman joined 13:34 kaleem joined
masak moritz++ # free-sinker 13:37
dalek kudo/sink: a07582b | moritz++ | src/Perl6/ (2 files):
add nosink annotation
13:39
Teratogen nom: say 1 + 1 13:45
p6eval nom f9fcb2: OUTPUT«2␤»
Teratogen yay, it works!
13:45 kaleem left
Teratogen But shouldn't it just say "2"? 13:46
masak Teratogen: using 'say' means that you want a newline at the end.
nom: print 1 + 1
p6eval nom f9fcb2: OUTPUT«2»
Teratogen oh!
my xchat client definitely doesn't have the right character set encoding to display that whatever it is
13:47 snearch joined
masak the difference between 'print' and 'say' is the newline (and some other distracting and useless distinction that TimToady and moritz seem to like but that I don't see the use for) 13:47
13:48 PZt joined
moritz Teratogen: use UTF-8 13:52
$ ./perl6 -e 'class A { method sink() { say "sunk!" } }; A.new; 1'
for now it generally excludes the last statement of a block 13:53
because that's the return value, and the caller needs to handle its context
of course that's not true for the mainline, but I didn't special-case that yet
13:54 Trashlord joined
masak it's somewhat of a transitive thing, isn't it? 13:55
dalek kudo/sink: 822bef8 | moritz++ | src/core/control.pm:
fix sinko
masak the last statement of a block can be in sink context, depending on whether the calling statement is.
moritz masak: well, that's one way to look at it 13:56
masak so code can behave quite differently depending on how it's called. it's basically caller context propagating into the callee, but at a smaller scale than with Perl 5.
moritz masak: the other way to look at it that the last statement of a block isn't in sink context, but the caller can still call &sink on the return value of that statement 13:57
which fits the "context flows outwards" view of Perl 6 much better, IMHO
13:58 xinming joined
masak that mental model feels to me like the &sink call happens "too late", though. 13:58
because (for example) a for loop can produce hefty amounts of garbage data if it finds itself in a non-sink context. 13:59
moritz erm, no
flussence I guess it depends on having sufficient laziness
masak and just calling &sink after it's returned all the garbage helps no-one.
moritz a for-loop in non-sink context is lazy
and doesen't produce anything, except a lazy thunks
*thunk
masak oh, right.
that's even *more* confusing! :)
but it's consistent with the rest of Perl 6, I guess. 14:00
moritz sink context is there to make for-loops less confusing :-)
flussence it makes more sense if you start at the end of the program and work backwards :)
14:00 raoul left
masak nom: sub foo { for ^100 { say "OH NOES" when /99/; $_ } }; say foo[42] 14:01
p6eval nom f9fcb2: OUTPUT«OH NOES␤42␤»
masak /o\
moritz well, that's the old behavior, which I want to change 14:02
masak nodnod
moritz spectests first 14:03
masak has anyone ever made the parallel between binding and quantum entanglement? 14:04
jnthn Note that eager context and sink context are different. Sink context should make a for loop (or map) not build a result list
Note that this can work becasue a for or map on its own does absolutely nothing until you ask it for results.
masak still, it feels to me that both sinkness and eagerness propagate inwards into callees. 14:05
the &map code called by the 'for' loop needs to be aware that it's in sink context, and not build the result list. 14:07
jnthn no 14:08
&map returns a MapIter *immediately*. It doesn't do any work itself.
That iterator has .sink called on it.
masak oh! 14:09
moritz and the problem with the current factoring is that it has .eager and not .sink called on it
jnthn right. which is why it keeps date for too long
14:09 tokuhirom joined
masak so... there's some kind of dependency injection going on here that puts the caller in control. nice. 14:09
moritz which means we can never GC return values of the loop, even in sink context
masak or would that be "reverse dependency injection"? hm. 14:10
14:10 xinming left
masak nom: MapIter; say "alive" 14:13
p6eval nom f9fcb2: OUTPUT«alive␤»
masak nom: say MapIter.^methods
p6eval nom f9fcb2: OUTPUT«new BUILD reify DUMP iterator list flat elems infinite item fmt Int Num chrs Numeric Str␤»
jnthn masak: I lied a bit - the MapIter isn't returned itself, but rather a List with a MapIter in its unreified portion 14:14
masak ah, so the MapIter is a sort of "promise" of a future calculation?
like in HOP :) 14:15
er, the MJD book, I mean.
lumi___ Wouldn't the masak-type sink be easier to optimize?
14:16 xinming joined
jnthn masak: kinda like that, yet 14:16
If you mean what I think you mean, anyway :) 14:17
moritz lumi___: the reason we abolished inward flowing context is that it doesn't mix with multi dispatch
multi a() { }; multi a(Str $x) { }; a(b()) # is &b in sink context or in Str context here? 14:18
14:19 tokuhirom left, tokuhir__ joined, Trashlord left
lumi___ moritz: Oh, I see 14:21
So sink context mustn't affect the return value, so the callee can't know it, right?
moritz the caller imposes the sink context on the return value (or it doesn't) 14:22
masak moritz: I don't get your example. clearly &b can't be in sink context there, since its return value is passed on to &a. 14:23
14:24 tokuhir__ left
moritz eval: use Data::Dumper; sub a { print Dumper wantarray }; sub b() { }; b a 14:24
buubot_backup moritz: ERROR: syntax error at (eval 20) line 2, near "b a "
moritz eval: use Data::Dumper; sub a { print Dumper wantarray }; sub b() { }; b(a)
buubot_backup moritz: ERROR: Too many arguments for main::b at (eval 20) line 2, near "a) "
moritz eval: use Data::Dumper; sub a { print Dumper wantarray; return }; sub b() { }; b(a)
buubot_backup moritz: ERROR: Too many arguments for main::b at (eval 20) line 2, near "a) "
moritz why too many arguments, if a returns the empty list? 14:25
masak doesn't compile, probably even syntactically incorrect.
you're essentially saying that &b syntactically doesn't have any arguments.
moritz right
masak not a big problem in practice, I guess :)
moritz aye 14:26
because p5 doesn't have multi dispatch
but if the caller is a multi with a nullary candidate, there is a case where it wants the callee to return 0 args. Which is the same as sink context, no? 14:27
masak I don't know.
14:27 leprevost left
masak feels like there is a slight qualitative difference between returning Nil and returning () 14:28
[Coke] "./perl6 --profile foo.p6" - runs the program and THEN complains about the profile option.
masak [Coke]: that's how fast it is! :P
moritz complains?
it writes the profile to STDERR
[Coke] masak++ #print vs. say
14:29 sftp joined
[Coke] (nd if you try to use the usage it suggests, you get an immediate usage error.) 14:29
dalek kudo/sink: 6ca381c | moritz++ | src/ (2 files):
make for-loops lazy, unless in sink context
14:31
14:31 sftp left
moritz oops. That commit breaks 'use Test;' 14:34
jnthn Wow!
14:35 PacoAir joined
moritz oh, and the previous one broke dynamic vars 14:39
urks.
jnthn moritz: if you're not applying sink context in the setting then it'll break for loops... 14:40
moritz jnthn: oh right. Ouch. 14:41
lumi___ moritz: Actually I don't see how any signature can bind successfully and still give a sink context
jnthn moritz: Why can we not apply it in the setting?
I mean, if it's written early on...
oh, other than the infinite recursion issue.. 14:42
moritz well, that one was the real reason
jnthn But most things in the setting don't run until after the setting is compiled
14:43 lateau_ joined
jnthn moritz: Maybe just disable sink if we're inside a routien called sink ;) 14:43
moritz jnthn: it would feel righter to declare &sink in BOOTSTRAP.pm 14:44
jnthn: is that feasible?
jnthn moritz: Only if you construct the Routine object by hand and add it to the export list 14:45
Well, Sub object
But yeah, seems possible
kcw is there any way to get an unbound class method? or does that even make sense the way p6 treats types?
moritz kcw: what's an "unbound" class method? 14:46
kcw a method from a class that isn't attached to any specific instance of the class
moritz you can just write a method that doesn't access any attributes 14:47
then it works as such a method
nom: class A { method speak() { say '\\o kcw' } }; A.speak
p6eval nom f9fcb2: OUTPUT«\o kcw␤»
kcw I mean to do things like "my $func = Str.say; my Str $x = 'text'; $func($x)" 14:48
masak kcw: doing it that way calls the method.
but it can be done without much trouble with a different syntax. 14:49
kcw ^ ok; that's what I was looking for
masak nom: say Str.can("say")
p6eval nom f9fcb2: OUTPUT«say␤»
moritz nom: my ($func) = Str.can('say'); $func('foo')
p6eval nom f9fcb2: OUTPUT«foo␤»
masak nom: say Str.can("say").^name
p6eval nom f9fcb2: OUTPUT«Parcel␤»
masak nom: say Str.can("say")[0].^name
p6eval nom f9fcb2: OUTPUT«Method␤»
masak moritz++ # already knew what I was figgering out 14:50
moritz note that it also works the other way round:
nom: 'foo'.&say
p6eval nom f9fcb2: OUTPUT«foo␤»
masak nom: my ($func) = Str.can('say'); $func(42)
p6eval nom f9fcb2: OUTPUT«42␤»
masak ooh!
and that's *correct*, because the method .say is on Any :) 14:51
PerlJam greetings
masak PerlJam! \o/
moritz masak: but you shouldn't rely on it, because the compiler might add an optimized 'say'-method to Str 14:52
14:52 mikemol joined 14:53 lateau_ left 14:55 mikemol left, mikemol joined 14:56 thou joined
masak ponders this from a Liskov perspective 14:58
14:58 sftp joined
masak generalizing, that means that whenever I fetch out a method like that, there's really nothing I can say about how narrow or wide the invocant type can be, except that it must contain the type I got it from. 14:58
14:59 tarch__ joined
moritz which is a statement about its wideness (it's wide enough to accept the invocant type) :-) 15:00
15:02 noam joined, mikemol left
masak in Java generics terminology, it's <? super Str> (for some value of Str). 15:03
15:03 mikemol joined 15:04 MayDaniel left 15:06 tarch joined 15:07 tarch__ left 15:08 sftp left 15:10 snearch left
[Coke] moritz: profile doesn't play well with MAINs with signatures. 15:11
oh. yes it does.
(this random .p6 had a MAIN and invoked MAIN. something is confused, but it's probably not --profile) 15:12
flussence wants --profile[=<fileno>] instead of always going to stderr 15:13
15:13 sftp joined
masak wants to watch vimeo.com/36579366 but has to wait until he gets home -- it looks promising! 15:13
moritz flussence: then patch it. Shouldn't be too hard, I think
masak it's by the worrydream.com/LadderOfAbstraction/ guy. 15:14
flussence hm, maybe that should be file *name*, I'm not sure how well multiple fd's works outside linux...
moritz file name would be more intuitive
flussence and I might give it a go, after $dayjob :)
jnthn Note that instead of .can you can also .^find_method :) 15:17
Teratogen .tincan 15:18
15:18 leprevost joined
jnthn .beercan 15:18
15:22 MayDaniel joined
masak .can-can 15:25
flussence .can't
[Coke] # 02/16/2012 - niecza at 99.88% 15:26
"niecza", 20055, 8, 751, 1573, 22387, 23257
"rakudo", 20078, 28, 610, 1863, 22579, 23267
jnthn nom: use MONKEY_TYPING; augment class Mu { method can't($name) { !self.can($name) } }; say FatRat.can't('fit-in-small-holes') 15:28
p6eval nom f9fcb2: OUTPUT«True␤»
jnthn \o/
masak :P
nom: use MONKEY_TYPING; augment class Mu { method can't($name) { !self.can($name) } }; say Num.can't('floor')
p6eval nom f9fcb2: OUTPUT«False␤»
masak \o/
jnthn oh 15:29
For my GPW meta-programming talk, I should make a custom meta-class that, for all Bool returning methods, adds an inverse. :)
[Coke] shouldn't 15:30
jnthn :P
It's *really* easy to do :)
moritz even I would manage that, I think 15:31
[Coke] wouldn't
jnthn method add_method($obj, $name, $code) { callsame; if $code.returns === Bool { self.add_method($obj, $name ~ "'t", method (|$c) { !$code(|$c) }) } } 15:32
masak won't that recurse forever? 15:33
hm, maybe not, since the call doesn't add a method which explicitly returns a Bool. 15:34
jnthn No, because I didn't put "returns Bool" on the generated method :)
masak right.
[Coke] what if you have an analyzer smart enough to determine that it does return bool even if you don't declare it? 15:35
(would that get ignored?)
jnthn [Coke]: I suspect that'd be optimizer space, and optimization happens after method addition I guess.
Plus I'm not sure if we should go adding traits the user didn't declare. 15:36
masak not by default, no.
jnthn True. All's fair if... :)
15:41 alester joined 15:42 benabik joined 15:43 MayDaniel left, Psyche^ joined 15:44 kaleem joined 15:47 Psyche^ is now known as Patterner 15:51 jferrero joined 15:58 jaldhar joined
moritz appft1.uspto.gov/netacgi/nph-Parser...0040230959 didn't we have === and !=== back in 2003? :-) 16:06
moritz too young, p6 wise
doy is perl6 a BASIC-derived programming language compiler? 16:08
moritz not really 16:09
PerlJam There is some small distillation of BASIC within Perl 6 , but I'd hardly call that "derived"
moritz decommutes 16:10
PerlJam jsut boggles that there are 3 co-inventors for the IsNot operator
s/jsut/just/
flussence sounds like people weren't kidding when they say pointer math is hard :) 16:11
masak I see nothing of merit in software patents. they just make it harder for everyone who wants to develop software.
Teratogen software patents are stupid.
But, I think one of the first software patents was some access control mechanism for Unix. 16:12
jnthn
.oO( If u nix our ideas, we sue! )
flussence
.oO( so *that's* why nothing has a working file locking API! )
16:13
PerlJam software patents are a legal tool for financial protection. i.e. an anathema to those of us raised in a scientific tradition of sharing.
But I don't think patents would be so bad if the patent office were sane. 16:14
flussence or competent
I've heard the vast majority of that stuff just gets rubber-stamped without even being read 16:15
Teratogen I think there was a major kerfluffle when Microsoft tried to patent the symbolic link. 16:16
Uhm, wait a second you guys, Unix has had symbolic links for DECADES.
PerlJam pictures Einstein with a rubber stamp
masak I just think software is different enough that patents on software don't make much sense. it's almost as if someone went and patented the use of past tenses of the verb "interject", and then protected his exclusive right to that use by suing other authors who used it. 16:19
PerlJam masak: software patents make sense, it's their appliction to stupid things that doesn't make sense 16:22
masak I think I've only seen it applied in ways that I consider stupid.
PerlJam I remember long a ago there was a patent on the blinking cursor (held by the Lotus Corp. I think). That's just stupid. 16:23
But patenting a complicated process that is non-obvious and does something useful seems perfectly valid to me. 16:24
masak I'm not sure I agree right away. 16:25
jnthn decommutes 16:26
PerlJam If the hardware for an MRI machine were available in any local hardware store, but you developed some software that made the MRI machine actually useful, wouldn't you want some protection so that you sell your invention (software) ?
(that's ultimately what happens for software ... the hardware is generally ubiquitous, but the arrangement of concepts via programming isn't) 16:27
colomon PerlJam: sure, but that's what copyright is for 16:28
PerlJam colomon: copyright protects the text, but not the process.
e.g., copyright will protect my C program, but if someone else wrote a Java program to do that same thing, then that's perfectly fine 16:30
colomon PerlJam: so? If the process is so obvious anyone can easily reconstruct it, then I don't deserve a patent. If not, then copyright is fine protection.
the goal is to reward the programmer's effort, not to give them a monopoly on a certain kind of software 16:31
16:32 kaleem_ joined
PerlJam colomon: That's *exactly* what patent protection is for ... it's only "obvious" after someone else has taken the time to figure out which pieces to put together and in what order. 16:32
16:33 Trashlord joined 16:34 kaleem left
colomon PerlJam: that's a great assertion, but do you have a shred of proof? 16:35
masak decommutes 16:36
colomon Or to put it another way: I've been successfully running a small software business for 13 years now. I've never patented anything. In my opinion, the threat that some arsehole out there has patented something that I came up with on my own is a bigger threat to my business than if all my source code somehow escaped into the wild... 16:37
16:40 leprevost left 16:41 jferrero left
PerlJam colomon: I've got no axe to grind really. But IMHO, the ideals of patents as applied to software have some merit though the execution of those ideals via patent offices and patent law are flawed. 16:42
16:46 jferrero joined 16:48 MayDaniel joined 16:52 leprevost joined
TimToady patents really only make sense for companies who can also afford lawyers, but there's no equal protection under the law for the little guy who can not afford to guess which bits of his intellectual property to waste time patenting at thousands of dollars a pop 16:53
the guy with most of the sheep will eventually steal your one sheep anyway 16:54
TimToady is reminded of the episode with David and Nathan with respect to Bathsheba
16:57 alester left
TimToady not to mention Uriah the Hittite... 16:57
Teratogen I unlicense all my code, even trivial code. That way there is prior art. 16:58
TimToady except the stupid patent office is going with the stupid first-to-file rule rather than first-to-invent 16:59
geekosaur also note that prior art only helps if someone can afford to challenge in court 17:01
unfortunately, the PTO doesn't do any due diligence; there can be mountains of prior art and nobody will verify before granting the patent 17:02
17:04 kaare_ joined
TimToady so really our only viable strategy is to write successful open source software but fly under the radar long enough that most of the software economy ends up ignoring the patent office 17:04
that is the only strategy that I can see working 17:05
benabik Quick, patent it so nobody else can sue you for using it. ;-) 17:07
17:10 kaleem_ left 17:17 pat_js joined
TimToady moritz: I suspect sink should return () rather than Nil, since Nil is becoming an item; otherwise "sink sink" is an error, when it should just be a noop 17:17
and you want to be able to put sink into the middle of an expression and interpolate nothing 17:18
as to when you should put something in sink context, just ask yourself "Does this merit a 'Useless use of X' award?" 17:20
sink context awards that error to anything without side effects 17:21
au . o O { sink sink sink reboot(); } # ...merits a 'Useless use of "sink"' award
TimToady the question, for example, is whether we view fetching a variable as a valid way to produce side effects
I'm not sure it is 17:22
:)
benabik Proxy.new( FETCH => { $database.fetch('variable') } ); ?
17:23 jaldhar left
TimToady otoh, we know, or at least hope, that reboot() has side effects, so it's not a Useless use of reboot 17:23
au exactly. 17:24
benabik I could see fetching variables opening connections to databases, opening files, etc.
TimToady so a sink on something with side effects is a side effect, but a sink of that sink isn't... :)
benabik OTOH, if you're doing that lazily, it shouldn't matter if it doesn't happen.
TimToady so with enough sinks you can issue the "Useless use of sink" award 17:25
au so tat's two useless uses of "sink" awards
yeah.
TimToady awards a Most Useful award to Perl 5's Useless award :) 17:26
that's where most precedence screwups manifest themselves
17:27 zby_home joined
colomon au! \o/ 17:27
au /o
TimToady hopes that a salute and not an oncoming headache...
au it's intended as a salutation 17:28
TimToady benabik: even fetching a lazy array should probably be biased in favor of FP semantics, so maybe we should require an explicit eager to drain one of those 17:31
well, not drain, but force to completion, and then the implicit sink throws away the whole list 17:34
moritz so a bare mention of a variable would be a warning, not a sink 17:36
17:36 packetknife joined
TimToady a warning and a sink, I tihnk 17:36
side-effect() + side-effect() gets a useless use of + award but also does the side effects 17:37
17:37 packetknife left
TimToady eval: use warnings; (print "A") + (print "B") 17:39
buubot_backup TimToady: AB2
TimToady hmm, buubot doesn't appear to relay STDERR
but locally: Useless use of addition (+) in void context at -e line 1. 17:40
but it still prints AB
moritz TimToady: buubot_backup just doesn't evaluate in void context
TimToady: it even gives you the return value (2) at the end 17:41
TimToady ah, you're right
eval: use warnings; (print "A") + (print "B"); 42
buubot_backup TimToady: Useless use of addition (+) in void context at (eval 20) line 1. AB42
TimToady \o/
moritz++
colomon 's current giant svn merge is making him long for git for $work
benabik colomon: This is what git-svn is for. 17:42
colomon benabik: I gave it a try a few years ago, but it doesn't seem a good solution for the case where you normally have a couple dozen copies of cloned at the same time. 17:43
benabik colomon: Ah, yes. Takes more finesse that way. I know it's generally best to have a single point of svn->git, but not sure if dcommitting from multiple works well. 17:44
17:44 xinming left 17:45 xinming joined, packetknife joined
TimToady moritz: I would also guess that an implicit sink may have subtly different semantics than an explicit one 17:46
so that a bare "@foo;" would not cause side effects in @foo, but and explicit "sink @foo" would behave like "eager @foo"
I thought of another difference earlier but have since forgotten it :/ 17:47
well, there's the fact that an explicit sink needs to arrange to return () if there's any overhead to that, while an implicit sink need to arrange to return anything 17:48
s/need/does not need/
there's no difference on P5 since it's stack based, and sinking just pushes nothing (well, just does the stack reset between statements) 17:50
but in P6 it might involve generating an empty Parcel
17:50 xinming left 17:51 xinming joined
benabik Are Parcels mutable? 17:53
If they're not, you could just return a global empty Parcel.
TimToady Parcels are not mutable, but they may contain mutables 17:54
so () is immutable, yes
($foo) is immutable on the outside :) 17:55
17:55 Chillance joined 17:57 packetknife left 17:59 thou left
moritz well, sink @foo empties @foo 18:01
otherwise a for-loop in sink context must retain its elements 18:02
TimToady well, here's another difference between explicit and implicit sink: the implicit sink is a circularity saw
moritz thought it was sinks all the way down
TimToady but yeah, if you call a routine as a procedure, you expect it to do side effects
so draining is probably correct even for implicit, though we can probably optimize things some 18:03
the sink might delegate a sink-yourself to a list
been thinking there is something similar for when you print an infinite list 18:04
instead of just freezing, it should do something like .print for @list
or .spray, or whatever we split the raw print into to make masak happy^Whappier
jnthn evenin' 18:05
PerlJam print, say, spray? 18:06
18:06 thou joined
TimToady well, a politer form of .spew :) 18:06
opposite of slurp
.spit 18:07
it's hard to think of an opposite that doesn't have negative socal vibes
moritz perl6: print 1..*
emit 18:08
but that's not very clear, I think
p6eval pugs b927740: OUTPUT«Stack space overflow: current size 8388608 bytes.␤Use `+RTS -Ksize -RTS' to increase it.␤»
..niecza v14-42-g1d02da9: OUTPUT«(timeout)»
..rakudo f9fcb2: OUTPUT«(timeout)1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211…
TimToady trouble with emit is that it's usually reserved for things like code generators
18:08 Tarmvred joined
TimToady looks like rakudo++ already manages to do it somehow 18:09
well...
perl6: (1..*).print
betcha that don't work
p6eval rakudo f9fcb2: OUTPUT«(timeout)1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211… 18:10
..pugs b927740: OUTPUT«pugs: out of memory (requested 1048576 bytes)␤»
..niecza v14-42-g1d02da9: OUTPUT«Unhandled exception: Unable to resolve method print in class Range␤ at /tmp/0b9nIt5SJj line 1 (mainline @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3773 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3774 (module-CORE @ 65) ␤ at /hom…
TimToady well, well
moritz claims a forfeit
TimToady paint me impressed
okay, I owe you a something or other
jnthn ...how does it do it? :)
TimToady delegation to the object in question 18:11
perl6: (1..*, 42).print
p6eval niecza v14-42-g1d02da9: OUTPUT«Unhandled exception: Unable to resolve method print in class Parcel␤ at /tmp/t4MkSH_mZr line 1 (mainline @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3773 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3774 (module-CORE @ 65) ␤ at /ho… 18:12
..rakudo f9fcb2: OUTPUT«(timeout)1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211…
..pugs b927740: OUTPUT«pugs: out of memory (requested 1048576 bytes)␤»
TimToady rakudo++
flussence might be useful for p6eval to print both ends of the output in case of a timeout... 18:14
moritz "both ends"? 18:15
TimToady how far the output got
18:15 kaleem joined
moritz hm, yes 18:16
TimToady presumably you can make a fairly large disk file in a few seconds :)
moritz not hard to patch, if anybody wants to do it
TimToady one could probably spaceout in addition to a timeout, with a proper ulimit
jnthn moritz: How's the sink stuff going? Need me to throw in any tuits/look at anything? 18:17
moritz the reason we don't do it is that STD.pm used to write files during compilation
jnthn should have some tuits after dinner :) 18:18
moritz jnthn: I haven't done much, mainly because I don't knoww (yet) how to proceed
jnthn moritz: OK.
moritz jnthn: putting &sink in bootstrap, or some other hack. That's the question.
hey, I know
I put it into a setting, and hack it to be only a single statement 18:19
(with Q:PIR or so)
so it doesn't get any inner statements that are sink-annotated themselves
18:19 MayDaniel left
jnthn ouch! 18:20
Though would work.
Though at the cost of Q:PIR, which we're supposed to be eliminating...
moritz we could also make it an opcode
TimToady yes, the circularity saw aspect of the implicit sink
moritz then the inliner can do its work on it 18:21
moritz feels really evil now
TimToady: should &sink return the empty list, or an empty parcel?
18:21 thou left
TimToady what's the effective difference? 18:22
which is faster? :)
moritz parcel is faster in rakudo, iirc
TimToady which will dwtm if they put it in the middle of an argument list?
I think parcel is better, offhand 18:23
jnthn Parcel is faster at the moment. But once I get the serialization work done both should be literals figured out at compile time.
TimToady I think parcel is correcter
jnthn Yeah, feels right to be.
*me
TimToady to be, too :)
18:25 Tarmvred left
jnthn moritz: Trouble with an opcode is that it'd probably end up doing the .?sink call in a nested runloop, which is very ungood. 18:25
moritz jnthn: oh :(
dalek ecs: b3ccbd1 | larry++ | S02-bits.pod:
sink returns (), not Nil
18:26
jnthn We certainly want something that'll get inlined though. 18:27
moritz agreed
jnthn Though, get the semantics right first and then we make the inliner diddle it.
moritz couldn't we emit .?sink; () directly, instead of calls to &sink ?
jnthn Yes. 18:29
Well, you'd need to stick the thing being sunk into a temporary register.
But that's easy too. 18:30
TimToady maybe everything should have a .sink method that says, "Evaluate yourself for side effects, and carp if you don't have any"
moritz we might even want to inline dispatch:<.?> in PAST
jnthn In fact, you can do it better than the normal .? path too.
moritz: Yes, that's what I was thinking. 18:31
TimToady then constant folding would automatically produce the Useless warnings
moritz jnthn: is there an example of such a temporary register usage at the PAST level somewhere? 18:32
18:32 MayDaniel joined
jnthn moritz: Grep Actions.pm for :scope('register') 18:33
(Multiple examples)
moritz: You'll maybe need a fresh name also; grep for .unique to see how to do that :) 18:34
moritz so I just chose a uniq name, declare it as :scope('register'), bind to it, and then a PAST::Var with the same scope and name?
can't we use the same register name throughout the whole program? 18:35
jnthn Correct
moritz: er, you'd need to declare it once per PAST::Block
18:36 snearch joined
jnthn moritz: And the optimizer may make assumptions about non-dupe register names when it inlines blocks, but that latter issue is very fixable. 18:36
TimToady commuting & 18:37
18:37 kaleem left 18:38 Tarmvred joined 18:39 pyrimidine left
masak phenny: "Tarmvred"? 18:46
phenny masak: "ileus" (sv to en, translate.google.com)
masak :)
"Ileus is a disruption of the normal propulsive ability of the gastrointestinal tract." -- Wikipedia 18:47
daxim soooo… propulsive? like in the first few seconds of "the pick of destiny"? 18:49
18:49 pyrimidine joined
jnthn dinner & 18:49
moritz nom: say infix:<,>().WHAT 18:52
p6eval nom f9fcb2: OUTPUT«Parcel()␤»
18:52 MayDaniel left 18:53 ab5tract joined 19:05 MayDaniel joined, birdwindupbird joined
Tarmvred daxim: Symptoms is pretty much the same as when learning Perl6. ;) 19:06
moritz jnthn: can I check if a PAST::Op returns a value? 19:09
19:10 aindilis joined
masak Tarmvred: you're learning Perl 6 the wrong way, then :) 19:26
19:27 wolfman2000 joined
jnthn moritz: There's...a lot of different things that a PAST::Op could represent. 19:29
moritz jnthn: never mind, I've fixed it
well, enough to compile the setting 19:30
jnthn :)
dalek kudo/sink: 89633a5 | moritz++ | src/ (4 files):
codegen .?sink; () directly instead of calling &sink
moritz aaand... only 3 files fail in 'make test' 19:31
jnthn ooh :)
moritz $ ./perl6 -e 'my $x = "foo"; $x++; say $x' 19:32
===SORRY!===
Method 'postcircumfix:<( )>' not found for invocant of class 'Parcel'
a, Str.succ fails
jnthn Well, that succs. 19:33
Str.succ is pretty complex, iirc
moritz the line that fails is my Int ($Ir0, $Ir1) = RANGEPOS($str); 19:35
jnthn Does list assignment generally work?
moritz yes 19:36
(that's the first thing I've checked)
Tarmvred masak: Hehe well, actually I find it extremely fun, and I figured out the answer to the question I came in here for (howto do my($multiple, $declaration). I'm quite new to programming in general but I haven't found anything as fun to learn as Perl, and directly to Perl 6
It's quite addictive
moritz jnthn: curiously the whole block compiled to PIR doesn't contain a single sink call 19:38
benabik Learning new languages and new paradigms is additive. Perl 6 just happens to be like three or four languages and tries to allow as many paradigms as possible.
jnthn moritz: It's not failing somewhere within RANGEPOS? 19:39
moritz current instr.: '_block4586' pc 76654 (src/gen/perl6-metamodel.pir:31072) (src/gen/Metamodel.pm:3425) 19:40
called from Sub 'succ' pc 924224 (src/gen/CORE.setting.pir:247047) (src/gen/CORE.setting:3347)
are the first two lines
masak Tarmvred: I agree -- it's a nice language.
Tarmvred: if you haven't already, check out strangelyconsistent.org/blog/list-of-posts, starting at 1 Jun, 2011. it's a 30-day course in programming and Perl 6. 19:41
moritz and src/gen/CORE.setting.pir:247047 is $P695 = "&RANGEPOS"($P694)
but the first bt line doesn't come from RANGEPOS 19:42
jnthn moritz: Can you gist me the PIR you're looking at? 19:43
May be able to spot something...
Tarmvred masak: Thats perfect, thanks. 19:44
moritz jnthn: willdo
jnthn: gist.github.com/1847311 19:47
a Parcel is what a sink returns 19:49
jnthn nom: class A { sub foo() { say 42 }; method bar() { foo() } }; A.bar 19:50
p6eval nom f9fcb2: OUTPUT«42␤»
jnthn moritz: Does ^^ work in your branch?
moritz jnthn: nope
also 19:51
jnthn moritz: Same kind of error?
moritz $ ./perl6 -e 'my ($a, $b) = "abc".split("b"); say $a; say $b'
Nil
jnthn nom: my $a; my $b; my $c := ($a, $b); $c.STORE((1, 2)); say $a, $b 19:52
p6eval nom f9fcb2: OUTPUT«12␤»
jnthn How about that one?
moritz 12
jnthn ok, so it's not busted Parcel.STORE then...
moritz my guess is really that some declarative stuff is busted 19:53
jnthn The above one with the sub in the class not working is a bit bothersome.
And could easily be the cause of the RANGEPOS issue - which is a sub declared in a class. 19:54
19:54 benabik left
moritz jnthn: gist.github.com/1847382 is the generated PIR for that 19:54
19:55 MayDaniel left
moritz oh 19:55
jnthn aha!
It's sinking the closure clone...
moritz aye
moritz just arrived at the same conclusion
jnthn A nosink around line 346 in World.pm should help 19:56
er 19:57
356
moritz I also think we need one in Actions in block_closure
19:57 benabik joined
jnthn Prolly 19:57
19:58 MayDaniel joined
moritz erm, in World.pm line 356 the top-level PAST::Op is a bind_6model 19:58
so that one shouldn't be sunk, because I don't recurse into PAST::Ops at all
only ever consider the top-level one
jnthn moritz: Yeah, that's why I'm confused how it's getting messed up... 19:59
moritz and only sink if that's a call
jnthn Also, we maybe don't want to even analyze the first PAST::Stmts within a PAST:Block 20:00
As it's always the declarative bits, not the executional bits
+ :pirop('can IPS'), 20:01
Should be IPs
moritz but not every first statement in a PAST::Block is declarative, no?
jnthn For better code gen
moritz ok, will fix that
jnthn moritz: A PAST::Block always contains two PAST::Stmts nodes that the top level
The first one is only for lexiecal declarations, closure cloning, calling the binder, etc.
The second one is what's produced by statementlist 20:02
That is, it contains the list of statements that were actually written.
moritz ok, so I can skip every first element of a PAST::Block
jnthn Right
That's why so much code does stuff with $block[0] :)
20:04 ksi_ joined
moritz then maybe it would be more efficient to make PAST::Block a class with two attributes (for declarative and procedural stuff) than an Array, no? 20:05
jnthn Well, so far the "two children" has been a convention only.
That is, Rakudo and NQP do it, but the compiler toolkit doesn't give any meaning to it beyond that. 20:06
moritz so I shouldn't rely on it in Perl6::Sinker?
jnthn You can rely on it in Perl6::Sinker 'cus its input is code that Perl6::Actions has produced :)
moritz waits for the setting to compile 20:10
meh, now dies during codegen 20:12
seems that $block[1] is Undef, occasionally
moritz refines the codegen 20:14
now the last lurker will have realized that codegen isn't my strong side
20:23 ab5tract left
[Coke] IWBNI strangelyconsistent.org had "next/prev" buttons on blog entries. 20:26
20:28 Chillance left, roadt joined, roadt left
moritz masak: feel hilighted, ^^ 20:29
20:31 mj41 joined
masak [Coke]: I've had the same thought. 20:31
it's not impossible.
flussence
.oO( isn't there a patent on double-linked lists?! :)
masak not only "next/prev post", but "next/prev post on this topic", fsvo "topic". 20:32
...without cluttering up the interface :)
moritz there's enough space under "no notes" and at the bottom of an article 20:33
masak sure, there's enough space. I put lots of space in there. :) 20:34
doesn't mean links won't clutter up that space.
20:34 localhost joined
masak [Coke]: I'll take it under consideration, not least because I was already thinking about something like that myself. 20:35
the main challenge is that introduction of such links causes neighboring posts to require an update whenever a post is created or changes title. 20:36
clearly I need to map out the data dependencies here, end then implement something clever that tracks them and updates the right stuff.
s/, end/, and/
moritz well, if it's just "next" and "previous", the deps don't need to be explicitly declared 20:37
clearly you need a Blog::World that tracks declarations and deps
:-)
meh. The nosink stuff doesn't work, it seems 20:38
masak well, the addition of a new post at the end of the line still affects the previous one by adding a link where there was none before.
moritz yes, but since that's a general rule, it doesn't need to be declared per post 20:39
masak thank heavens, no. everything that can be implicit should be :) 20:40
I wouldn't want to manage inter-post deps *anywhere*.
even the "next in topic" would just work by adding topic tags to posts.
20:40 wolfman2000 left
moritz aye 20:40
dalek kudo/sink: 54d7ab7 | moritz++ | src/Perl6/ (2 files):
codegen improvements, jnthn++.

But it seems it is not enough :(
20:41
20:50 leprevost left
jnthn moritz: What's the next failure? 20:51
dalek p/bs: dff3130 | jonathan++ | src/NQP/ (2 files):
Separate out creation of code objects from addition of methods; not all code objects are methods.
moritz jnthn: still the same failure 20:52
jnthn: ah, but I think I understand why
jnthn: let me try a possible fix here before I bother you again 20:53
jnthn k
jnthn if bothering himself plenty with refactoring multi handling in NQP :)
moritz hm, no, didn't fix it 20:58
moritz tries another thing
20:59 kaare_ left 21:01 birdwindupbird left 21:05 alester joined
dalek kudo/sink: 0b8b2f1 | moritz++ | src/Perl6/ (3 files):
better nosink annotations

Though I do not understand why this is necessary. The sinker code should never descend into PAST::Op nodes, so it shouldn't be necessary in Perl6::World
21:13
21:19 y3llow joined, pothos joined 21:21 y3llow left 21:22 y3llow joined, az5112 joined, pernatiy joined, pothos left 21:23 pothos joined 21:24 y3llow left, y3llow joined 21:25 pothos left 21:26 pothos joined 21:28 pat_js left
dalek kudo/sink: 7ed62e8 | moritz++ | src/Perl6/Actions.pm:
list assignment needs a nosink annotation, otherwise all arrays are empty
21:30
moritz jnthn: now 'make test' passes, except for the file that tests 'use Test;' 21:31
which imports nothing (but lives) 21:32
and I don't understand that all, since Test.pir contains no .?sink calls at all
and the code for 'use Test;' doesn't either
is there any setting code involved in loading a module? 21:33
jnthn moritz: Yes, traits.pm, the export trait. 21:35
Which does a for loop.
21:37 Khisanth joined
moritz -> sleep 21:40
jnthn 'night, moritz 21:41
21:43 preflex joined 21:46 danishman left
dalek p/bs: 61ec7dc | jonathan++ | src/how/NQPClassHOW.pm:
Prepare NQPClassHOW to handle the multi-method changes.
21:53
p/bs: e3b73bb | jonathan++ | src/core/NQPRoutine.pm:
Sketch some dispatcher related methods into NQPRoutine.
p/bs: b103371 | jonathan++ | src/NQP/Actions.pm:
Generate simpler code for attribute lookups in the non-role case.
p/bs: 1c216a2 | jonathan++ | src/NQP/World.pm:
Start to refactor the multi method handling in NQP::World to not rely on DispatcherSub. Not completely done yet; breaks multi-method tests. However, it's enough to get compilation further with the new serializer.
jnthn Enough for today. 21:57
felher jnthn: what does 'bs' stand for?
21:58 az5112 left
jnthn felher: Bounded Serialization 21:58
PerlJam felher: use your imagination :)
jnthn Coming up with bounded serialization takes quite a lot of imagination. :)
PerlJam It's more fun that way though. 21:59
felher :)
thnx :)
jnthn ;)
jnthn is hoping he can get the NQP side of this wrapped up at the weekend, then dig into getting Rakudo using it.
PerlJam jnthn: This should make some things faster, yes? 22:01
22:01 raoul_ joined, packetknife joined
felher reads en.wikipedia.org/wiki/Serialization to at least understand a tiny bit of whats going on and then goes to bed :) 22:01
22:02 ab5tract joined
jnthn PerlJam: Depends what you mean by "things" :) 22:02
PerlJam: It should make Rakudo compilation less memory hungry and faster.
PerlJam: It should also improve Rakudo's startup time. 22:03
It'll also unblock various other things.
Some of which are optimizations.
PerlJam jnthn: any guess how noticable the differences will be between before and after? 22:06
masak why guess? just write it and find out! :) 22:07
[Coke] jnthn will have more spare time!
jnthn PerlJam: It's a bit hard to guess at. I know that just under 60% of the lines of PIR we generate today for CORE.setting are related to re-building the environment, which is what the serialization work is replacing. 22:10
PerlJam wow.
jnthn Of course, it won't replace it with "nothing". :) But it will mean that a LOAD of PAST nodes we build today that generate that PIR will no longer be needed.
PerlJam I knew we were regenerating stuff, but I would have guessed it was more on the order of 20% or so 22:11
jnthn The thing it replaces it with is a (probably epic in this case) binary blob.
22:11 noam left
jnthn Plus building a big array of strings, and a big array of static code refs. 22:11
22:11 noam joined
jnthn Which in terms of PAST nodes should be a drop in the ocean compared to what we have today. 22:12
22:12 ksi_ left
jnthn How much faster startup will be is harder to put a figure on. 22:12
masak still, cause for hope. 22:21
jnthn aye 22:25
22:26 tarch left
jnthn Plus we'll be able to have nice things, like non-literal constants :) 22:26
Talking of nice things...sleep & 22:27
22:28 raoul_ left
masak std: my int ($a, $b) 22:28
p6eval std 52f3895: OUTPUT«ok 00:01 110m␤»
masak nom: my int ($a, $b); say 'alive' 22:29
p6eval nom f9fcb2: OUTPUT«Lexical '$a' is of wrong register type in lexical lookup␤ in block <anon> at /tmp/ZygsqoaYcw:1␤␤»
masak submits rakudobug
nom: my (int $a, int $b); say 'alive' 22:30
p6eval nom f9fcb2: OUTPUT«Lexical '$a' is of wrong register type in lexical lookup␤ in block <anon> at /tmp/oUNZad6Ay3:1␤␤»
masak huh! 22:31
nom: my (int $a); say 'alive'
p6eval nom f9fcb2: OUTPUT«Lexical '$a' is of wrong register type in lexical lookup␤ in block <anon> at /tmp/FpPrEx1LXf:1␤␤»
masak nom: my int $a; say 'alive'
p6eval nom f9fcb2: OUTPUT«alive␤»
masak still a bug, but not what I thought it was :)
22:31 freeu4 joined
PerlJam star: my int $a; say 'alive'; 22:32
p6eval star 2012.01: OUTPUT«alive␤»
PerlJam huh
masak does that surprise you? star works the same as nom. 22:33
PerlJam when I tried that locally, it died in the same manner as above
but I don't have a recently-build rakudo; it's a couple of days old 22:34
freeu4 i can't found any tutorial about compile perl6 code with parrot and rakudo !
masak freeu4: compiling code with parrot and rakudo is easy. just do 'perl6 mycode.pl' 22:35
rakudo compiles your code, and runs it.
22:35 benabik left
freeu4 masak: no creat stand alone file ?! 22:36
masak freeu4: no. neither Perl 5 nor Perl 6 creates a stand-alone compiled file before running it.
freeu4: what is your use case?
(i.e. why is not the script file sufficient for you?) 22:37
nom: my Int $a; say 'alive'
p6eval nom f9fcb2: OUTPUT«alive␤»
masak nom: my (Int $a); say 'alive'
p6eval nom f9fcb2: OUTPUT«alive␤»
masak nom: my (Int $a); $a = "OH HAI"; say 'alive'
p6eval nom f9fcb2: OUTPUT«alive␤»
masak nom: my (Int $a, Int $b); $b = "OH HAI"; say 'alive' 22:38
p6eval nom f9fcb2: OUTPUT«alive␤»
masak nom: my Int $a; $a = "OH HAI"; say 'alive'
p6eval nom f9fcb2: OUTPUT«Type check failed in assignment to '$a'; expected 'Int' but got 'Str'␤ in block <anon> at /tmp/FYE1VJwPBP:1␤␤»
22:39 dju joined
freeu4 masak: i want create a stnd-alone from perl6 script ; like after compile c progrm (./gcc 1.c -o 1) 22:41
masak yes, I understand.
why do you want this?
freeu4 masak: after public my program , everyone can run it 22:42
masak I guess there could be a way to bundle the 'perl6' runtime and the script together into one big binary monstrosity. 22:44
but you have to understand that you gain nothing from this -- you will always need a Perl 6 runtime to run your program.
so all you're doing by bundling things into one single executable is move data around. you won't get a smaller file, or anything like that. 22:45
my 'perl6' file from a recently compiled nom is 74KB. that's... small. 22:46
my guess because most of the stuff is in library files elsewhere.
you'd have to bundle those, too.
in the end, you'd need to bundle all of Rakudo and all of Parrot.
creating what's likely a HUGE file. that's one HUGE file per script you compile to a stand-alone executable. 22:47
consider the alternative -- running the script immediately :)
22:48 lutok joined
masak lots of advantages: smaller files. it works today. when we fix bugs and you update Rakudo, your script will run better/faster. 22:48
nom: constant FOO = 42; say 'alive' 22:50
p6eval nom f9fcb2: OUTPUT«alive␤»
Tarmvred masak: aren't there any perl 5 -> binary compiler/program?
perl2exe ex? Haven't tried it myself though. 22:52
PerlJam Tarmvred: there have been in the past, but most are now defunct.
though I hear that perlcc is being revived
slavik perlcc? 22:53
perl to binary?
PerlJam search.cpan.org/~nwclark/perl-5.8.9.../perlcc.PL
actually ... metacpan.org/module/perlcc that's the latest 22:54
freeu4 masak: thank you 22:59
23:00 freeu4 left
masak dang, I was gonna give freeu4 perldoc.perl.org/perlfaq3.html#How-...de-or-C%3f 23:01
nom: my $n = 0; while $n < 10 { say "HAHA $n"; NEXT { $n++ } }; say "alive" 23:04
p6eval nom f9fcb2: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&NEXT' called (line 1)␤»
araujo looks in 23:05
masak, o/
masak araujo! \o/
nom: for ^10 { foo($_); .say }; sub foo($x) { next if $x %% 2 }
p6eval nom f9fcb2: OUTPUT«1␤3␤5␤7␤9␤»
araujo heh :)
masak, heard around you were going to resume pugs dev? .... do you happen to have some TODO around? :)
masak araujo: no, we haven't been able to consistently create a working dev environment yet. 23:06
the TODO is basically "pick a lot of low-hanging fruit, learn how the Pugs architecture works, have lots of fun"
araujo I see
masak, "working dev environment" ?
care to elaborate? 23:07
masak a Pugs.hs repo on feather that can be compiled. 23:09
moritz got it to work; [Coke] and I didn't. we couldn't find any diff between our ways of setting things up. 23:10
araujo oh I see
I thought you were talking about some SDK or something :P
23:11 fsergot left 23:15 mj41 left
masak no, just Unix :) 23:21
but having the project compile feels like a necessary prerequisite to hacking. 23:22
23:27 tarch joined 23:39 pernatiy left 23:41 Tarmvred left 23:43 snearch left 23:48 tarch left 23:49 whiteknight joined