-Ofun: xrl.us/hxhk | pugscode.org | pugs.kwiki.org | paste: paste.lisp.org/new/perl6 or sial.org/pbot/perl6
Set by apple-gunkies on 11 November 2005.
obra seen audreyt 02:56
jabbot obra: audreyt was seen 1 days 3 hours 18 minutes 50 seconds ago
mlh_ getting over jet lag no doubt 03:08
Alias_ jabbot doesn't know what there were saying? 03:24
gaal morning 05:39
PerlJam good morrow 06:00
jdv79 are we there yet?
PerlJam Australia has been there for hours
Alias_ days even
jdv79 huh? 06:01
Alias_ Well, on any given day, we spend most of it in the American tomorrow :) 06:16
GeJ greetings all 06:33
PerlJam Alias_: I doubt that America will look like Australia tomorrow :) 06:34
Alias_ true
Do you have any idea how much effort we put in trying to live in the future! 06:35
PerlJam heh
gaal what ought to happen in terms of exportation for this sub?
sub In::Your::Face { ... } is export; 06:36
Is it okay to disallow this?
ie, reject export requests for scoped subs? 06:37
PerlJam "scoped subs"? 06:38
gaal errrr, qualified ones.
this is &Face, from the package In::Your 06:39
what does the consumer need to do to get this export?
PerlJam Why would you disallow the exportation? 06:40
gaal I'm not sure what it means. 06:41
ignore the export for a a moment:
is this new symbol (or overridden symbol) visible everywhere?
like it would be in p5
PerlJam Should be (unless there's a local policy that would disallow it by making packages "closed" for instance) 06:42
gaal so what does it mean for this to be exported?
what it would have meant if the original package had defined Face is export? 06:43
PerlJam gaal: What does it mean for this to be exported: package Foo; sub bar is export { ... }
And how does that differ from sub Foo::bar is export { ... } ?
gaal those should be equivalent. but consider: 06:44
package Foo; sub Bar::baz is export { ... }
PerlJam That would define the baz sub in the Bar package and make that baz subroutine available to the caller. 06:45
gaal the problem is that someone using Foo has control over symbols that are exported via use:
use Foo <baz> <- weird 06:46
and probably wrong too, because 06:47
package Foo; sub baz is export { <1> } sub Bar::baz is export { <2> }
I'd like use Foo <baz> to give me 1
(instead of a headache) 06:48
how does the caller even request the other export in this case?
use Foo <Bar::baz> looks perverted. 06:49
PerlJam seems like a question for p6l
gaal yeah..
writing up.
PerlJam hopefully you don't get warnocked 06:50
gaal that is always a hope.
Alias_ hmm yields from bulk line testing of PPI are tailing off 06:57
one test failure per half million tests on 120 random line noise
And with that case fixed... that's probably going to drop to 1 per multiple-million, so I'm really into the diminishing returns curve now 06:58
which probably sits over the 1-CPU-hour mark 06:59
obra Did you end up dealing with those last few known cpan edge cases? 07:00
Alias_ I don't know actually 07:01
That's my next step
The only thing nastier than random line noise is CPAN
:)
My biggest problem is there's a leak
1.1k per document, and I've confirmed it's not me leaking circulars
(for a 120char document) 07:02
gaal "valgrind perl -e1" is pretty... stark.
Alias_ I've expanded the CPAN fileset out to 90,000 files
And I can't make it to the end without leaking enough memory to crash my tinderbox-box 07:03
So there's still some issues obviously
But I imagine as far as complexity goes it should handle the corner cases now
we'll soo... I'm doing a final 1-million-document test run and I'll fire up CPAN::Metrics 07:04
see
obra: If I can't locate it by the weekend I'm going to post a beer-metre award 07:06
Hopefully that should help a little
AHA! 07:18
It's the tests that are leaking, not PPI! :)
luqui is replying to gaal 07:20
turns out that I've been thinking a lot about exports recently
PerlJam luqui++ 07:24
gaal luqui: good, me too :)
audreyt stevan__: twigils is out of fashion now, especially %:foo 07:30
stevan__: it became %!foo and then made optional
stevan__: I'm sorting out some $job stuff; will check back ~4hrs from now
I've seen the boot code; will read it after job 07:32
(I changed the twigils to !)
tewk boot code uses equals assignment ie ::Module = ::Class.new(); which doesn't parse yet, I believe. 07:36
svnbot6 r8248 | autrijus++ | * change twigils from : to ! to align with S12.
audreyt mm
it can certainly be desugared
luqui thinks the whole private thing can be handled better using exports 07:38
export to the "method namespace" of the object, or some such 07:39
Alias_ audreyt: PPI 1.108 uploaded to fix yet more here-doc corner cases 07:47
audreyt: I can't make it crash any more 07:48
audreyt tewk: implemented
Alias_ 1,000,000 x 120-character random line noise passes
audreyt Alias_: excellent!
Alias_ Final phase is "all of CPAN"
audreyt but this is tokenizer?
Alias_ Nope
audreyt oh, the whole thing
you rock 07:49
svnbot6 r8249 | autrijus++ | * PIL.Native.Parser: Binding is desugared:
r8249 | autrijus++ | $a := 1; $a.add(2)
r8249 | autrijus++ | becomes
r8249 | autrijus++ | (-> $a {$a.add(2)}).(1)
r8249 | autrijus++ | * Fix boot code to using :=
Alias_ All the way out to full ::Document objects
audreyt I thought you said you had enough of it
;)
Alias_ Turns out there were less problems than I thought
Maybe 10-15
audreyt wonderful
but I need to be offline and work out this $job thing :)
Alias_ line noise doesn't stress the "lexer" enough though
audreyt will be back in ~4hrs
Alias_ So I'll throw CPAN at it a few times and we'll see
audreyt yeah you need token generator
instead of random chr, make it random useful tokens
Alias_ right, CPAN 07:50
audreyt and chain them together
Alias_ random useful tokens
audreyt nah, cpan is not random enough... need a markov chain
but CPAN is a good start
Alias_ You can write that for me then
CPAN is phase 3, it will suffice
audreyt sure :)
yup
Alias_ phase 4... yeah, you can do
audreyt tewk: See if := makes sense to you and write some tests?
need to run now... bbiab 07:51
&
gaal goes afk too &
Alias_ By "had enough" I generally mean "until I have a decent night's sleep"
I get sucked back in
gaal luqui++ # response makes sense 07:54
while you're at it please see my mail before that, on a similar subject
afk fer real &
Alias_ blm: did you get my response? 07:55
blm Nope.
Did you do /msg NickServ IDENTIFY ?
Sorry! 07:56
Alias_ several times
And it doesn't seen to like me
oh well
blm Yes thought you would have
Alias_ Actually, brb
blm ok :-)
tewk audreyt: will do. 07:58
svnbot6 r8250 | tewk++ | Pil.hs 09:04
r8250 | tewk++ | - added -p and -P to just dump parsed output
r8250 | tewk++ | t/pil/bindings.t
r8250 | tewk++ | - initial tests for := bindings in mini-lang
tewk audreyt: Where do I go to add line and column for this error message, pil: user error (Invalid number of args [] vs params ["%params"])? 09:23
./pil src/PIL/Native/Bootstrap.pil generates the above error message 09:25
svnbot6 r8251 | tewk++ | Fixed syntax error due to missing comas
pd Missing comas isn't necessarily a bad thing. 09:29
meppl guten morgen 09:31
clkao who maintains the smokeserv? 09:38
svnbot6 r8252 | xgl++ | fixed squinting my variables 09:51
Alias_ grr... very very bored right now
nothingmuch sneezes 11:03
perlmonks.org/?node=Visit%20Reaped%...num=515681 11:21
gaal rehi 11:26
nothingmuch hola gaal 11:28
xinming bool 11:29
?eval bool
11:29 evalbot_8246 is now known as evalbot_8252
evalbot_8252 Error: No such sub: "&bool" 11:29
xinming ?eval boolean
evalbot_8252 Error: No such sub: "&boolean"
xinming hmm, is there a function to use instead of ? for boolean context? 11:30
Alias_ bool::erm 11:31
gaal yo nuff 11:32
xinming: where would you use it, for precedence fixing? 11:33
xinming gaal: hmm, I will use ? most time, But I think if there is a Bool function which will turn the context into boolean would be good, 11:36
gaal how is this function distinct from "?"? 11:38
xinming no difference. :-P 11:39
gaal clkao: iblech, I think. 11:41
xinming: :-)
xinming: by the way, type declarations will probably do coersion, not raise an error. so: 12:02
my Bool $x = some_expr; 12:03
$x will be boolean.
afaik this isn't final though.
kane-xs_ my $x = !!some_expr; # so much more intuitive! 12:05
gaal well, in the case of punctuation the starting point was that you could say ?some_expr. 12:06
12:15 Jooon_ is now known as Jooon
fglock xinming: the function for boolean context is 'true()' 12:17
xinming ?eval true("")
evalbot_8252 bool::false
xinming how about the numberic and string context? 12:18
fglock +() and ~() 12:19
xinming hmm, I mean the function.
not the prefix operator. 12:20
wolverian function, operator, what's the difference? :)
fglock you mean the text-named function - I don't know if there is one for num and str. There is int() for integer 12:21
xinming wolverian: prefer to have a clear name for the operator. 12:22
after perl 6 can be hosted, I think I will make the suggestion.
s/hosted/self-hosted/
fglock sub num($x){+$x} sub str($x){~$x} 12:24
xinming hmm, I mean for default perl 6. :-)
gaal och, I'm being bitten by autovivification not working on raw ASTs. Is there a convenient way to get it? 12:25
xinming I know we can write it ourselves. But if default perl 6 has such functions will be better. :-)
fglock xinming: you can make suggestions in p6l
gaal Syn "=" [Syn "{}" [Syn "{}" [Syn "{}" [ ... ] ] ] ]
at least, I think that's what's happening... the expression fails. 12:27
fglock xinming: for stringification, '1.as("%d")' 12:29
but 'as(1,"%d")' doesn't work yet 12:31
or you can use 'sprintf("%d",1)', which is pretty standard 12:32
oh, 'as(1:"%d")' works 12:33
wolverian isn't there an infix 'as' operator too? 12:34
it's in the precedence table, anyway, but I can't find its description :)
Alias_ as is a multi thing 12:36
wolverian hm? 12:37
Alias_ it's something weird :)
wolverian yeah. I have the impression it's not final, either. 12:38
maybe just because coerce<as> makes no sense whatsoever to me. 12:39
Alias_ coercion needs to be graph-based, so you can't do it as a method
wolverian coercion has disappeared from the synopses.. 12:40
or my grep is broken :)
Alias_ I talked it over with Audrey last week, and it's good
wolverian it?
Alias_ coercion
It will cover all the cases it needs to
and do it the right way 12:41
wolverian I'm talking about the syntax. :)
Alias_ the syntax is part of it I guess 12:43
wolverian I don 12:44
't see it defined
svnbot6 r8253 | xgl++ | fixed t/pugsbugs/parsing_if.t; 12:46
r8254 | xgl++ | fixed t/pugsbugs/parsing_if.t; 12:49
r8255 | kane++ | r499@coke: kane | 2005-12-15 14:14:40 +0100 13:16
r8255 | kane++ | * fix some pod in Installation.pm
r8255 | kane++ | * make uninstall() work from pkg::installed->...
r8255 | kane++ | * this should be moved to installation.pm in due time
r8255 | kane++ | * fix bug in packlist generation in pkg::source
r8255 | kane++ | * add basic uninstall tests
stevan__ tewk, audreyt: sorry if I was not clear, the Bootstrap has much hand waving in it :) 13:22
audreyt++ # := makes things /much/ easier :) 13:33
fglock stevan_: I'm translating the factorial program to p5 13:34
stevan__ fglock: cool
audreyt: rebinding even seems to work as expected
$x := 3; $y := 5; $x := $x.add($y); $x; gives me 8 13:35
tewk: please add some tests for rebinding too :)
fglock bbiab
stevan__ audreyt: I have a small "wish list" for the mini-lang when you have some time 13:36
if we could load the boostrap as a file, rather than embedding it in the Haskell, that would be good
stevan__ has evil alternate metamodel ideas :) *cough* prototype-based *cough* 13:37
audreyt: and if we could make bit.and and bit.or more lazy, that would be great
Alias_ DIE DIE DIE!
stevan__ Alias_: is that for me? :) 13:38
or HEREDOCS
Alias_ both!
stevan__ LOL
Alias_ Buit heredocs first
home for me 13:39
night
stevan__ night Alias_ ... sweet HEREDOC-less dreams
Alias_ I think I killed the last of the heredoc bugs... next up are the nightmares of 100,000 line 500k Perl files
Go look at the source for Genezzo::Parser::SQL 13:40
night
stevan__ audreyt: oh, one last thing.. I need some kind of looping construct 13:44
svnbot6 r8256 | stevan++ | PIL.Native.Bootstrap.pil
r8256 | stevan++ | - ::Class.bless now uses the := operator, which desugars into
r8256 | stevan++ | exactly what was there before (however now it is much more
r8256 | stevan++ | readable :)
stevan__ list.apply(->$x { ... }) would be nice 13:45
some kind of do while would be nice as well :) 13:55
stevan__ is off to $work 14:01
pasteling "avar" at 212.30.222.56 pasted "Fibonacci" (9 lines, 206B) at sial.org/pbot/14972 14:03
avar woo;)
I'm doing some algorithm benchmarking on different programming languages 14:04
wrote a fibonacci algo in C, it calculated fibo(40) in 22 secs, currently doing php, 15mins and counting;) 14:05
xinming pugs will defeat all by the slowliness. :-P
avar we'll see;)
would a: 14:07
if expr
block;
syntax have been ambiguous to something else in perl6? 14:08
$ time php fibonacci.php
165580141
real 22m6.098s
;)
we'll see about pugs;) 14:09
?eval 1 any(1,2) 14:12
14:12 evalbot_8252 is now known as evalbot_8256
evalbot_8256 Error: unexpected "a" expecting operator, postfix conditional, postfix loop, postfix iteration, ";" or end of input 14:12
avar ?eval 1 == any(1,2) 14:13
evalbot_8256 bool::false
avar ?eval 1 == any(1..2) 14:14
evalbot_8256 bool::false
avar ?eval 1 == 1|2
evalbot_8256 bool::false
avar ?eval 1 == (1|2)
evalbot_8256 bool::false
SamB your any is strange
avar that should work, unless I'm missing something 14:15
unless $roll == any(1..6) { print "Invalid roll" }
if $roll == 1|2|3 { print "Low roll" }
from syn03
SamB strange ways of doing things, you perl users have... 14:16
avar ?eval 1 == 1 or 1 == 2 14:17
evalbot_8256 bool::true
avar must not be implemented or something
xinming ?eval 1|2 == 1
evalbot_8256 bool::false
SamB in Haskell, I would write "any (==roll) [1..6]"
xinming hmm, seems like a bug
SamB ?eval any(1..6)
evalbot_8256 1
SamB ?eval any(1..6)
evalbot_8256 1
avar ?eval ~any(1..6)
evalbot_8256 "1"
SamB whats it supposed to do? 14:18
is it nondeterministic?
avar 1 == any(1..6) is the same as 1 in range(1,6) in python 14:20
returns true if a number belongs to the range
or rather, not a range, but any of a given whatever
SamB hehe. 14:21
avar doesn't have to be a number range
?eval "foo" eq any("bar", "foo", "zar")
SamB only 1 in range(1,6) actually returns true
evalbot_8256 bool::false
avar yeah, only that
but we have a solution to this issue 14:22
?eval not "foo" eq any("bar", "foo", "zar")
evalbot_8256 bool::false
avar ahem
?eval not ("foo" eq any("bar", "foo", "zar"))
evalbot_8256 bool::false
avar ?eval !("foo" eq any("bar", "foo", "zar"))
evalbot_8256 bool::false
avar !!!!
?eval 1
evalbot_8256 1
avar ?eval ?1
evalbot_8256 bool::true
avar there!
;)
xinming avar: Did Pugs finished calculation? :-) 14:27
avar 14 mins and running 14:28
it can defeat php yet
xinming I know, 14:29
?eval (1..10000000).sum.say; 14:31
evalbot_8256 pugs: out of memory (requested 1048576 bytes)
avar ?eval (0..Inf).sum 14:33
evalbot_8256 pugs: out of memory (requested 1048576 bytes)
pasteling "gaal" at 192.115.25.249 pasted "exp failing" (8 lines, 364B) at sial.org/pbot/14973 14:38
svnbot6 r8257 | autrijus++ | * by stevan's request, implement three more methods (do_if, do_unless, do_for) for Sub:
r8257 | autrijus++ | ->$x{$x.add(1)}.do_for(1,2,3,4)
gaal audreyt: any idea? this doesn't look like an autovivifaction problem, autovivify happens elsewhere for me in similar usage. 14:40
avar xinming: still going at 24min;/ 14:43
xinming avar: IMHO, It might go at least 40 min where the result is estimated by the 22 of PHP. :-P 14:45
pasteling "gaal" at 192.115.25.249 pasted "order matters" (11 lines, 420B) at sial.org/pbot/14974 15:01
gaal this is weird! in the order nopasted, it works.
when I switch (1) and (2), it doesn't. I can't figure out why, though.
kane-xs_ itym size matters
kane-xs_ hands gaal an extra few bytes
gaal transmutes kane-xs_'s bytes into words 15:02
avar xinming: 44 mins and running 15:20
xinming ...
I under-estimated the slowliness of pugs. >_<
pd xinming, I tried running mops.p6 under pugs, clocked it at about 0.0013087 M op/s 15:38
Which is less than 2000x slower than perl5, woo hoo! 15:39
xinming It will be much faster after the perl 6 running on top of parrot. :-) 15:41
pd Yeah, I'd like to know if/when that's the case. I haven't gotten pugs to emit anything that I could run on parrot, but at the moment it seems somewhat verbose. 15:42
avar do modules like Digest::SHA1 work with pugs? 16:28
?eval use Digest::SHA1
16:28 evalbot_8256 is now known as evalbot_8257
evalbot_8257 pugs: *** No such method: "&use" at <prelude> line 62, column 30-59 16:28
avar right..
Khisanth I don't think the evalbot allows that 16:30
rafl Evalbot is restricted, yes. 16:31
masak does anyone know how the p5 'exists $hash{$key}' idiom is written in p6? 16:34
gaal avar: if you want a perl 5 package, you do use perl5:Digest::SHA1 (note one ':' after "perl5")
masak i find that '%hash.exists($key)' works, but is there another way?
gaal do find out if a hash key... exists? :-) 16:35
I think the imperative version needs to be a macro, if that's what you mean 16:37
masak gaal: ...and we don't have macros yet, hence i have to write it as a method call, correct? 16:55
gaal for now, yes 16:57
wolverian I dislike the macro version
(the perl5 version)
svnbot6 r8258 | masak++ | changed tests because we don't have macro version of hash &exist yet 17:00
r8259 | kane++ | r503@coke: kane | 2005-12-15 15:09:06 +0100 17:03
r8259 | kane++ | * move uninstall code to Installation->unregister
r8259 | kane++ | * split out removing alternatives and available objects to seperate methods
r8259 | kane++ | * linking is next
r8260 | kane++ | r504@coke: kane | 2005-12-15 16:21:34 +0100 17:06
r8260 | kane++ | * abstract the linking code out to a sub in Installation.pm
r8260 | kane++ | * remove pkg::installed->uninstall and make it point to Installation->unregister
r8260 | kane++ | * remove a few uses of File::Spec in favour of path::class
r8261 | kane++ | r505@coke: kane | 2005-12-15 17:59:07 +0100
r8261 | kane++ | * note we need more tests :)
rafl kane-xs_: My work is done for this month. JIB hacking can continue :-) 17:07
kane-xs_ hooray!
rafl kane-xs_: I think I'll start with writing Repo tests.. ;-)
kane-xs_ rafl: i've been hacking away wildly
yes, tests good
repo may be broken now, there were no tests to check :(
rafl Why should it be broken now? 17:08
It seems to work for me.
r0nny yi
rafl Hello r0nny 17:09
kane-xs_ i changed the way config works for example
quite dramatically even
although hte api shoudl be *mostly* the same.. unless you were catting paths together
anyway, i didn't say it /was/ broken, just that it could be, as there were no tests :)
rafl Does stuff like SUBDIR_OF_ROOT belong to the config? 17:10
Oh, yes. It does. 17:11
JIB::Config looks funny now. :-) 17:12
kane-xs_ yeah.. but it wokrs like a charm
rafl THe only thing that looks wrong is that $r = JIB::Repository->new(root => "foo"); $r->create; $r->add_files("t/src/p5-Foo-Bar-1.2-cpan+KANE.jib");' creates a 'fr' directory. 17:13
kane-xs_ yeah.. the 'root' dir is 'fr' in teh config.. i set it to 'fakeroot' explicitly in the tests
it should be '/' ultimately of course 17:14
but with so much prototype code, that makes me nervous
rafl When is it created? 17:15
kane-xs_ it's created in t/inc/conf.pl
which is included in a few tests
rafl But it's not created when running tests but when executing the above code to create a repo and add a jib to it. 17:16
kane-xs_ then your repo code creates it
gaal audreyt: d'you think you'll be here about 12 hours from now? 17:18
kane-xs_ $dir->mkpath() or error($!), return;
so yeah, its' your repo code rafl
rafl: just include conf.pl in your tests and All Will Be Well (tm) 17:19
just copy the relevant chunk from say, 020.t
rafl It should not do that. $config->root is not in @dirs, afaik. 17:21
kane-xs_ my @dirs = ( 17:22
$self->root,
so i'd say it is
rafl $self->root, not $self->config->root
kane-xs_ ok.. i don't know -- add tests, we'll see :) 17:23
kane-xs_ home now -- back later
rafl Well, I blame JIB::Pkg. :-)
pasteling "fglock" at 200.17.89.80 pasted "p5 version of: (-> $n {-> &f { $n.eq(0).cond( ->{1}, ->{$n.multiply(&f.($n.subtract(1)))}) }.(&?SUB)}).(10)" (29 lines, 758B) at sial.org/pbot/14975 17:25
fglock stevan: I can't make it work - there may be a problem with the number of parameters to &f ? 17:26
I picked the code from t/pil/simple.t 17:32
tewk fglock: what generated that code? 17:39
fglock tewk: you mean the p5 code? it was hand written 17:43
tewk stevan: $a := 5 should return nil right. 17:44
stevan tewk: yes IMO at least
fglock stevan: please see sial.org/pbot/14975
the factorial in r8195 log is different - I will try that 17:50
svnbot6 r8262 | tewk++ | PIL rebinding test
fglock tewk: I'm writing p5 code by hand first, then I'll try to write a generator 17:51
stevan fglock: my factorial doenst use the $?SUB 17:52
fglock stevan: so I'm using the wrong one. Is this correct? colabti.de/irclogger/irclogger_log/...l=168#l246 17:54
tewk the simple.t factorial was a audreyt example I believe 17:56
stevan fglock: this one (use.perl.org/~stevan/journal) is the one I have messed with
and then what tewk said :)
both work
$?SUB is magical though,.. so it means you have to write more stuff to deal with it
the one in my journal doesnt use $?SUB
fglock ok - I'll try with the journal version 17:58
svnbot6 r8263 | tewk++ | wanted_features.t 18:08
r8263 | tewk++ | - Test Driven Development :)
r8263 | tewk++ | t/pil/bindings.t
r8263 | tewk++ | - stevan's rebinding test
tewk stevan: take a look at r8263
opps, wanted_features.t needs a little refactoring to make it lambda friendly 18:11
my imperative mind took control
stevan tewk++ # doing all the things I dont currenly have the tuits to do :) 18:17
tewk: i will take a look when I can,.. I am currently putting out @fires for $work 18:18
tewk stevan: understood
hmmm if we have list.apply (map), do we need dowhile and loop? generic loops are hard to write in lambda because they often involve accumulators. 18:30
maybe what we need is map, fold, zip which are special purpose looping structures. 18:31
stevan tewk: I have a do_while for the block type in the ObjectSpace prototype, not sure if it would have the correct level or purity though 18:33
tewk file, line number? 18:34
stevan perl5/Perl6-ObjectSpace/lib/Perl6/Core/Block.pm 18:39
tewk: I also hacked this together this morning ... (wait for the nopaste bot) 18:40
tewk no problem 18:41
pasteling "stevan" at 69.3.245.254 pasted "Looping with the min-lang" (13 lines, 248B) at sial.org/pbot/14978
stevan its a hack for sure,.. but its a start maybe
I think we need list-style macros in our mini-lang
macro infix<:=> ($lhs, $rhs) { -> $lhs { $rhs } } 18:43
simplistic yes, but something likethat would be nice :) 18:44
pasteling "fglock" at 200.17.89.80 pasted "2nd try: minilang->p5 factorial" (50 lines, 1.3K) at sial.org/pbot/14979 18:49
fglock this version doesn't work yet, but it prints a trace that can help find the bug 18:50
fixed! I'll post in a sec 18:53
pasteling "fglock" at 200.17.89.80 pasted "working minilang->p5 factorial example" (48 lines, 1.3K) at sial.org/pbot/14980 18:56
fglock stevan: does this make sense as a possible p5 implementation? 18:57
stevan fglock: yes 18:59
fglock: I am not sure all the mini-lang stuff will be translatable to pure perl without issue 19:03
it might make sense to make a p5 impl of the underlying mini-lang objects
fglock stevan: ok 19:06
I hope the minilang don't get too complex :)
tewk stevan: right so what does f do, usually a recursive function passes some state along to itself as a parameter( the accumulator ). the state can be a list.
stevan fglock: it won't, I promise :) 19:08
fglock I'm trying to find out why I need '->()' in the end of the sentence '$fun_f->( $fun_f, $var_n )->()' - this looks like an error. The minilang version doesn't need it.
stevan: :)
tewk What I just described is called fold in lisp. Which can be extended to take integers as additional accumulators which gives you do_wuile, for
stevan tewk: which f are you speaking of?
tewk &f.($x, &f, &c) this one. 19:09
stevan tewk: that is the body of the function
fixed point combinator stuff 19:10
if you dont have named functions (which we dont), then you cannot have a recursive func
cause you cannot call it by name
so you have to pass it as an arg to itself,.. call-by-value,... then you can recurse
tewk Right I get it. 19:11
So is &f defined in the mini-language or in Perl6
stevan fglock: you need to do that extra ->() to keep things lazy
fglock stevan: the minilang dereferences functions automatically? 19:13
stevan hmm 19:14
wait,.. nevermind,.. lemme look again
fglock bbiab 19:15
stevan fglock: your cond() needs to eval the subs 19:20
$_[0] ? $_[1]->() : $_[2]->()
that should aleviate the need for the extra ->()
tewk stevan: doesn't binding := in a way give you named functions?, I know it gets desugared underneath, but what is different between := and (define) in scheme? 19:22
If &f is in perl6 that operates on an environment, It makes sense. 19:23
If &f is mini-lang defined (pure) it can only return a value. Without additional state it is useless. 19:24
stevan tewk: binding gives us named functions, but I am not sure they will work for recursion, it becomes a scoping issues at that point 19:25
tewk: I am not sure I understand the your point re: &f in mini-lang terms 19:26
with the pure approach you need to carry around the environment explicity
you'd be suprised what you do with *just* functions :) 19:27
tewk I'll put together a paste. 19:29
stevan tewk: see (search.cpan.org/src/STEVAN/fp-0.03/...lambda.pm) ,.. scroll down to the list implementation :)
xinming why there will be Chinese Characters? *_* 19:33
stevan xinming: ??
xinming oops. sorry for the wrong encoding of the browser. :-/
Ī» in GB2312 encoding is a Chinese character. :-) 19:34
stevan ah
:)
utf-8 :)
xinming by the way, what's that exactly? 19:35
stevan xinming: it is pure lambda calculus in perl 5 19:36
just for fun mostly :)
xinming is using m4 to make a cgi. :-P 19:40
the same reason
tewk "you'd be suprised what you do with *just* functions", yeah I understand pure lambda calculus. 19:45
stevan tewk: :)
tewk Well, this (named functions) seems to work even if it's not suppose to: $a := (-> $x { ($x.eq(0)).cond( ->{"Done"}, ->{$a.($x.subtract(1))}) }) ; $a.(10000) 19:46
stevan tewk: nice :)
what does it parse as? 19:47
fglock stevan: thanks - it works after fixing cond() 19:48
stevan fglock: nice :)
tewk 12:50 tewk@flaka:~/srcs/pugs]$ ./pil -p '$a := (-> $x { ($x.eq(0)).cond( ->{"Done"}, ->{$a.($x.subtract(1))}) }) ; $a.(10000)' 19:51
(-> $a {$a.(10000)}).(-> $x
{$x.eq(0).cond(-> {"Done"}, -> {$a.($x.subtract(1))})})
kane_ wow.. you wrote lisp! 19:52
stevan tewk: yea that is strange
I didnt think that would work
tewk kane_: pad "Greenspun's Tenth Rule of Programming: any sufficiently complicated C or Fortran program contains an ad hoc informally-specified bug-ridden slow implementation of half of Common Lisp." 19:54
stevan makes a note to ask audreyt about scoping
tewk - Philip Greenspun
s/C or Fortran/Perl :)
stevan tewk: maybe the scopes are execution scope, instead of lexical scope
tewk: are you going to school for CS? 19:56
tewk I've graduated once, I'm finishing a masters thesis right now. 19:57
stevan tewk: of course you thesis is on Pugs right :) 19:58
tewk I wish, my masters thesis is XQuery natively embedded in scheme, I would love to do some phd work with pugs/perl6. 19:59
PerlJam tewk: ick.
stevan PerlJam: ick on the PHd or ick on Pugs :) 20:00
tewk: where are you going to uni? 20:01
tewk That was my question?
BYU Phil Windley is my advisor. www.windley.com. That's my only tie to fame in the IT/geek world.
PerlJam stevan: ick on XQuery embedded in Scheme. 20:02
stevan ah
tewk He is a pretty well know name.
stevan I second that one :)
stevan lunch has arrived ,.. yummy Pork in Garlic Sauce :) 20:03
tewk Well as an aspiring lambda head, XQuery was designed by Phil Wader(one of the principle minds behind Haskell), so it is functional of course.
stevan eating &
tewk: XSL is a functional language too ;)
with a really really really ugly syntax 20:04
tewk Scheme has sexprs and Perl6 isn't finished, thats why I choose Scheme.
I'd like to graduate before Perl6 releases :) 20:05
but you could replace scheme with Haskell or Perl6
stevan: amen, XSL is very very nasty, XQuery is not usually written in XML. 20:06
So the idea is to take XQuery semantics and put them in scheme as sexprs.
No more quoted query strings, SQL syntax, etc in code. 20:07
Microsoft "stole" my idea and with XLINQ in C# 3.0
:)
PerlJam tewk: I'd rather see something in haskell than scheme. 20:09
pd speaking of XML, XSL, and shorthand for them, there's also pxsl: community.moertel.com/ss/space/pxsl
PerlJam tewk: or even perl6 (it doesn't matter that it's not finished)
pd it looks more like something a python fan would love
PerlJam pd: it does evoke a pythonesque mood 20:10
tewk PerlJam: given infinite time I would have liked to do haskell or perl6, but graduation is alot like business. You adopt some necessary evils to graduate :) 20:12
PerlJam tewk++ good luck on that graduation thing :)
tewk Well I've mentioned scheme, C#, and have been labeled as a pythonic. 20:13
tewk fears for his life :)
PerlJam tewk: people who inhabit the true spirit of perl are language agnostic.
PerlJam wanders off to do some work 20:14
tewk Thanks 20:15
I agree.
SamB how can *people* be language-agnostic? 20:17
_fallen- are hare somebody who worked with PARROT? =))) 20:44
obra There are some. What's your question?
_fallen- i need your opinion 20:45
about it
pd breaks out his magic 8 ball
integral The blue definately looks better
pd _fallen-, parrot is nifty. Anything in particular you want to do with it? 20:46
_fallen- pd maybe =)
pd Then maybe it'd work out. :)
_fallen- lol 20:47
pd Anyhow. My opinion is that parrot is fun to play with and hack on, but it can be a bit of a moving target, and thus you'd want to pay attention to the list and the (working) example code out there to see how things are done. 20:50
For example, partcl, the (partial) Tcl implementation in parrot--it's generally kept up to date. 20:51
20:53 mugwump_ is now known as mugwump
stevan nothingmuch: ping 21:14
nothingmuch ducks 21:15
stevan nothingmuch: can we talk on IM? 21:16
nothingmuch sure
stevan sign on please :)
kolibrie so, I've been missing in action for a while (3rd child was born) 21:22
I notice that autrijus is now audreyt?
stevan kolibrie: yes 21:24
kolibrie stevan: reasoning?
stevan he has promised a journal to explain 21:25
kolibrie I looked for a journal entry with explanation... they do seem sparse of late 21:26
obra Give it a bit of time. Audrey has been travelling and is now crunching on a customer project 21:27
stevan he is still the same a(trijus|udreyt) as far as I am concerned, it just means my fingers need to adjust a bit :) 21:28
I mean no one seems to care that I am really a dog
stevan *woofs*
kolibrie no hurries, the last journal suggested "brief pause" 21:29
obra It's the internet. Your canineness is not an issue. This is well-established.
stevan :) 21:30
kolibrie stevan: no change for me, just type au-TAB
stevan wags his tail
kolibrie: that is how I see it too :)
pd that's fortunate--I never could spell autrijus. 21:31
stevan although my fingers were trained to aut-TAB because of autark-jp
kolibrie yes
and I could almost pronounce autrijus, I think 21:32
all that time spent practicing
dduncan I just looked up Perl 6 on Wikipedia for the first time ( en.wikipedia.org/wiki/Perl6 ), and noticed that some details are out of date, so I'm going to go and update them over the next few minutes 21:41
put some use to the account I got there a few days ago 21:42
kolibrie dduncan++ # keeping Wikipedia up-to-date 21:43
dduncan I'll post a note here after I made the changes ... until then, assume I didn't do them yet 21:45
22:15 evalbot_8257 is now known as evalbot_8263
dduncan okay, today's set of changes are made ... en.wikipedia.org/wiki/Perl_6 ... diff history for exactly what I did 22:27
luqui dduncan, you know that =<> is still valid, right? 23:14
the "fish operator"? 23:15
dduncan perhaps, but I figured that =$*IN was more self documenting
and hence put Perl 6 in a better light
that's why I changed that one 23:16
luqui I suppose
except that the semantics are not equivalent
dduncan the main "correction" I made was actually the argument syntax, with the ? and : etc
luqui right
=<> will read from files in @ARGS, $*IN won't.
dduncan I also split up the paragraph on parrot at the top, since it looked confusing to have pugs info mixed in 23:17
luqui yeah, I agree with that one for sure
dduncan is that the same as perl 5?
in perl 5, <> was stdin, I think
luqui yep
oh, no
<> is the ARGV handle
dduncan well, the example was showing a perl 5 equivalent, right
luqui which defaults to STDIN when there are no command line arguments
dduncan so what do people use more? 23:18
personally, I used STDIN in perl 5 when I meant that
PerlJam I wonder if =<> will be any different from =''
luqui while (<>) is the convention for scripts, because you can pipe to them or specify files on the command line
PerlJam, I think we disallow the latter 23:19
PerlJam luqui: why?
luqui er, no, that probably just reads from the empty file
which probably doesn't exist
PerlJam luqui: The <> in =<> are just funny looking quotes
luqui they are funny looking *brackets*
<> is equivalent to []
er, rather, ()
PerlJam er, what? 23:20
luqui <foo bar baz> is equivalent to ("foo", "bar", "baz")
PerlJam %hash<foo> doesn't look at all like %hash('foo')
luqui it's a subscripter there
in any case, they construct lists, not strings
(lists of strings)
PerlJam Then what's <<foo bar baz>> 23:21
?
luqui the same things, except that it interpolates
<> is to '' as <<>> is to ""
double them to get interpolation :-)
PerlJam oh right.
PerlJam continues to think it was wise that he stopped playing with perl6 so much.
luqui heh
Qiang my Point $point .= new; is it equal to my Point $point = new Point ?
luqui Qiang, pretty much 23:22
Qiang reading the wikipedia page
PerlJam Don't you need the : for IO notation?
Qiang hm. is that necessary... who want that ;-)
luqui if there were arguments
PerlJam oh that's right.
luqui though I'd say Point.new 23:23
just in case somebody put a "new" listop in my scope
Qiang, what do you mean who would want that?
Haven't you seen all that java code
Qiang the .= new part.
svnbot6 r8264 | clkao++ | Add necessary bits for smoking jsperl5
PerlJam Qiang: I'd rather not be required to type the class name twice thank you.
luqui ReadButNotWriteStringBuffer x = new ReadButNotWriteStringBuffer ()
Qiang fair enough. 23:24
i haven't done any java since graduated from university. :-) 23:25
PerlJam Qiang: good for you!
Qiang i like the @array[1] in perl6. indeed better than $array[1]
PerlJam: :) i think our dev team is going for Perl. that's even better news 23:26
luqui yum
PerlJam I haven't done any perl6 since I realized that it was affecting my ability to write perl5 (I kept wishing for features that weren't there :)
luqui PerlJam, write modules!!
Qiang heh.
luqui but I know what you mean 23:27
I was thinking in coroutines when I was designing Logic.pm in my head
and then I realized that I couldn't have them :-(
PerlJam luqui: Aren't you helping Pm with the perl6 compiler? :)
luqui not anymore. I mean, yeah, but no 23:28
I have dibs on writing perl 6 in perl 6
(whatever "dibs" means in an open source project ;-)
But recently we've been coming up with the machinery to make that possible
PerlJam just wants the path from here to a working parrot-enabled perl6 compiler to be short 23:29
shorter
luqui see, the thing is, they want to write the perl 6 compiler in PIR
integral isn't the machinery to just write a grammar for perl6 already in place?
luqui that's when I bailed
integral, to *parse* it, yes
PerlJam I still have a perpetual "It'll be here in about 2 years" in my head. Only 2 years keeps getting farther out.
integral so can't someone take that forward, which other people faff around with the other bits of the spec? 23:30
surely it all doesn't need to be there at once
luqui but perl 6 still sucks at complex data structure processing
integral especially since pugs can run code, it doesn't matter if the real parser can only parse
luqui integral, that's true
integral but?
luqui I haven't been available since that happened
school and whatnot 23:31
before this semester started, PGE was in no state to parse perl 6
PerlJam yeah, there's always "real life" getting in the way :)
luqui but now it is ;-)
integral hmm, did anyone try to write any grammar in the past? I seem to remember some people trying to write some example bits of perl6 code at one point
luqui yeah, I wrote a skeleton, and then pm & co. filled it out
buu pokes integral 23:32
integral buu?
luqui says "ow" on behalf of integral
buu integral: #perl
PerlJam luqui: now that the semester is over, you should have lots of free time ;-)
audreyt for some definition of "fill it out"...
luqui until it starts again
audreyt luqui: are you talking about svn.perl.org/perl6/grammar/trunk/Grammar.perl6 ?
luqui but I hope to get some good work done over the break
audreyt, I think so
yeah
it flopped
audreyt it's missing 95% or so of constructs :/ 23:33
PerlJam luqui: It didn't flop ... it just needs a shepherd
luqui It needs to be able to be run is what it needs
integral hmm, is there enough in PGE to feed that into it?
audreyt integral: yes, including the precedence parser
integral: it's memory efficiency is not great at all, but should run
luqui It's very hard to write a grammar without seeing if it works as you go 23:34
especially one as big as perl 6's
integral but isn't all the details like backtracking, and non-ambiguity in the specs?
luqui but it's still software
integral maybe the syntax needs to be simplified then?
PerlJam Well, we have enough bootstraps, we just need someone hoist one of them into the "real" perl6 compiler.
luqui you could write it and prove that it's correct, but we hackers prefer to try it out 23:35
PerlJam, how many bootstraps do we have?
audreyt integral: I think it's been, a lot... the grammatical categories are there to simplify stuff
luqui I suppose one is enough...
dduncan luqui, so does that conversation mean that I actually did fix a bug, since <> is a string quote and not a filehandle?
audreyt integral: otoh Grammar.perl6 was written long before the categories are figured out (for that matter, so is Pugs.Parser), so it looks messy
luqui dduncan, no
=<> is "reading from the empty list" 23:36
which is magic
dduncan then the other question is, should I change it back, or is the current one fine?
luqui well, you should change it back if you want to be equivalent to that perl 5
but if you want to show how there's no magic, it's probably best to keep it
(but change the perl 5)
PerlJam luqui: I was kinda hoping that one of the lambda camels who was well versed in haskell could start a competing implementation to PGE using Parsec since pugs seems to be the most promising as far as getting things done.
luqui I was kinda hoping that one of the lambdacamels would port PGE to perl 6 23:37
PerlJam or that
audreyt it'd be easier if PGE has pseudocode comments explaining what it does :)
integral isn't haskell a better language than perl6 for writing a grammar engine in though?
luqui I was actually hoping that I'd do a lot of this stuff, but my brain doesn't seem to have that style
integral, certainly
but it's written in haskell
PerlJam audreyt: sounds like someone should prod Pm in that direction then. :) 23:38
luqui so then you'd have to write one in perl 5, and you'd have to write one in javascript
if you write it in perl 6, then you get it everywhere
even if it's slow
audreyt integral: also perl6 makes more accessible pseudocode s:)
luqui audreyt, true
integral why can't we have haskell and perl6 frontends to the perl6 compiler? why does perl6 need to do everything? 23:39
PerlJam integral: it's got all of the nifty rules semantis
er, semantics
audreyt integral: I think it's for the same reason that GHC did away with Perl5 in most places (other than the evil mangler) :)
luqui because of the JS and perl 5 backends!
audreyt and those, too 23:40
luqui you can have both a haskell and a perl 6 frontend
but then you have to maintain two things
integral luqui: eh? you're saying that you can compile perl6 to JS, but you can't compile haskell to JS?
luqui I'm saying that you need a perl 6 compiler written in perl 6 if you want "eval" in JS
PerlJam home &
integral but if you put enough machinery in perl6 to be able to do the things you can do easily with haskell, also easily in perl6, you've got just as much there
luqui ? 23:41
integral it's not easier to implement two simple languages, than one complex language?
luqui I don't follow
integral anyway, too argumentative, and off-track
luqui no, please explain
integral I was thinking of attribute grammars and rules. Both of those are modules that implement their own DSLs 23:42
luqui DSL?
audreyt domain-specific language
integral domain specific language
luqui ahh
integral but they integrate into the perl6 syntax somewhat (at least rules do)
clkao audreyt
audreyt goes finding some breakfast and leave it to integral :)
integral but people have been trying to add type infering to perl6
rather than taking something like haskell or ML which does that well, and integrating it as a sub-language into perl6 23:43
luqui uh
what? you're saying that if you want type inference in perl 6, you should write in haskell?
integral yes.
but it doesn't need to have haskell's syntax obviously. 23:44
luqui oh, like audreyt's "pure functional subset" idea?
integral yes, exactly
you could use "fun" rather than "sub" to declare you sub for example, and get different semantics in it 23:45
luqui okay, so what does that buy us?
integral it's simpler.
luqui it's simpler to implement
integral easier to document, easier to implement, easier to teach to people, easier to check that it's working right, without all the tiny little corner cases perl5 has 23:46
luqui harder to program in
I argue
harder to build standard libraries for
integral why?
luqui if you want to be pure functional and have side effects
you need monads
pasteling "clkao" at 82.35.81.242 pasted "system jsperl5" (9 lines, 279B) at sial.org/pbot/14988
pd 'fun' -- is that the keyword that haskell uses for function calls? Don't mind me.
integral pd: ML :)
clkao ./runjs.pl --run=jspm --perl5 -e 'system("echo 1")'Syntax error: word unexpected (expecting ")")
integral luqui: sure
clkao looks weird.. expecting ')' ?? 23:47
luqui so then you have monadic versions of a lot of the builtins that are there in the regular dialect
pd aha, I somehow managed to not learn ML either. They taught us scheme instead. :)
luqui the point is, we want perl 6 to be a language
not fifty languages that are very loosely connected
perl 6 has sublanguages 23:48
hmmm..
where am I going with this
integral I don't understand why you think this "monad" thing require separate builtins
luqui well you have the "say" that's a function and returns a monad
and you have the "say" that's a procedure, outputs to the screen, and returns nothing
you can't unify those
because of: 23:49
my $x = say 4;
in regular code means to print "4" to the screen and put "1" in $x
whereas in functional code it means to put a monad representing the action of putting "4" on the screen in $x
integral oh, you want "say 4" to return a monad. 23:50
dduncan okay, luqui, I replaced the magical <> with non-magical <STDIN>, which is more easily understood and matches the perl 6 =$*IN
luqui integral, you have to if you are pure functional
dduncan, kay, cool
dduncan thanks for pointing this out
integral my $x = unsafe { say 4 }; # you could require explict unsafes, but that's sort of unsafe 23:51
dduncan okay, so I'm off to town in a few minutes
luqui integral, and then inside the unsafe you go back to regular side-effecty perl?
integral yes.
luqui why would anyone use the pure functional dialect then? 23:52
integral I feel it's a wee bit like currying in perl5: sub { func($a, @_) }
well, when you're *not* dealing with the IO monad!
the same as in haskell really.
pd yeah, perl5 does closures
svnbot6 r8265 | clkao++ | non-working system() in jsperl5.
integral if you're writing code that's all in the IO monad, you do not use the functional sublanguage 23:53
luqui integral, and you'd lose type inference in regular perl?
okay, let's back up, we're still talking about inference, right?
integral you'd lose the very strict type infering and checking, yes.
luqui: a bit, yes
luqui adding inference to all of perl is not the problem
perl 6, despite being huge, still has a small core calculus 23:54
the problem is the type system it uses, which hasn't been defined yet
but it has subtyping
and haskell has no subtyping, which allows it to be good at inference
integral how can you say inference isn't a problem, when you don't know what it's infering?
luqui I don't follow? 23:55
integral well, in Hindley-Milner you don't need any annotation, because your types are first-order and all that. But when you add GHC's extensions, you sometimes need annotations. So if you add all these extensions: subtyping, and the other things that haven't been defined, it can vastly change how much can be inferred 23:56
luqui I kno
w
I don't see how a functional sublanguage helps
the functional sublanguage still has to handle subtyping
because perl's object system is based on subtyping
integral hmm, did you see the paper a while ago from SPJ&co on mapping C# classes and interfaces into haskell typeclasses? 23:57
luqui nope
luqui looks
still, afaik, haskell can't do covariant subtyping 23:58
that is, no existential types
you can simulate subtyping as you're passing arguments into a function 23:59
but not as you're getting them back out
integral hmm
luqui er, getting results out