Upgrade to YAML::Syck 0.85 before smoking | pugscode.org | sial.org/pbot/perl6 | ?eval [~] <m oo se> | We do Haskell, too | > reverse (show (scanl (*) 1 [1..] !! 4)) | "Perl 6 Today" video from YAPC::Asia: xrl.us/vw3p
Set by avar on 27 April 2007.
00:07 zamolxes joined 00:27 drbean_ joined 01:11 gregm joined 01:36 dolmans joined 02:07 rissy joined 02:08 dolmans_ joined 03:01 elmex_ joined 03:33 deq` joined
pasteling "evalbot6_r16147" at 65.89.234.66 pasted "Pugs build failure" (330 lines, 19.9K) at sial.org/pbot/24586 03:35
03:39 samsm left
Aankhen`` ?eval "—" 03:41
Oh, dang.
03:44 justatheory joined 04:00 SubStack joined 05:03 thestarslookdown joined 05:23 jisom joined 05:32 root joined, root is now known as chunzi 05:45 SubStack joined 05:54 SubStack_ joined, SubStack_ is now known as SubStack 06:01 \amethyst joined 06:14 thestarslookdown joined 06:40 mfunebre joined 06:52 mfunebre left, rissy_ joined 06:53 rissy_ left 07:30 BooK joined 07:42 dduncan left 07:57 iblechbot joined 08:12 franck__ joined 08:35 buetow joined 09:08 pack|pizza joined 09:20 SubStack joined 09:24 elmex joined 09:28 the_dormant joined 09:31 katlyn- joined 10:03 thestarslookdown joined 10:45 kanru joined 11:06 iblechbot joined 11:31 bas joined 11:35 ludan joined 11:40 rindolf joined 12:14 marmic joined 12:49 macroron joined
gaal moose 12:52
13:00 bonesss joined
lumi Elk 13:04
moritz camel 13:09
lumi Salamander
13:28 jerrylee joined 13:31 sunnavy joined 14:09 weinig is now known as weinig_ 14:16 weinig_ is now known as weinig 14:17 jisom joined 14:42 jerrylee_ joined 14:43 jerrylee_ joined 14:46 chylli joined 14:50 kanru joined 14:57 weinig is now known as weinig|away 15:02 chylli left
offby1 paramecium 15:15
15:23 RHainsworth joined, RHainsworth left 15:27 DarkWolf84 joined 15:35 pack|pizza joined 16:03 weinig|away is now known as weinig 16:38 crashmatrix joined 16:48 cmarcelo joined
cmarcelo TimToady: ping? 16:53
?seen TimToady
lambdabot TimToady is in #perl6. I last heard TimToady speak 17h 7m 19s ago.
cmarcelo @tell TimToady Just read chromatic meeting minutes. And I'm stuck at understanding Haskell->P5 bridge yet. Maybe I should play directly with PCR... Makes me wonder, Pugs used PGE/PCR instead of Parsec because convenience or because Parsec limitations? 16:57
lambdabot Consider it noted.
cmarcelo @tell TimToady Also in the minutes you hint about some clear goal/objective for people impl. S05. Could you explain this better? 16:58
lambdabot Consider it noted.
16:59 gaal joined
TimToady cmarcelo: pong 16:59
lambdabot TimToady: You have 2 new messages. '/msg lambdabot @messages' to read them.
cmarcelo moose
TimToady I'm not sure why pugs doesn't have a native regex yet. You'd have to ask audreyt. 17:00
on the goal thing src/perl6/Perl-6.0.0-STD.pm is a P6 grammar written in P6
nothing can run it yet
though pugs can parse it, if we run it through "cheat" first. 17:01
17:01 VanilleBert joined
DarkWolf84 parrot backend maybe will do the job 17:01
TimToady I just saw the various P6 parsers going off in various directions, and I wanted to put something out there closer to what we'll end up with.
cmarcelo @tell audreyt Hi! The PGE/PCR-way to do regexes in Pugs was because convenience (they were being developed already | want to test P5 bridge) or because of Parsec limitations?
lambdabot Consider it noted.
DarkWolf84 but it's broken lately
cmarcelo TimToady: Hmm.. I see.. 17:02
TimToady well, all the approaches that involve delegating regex to some other engine are fragile.
fglock was just talking about an approach where we take mp6 and make it spit out P6 closures instead of P5 closures. 17:04
basically a version of PCR that pugs can run.
cmarcelo Even 'cheating' STD.pm I've got errors here when executing them in pugs..
TimToady yes, you'll get a lot of errors that way. we're not sure why it doesn't like <?before <$stop>> yet... 17:05
17:05 turrepurre joined
TimToady but the advantage of implementing pcr in p6 is that we don't have to worry about the linkage of p6 vars with p5 vars 17:06
and pugs has continuations
so we wouldn't necessarily be limited to :ratchet
the other advantage of that approach is that we don't have to write a regex engine in Haskell. 17:07
'course, if you want to do that, feel free. :)
cmarcelo by implementing 'pcr in p6' you mean using mp6, or no? 17:08
cmarcelo still fighting to understand some constructions inside Pugs hs code base.. :o) 17:09
TimToady I think fglock was talking about writing a compiler in mp6 that is good enough to parse and run a cheated STD.pm
it wouldn't be very efficient, but it's a route to bootstrapping a parser in p6 17:10
and it might be the most efficient route
in terms of programmer time 17:11
cmarcelo gaal: do you picture yourself putting more content into dev.pugscode.org/wiki/Overview ? ;)
TimToady I don't entirely understand the Haskell codebase either... 17:13
gaal cmarcelo: thanks for the nudge. definitely yes
cmarcelo TimToady: re: compiler in mp6, parse ok, but run means spitting (p5|p6) and run with (perl|pugs) or actually having a runtime written in mp6 too? 17:14
gaal of course, the more other people moose in, the funner it'll be
TimToady talking about spitting out pure P6 in the subset currently implemented by pugs
and with regex implemented in pugs closures rather than P5 closures 17:15
17:16 \amethyst joined
cmarcelo gaal: (yes I'm guilty too :o) ) I was filling stuff in MO comments (ok not much hehe), maybe lifting to wiki since the concepts are useful for other implementations (fglock recently hacking MOP in kp6).. 17:16
gaal cmarcelo: that's great
cmarcelo gaal: Today's Pugs is still in that stage between old AST and new AST, right? 17:18
gaal well, newVal is available, but not used everywhere in the core
strings for example are newVal 17:19
as for Exp, still old
TimToady is finishing that dependent on MO?
gaal channels moosefulness in audreyt's direction
MO the framework is in good shape; we have to first transition more runtime stuff to actually use it 17:20
TimToady I moose her too.
gaal for example this is in MO:
?eval vv("a moose is a great thing").reverse
TimToady I don't think evalbot is running
gaal but for example Num methods aren't in MO yet, though they can be transitioned off from Pugs.Prim.Num by anyone with haskell-fu and some tuits 17:21
(to do this, see Pugs.Meta.Str)
after that, the next step is to start tweaking the parser to construct newVal objects from literals 17:22
cmarcelo gaal: idea => example on how to translate stuff from oldVal to newVal.. this would be an incentive to @hs_minions to work on that..
gaal then we can release the coming version, I think -- well probably audreyt has other things to go there too
after that, the parser should be modified to construct new AST not just new value types 17:23
and then we will have transitioned completely.
cmarcelo: okay. the focus now is on value type's classes 17:24
cmarcelo she did a "megacommit" and then reverted it with some stuff on MO integration. also in YAPC::Asia talk she hinted that 6.28 was near...
gaal so for example if we look at Pugs.Meta.Str
cmarcelo: yes; I think that patch hasn't bitrotted because there've been so few .hs commits
but it did cause some test breakages
so it's not 100% complete evidently 17:25
17:25 rindolf joined
gaal has the yapc::asia talk in the background, not seeing it but enjoying audreyt's voice 17:25
so p.m.str again...
cmarcelo gaal: new Values != new AST, right? 17:26
gaal _StrClass = mkPureClass "Str" [a list of modules]
cmarcelo: right. newVal is just a subset, for which we have a bridge
newVals have magical MO glue
cmarcelo TimToady: I'll try to talk with fglock later about pcr in mp6. Thanks :)
gaal so in pugsland, any $thing_that_is_a_newVal.method is automatically dispatched via MO 17:27
TimToady you're very welcome.
gaal so e.g.: "reverse" ... Str.reverse
Yaakov Howdy, Larry. Hope your day is going well.
TimToady so far so good.
gaal (...) is a clever combinator that constructs a method from a name and a haskell lambda
17:28 \amethyst left
cmarcelo (nice quotation from Perl 6 Today talk: "We are pretty much anarchistic, that's to say, 'like Wikipedia' if anarchy scares people") :) 17:28
Yaakov Isn't that what the man who fell off the building said haflway down?
gaal since our implementation type for strings is just ByteStrings, "Str.reverse" (which is Data.ByteString.OurUtf8Library.reverse) is the entire method needed 17:29
TimToady I hope not to splat before the end of the day, but you never know.
gaal the (...) combinator takes care of unrapping the value polymorphically from the Val to an implementation type and back
by which I mean that if you were looking at a newVal string in the AST, you'd see... 17:30
cmarcelo gaal: the MO side of things I think get (like "..." hackery). What I don't get is the bits before. How things end up using this new MO-enabled values, where is this transition happening?
TimToady bbl &
gaal Val (VV (PureStr "moose"))
but obviously the Val . VV is boilerplate in both directions (input and method output) 17:31
cmarcelo: the magical package is Pugs.Class 17:32
cmarcelo old value types have a leak (VV) for getting new value types inside. And PureStr is a "new value" type.. makes sense?
gaal the Boxable class
indeed!
(Pugs.Val is newVal)
so for ages we had this huuuuuuge Pugs.Prim module 17:33
cmarcelo where's old Val?
gaal now things like P.M.Str are helping to break that down
hmm look at data Val in Pugs.AST.Internals
(another huuuuuge file that will get shorter...)
perhaps for the coming release we will actually be able to get away with eliding oldVal completely from oldExp, and go through VV for all value nodes 17:36
not crucial though 17:37
cmarcelo ok. and the old AST vs. new AST, would be in 6.28 or is something independent?
gaal although as you can see, MO isn't heavily used for ptimitives now
cmarcelo (where are they in code?)
gaal new AST will happen after the release
it's a biggish change 17:38
the design of the newAST is, hmm, almost a year old: Pugs.AST.CapInternals, a file that isn't compiled now
cmarcelo filling P.M.Str P.M.Num P.M.Socket and etc maybe be the way to go right now? or not?
gaal yes
if only to start cutting Prim and exercising MO more 17:39
cmarcelo A Perl 6 Num type has a direct match to some Hs numeric type today?
s/A//
gaal the new AST is very articulated: there are IIRC four different nodes for conditionals
cmarcelo: no; Pugs.Val:84 17:40
it's either a hs Double or a hs Rational 17:41
cmarcelo P.M.Num would have the 'Boxable PureNum' instance then. and move Prim that deal with Num to being methods of a PureNum class.. 17:43
gaal yes. see Pugs.Prim.Numeric...
that could perhaps stay as a support library 17:44
because we maybe want to resuse some code across (P6) Int and Num
but maybe not.. not sure
the Num class isn's as simple as Str 17:45
but isn't like, much more complex
17:47 Patterner joined
cmarcelo you told about having oldExp (from oldAST) using VV for value nodes, where this change would happen? Today literal Strings aren't newVal PureStr, would be very hard to make them? Need to finish moving every Str func from Prim to Meta.Str... but something else besides that? 17:47
gaal one thing to do as Str nears completion is to tweak the parser never to construct oldVals for strings -- and then kill them comlpetely and see what breaks 17:48
very easy to make them
already possible
the "vv" function in pugs p6land makes testing/dev possible
from haskell, just do VV . PureStr instead of VStr 17:49
the ' vv("moose").reverse ' example already fires the MO method 17:50
cmarcelo nice. i'll see what I can do in terms of documenting about or coding this transition. 17:51
gaal there's some work to finish in Str as well; I did spilt-on-string but not split-on-rx just because of techincal reasons 17:52
cmarcelo (also, unrelated question: do you know if Regex was delegated to PGE/PCR because of a Parsec limitation?)
gaal because the VRule type was hidden in Pugs.AST.Internals, if I remember correcly
you mean, why didn't use Parsec to create Regex? 17:53
the reason is because PGE had a working implementation :)
one other thing that I should mention about methods in Meta 17:54
is that they shouldn't bother with fancy argument processing
for example, I have _split_str, which isn't a standard Perl 6 method 17:55
and should have _split_re
cmarcelo that difficult means you need to port Regex to VV before having PureStr methods that deal with Regexen..?
gaal the idea is that Prelude.pm will dispatch to either one according to perlside smarts
no, just to make that type visible to Pugs.Meta.Str 17:56
it's a module circularity technicality
cmarcelo so 'Str.split' itself would be defined in Prelude.pm? Prelude would be Pugs dependant or Str._split_str is part of Str spec? 17:57
gaal because data VRule mentions the Val datatype
_split_str is not part of Perl 6
it's a primitive
oh to finish that thought: (...)-constructed methods accept positional args only 17:58
so do the processing perlside on things like options, default values, etc. 17:59
cmarcelo but if Prelude.pm does the dispatch, it will be a 'Pugs-specific Prelude.pm'.. 18:00
gaal well... I should direct you to nothingmuch on that topic 18:01
he had some thoughts on circularity
i think the idea is that the prelude defines notionally *everything*, in principle down to basic arithmetic
but once it detects the runtime knows how to do something it dispatches to there 18:02
consider that even w/o mention of _split_str, you needed something like a runtime-conscious prelude 18:03
18:03 VanilleBert left
gaal because e.g. you wanted to exploit hs-side Str.reverse. but who said $new_implementation provides reverse in its core? 18:04
so, I'm just pointing out that this is a separate question, and the concrete Prelude.pm in src/perl6 is pugs-specific already. :-)
cmarcelo hmm ok :) 18:05
I have to go now. Will try to keep my promise on documenting :) tks for the updates on newVal and such. 18:06
gaal sure! keep nudging if I don't moose the wiki some more this week... 18:09
cmarcelo ok :) & 18:11
18:31 the_dormant joined 18:41 sapir joined 19:07 andreum joined 19:36 nothingmuch_ joined 19:40 weinig is now known as weinig|bbl 19:48 marco_ joined 19:51 benny_ joined 19:56 mj41_ joined 20:01 wilx joined 20:05 justatheory joined 20:13 weinig|bbl is now known as weinig 20:50 pbuetow joined 20:55 SamB joined, Aankhen`` joined 21:11 offby1 joined 21:19 benny_ is now known as benny 21:58 njbartlett joined 22:40 justatheory joined 22:42 weinig is now known as weinig|away 22:57 takesako__ joined 23:23 weinig|away is now known as weinig 23:28 ozo_ joined 23:29 bsb joined
ruz hi, in perl 5 I often want make slice of a hash, something like %hash{qw(key1 key2)}, however that's not possible 23:33
wonder if that would be possible in p6
avar @hash{qw(a b c)} 23:34
lambdabot Unknown command, try @list
ruz avar: it's an array of keys, however I need equivalent of %hash_slice = map { $_ => $h{$_} } qw(a b s); 23:37
avar well that's not a slice at all 23:38
23:39 SubStack joined
wolverian ruz, note that array slices don't do that either. 23:39
ruz may be I'm weak in terms. Isn't it clear what I want? 23:40
avar It's clear, you're just not going to get it with any sort of slice syntax in perl 5 or perl 6
A slice is a list of values in a hash given keys or values in an array given indexes, you want to get a new hash that has the values *and* their keys 23:41
ruz yep
I even think it makes sense as left value
%h{qw(Key1 Key2)} = %h{qw(PrefixKey1 PrefixKey2)}l 23:43
s/l$/;/
or something like that
avar yes, you can do that 23:47
If you want ^Key to have the value of ^PrefixKey that is
23:48 dduncan joined 23:53 Daveman joined 23:54 [particle] joined
ruz that was wrong example, however, I must go to sleep 23:56