pugscode.org/ | nopaste: sial.org/pbot/perl6 | pugs: [~] <m oo se> (or rakudo:, kp6:, smop: etc.) || We do Haskell, too | > reverse . show $ foldl1 (*) [1..4] | irclog: irc.pugscode.org/
Set by TimToady on 25 January 2008.
pmichaud TimToady: in regexes, is a colon followed by a word character always considered a modifier? 01:14
i.e., / \d+:abc / parses as / [\d+] :abc / and not / [\d+:] abc / 01:15
(I think I asked this once before and got that answer, but want to reconfirm before committing to code.)
pmichaud oops, that's a bad example, since +: is a token 01:23
so...
<xyz>:i / parses as / [<xyz>] :i / and not / [<xyz>:] i / ?
syle this perl6 stuff gonna be good? or is c/c++ still gonna beat the shit out of it for eventloop performance and such? 05:05
spinclad definitely good. i also note that your two questions are unrelated. 05:37
TimToady pmichaud: that's correct 05:43
syle give control over freeing memory, i can't stress this enough 06:54
i cannot build a big app without that control 06:55
masak syle: well, the general trend goes towards abstracting away memory management in programming languages
syle i understand this , but that is for simple applications under 5 thousand lines of code 06:56
masak I understand that your argument is that need of control is related to code size 06:57
not sure I agree
just as optimization has been successively delegated to compilers, memory management has been successively delegated to GCs
syle i understand free it self is expensive, but if i set my own counters to free memory after so much memory allocation, is it so much to ask? 06:58
masak however, since you have very fine control over your VM (Parrot), you should most likely be able to reach into it and do such things 06:58
...I think
syle thats a cop out, write the free routine and make everyone happy 06:59
masak but we're not quite there yet where anyone can guarantee that
syle: can you explain how your request would not affect everyone else 07:00
more specifically, people who do not want to care about memory management
syle people do CARE about memory management in big applications, are you saying perl6 should be some little scripting language incompentent of being used in big applications? 07:01
masak no
I'm saying that many successful programming languages where people do in fact write big applications do not allow manual freeing 07:02
moritz_ syle: they only care because existing garbage collecters aren't good enough (like perl5s ref counting)
syle on moritz statement yes thats a big factor because of alot of c modules being loaded could keep references and become problematic if the reference has been weakened or not 07:03
regardless perl loads alot of c modules etc, and if some asshole c author keeps a reference, we need better control to free that memory 07:04
masak syle: what happens to the reference? 07:05
moritz_ that's the wrong approach. If there is a reference left, it could segfault
the right approach is to make C extensions much easier and safer 07:06
masak aye
syle well for example, eventlib allows you to remove events, but not destroy them
moritz_ so that it's very unlikely that something like this happens
Perl 6 won't fix buggy C software for you
it simply can't do that
masak syle: it's like this: if the Perl 6 design team said "ok, we'll add it" in reply to every request for features, Perl 6 would be a mess. 07:07
I'm saying your feature request would mess up Perl 6 a little
moritz_ I'd say that if it turns out to be needed, somebody will write a module that does it 07:08
syle omg, look, you malloc so much memory for a hash, allow someone to call free on that exact structure, that is not alot to ask
masak at least until you show me how you can introduce it without also introducing segfaults, and worries for people who don't want to care
masak syle: sounds to me you just want Perl 6 to be C, period. 07:08
get over it
syle in a sense yes
i want it to be better
after using hashes , honestly who wants to be stuck using just arrays and scalars 07:09
masak de gustibus not est disputandum -- you think it would be better, 99% of Perl programmers would hate it
syle well i;d have to ask you what do 99% of perl programmers in your opinion use it for? 07:10
masak Perl?
most things, I guess
including large stuff
syle cgi, tcp , server apps, client apps, what?
masak sure
moritz_ many many CGI and reporting applications 07:11
GUI stuff
everything.
I even read about prototyping scanner drivers with perl the other day ;)
syle i want perl6 to compete with being able to write a tcp server that can compete with c
masak I disagree with the idea that lack of `free()` would prevent one from writing large-scale applications
syle otherwise its useless
masak as moritz_ says, at least wait until you've tried a good GC along with Perl 07:12
you'd be surprised
syle good GC i heard new one is up on google summer of code
moritz_ syle: most people are quite happy with writing applications in perl that are twice as slow as the C equivalent, but take 1/10 of the time to develop 07:13
masak yes
syle so thats a big maybe right
masak syle: it always is with planned code
Java/JVM has developed quite a bit over the years with regards to its GC
syle moritz: i agree completely, but fuk if it was somewhat close to c at 1/10th of the code, you;d dominate the market wouldn;t you
masak syle: that's not a sensible argument 07:14
moritz_ syle: at least the part of the world that doesn't hate sigils ;-)
masak no-one argues that Perl should be unlike C just for the sake of it
it's just unlike C where it's more like Perl :) 07:15
moritz_ and nobody argues that it should be fast
syle well with processors getting faster, and becomming dual core etc, as long as you can compile it i guess in longrun it will survive is the consensus then right
moritz_ but most people think that speed shouldn't be top priority these days
masak however, parallel constructs might be a big win
gotta use those cores 07:16
syle well with async applications , non blocking sockets for example, we are creating more demand on the cpu that memory than ever before
s/that/than 07:17
masak syle: exactly. so forget about your `free()` request :)
syle however if processors reach a point which i suspect that it becomes overly fast and memory stays as expensive as it is, then can run less perl on one box 07:18
i realize with new 8 core cpus, that cpu will become less of an issue, but i have not seen memory drop in price 07:19
but regardless there is still issue of i could run the same app with 10 times more threads in c than with perl 07:20
i am a strong beleiver perl6 with compete with c, and we in the 20th century can stop using languages with shitty structures 07:21
moritz_ you're speaking about your bad experiences with Perl 5
Perl 6 has taken great care not to fall into the same trap
like much less global variables (so that threads stay light weight)
syle perl 5.10 remove the byte code, that pissed me off 07:22
moritz_ byte code?
what do you mean?
masak syle: it's sort of a central assumption in Perl that references cannot dangle. that's why they're _references_, not pointers. if you don't solve that, Perl programmers will simply not be interested.
moritz_ it still uses byte code
syle perl -MO=Bytecode,-H,-oa.out blah.pm 07:23
moritz_ well, nobody was able and willing to maintain that
and fix it
if you want it badly, you can get it in shape
and if you maintain it, I'm sure people will use it 07:24
syle ohhh christ, don;t put that on me, i;m already writing an app in perl5 thats over 7 thousand lines and not done yet
moritz_ but you can't expect volunteers to do exactly what you want
ah, then don't complain
masak syle: think of it! if you get control of the bytecode, you can add your own `free()`! :) 07:25
syle lol well with parrot i think i can probably export my own free routines anyways
i would just like to see it apart of core
moritz_ core is totally overrated 07:26
in Perl 6 core will be just the things that you need to install new modules
masak yeah, core is so 1990
Perl 6 is more of a micro-core
syle ok so standard has changed, usually you have core tree and devel tree 07:27
masak not sure if that's the same nomenclature 07:28
moritz_ devel/maint and core/non-core are orthogonal concepts 07:29
syle Typical anti-egalitarian view 07:32
masak huh? 07:33
in what sense?
eternaleye syle: devel/maint is stability/testedness index, core/non-core is essentiality index 07:40
AFAIU, it's only in core if it's needed to install things that aren't in core
masak however, someone who has different opinions on what should be core is wont to call the division 'anti-egalitarian' 07:41
syle why wouldn't they? 07:44
devel/maint is a means to an end regardless 07:47
syle and while everyone struggles to remember their comp sci debate classes, i;m just stating a free routine would be nice in case new author of GC routine doesn't work out well 07:53
eternaleye syle: GC engines are modular and pluggable, feel free to implement one which hooks into the code being executed with free() routines invoking collection 08:01
pmurias syle: what exactly do you want to be avalible, do you want to force the gc to do garbadge collection or do you want to create dangling pointers and enjoy segfaults 08:56
? 08:57
the perl5 style reference counting dosn't have to eat much more memory than c style manual memory allocation, you just can't avoid having a reference counter on most objects 08:59
so doing manual memory allocation would help on the small scale only 09:04
masak just the opposite of what syle wanted it for 09:09
moritz_ class Foo { my $a }; class Foo is also { say $a }; # is that allowed? 13:35
I mean is "my $a" scoped to the block or to the class? 13:36
pmichaud my is scoped to the block. 13:39
to scope to the class, use 'our'
er.
hmmm. actually, would need our $a in both cases. 13:40
that's my guess, anyway.
moritz_ but then it's not a private variable anymore
our $!a; ? 13:41
pmichaud probably
from S12: our %!cache is rw; # generates no public accessor 13:42
moritz_ ah, cool
it would be really useful if I could search the synopsis with queries like <siglil>'!'<identifier>, where <sigil> takes its definitioin from STD.pm ;-) 13:43
pmichaud I just did a search of S12 for ' our ' 13:44
yes, you're correct, it would be cool. Someday it will even be possible :-)
when we have the p6-version of 'ack', certainly :-)
moritz_ aye
pmichaud afk # appointment 13:46
pugs_svnbot r20390 | moritz++ | [t/spec] changed 'use v6-alpha;' to 'use v6;' 15:14
diff: dev.pugscode.org/changeset/20390
lambdabot Title: Changeset 20390 - Pugs - Trac
pmurias moritz_: is use v6-alpha incorrect? 15:21
moritz_ pmurias: v6-alpha is the perl 6 syntax as we have it today 15:22
pmurias: but the test suite should test Perl 6.0.0
pmurias: so there's nothing wrong with using it, but it doesn't belong into the test suite
[particle] v6-alpha is not legal perl 6 anymore 15:23
moritz_ was it removed from S02?
moritz_ it's still in S01 15:24
(not S02, sorry)
and S11 says The use v6-alpha line also serves as the Perl 5 incantation to switch to Perl 6 parsing. In Perl 5 this actually ends up calling the v6.pm module with a -alpha argument, for insane-but-useful reasons. 15:25
pmurias it is specced in in S11:369
[particle] ah, hrmm, it is still specced.
i thought that had been changed, sorry. 15:26
moritz_ is this valid syntax? my %h{'a' .. 'z'} = (1..26); 15:40
it's in S29-hash/exists.t, but it looks suspicious to me
(and rakudo chokes on it)
[particle] i believe it's valid, but rakudo and list assignment are not friends yet 15:41
moritz_ in perl 5 you can't do things like that
masak moritz_: you can't? why not? 16:04
moritz_ masak: because you first have to declare the container (%h) and then assign ( @h{'a' ... 'z'}) 16:05
[particle] @$_[...] = (...) for \my %h; 16:07
lambdabot Unknown command, try @list
[particle] errands &
masak moritz_: ah, you declare it too. missed that. 16:09
pmichaud (v6-alpha) TimToady has remarked in the past that "use v6-alpha;" is going away. I'm guessing he either changed his mind or that the synopses haven't been changed to reflect that yet. 17:02
[particle] i think the syns are out of date. 17:05
unless you still want them frozen :P
pmichaud uhhhhhh.... NO. :-P 17:06
pmurias how much of Perl 6 remains to be speced? 17:12
moritz_ the second 80%? 17:12
most of I/O and concurrency is unspecced 17:13
iirc there's no formal definition of the hierarchy of the builtin types
pmurias & 17:15
TimToady that won't be legal, but you'll hopefully be able to say (my %h){'a'..'z'} = 1..26 17:27
v6-alpha is going away slowly. :) 17:28
[particle] ah, i had the (accent) on the wrong (syllable). 17:29
TimToady: thank you for bringing even more cool, grey weather to seattle. 17:33
TimToady you must be confusing Mountain View with San Francisco... 17:34
Mountain View tends to be short of cool, grey weather, so that's why I'm going to Tokyo, to fetch some more back home... 17:35
TimToady unfortunately Seattle has bribed the prevailing westerlies to blow a little from the south as well, so you're taking more than your fair share of Tokyo weather from us down south 17:37
[particle] i blow and i blow, but the westerlies still prevail :(
i miss nepal. at least there, if you didn't like the weather, you had three options 17:39
1) walk uphill, 2) walk downhill, 3) wait.
TimToady well, you could hang-glide downhill, or, depending on the weather, uphill as well 17:40
[particle] :) 17:41
TimToady oh, wait, there's no air there--nevermind...
how do they have weather without air, I wonder...
[particle] ask the old man with enormous wings for a lift
pugs_svnbot r20391 | moritz++ | [t/spec] split illegal declaration+initialzation of a hash 18:06
diff: dev.pugscode.org/changeset/20391
lambdabot Title: Changeset 20391 - Pugs - Trac
[particle] moritz++ 18:09
moritz_: have any tuits to add #?rakudo decls to t/spec to make our parsefails less visible?
moritz_ [particle]: I'm currently going through the parsefails... 18:10
[particle]: and I first search for syntax errors, and clear them 18:11
[particle]: when I'm done with that I'll take a look at remaining parsefails
but it's a tedious business atm 18:12
[particle] indeed, it is 18:14
you're starting in s29-hash? 18:15
moritz_ not really, that was a coincidence
[particle] okay.
moritz_ but for now I'll look at various S29-* stuff
[particle] just don't want to step on your toes
moritz_ allright 18:16
[particle] it should be easy enough to skip most of S29-list, as i bet most of it is due to lack of list context
something like #?rakudo emit skip_rest 'no list context'
however, you'll still need #?rakudo 999999 skip 'parsefail' 18:17
...or somesuch, because code in fudge's emit declaration happens *after* parrot parses 18:18
moritz_ @array.delete doesn't seem to work
lambdabot Unknown command, try @list
moritz_ but that's not a parse failure, at least ;)
[particle] what's @array.WHAT ?
moritz_ List 18:19
which might be the problem
[particle] hrmm, src/classes/List.pir contains a 'delete' method
moritz_ it dies with Could not invoke non-existent sub undef 18:20
so I won't fudge the test because it fails legitimately
[particle] yes, that's legit 18:21
that's a rakudobug
moritz_ what's the status of calling 'pop @list' instead of [email@hidden.address] 18:23
I mean in general for those methods that can also be called as sub
s
they seem to cause quite many failures 18:24
[particle] eventually we'll have a role that handles the exporting
currently, we have sub wrappers that call the method
it's possible some of those wrappers are missing
eg: 18:25
.sub delete :multi('List')
.param pmc list
.param pmc indices :slurpy
.return list.'delete'(indices :flat)
.end
pugs_svnbot r20392 | moritz++ | [spec] S29-array/splice.t: qw(..) is normally <...> now 18:30
diff: dev.pugscode.org/changeset/20392
lambdabot Title: Changeset 20392 - Pugs - Trac
pugs_svnbot r20393 | moritz++ | [spec] fudged S29-hash/delete.t 18:39
diff: dev.pugscode.org/changeset/20393
lambdabot Title: Changeset 20393 - Pugs - Trac
pmurias would it be possible to pass additional parameters using the perl5 stack in such a way that they won't end up in @_? 19:07
moritz_ you could use global var instead of the stack 19:09
pmurias figured a way how do what i want withought bring the perl5 stack/xs into the picture
moritz_: what i won't is to pass named params seperatly from @_ 19:12
* want
in a way that subs which don't support them will ignore them
moritz_ pmurias: you could try some evil hackery with a global hash that is indexed by the current sub name, or caller or something like that 19:14
[particle] and use attributes to specify which subs use the global? 19:15
course, that's not thread-friendly
(the global)
pmurias pugs: sub foo($b) {say $b;} 19:17
exp_evalbot RESULT[\sub :($b) "$_" := "Scalar" #<Scalar:0xb72c7e98>␤ "&?ROUTINE" := "Sub" #<Sub:0xb6604cec>␤ "&?BLOCK" := "Sub" #<Sub:0xb6604cec>␤ "$b" := "Scalar" #<Scalar:0xb72c6b7c> {"&foo" := "Sub" #<Sub:0xb7210f70>, "$_" := "Scalar" #<Scalar:0xb7270d00>␤
.. ...
pmurias pugs: sub foo($b) {say $b;}; foo(b=>3)
exp_evalbot OUTPUT[3␤]
pmurias pugs: sub foo($b) {say $b;}; foo(b=>3,c=>5)
exp_evalbot OUTPUT[*** No compatible multi variant found: "&foo"␤ at /tmp/J8yASCGu1v line 1, column 24 - line 2, column 1␤] 19:18
[particle] rakudo: sub foo($b) {say $b};
exp_evalbot RESULT[Method 'perl' not found for invocant of class 'Closure'␤current instr.: '_block10' pc 35 (EVAL_12:16)␤called from Sub 'parrot;PCT::HLLCompiler;eval' pc 785 (src/PCT/HLLCompiler.pir:458)␤called from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 1067 (src/PCT/HLLCompiler.pir:587)␤called from Sub
..'parrot;PCT::HLLCompiler;command_line' pc 1246 (...
pmurias pugs: sub foo {}; foo(b=>3,c=>5)
exp_evalbot OUTPUT[*** Named argument found where no matched parameter expected: ("b",Ann (Pos (MkPos "/tmp/Sld6Xsf8DD" 1 20 1 21)) (Val (VInt 3)))␤ at /tmp/Sld6Xsf8DD line 1, column 13 - line 2, column 1␤]
[particle] heh. that's exp_evalbot getting carried away
rakudo: sub foo($b) {say $b}; 1 19:19
exp_evalbot RESULT[1]
[particle] rakudo: sub foo($b) {say $b}; foo(b => 3)
exp_evalbot OUTPUT[too many named arguments - 'b' not expected␤current instr.: 'foo' pc 38 (EVAL_12:21)␤called from Sub '_block10' pc 32 (EVAL_12:15)␤called from Sub 'parrot;PCT::HLLCompiler;eval' pc 785 (src/PCT/HLLCompiler.pir:458)␤called from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 1067
..(src/PCT/HLLCompiler.pir:587)␤called from Sub 'parrot;PCT::HLLCom...
[particle] rakudo: sub foo(:$b) {say $b}; foo(b => 3)
exp_evalbot OUTPUT[3␤]
pmurias [particle]: re thread safety, are perl threads used much? 19:21
moritz_ pmurias: most people try to avoid them wherever possible ;)
pmurias re passing of named parameters separately, i was trying to do a stupid thing, no wander it has to be done very hackishly 19:23
* wonder 19:24
pmurias hates the fact that his spelling suffers horribly when he uses irc :(
moritz_ rakudo: class A { has $.a; has $.b; }; my $x = A.new(a => 1, b => 2); say $x.a; say $x.b 20:46
exp_evalbot OUTPUT[1␤␤]
moritz_ b0rked 20:47
[particle] yes, i think rakudo only handles the first Pair
not certain though 20:48
rakudo: class A { has $.a; has $.b; }; my $x = A.new(b => 2, a => 1); say $x.a; say $x.b
exp_evalbot OUTPUT[␤2␤]
[particle] so it seems.
moritz_ should I write a small bug report? 20:49
[particle] sure 20:50
moritz_ in NQP this is an error if $<foo> isn't a list: for $<foo> { ... } 21:16
is there an easy workaround?
cjfields I saw the same Pair problem the other day (only accepting the first Pair) 21:21
rakudo: class A { has $.a; has $.b; }; my $x = A.new(:a(1), :b(2)); say $x.a; say $x.b 21:22
exp_evalbot OUTPUT[1␤2␤]
cjfields class A { has $.a; has $.b; }; my $x = A.new(a => 1, b => 2); say $x.a; say $x.b
rakudo: class A { has $.a; has $.b; }; my $x = A.new(a => 1, b => 2); say $x.a; say $x.b
exp_evalbot OUTPUT[1␤␤]
moritz_ cjfields: I submitted a bug report for rakudo
cjfields: but good to know that colon pairs work 21:23
or whatever their name is ;)
cjfields pugs: class A { has $.a; has $.b; }; my $x = A.new(a => 1, b => 2); say $x.a; say $x.b
exp_evalbot OUTPUT[1␤2␤]
cjfields well, pugs gets it right, but I guess that's no longer maintained :( 21:24
moritz_: thanks for submitting that!
meppl good night 21:50
moritz_ good night ;) 21:51
meppl ;)
mncharity pugs: \(4:5,6) 22:07
exp_evalbot RESULT[CaptMeth {c_invocant = IFinite 4, c_feeds = [:MkFeed {f_positionals = [:IFinite 5,IFinite 6:], f_nameds = fromList []}:]}]
mncharity rakudo: \(4:5,6) 22:08
exp_evalbot OUTPUT[Syntax error at line 1, near "\\(4:5,6)"␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤called from Sub 'parrot;Perl6::Grammar;TOP' pc 11308 (src/gen_grammar.pir:249)␤called from Sub 'parrot;PCT::HLLCompiler;parse' pc 564
..(src/PCT/HLLCompiler.pir:348)␤called from Sub 'parrot;PCT::HLLCompiler;compile...
moritz_ what's 4:5 supposed to be?
mncharity i was wondering that. but now think it's an invocant of 4, and extra positional args of 5 and 6.
moritz_ not very intuitive 22:09
we had the discussion what $obj.math:{block} means 22:10
and it turned out to be parsed as $obj.meth :{block}
so why would a capture be parsed differently?
mncharity moritz_: a Capture is a generalized right hand side, and : as a comma-like thing to separate invocant from other args matches the generalized left hand side Signature's similar use for parameters. 22:13
sub foo($a: $b) { ... }
I might not even have been puzzled by it if it had been spaced as \(4: 5, 6) ;) 22:14
moritz_ ok, it can't be parsed as \(4 :5, 6) because that's not valid perl 6, right? 22:16
pugs: print perl \(4 :5, 6)
exp_evalbot OUTPUT[CaptMeth {c_invocant = IFinite 4, c_feeds = [:MkFeed {f_positionals = [:IFinite 5,IFinite 6:], f_nameds = fromList []}:]}]
mncharity TimToady: (1) <capture> uses EXPR which doesn't seem to match '4:5'. should there be a token infix:sym<:> ( --> Comma) ?
re ':5,6', looking... 22:24
mncharity re ':5,6', right, doesn't look like it's a valid parse. 22:26
moritz_ anyway, I'm off to bed 22:27
moritz_ g'night 22:27
mncharity oh, wait. \(4 :5, 6) is valid. it's (:5,6) which looks like not. 22:27
mncharity good night :) 22:27
mncharity wolv: you're... shorter 22:28
ah, back
mncharity :) 22:28
mncharity checks if multi f() {} is valid... (ie, no 'sub') 22:32
yep 22:33
TimToady: (2) plurality_declarator:multi doesn't parse 'multi foo() {}' (ie, implicit 'sub'). 22:35
mncharity oh, that was happy. have parsefail, check STD.pm, notice changes, apply changes, parsefail gone. :) 22:57
Tene nice
mncharity TimToady: (3) regex_def doesn't seem to handle adverbial modifiers? 'token f :P5 {a}' 23:02
mncharity TimToady: (4) fatarrow has a lhs of ident, but STD.pm in several places (and a kp6 test) says 'foo'=>... . ie, lhs string. ?? 23:26
mncharity low-key happiness. if (4) is fudged, STD_red accepts kp6's t/kp6/*.t . 23:38
pugs t/ acceptance is still a mess. 23:39
acceptance does _not_ imply the parse is correct, or the tree returned is healthy. it simply means "didn't choke on it". 23:40
mncharity Are the =kwid ... =cut pod comments in pugs t/ now all obsolete/invalid? 23:48
mncharity TimToady: (5) lots of pugs t/ tests use a =kwid...=cut construct, which STD doesn't understand. depreciated? invalid? 23:50
obra =kwid was ingy's attempt a first cut of pod6 23:52
as I understand it, it's been superceded by damian's pod6 spec 23:53
mncharity thanks obra 23:55
obra nnn 23:56
np 23:57
I can't find the conversation I had with particle last week, but I believe current is:
=begin pod
I don't know if a global search and replace is Right or Wrong