Pugs t-shirts www.cafepress.com/pugscode | Pugs 6.2.9 released | pugscode.org | pugs.kwiki.org | paste: sial.org/pbot/perl6 | www.geeksunite.net
Set by stevan on 15 August 2005.
luqui just finished a tic tac toe AI in haskell :-) 00:10
It seems I'm learning
landover hey all 00:59
nothingmuch_ hi people 02:48
nothingmuch opened a basecamp account for pugs (free) 02:50
pugs.grouphub.com/
if anyone wants an account ask me
if it seems useful i'll buy a real account 02:51
luqui vas ist basecamp? 03:07
obra basecamp is a project management app written in rails 03:11
from 37signals 03:12
03:34 autark is now known as jp-autark
nothingmuch luqui, obra - want to co admin that thing? 03:34
obra I'd be vaguely curious to. 03:35
is this to ditch foundry?
or not for bugtracking?
nothingmuch not for bugtracking, for todo list stuff, and overall tab keeping on state of things 03:36
obra hm.
nothingmuch since we now have a bajillion side projects (PIL2JS, PIL2P5, PIL2, pugs the runtime)
landover nothingmuch 03:54
sounds to me like you guys need a project manager
heh
nothingmuch who is the project lead? 03:56
obra I'd probably peg autrijus as the project lead 04:00
07:29 autark is now known as jp-autark
kvakke seen autrijus 11:03
12:57 firemind is now known as blez
svnbot6 r6516 | autrijus++ | * add -e support for crude_repl.pl: 14:06
r6516 | autrijus++ | perl perl5/PIL-Run/crude_repl.pl -e 'say 123'
putter iblech: ping? 14:42
iblech putter: pong
putter :)
you saw the correction to my comment as you were logging off the other day?
iblech Yep, and my brain automatically s/putter/iblech/ when I first read the sentence, so, no worries :) 14:43
putter ok. :) 14:44
svnbot6 r6517 | iblech++ | * DrIFT.Perl5: Emit proper utf8. 14:48
r6517 | iblech++ | * t/var/symbolic_deref.t: Fixed tests WRT s/our/my/ (added link to Larry's
r6517 | iblech++ | statement) and added test for symdereffing Unicode vars.
QtPlatypus iblech: What is a symdereffing Unicode var? 14:49
iblech QtPlatypus: my $Ć¤Ć¶Ć¼ = 42; say $::("Ć¤Ć¶Ć¼")
QtPlatypus Are
Arh I undrstand 14:50
svnbot6 r6518 | iblech++ | * t/var/symbolic_deref.t: our $a; say $::("a") should work as well. 14:54
r6518 | iblech++ | * PIL2JS: Proper UTF8 handling, symbolic dereferentiation.
r6518 | iblech++ | * pil2js.pl, jspugs.pl, PIL: Use Encode etc. to handle UTF8 correctly.
r6518 | iblech++ | * README: Added section about the implementation of coroutines in PIL2JS.
r6518 | iblech++ | * Prelude::JS: Symbolic dereferentiation (implemented by using $CALLER::)
r6519 | iblech++ | PIL2JS: 15:00
r6519 | iblech++ | * PIL2JS.js: Fix very stupid error regarding creation of user-defined
r6519 | iblech++ | exceptions (4-char patch).
r6519 | iblech++ | * PIL::Subs: Backup $! in subs (i.e. "sub foo { try { die "foo" } }; foo(); say
r6519 | iblech++ | $!" prints now (correctly) "").
r6519 | iblech++ | * Prelude::JS::ControlFlow: Modify &try to work with the above change.
r6519 | iblech++ | * Prelude::JS::Array: ($a, $b) := ($b, $a) works now (probably a bit
r6519 | iblech++ | incorrectly, though, will enhance binding.t).
r6520 | iblech++ | t/operators/binding.t: Added more tests regarding binding of list literals 15:11
r6520 | iblech++ | (e.g. ($a, $b) := ...). (PIL2JS doesn't pass these additional tests -- to fix
r6520 | iblech++ | them, I'd have to add a evil hack, so I probably won't fix this now. (It will
r6520 | iblech++ | be automatically fixed with PIL2 (which emits the LHS of a binding operation as
r6520 | iblech++ | a Params structure (exactly like sub signatures)).)
r6521 | putter++ | crude_repl.pl: Command line accepts multiple input files, optionally followed by repl use. Also now multiple -e's. 15:17
putter Hmm... with getopt(), how does one override the (grossly unprofessional) default 'version' message? 15:26
(adding a 'version' pair generates a warning message re "duplicate"...)
iblech dunno about getopt, but Getopt::Long's GetOptions() allows you to GetOptions("version" => sub { print "foobar 0.1..."; exit }) 15:31
putter Thanks. It's just a bare getopt(), though the args look like Getopt::Long. Adding a "version" handler results in a Duplicate specification "version" for option "version" warning. Adding a use Getopt::Long to config no_auto_version doesnt help. 15:36
Bah. "crude"_repl isn't supposed to mean it says things like This is crude_repl.pl, with no version, so stick it up your source repository! 15:37
svnbot6 r6522 | putter++ | crude_repl.pl: Avoid unfortunate default -V --version message. A warning is now emitted on every run, but it's not immediately clear how to avoid this. Anyone? 15:47
r6523 | putter++ | crude_repl.pl: now executable.
r6524 | vkon++ | fix tibetan unicode test, add russian similar one 16:20
putter iblech: do we know what PIL2 class defs are going to look like? if we could easily fake them... 16:21
iblech putter: No, I do not... Except: class Foo {...} will really be ::Foo ::= class {...} (this allows us to make "my $x; class Foo { has $.foo = $x }" work) 16:23
integral is PIL/PIL.hs all that there is on the PIL2 ADT at the moment? 16:24
iblech putter: Maybe that will emit calls to the metamodel? E.g. ::Foo ::= $*METAMODEL.new_class().add_instance_attribute('$.foo')... 16:25
integral: I think so.
integral hrm. :-/
putter ooo, neat idea...
integral metamodel calls are modeled as actual perl6 things still at PIL level? Not as "opcodes"?
iblech integral: I dunno. But I'd like them not to be opcodes, because then you can override things from Perl 6-space 16:26
integral hmm, I was thinking of it as a bit like tieing, where you either don't have a tie, or you do, in which case the haskell behind the opcode proxies back to perl6 16:27
iblech Hm, I'd be fine with that, too 16:29
putter one downside of not having (at least some of) them be opcodes is it would rather decrease your ability to compile PIL.
but that loss seems inherent in being able to override the mm. 16:30
iblech Right, putter. 16:31
putter is the currently a common mm api between the perl and js mm's?
s/the/there/
(and, next question, is it exposed to p6 under js? ie, can one write p6 code which calls mm constructors?) 16:33
iblech No. I wanted to add that but noticed that the API is totally unspecced.
No, you can't.
putter hmm
iblech (It would be relatively simple to implement it -- but I need an API specification)
putter can't under p5 either, but as you say, it shouldnt be difficult to implement. 16:35
if p6 oo was working under pugs, do you have a feel for how much of PIL2JS you would shift to p6? Eg, for pilrun, I'd just asume have all the PIL analysis and codegen done in p6 (but that is at least in part, because it isnt written yet;). 16:37
iblech Hm, I'd probably (try to) shift everything to P6, with the possibly exceptions of jspugs.pl (Term::Readline) and pil2js.pl (BSD::Resource) 16:39
putter yeah. 16:40
svnbot6 r6525 | iblech++ | * New t/data_types/lists.t: Tests list indexing, list slicing, list elements as 16:43
r6525 | iblech++ | lvalues, and lists as lvalues in assignment and binding, Juerd++.
r6525 | iblech++ | * t/subroutines/sub_named_params.t: Skip inflooping test under PIL2JS.
r6525 | iblech++ | * PIL2JS: Prelude::JS::Array, PIL2JS.js:
r6525 | iblech++ | List creation (&infix:<,>) no longer creates new containers.
r6525 | iblech++ | Instead, assigning to an array takes care of that.
r6525 | iblech++ | This is so we can pass lists.t 14/14 and binding.t 28/28 :)
iblech Hm, it seems to me that ($first, @rest) = foo() is bogus/hard to implement. 16:44
($first, *@rest) := foo() will be no problem, as the LHS of a binding operation is really a sub signature (and PIL2 will emit an appropriate Params structure) 16:45
But I don't think I can get the first case (normal assignment) to work without hackery, as &infix:<,> has a signature of (*@xs), so @rest will be flattened 16:46
putter hmm. that consistency might be worth losing backwards compatibility for.
p6l? 16:47
iblech I think so, too.
Yep, writing mail...
16:50 poletti is now known as frodo72
putter (*%mods, +$bar, *@rest) = foo() the mind boggles. ;) 16:50
perhaps what you are really doing there is specifying the signature of the return continuation of foo(). 16:52
though in p5 there is an extra implicit and hidden *@ignore_any_extra_trailing_arguments 16:54
iblech Right, you can see it that way. 16:56
Right.
putter (now if continuations could be multi subs... :) oh, unless we have separate escape continuations, I guess they already are?
iblech continuations as multi subs # mind *really* boggles ;) 16:58
putter ;) well, if you only have the one continuation, then raise would use it, and Exception is unlikely to match the default return args, so... multi sub? 17:01
obviously, in the real world, you have a second continuation for exceptions. but there seems a certain elegance in having just one. and done via multisubs, one gets nice properties like catching with full mmd capabilities. 17:04
iblech <evil_idea>We could see throwing an exception as a regular return, and catching would be simple: (Exception $foo) := bar(). Because return continuations would be multi subs, regular returns wouldn't be affected.</evil_idea> 17:05
putter :-) 17:06
iblech perlbot nopaste 17:10
perlbot Paste your code here and #<channel> will be able to view it: sial.org/pbot/<channel>
pasteling "iblech" at 80.81.23.67 pasted "p6l post draft" (40 lines, 1.6K) at sial.org/pbot/12774 17:11
putter can individual... drat, we need a different acronym for metamodel so we can have mm back for multi method... can individual "branches" of a multi be declared my or local^H^Htemp?
iblech I think so. 17:12
QtPlatypus doesn't see why not. 17:14
putter oh, that's very nice then. one can be safe, my, or choose to live dangerously, and not be limited to Exception based... exceptions.
iblech mail sent. food & 17:17
putter iblech: for p6l, it might be better as a strictly language question. what is easier/harder for PIL2JS, or pugs as a whole, is a secondary issue. so maybe just, "if we do foo (*@rest), it will be consistent with bar (signitures)
oh. putter really needs to learn to hit return more often. ;)
no problem. worth sending. see'ya later &
hmm food... 17:18
nothingmuch landover: ping 17:21
iblech: you've got mail 18:04
iblech nothingmuch: re. you've got mail, too :) 18:19
putter luqui: fyi, www.luqui.org is currently refusing connections. 18:48
svnbot6 r6526 | iblech++ | PIL2JS: 18:53
r6526 | iblech++ | * PIL::Subs: Fix the .name of PSubs.
r6526 | iblech++ | * Prelude::JS::Code: Add a "name" method so &Test::cmp_ok can report errors
r6526 | iblech++ | correctly.
r6526 | iblech++ | * PIL2JS: &jsbin_hack: Add a CPU-burning implementation of window.setTimeout,
r6526 | iblech++ | needed to support &sleep when running under bin/js.
r6526 | iblech++ | * Prelude::JS::Operators: Readd many operators so taking a reference to them
r6526 | iblech++ | works again (needed for most calls to &Test::cmp_ok).
r6526 | iblech++ | * README: Minor updates.
iblech nothingmuch: ...and nothingmuch.woobling.org/pugs_test_status/ is still at r6378
nothingmuch kicks eris 18:54
ah, someone rebooted
iblech Hm, according to nothingmuch's smoke, normal Pugs passed only 85.71% at r6378 (only 12% more than PIL2JS! :)) 18:55
nothingmuch ooh 18:56
time to port Prototype to perl 6?
putter iblech: and 20% are rules!?! 18:59
iblech putter: Hm, wait, nothingmuch's smoke failed all rules tests, and PIL2JS skips all rules test, so we've to add your 20% to nothingmuch's smoke to get comparable numbers 19:01
putter oh. drat. never mind.
nothingmuch can anyone fix rules for me? i don't know what I'm doing wrong
putter is your smoke pugs compiled with parrot external or internal? 19:02
nothingmuch iblech: how quick a hack is it to make the JS runtime put $*DOM as an object that has some top level objects (window, document, etc)
putter ;)
iblech nothingmuch: $*JS.window works :) 19:03
nothingmuch arguably that isn't $*JS though =/
but great =)
can you call to JS code?
iblech nothingmuch: Sure! JS::alert 42 19:04
nothingmuch i mean user defined code
JS::myFunc?
iblech Works as well :)
nothingmuch wunderbar
iblech You can even call methods on (optionally user-defined) classes :)
s/classes/objects/
(I.e. $*JS.document.write("foo") works, but new $*JS::Date does not.) 19:05
nothingmuch hmm
so how far are we from porting Prototype to Perl 6?
putter nothingmuch: rules smoke fine for me. I'd be glad to ask&answer questions re likely problems if you wish.
iblech (But you can fake it: JS::inline('new Date').foo.bar.baz works)
nothingmuch iblech: what about my $foo = JS::inline('new Date'); ? 19:06
iblech nothingmuch: Works.
nothingmuch: Even my $foo = &JS::alert; $foo("hi!") works
nothingmuch does pugs let you say &code.pil ?
iblech No. 19:07
nothingmuch i think that's the next step
then you could write code as JS
uh, ^H
you could write a webapp framework
and write prototype code as perl 6 code
and then just point to the functions, and say js(&effect.pil); # or whatever
it would probably be very very slow right now, but still cool 19:08
is mod_pugs still working?
putter I was just now looking at DrIFT, thinking of writing -CPerl6. The DrIFT representations seemed rather verbose... creating a p6 version from the p5 version should only require changing a line or two, no? rather than cut and pasting two files. 19:11
nothingmuch time to do the dishes 19:13
putter nothingmuch: some of your smoke's behavior re rules is consistent with a default pugs build (no embedded parrot) which doesnt have parrot in its PATH at smoke time.
nothingmuch putter: if you feel like volunteering to trouble shoot my smoke loop I can give you shell access
ah, path... hmm
putter nothingmuch: can I add make smoke-js ? ;) 19:15
nothingmuch putter: sure, let me rsync my spidermonkey source tree.
iblech putter: Unfortunately, I know absolutely nothing about how to write "class DrIFT::Perl6 is Drift::Perl5 {...}" in Haskell...
nothingmuch: ooh latest spidermonkey
nothingmuch iblech: 1.5-rc6a? 19:16
i really have to do the dishes... talk to you guys later
iblech nothingmuch: There might be a problem -- make smoke-js isn't capable of creating a smoke-js.html -- I've always had to manually run /util/testgraph.pl > smoke-js.html (dunny why)
nothingmuch putter: /msg me a login and temp password or ssh key
iblech nothingmuch: 1.5-rc6a is fine
nothingmuch iblech: i'll help you with TTH later 19:17
*poof*
iblech Later nothingmuch
putter iblech: any reason not to do unattended automated smokes of js? Eg, pilrun or the mm still has swap-exhausing deep recursions... 19:19
(so that's an example of a reason why nothingmuch doing make smoke-perl5 is still a bad idea...;) 19:21
iblech Hm, if you export PIL2JS_RESOURCE_GUARD=1 then no test can run longer than 35s. But WRT RAM use, compiling the Prelude does take several hundreds of MiB, and bin/js takes constantly ~~100 MiB (on all tests)
But now that I think of it, it might be a bad idea to smoke-js unattendedly 19:22
putter :( 19:23
iblech (Unless the machine has got, say, >= 1.5 GiB of RAM)
The problem this, although *currently* running a smoke does not take more than, say, 300 MiB, this might change, causing nothingmuch's poor box to die... 19:24
putter Hmm... perhaps we are going about this the wrong way... maybe just a repository where anyone can upload (ftp) a smoke they have run, and a simple gardian (delete if older than n-days or doesnt look like a smoke file).
s/ftp/ftp?/ 19:25
iblech I like that :) 19:26
putter so either anon ftp, or an html upload file? 19:27
iblech I think ftp is easier to automatize than html upload 19:29
putter nothingmuch: would you be willing to host such a service?
iblech (But I wouldn't mind html upload)
putter k
I dont know if anon ftp still has a poor security rep. but could be easiest approach. html would allow enforcing/hinting naming conventions, but that might be pointless or otherwise undesireable. 19:30
ok, just need a host. Volunteers? 19:32
ahem, 19:33
================================================================
Volunteers!
================================================================
;) 19:34
iblech volunteers. (But as I don't know much about properly configuring a ftpd, it might take a while...
)
putter :) 19:35
iblech++
putter contemplates a few line util/pil_p6_from_p5.pl converter script... 19:36
iblech: would also need to be running a webserver on the machine... 19:37
iblech putter: Webserver is not a problem, already set up :) 19:38
putter please dont let me loud cry for volunteers push you into running a service you would rather not...
(more services unavoidably means more potential problems sucking time and interrupting whatever the normal use of your machine is) 19:39
hmm... though admittedly it's been running wiki's which have soured me on a "sure, toss on lots of services and quietly run them for years" concept. 19:41
iblech I wouldn't have volunteered if it'd be a problem :) The normal use is just delivering two local websites and running the svnbot6 :)
putter :)
MIT brings in the alums, gets 'em drunk, and talks them into donating large chunks of money. Always seemed to me at best borderline unethical. 19:43
Caveat, such checks arent actually signed until later, but the social lock-in, anouncement etc, happen immediately. 19:44
hmm, we cant cast hashes to arrays @%h, is there some way that given $x which is array @a or hash %h, to get @a and %h.kv respectively? 20:02
iblech hash(@array).isa(Hash) # true 20:07
[%hash].isa(Array) # true
Or do you mean something different?
putter $x.isa(Hash) ?? $x.kv :: @$x 20:09
which I guess surfices. thanks.
snack... and then end of day I expect. 20:11
wolverian putter, I think one should use .does 20:24
or just ~~
(unless it doesn't work yet...)
putter btw, to convert -CPerl5 to -CPerl6, this may be a sufficient kludge: $code ~~ s:perl5:g:i/ => ("[a-z:]+"\))/ , $0/; my sub bless($x,$y){...} eval($code); say $! if $!;
wolverian: good point. thanks! :) 20:25
wolverian don't hashes listify in list context anyway?
*$foo or list($foo)? hmm.
iblech Hashes do, but not hash references 20:27
wolverian right.
putter Aha! and there's the answer folks, *$x
iblech [$x], where $x is a hash reference, evaluates to a one-elem array
wolverian that works? wow, yay me.
putter (or at least so says pugs) 20:28
wolverian++
iblech Huh? *$hashref does not evaluate to $hashref.kv in normal Pugs
?eval (*{a => 1, b => 2}).isa(Array)
evalbot_6515 bool::true
iblech oh
hm
Ah, one(Pugs, I) got the precedence of 20:29
Ah, one(Pugs, I) got the precedence of * wrong
putter pugs> my %h=(3,4,5,6); *%h
('3', 4, '5', 6)
hmm... 20:30
ods15 makes sense
iblech ?eval my %h = (a => 1, b => 2); *%h
evalbot_6515 ('a', 1, 'b', 2)
wolverian imho doing that should warn. "did you mean to construct a list? use => with literal hashes"
iblech hm
ods15 ?eval my %h = (a => 1 => b => 2); *%h
evalbot_6515 ('a', (1, ('b' => 2)))
ods15 err??
iblech wolverian: Consider my %hash = foo() (where &foo returns a list)
wolverian iblech, right. I only mean literal hashes.
svnbot6 r6527 | iblech++ | * t/unspecced/connect.t: Check for $*OS eq "browser" before checking for %*ENV.
r6527 | iblech++ | * t/data_types/array_ref.t: [$foo][0] =:= $foo should be false, as [] creates a
r6527 | iblech++ | new array (with new containers), not a list.
r6527 | iblech++ | * PIL2JS.
r6527 | iblech++ | * PIL: Escape UTF-8 so not only Firefox can handle it, but Spidermonkey's
r6527 | iblech++ | /bin/js, too.
r6527 | iblech++ | * PIL::Subs: Fix .name of /^__init/ and /^__export/ special subs.
r6527 | iblech++ | * PIL2JS.pm: Call &Encode::encode($output_of_bin_js). 20:31
r6527 | iblech++ | * Prelude::JS::ControlFlow: Make $! rw again.
r6527 | iblech++ | * Prelude::JS::Str: $_ = "foo"; say uc # works now (same for ucfirst, etc.)
r6527 | iblech++ | * Prelude::JS::Array: [] should create a new array with new containers.
putter re -CPerl5 to -CPerl6 , note that using p5 for the transliteration is much faster. unfortunately, I dont immediately see a way to ask Data::Dumper to use "," instead of "=>" to separate bless()'s arguments.
iblech ods15: That's correct. You created a hash containing one elem (with key "a"). %h<a> is the nested pair (1 => (b => 2))
wolverian: Ah, ok.
ods15 in perl5 what did i just do then?
iblech ods15: In Perl 5, => is exactly the same as , 20:32
ods15 not exactly
iblech right, => autoquotes
ods15 ok
iblech but semantically speaking, they're equivalent
ods15 so perl6 different :)
iblech Right. In P6, => creates a real Pair object, which provides the .key .value .pairs .kv methods 20:33
Oh, and it provides .values and .keys
And &postcircumfix:<{ }>, IIRC:
?eval (a => 1)<a>
evalbot_6515 \1
iblech Yep.
wolverian Pair doesn't have .values and .keys 20:35
it shouldn't have, anyway
iblech ?eval (a => 1).keys
evalbot_6515 ('a')
iblech It should have, per the pairs-can-behave-like-one-element-hashes
wolverian oh. okay.
I think that should be autopromoted to a Hash, actually
it feels cleaner, anyway. 20:36
(the hoops we jump through...)
iblech This can be considered as an implementation detail -- the user won't notice a difference if $pair.keys is really &coerce:<as>($pair, Hash).keys or &Pair::keys($pair:) 20:37
But I need to sleep now. Night all! :) 20:38
putter iblech: quick question...
iblech putter: Oh and I'll probably set up the ftp thingie tomorrow :)
putter: Go ahead
putter neat, err, is there a js read eval print loop. Ie, I type "say 3" and see "3"? 20:39
iblech No, but it would be trivial to add (except that there's no .perl yet in PIL2JS)
putter ok.. thanks. just wanted to make sure I wasnt missing something obvious. good night! &
iblech Currently, jspugs.pl always creates a output.html, and I typically always hold a tab with output.html in Firefox 20:40
Ok. Night all! :)
ods15 pains in the asses, they won't let me rest in the guard tower :( last time i fell asleep there they friggin woke me up!! 20:42
putter ;) 20:43
wolverian is that a game you're talking about or ...?
putter ("sleeping in guard tower" ~~ "bad precedent" ;) 20:44
good night & 20:45
ods15 not game 20:47
army...
wolverian oh. I'm sorry. :/ 20:48
or is it voluntary?
clkao 6/win11 21:13