Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2008-01-05

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:01 pugs_svn r19333 | Darren_Duncan++ | ext/Muldis-DB/ : updated copyright range-ends to 2008
00:24 shafire joined #perl6
00:24 shafire hi
00:24 shafire ranti?
00:24 shafire :o
00:25 shafire ah pbuetow :)
00:25 pbuetow hallo shafire
00:26 shafire 3st xD
00:26 lorn_ joined #perl6
00:40 jferrero joined #perl6
01:30 drbean joined #perl6
01:54 kanru joined #perl6
02:02 vdrab joined #perl6
02:14 Caelum joined #perl6
02:21 Limbic_Region joined #perl6
02:46 hexmode joined #perl6
02:46 pugs_svn r19334 | rhr++ | [Unicode.pm] factor out Utable, tests for Utable, some S29 stuff, misc fixes
02:55 jrm__ joined #perl6
03:18 pugs_svn r19335 | rhr++ | [Unicode.pm] implement <alpha> <digit> <isZs> etc.
03:20 pugs_svn r19336 | rhr++ | [Unicode.pm] forgot ;s
03:25 lisppaste3 joined #perl6
03:48 vainguard joined #perl6
04:14 vainguard_ joined #perl6
04:27 diakopter TimToady: you're trying to keep the language agnostic, or trying to keep the language implementation agnostic?  If the former, it tickles me.
04:28 diakopter above, insert a hyphen between implemenation and agnostic.
06:26 Schwern joined #perl6
06:26 Schwern What's "quasiquoting"?
06:26 * Schwern just found q:code in S02
06:27 jql larry stole that from lisp
06:28 Schwern Ok, what's it in Lisp?
06:28 allbery_b backquote
06:28 Schwern WHAT DOES IT DO
06:29 allbery_b it quotes except when things are *un*escaped
06:29 Schwern I don't understand.  Can you give an example?
06:29 allbery_b in Lisp, `(sexpr) is quoted excvept whn something is preceded by , or ,@
06:30 allbery_b in which case it is expanded (,foo expands a list in place as (list), ,@foo expands the list inline so it is added to whatever the current sexp is)
06:30 Schwern Let's assume I don't know Lisp
06:30 jql (don't `(you ,@quote-me))
06:30 Schwern What do you use it for?
06:30 Tene allbery_b: can you give an example of a Perl 6 quasiquote, perhaps, and its meaning?
06:31 allbery_b code generation (in lisp via macros; in perl by manipulating ASTs)
06:31 jql it's for interpolating variables into an eval{} q construct
06:31 Schwern How is it better than eval STRING?
06:31 allbery_b in p6?  not so much.  I'm still weak on the language, never mind how the AST stuff worjks
06:31 __Ace__ joined #perl6
06:32 jql eval "\$foo $bar" vs q:list<$foo ,$bar>
06:32 jql err, s/list/lisp/
06:33 Schwern Isn't it q:code?
06:33 jql yes, but my version wasn't valid for q:code
06:33 jql mine was made-up bs
06:33 Schwern ah ha
06:34 allbery_b the very shoprt version, as I understand it (which may bre incorrect):  you have more control over the substitution because you specify exactly the context into which it substitutes.  in the evlal string version, the string could contain random evil stuff; in quasiquoted code, it has to be exactly what is permitted at that place (e.g. if it's looking for a variable, only a variable can be substituted)
06:35 allbery_b it's not interpolating a string, it's interpolating a semantic element
06:35 Schwern What's "it" in "it's looking for a variable"?
06:35 allbery_b (niot syntactic)
06:35 jql quasi-quoting is a lot more like allowing interpolation into an eval{} than an eval""
06:35 allbery_b it = the perl parser
06:37 allbery_b quasiquoted code is parsed.  but you can substitute specific things into it (hence "quasi":  you control where substition is permitted) as long as what is substituted is acceptable in that particular place in the generated parse tree (not in the source!)
06:37 Schwern Yeah, I'd need to see an example
06:37 allbery_b except I'm not sure if it actually works at the parse tree level or at the source level
06:38 allbery_b I think we all do, to be honest :)
06:38 jql I don't know the syntax for dequoting stuff
06:38 allbery_b I'm not cl;ear on what level p6 quasiquoting actually operates
06:38 Schwern It came up because of the issues with this in Perl 5:   eval "sub $name { my \$foo = 42;  print $name }"
06:39 jql oh bleh
06:39 Schwern The whole problem of interpolating code as a string and how there's no good way to do it.
06:39 allbery_b I know how quasiquoting works in lisp, and have some idea of how it works in template haskell (which operates on the level of the parse tree / AST).  I think p6 is more like the latter
06:39 Schwern And realizing that Perl 6 interpolating {} is going to make that easier and harder.
06:39 Schwern So there must be an improved substitute.
06:40 Schwern And then stumblign on q:to:code
06:42 jql macro gimmeh($name) { qc{ my sub !$name! { my $foo = 42; print !$name! } } }   # how about I steal some syntax
06:43 Schwern qc already means something.
06:43 jql actually, print !$name! is a syntax error
06:43 * jql sucks
06:43 Schwern quote closure
06:43 jql say !!$name!!
06:43 jql there, invented "" for quasis
06:44 jql heck, it could be a meta-twigil
06:45 jql $'name
06:45 jql although reintroducing unmatched ' is verboten
06:55 jjore-m joined #perl6
06:56 jjore-m joined #perl6
07:36 lyokato_ joined #perl6
07:38 pugs_svn r19337 | Darren_Duncan++ | ext/Muldis-DB/ : in Value.pm, demoted Order type from generic to catalog-specific
07:54 Aankhen`` joined #perl6
08:03 pmurias joined #perl6
08:05 pmurias Schwern: the quasi-quote is equvialent to writing the ast AST in the AstNode.new(...) form, only with better syntax
08:07 pmurias checking if the example i wrote is update with the spec
08:09 TimToady yes, the basic problem with eval "" is that it has to reparse the entire string, including (often) large quantities of non-varying code
08:09 TimToady a quasi quote allows you to parse the non-varying bits only once at compile time, while still allowing you to plug in bits of AST for the varying parts
08:10 TimToady not only is this more efficient, but it's also more secure
08:10 TimToady (much like the placeholders that DBI uses to prevent SQL injection attacks)
08:11 pmurias TimToady: one thing i wandered about is if the various implementatins will have to adapt a single AST to make the macros portable?
08:11 TimToady seems like it, doesn't it?
08:11 pmurias * implementations
08:13 pmurias if the have the same grammar and AST they will probably have interchangable componets
08:13 pmurias * components
08:13 TimToady on the other hand, we can probably parse bits of code with an eval-like operator that returns AST
08:13 TimToady as long as the parser knows which rule to start with
08:14 TimToady so as long as the same rules are called, it doesn't matter so much if the trees are different
08:15 TimToady but that approach would not be quite as safe as directly constructing AST
08:15 TimToady so yes, I'm hoping for convergence there
08:16 TimToady or maybe there's some common AST form that each implementation can transmogrify into its own form
08:27 devogon joined #perl6
08:31 p6quester joined #perl6
08:32 pmurias .HOW returns a metaclass instance, which .isa a metaclass, right?
08:36 pugs_svn r19338 | pmurias++ | [yap6] fixed minor grammar issues
08:47 TimToady pmurias: correct
08:48 TimToady thunk &
09:01 pmurias TimToady: thanks
09:28 gaal hi there
09:28 devogon joined #perl6
09:30 devogon joined #perl6
09:31 jisom joined #perl6
09:33 pmurias gaal: hi
10:31 thoughtpolice joined #perl6
10:46 meppuru joined #perl6
10:46 IllvilJa joined #perl6
11:14 iblechbot joined #perl6
11:37 vdrab left #perl6
11:39 cognominal_ joined #perl6
11:43 meppuru joined #perl6
11:47 meppel-san joined #perl6
11:53 Schnueff joined #perl6
12:10 rindolf joined #perl6
12:12 jferrero joined #perl6
12:19 blindfish_ joined #perl6
12:22 kanru joined #perl6
12:44 masak joined #perl6
12:47 jedai joined #perl6
13:47 ruoso pugs: my int $a = '1'.int();
13:47 exp_evalbot RESULT[\1]
13:47 ruoso pugs: my Int $a = '1'.int();
13:47 exp_evalbot RESULT[\1]
13:47 ruoso pugs: my Int $a = '1'.Int();
13:47 exp_evalbot OUTPUT[*** No such method in class Str: "&Int"␤    at /tmp/VJ8PDfysAF line 1, column 8-22␤]
13:47 ludan joined #perl6
13:59 __Ace__ joined #perl6
14:03 meppel-san joined #perl6
14:04 jrm_ joined #perl6
14:07 lorn joined #perl6
14:19 ruoso pugs: my Int $a = 1; my int $b = $a;
14:19 exp_evalbot RESULT[\1]
14:19 ruoso Int and int autoboxes
14:20 ruoso right, but which is the method we call on Int to get a int?
14:21 ruoso I suppose that is "standard" API
14:22 ruoso I mean, there might be several Int implementations coexisting
14:22 drrho joined #perl6
14:24 ruoso as any object can have a metaclass that returns true on $obj.^does(Int)
14:27 polettix joined #perl6
14:28 ruoso maybe these would be metamethods
14:28 ruoso like .^does and .^can
14:29 ruoso maybe .^native($type)
14:30 ruoso In the YAP6 model, it makes sense to be in the metaclass
14:31 pmurias ruoso: you seem to be using the phrase "metaclass" in place of "metaclass instance"
14:31 ruoso yes
14:31 ruoso in fact
14:31 pmurias go on
14:31 ruoso but that's because in this model,
14:31 ruoso the metaclass is always a prototype
14:32 ruoso that is realized in the low-level
14:32 ruoso in C
14:32 ruoso hmm
14:33 ruoso ok... it doesn't need to be a prototype
14:33 ruoso hmm
14:33 ruoso not sure
14:33 ruoso in fact, it's its own prototype
14:33 ruoso yes
14:33 ruoso but anyway
14:34 ruoso you know what I mean, right
14:34 ruoso ?
14:34 ruoso there's no metaclass class
14:34 ruoso there are only metaclass instances
14:34 pmurias i see
14:34 ruoso and the metaclass API
14:35 ruoso which have .does, .can and .isa
14:35 pmurias there will be metaclasses when the model bootstraps
14:35 pmurias ?
14:35 ruoso and I'm now thinking about .native
14:35 ruoso always
14:35 ruoso that's how you'll be able to use p5 objects from yap6
14:36 ruoso or even PMCs
14:37 ruoso remember, a Int is simply something that returns true to .^does(Int)
14:37 ruoso so nothing stops me from using a SV* directly as an Int
14:37 pmurias i mean .HOW() returns a metaclass instance, which is not .isa anything at first
14:37 ruoso it's design by contract
14:37 ruoso yes
14:37 ruoso metaclass .isa itself
14:37 ruoso heh
14:38 xinming joined #perl6
14:41 pmurias ruoso: but Foo.HOW() .isa Class.HOW()
14:41 pmurias (Foo.HOW).isa(Class.HOW)
14:42 ruoso in theory, that's true if both Foo and Class are laid out as the same metaclas
14:42 ruoso s/as the/by the/
14:42 ruoso because the metaclass is also a prototype
14:43 pmurias a metaclass?
14:43 ruoso "metaclass instance"
14:44 ruoso but it never realizes itself as an object
14:44 ruoso Foo.HOW().new() should return another prototype
14:44 ruoso instead of an object that have Foo.HOW() as its prototype
14:44 pmurias i think metaclass instance and the prototype object are seperate thing
14:44 ruoso they are
14:45 ruoso I mean
14:45 ruoso Foo.WHAT is not the same as Foo.HOW
14:45 pmurias yes
14:45 ruoso but Foo.HOW.WHAT is the same as Foo.HOW
14:45 ruoso and Foo.HOW.HOW is the same as Foo.HOW
14:45 pmurias Foo.HOW.HOW is diffrent from Foo.HOW
14:46 ruoso and what is it?
14:46 ruoso the metaclass's metaclass
14:46 ruoso you just change the invocant
14:47 ruoso $a.foo() is $a.HOW.can(foo).call($a: )
14:48 ruoso $a.foo() is $a.HOW.can("foo").call($a: ) actually
14:48 pmurias ruoso: Foo.HOW.HOW is the Foo's metaclass instance parents metaclass instance
14:48 pmurias so it's Class.HOW
14:49 ruoso Only if Foo is laid out by the Class metaclass
14:49 pmurias we need a better term than "metaclass instance" a metaobject would be fine
14:49 ruoso which may not be true
14:49 pmurias ruoso: yes
14:49 ruoso and what is Class.HOW if not Class again?
14:50 ruoso and there's the bootstrap
14:50 pmurias Class.HOW is the special case
14:50 ruoso we don't need a special case
14:50 ruoso we can bootstrap
14:52 pmurias Class.HOW is not Class
14:52 ruoso that's an implementaiton detail
14:52 vainguard joined #perl6
14:52 ruoso actually Class.HOW may be p6opaque
14:52 ruoso but then Foo.HOW will probably be p6opaque again
14:53 pmurias Class.HOW.HOW === Class.HOW # that's the special case
14:53 ruoso well.. it's a special case in the implementation, not in the architecture...
14:53 ruoso it's a bootstrapped metaclass
14:53 ruoso a metaclass that can be described by itself
14:54 pmurias normal class are not bootstrap is what i mean
14:54 pmurias * classes
14:54 ruoso normal classes depend on the metaclass
14:55 ruoso and by class here, we really should use prototypes
14:55 ruoso a metaclass is something that is self-suficient
14:55 pmurias prototype objects are not metaclass instances
14:55 ruoso no,
14:56 ruoso but metaclass instances are prototype object
14:56 ruoso s
14:56 pmurias i don't think they are
14:56 ruoso I mean, they don't need to be
14:56 ruoso that's how I managed to figure out how to bootstrap in the model I designed
14:57 ruoso that is implementation specific
14:57 pmurias i mean in Perl 6
14:57 ruoso Perl 6 doesn't really differentiate between prototypes and objects
14:58 ruoso a prototype is something that can be used as an object
14:58 ruoso it's implementation specific how to define the differences between them
14:59 pmurias class Foo {method methods() {print "foo!!!"}};::Foo.methods
15:00 pmurias kp6: class Foo {method methods() {print "foo!!!"}};Foo.methods
15:00 exp_evalbot r19338: OUTPUT[foo!!!]
15:00 pmurias kp6: class Foo {method methods() {print "foo!!!"}};Foo.HOW.methods
15:00 exp_evalbot r19338: OUTPUT[syntax error at position 53, line 1 column 53:␤class Foo {method methods() {print "foo!!!"}};Foo.HOW.method␤                                                     ^ HERE␤]
15:00 pmurias kp6: class Foo {method methods() {print "foo!!!"}};(Foo.HOW).methods
15:00 pmurias kp6: class Foo {method methods() {print "foo!!!"}};say (Foo.HOW).methods
15:00 exp_evalbot r19338: RESULT[no method 'APPLY' in Class 'Undef'␤ at compiled/perl5-kp6-mp6/lib/Ki​ndaPerl6/Runtime/Perl5/MOP.pm line 345␤        KindaPerl6::Runtime::Perl5::MO​P::__ANON__('HASH(0x824c364)', 'APPLY', 'HASH(0x8e76204)') called at compiled/perl5-kp6-mp6/lib/Ki​ndaPerl6/Runtime/Perl5/MOP.pm line 169␤
15:00 exp_evalbot ..main::DISPATCH('HASH(0x824c364)', 'APPLY', 'HASH(0x8e76204)') ca...
15:00 exp_evalbot r19338: OUTPUT[methodsHOWWHAT␤]
15:01 ruoso kp6: say Int.HOW.WHAT
15:01 exp_evalbot r19338: OUTPUT[Int␤]
15:01 ruoso kp6: say (Int.HOW).WHAT
15:01 exp_evalbot r19338: OUTPUT[Class␤]
15:01 ruoso but that's how kp6 implements
15:01 ruoso nothing says that the metaclass instance of Int must be Class
15:01 ruoso it can be anything else
15:02 ruoso kp6: say (Int.HOW).HOW
15:02 pmurias ruoso: yes but it can't be Int
15:02 exp_evalbot r19338: OUTPUT[Class␤]
15:02 ruoso pmurias, it could
15:02 ruoso nothing stops it from being
15:02 ruoso it only needs to be a Int implementation that supports the metaclass API
15:03 pmurias ruoso: i meant the standard Int class
15:03 ruoso the thing is
15:03 ruoso there's no "standard" int class
15:03 ruoso Int is anything that returns true to $foo.^does(Int)
15:04 ruoso I can have several Int implementations coexisting
15:04 ruoso Ok, only one will be registered in the namespace as Int
15:04 ruoso but even then
15:04 ruoso I can have it changed
15:05 ruoso and the change can be scoped
15:06 pmurias the one which is registered in "vanilla" Perl 6
15:06 ruoso you mean the API
15:06 ruoso I agree that there's a standard API
15:07 ruoso it's design by contract
15:07 jhorwitz joined #perl6
15:16 alester joined #perl6
15:19 pugs_svn r19339 | ruoso++ | [yap6] a big block of comment in yap6.h introducing how to deal with the native types.
15:20 ruoso pmurias, please take a look at that last comment block in yap6.h
15:23 pmurias ok
15:27 pmurias ruoso: i don't think the native method has to live in the metaclass
15:28 ruoso where would it be?
15:29 pmurias in the Int class
15:30 ruoso I thought about it,
15:30 ruoso but there's one important reason for it to be in the metaclas
15:30 ruoso which is the fact that building a native object requires low-level call
15:30 ruoso I mean
15:31 ruoso you can't say int.new(1)
15:31 pmurias class Int {has int $.value;method int {return $.value;}
15:31 ruoso because 1 is already a int
15:31 ruoso so
15:31 ruoso it woul be int.new(int.new(int.new( ...
15:31 ruoso the low-level int creation needs to be made at low-level
15:31 pmurias 1 compile to well... 1 which is int
15:32 pmurias s/compile/compiles/
15:32 ruoso yeah... but thinking in implementation, this means a C call
15:32 ruoso not a Perl clal
15:32 ruoso call
15:32 pmurias yes
15:33 ruoso and this even for classes implemented completely in Perl
15:34 ruoso so, considering that the metaclass already needs to be implemented in C
15:34 ruoso at least some part of it
15:34 ruoso I thought it would be interesting to consolidate that there
15:35 pmurias ruoso: how will you pass the value of the int to the metaclass
15:35 pmurias unless you use church numerals
15:35 ruoso that's the point, the metaclass understands the object representation
15:35 ruoso and can extract it from there
15:37 pmurias if you pass buf yes
15:37 ruoso hm?
15:37 pmurias a bag of bits
15:38 ruoso I mean, we are talking about C code here
15:38 ruoso the metaclass understand the C structure of the data
15:38 ruoso and can deal with that
15:38 pmurias so we can do int.new(1)
15:38 ruoso in C, yes
15:39 ruoso which would probably be yap6_int_create(1)
15:39 pmurias in opcode tree we do something in the style of call(prototype('int'),'new',int(1))
15:40 meppel-san joined #perl6
15:40 ruoso pmurias, no... probably something more call(lowlevel('int_create',1))
15:41 pmurias was just making stuff up
15:41 ruoso I see, but I really mean that this should be an explicit lowlevel thing
15:41 ruoso not implicit
15:42 ruoso it's a lowlevel operator
15:43 vainguard_ joined #perl6
15:50 pmurias in order for native to work you'll need a custom metaclass for Int
15:50 pugs_svn r19340 | ruoso++ | [yap6] some more reasoning on why the "native" method resides in the metaclass
15:51 ruoso pmurias, probably...
15:51 ruoso but I would probably have it in the first place
15:51 ruoso because I don't want Int to have the same representation of Complex
15:53 ruoso or Str
15:53 ruoso but, for instance...
15:53 ruoso if we're mapping SV*s
15:53 ruoso every SV object can return a native type in the same way
15:54 ruoso so the YAP6-SV metaclass would implement native(int) directly
15:54 ruoso without an extra call to imply numeric context
15:56 ruoso so, basically, every SV would be able to say .^does(Int)
15:56 ruoso hmm
15:56 ruoso but it doesn't need to
16:02 vainguard joined #perl6
16:03 ruoso pmurias, ok... now I'm in doubt
16:03 ruoso maybe it should go to the Int implementation
16:03 ruoso and not the metaclass
16:10 acmoore joined #perl6
16:14 pmurias ruoso: you can have a perl5-hash-based-object metaclass, but a YAP6-SV would be rather limited
16:15 ruoso pmurias, as limited as perl5-hash-based-object is
16:15 pmurias s/limited/diffrent
16:16 pmurias different
16:17 ruoso well... p5 oo may have different implementations
16:17 ruoso but in the end you have a ref blessed to a package name
16:17 pmurias you can have metaclasses for diffrent p5 oo implementations
16:17 pmurias * different
16:17 pmurias or a read only one for a ref blessed to a package name
16:21 ruoso pmurias, I wouldn't expect to be able to have a rw metaclass to a p5 object
16:21 ruoso I mean,
16:22 ruoso my $foo = some_sub_that_returns_a_p5_object()
16:22 ruoso $foo does Bla;
16:22 ruoso would create a new prototype that extends the original class and composes with Bla
16:22 ruoso the new prototype would point to a "composition" metaclass
16:23 ruoso that would know how to ask for the previous prototype
16:32 rindolf joined #perl6
16:39 |Jedai| joined #perl6
16:42 pmurias the metaclass would wrap the perl5 object so that perl5 integers returned from methods will be turned into perl6 int's
16:43 pmurias hosting a starcraft lan party&
16:46 _Jedai_ joined #perl6
16:51 Psyche^ joined #perl6
16:52 pugs_svn r19341 | ruoso++ | [yap6] declaring the native-type prototypes and the low-level API for using them
16:55 mncharity exists MY::<$a> ?? MY::<$a> !! exists OUR::<$a> ?? OUR::<$a> !! exists GLOBAL::<$a> ?? GLOBAL::<$a> !! CANDO($?PACKAGE, Item, '$a')
16:55 mncharity is that what name resolution of $a looks like?
17:00 mncharity TimToady: ^^^ ?  tnx
17:00 DaGo joined #perl6
17:04 pugs_svn r19342 | ruoso++ | [yap6] I think this is the entire external API for YAP6
17:10 fihi09 joined #perl6
17:22 rhr can you slice up slurpy args like so? sub foo(*$first, *@ignored[11], *$thirteenth, *@rest) {...}
17:24 Psyche^ joined #perl6
17:31 marmic joined #perl6
17:35 chris2_ joined #perl6
17:43 araujo joined #perl6
17:51 barney joined #perl6
18:09 rindolf joined #perl6
18:12 diakopter Juerd_: ping
18:17 pugs_svn r19343 | ruoso++ | [yap6] yap6.h now includes three files. This files now should have the YAP6 external API complete.
18:21 pugs_svn r19344 | ruoso++ | [yap6] The public headers are moved from src to include. These are the headers that programs using YAP6 will include.
18:24 ruoso I still have to work on the MESSAGE method of the metaclass to include something related to exception model and stuff...
18:24 ruoso but apart from that, I think the way it's design will support Perl 6 completely
18:49 vainguard_ joined #perl6
19:06 pugs_svn r19345 | rhr++ | [Unicode.pm] start reading and dumping the UCD.  implement %open2close per S02:68
19:06 pugs_svn r19345 | rhr++ | [Utable.pm] add .perl and tests
19:21 meppuru joined #perl6
19:21 vainguard joined #perl6
19:24 pugs_svn r19346 | ruoso++ | [yap6] a "repr" member of the YAP6__Object structure is where the object representation will be held.
19:26 jisom joined #perl6
19:53 barney joined #perl6
19:53 TimToady rhr: no, formal parameters can't take subscripts
19:58 TimToady mncharity: not exactly.  MY should give a view of all lexically scoped declarations including "our" and "state"
19:58 TimToady arguably it's misnamed
19:58 TimToady also, it doesn't fallback to GLOBAL under strict
20:01 vainguard_ joined #perl6
20:02 TimToady (or do the package CANDO lookup either)
20:02 TimToady under strict, if it's not lexically declared or imported, it's not visible
20:05 wolverian TimToady, can you use pattern matching to do the same thing (slice up the slurpy args)? though doing that beyond splitting head and tail goes into dependent types territory if you want to define it that way..
20:08 TimToady you can certainly apply subsignatures to array arguments, so there's doubtless some way to work it so the nth element gets bound to a particular variable name, but subscript notation doesn't have much to do with it on the formal end
20:12 wolverian yeah.
20:16 vainguard__ joined #perl6
20:22 rhr TimToady: yes, I see.  how would you do that?  I can't see any way to get an xx in there without using eval
20:25 kingkongrevenge joined #perl6
20:26 TimToady you can match a signature to any individual listy parameter using [$a,$b,$c]
20:26 TimToady so $c is by definition the 3rd element
20:28 TimToady see S06:1328 "Unpacking array parameters"
20:28 TimToady lunch
20:28 TimToady &
20:35 vainguard joined #perl6
20:43 rhr can you do something like: my Sig $one := :(*$ignored); my Sig $eleven := $one xx 11; sub foo(*$first, |$eleven, *$thirteenth, *@rest) {...} ?
20:47 vainguard_ joined #perl6
20:47 mncharity TimToady: thanks
20:49 mncharity On an unrelated note,
20:50 mncharity it seems the kp6 and pugs front-ends are complementary (objects vs language-coverage)
20:50 mncharity has anyone considered doing common backend?
20:51 mncharity Ie, a kp6 backend which also works as a pugs backend.
20:51 mncharity So one could do the prelude in kp6 dialect, but drive it with the entire pugs t/.
20:53 mncharity thoughts? questions?
21:03 barney joined #perl6
21:10 mncharity avar: ping?
21:13 mncharity anyone know the state of the kp6 lisp backend?
21:14 mncharity fax: aankhen: fglock: ping?
21:14 devogon joined #perl6
21:14 mncharity err, Aankhen
21:15 mncharity Aankhen`` even
21:28 mncharity Is there a recommended revision (and ghc version) to get a working pugs?  make o
21:29 rhr current rev should work well with 6.6.1, I think
21:29 mncharity n HEAD failed with Setup: error reading dist/setup-config; run "setup configure" command?  Build failed for '/a/home/jobsearch/a_bit_of_perl6/pu​gsx1/dist/build/libHSPugs-6.2.13.a': 256 at util/build_pugs.pl line 372.
21:30 mncharity rhr: trying... my thanks
21:34 Aankhen`` mncharity: Yes?
21:36 mncharity Aankhen``: hi.  I was wondering what the state of the kp6 backend is.  saw you in the log.
21:36 mncharity *lisp backend
21:36 Aankhen`` mncharity: I'm not sure, sorry. avar would know better.
21:36 mncharity np.  thanks
21:36 Aankhen`` I stopped working on it a long time ago.
21:37 mncharity ok
21:38 mncharity hmm, was any thought given to being a pugs backend as well?  or was the focus entirely on kp6?
21:39 Aankhen`` The focus was entirely on KP6 while I was there.
21:39 Aankhen`` I'm not sure Pugs entered the picture.
21:39 mncharity ok.  thanks again
21:42 ispy_ joined #perl6
21:59 pugs_svn r19347 | rhr++ | [Unicode.pm] a new Str.graphs.  some p5 unicode prop defs.
22:02 Juerd_ diakopter: pong
22:12 mncharity gaal: re Test-TAP-HTMLMatrix, 103 passes, 1 failure, and guess which configuration I have.  sigh. :)
22:24 TreyHarris i'm puzzling at a line in TimToady's recent edit to S09: my :($obj) := $cap;
22:25 TreyHarris that ":($obj) :=" is creating an anonymous Pair, and binding $obj to the value part of the Pair?
22:27 mncharity I'm quite rusty, but I believe the :($obj) is a Signature, rather than a Pair.
22:27 TreyHarris oh!  i thought signatures were ::
22:28 mncharity I remember seeing  "my :($obj) " is the same as "my($obj)".
22:28 TreyHarris I was going by S02, the line "'' => $x            :($x)"
22:29 TreyHarris mncharity: you just said two different things... the colon makes it a Signature, or the colon is doing nothing at all?
22:30 fglock joined #perl6
22:30 fglock obra: ping
22:30 lambdabot fglock: You have 1 new message. '/msg lambdabot @messages' to read it.
22:31 mncharity In "my($x);", the "($x)" part is a Signature, with the ":" optional here in my.
22:31 mncharity hi fglock
22:31 fglock mncharity: hi
22:32 TreyHarris mncharity: so you're saying TimToady didn't need the colon there in S09?
22:33 mncharity fglock: any idea what the state of the kp6 lisp backend is?
22:34 fglock mncharity: it blocked at implementing an AST transform to emulate perl6 lexical scopes,
22:35 fglock kp6-c is also waiting for that
22:35 mncharity TreyHarris: assuming my understanding is correct, I'm saying the code would behave identically without it.  which is _not_ saying it isn't needed there in S09 for expository purposes.
22:36 mncharity "AST transform to emulate perl6 lexical scopes"?
22:38 mncharity rhr: indeed ghc 6.6.1-3.fc7 x86_64 is indeed working on f8.  make test is running.  thanks again.
22:49 fglock mncharity: the lisp and C runtimes don't implement lexical scopes directly (but Perl 5 and Parrot do); we need to translate the AST to a very simplified form
22:51 mncharity the lisp runtime can't implement lexical scopes directly too?
22:53 fglock good question, I think it could
22:56 mncharity so perhaps the kp6 lisp backend is more sleeping than blocked
22:58 fglock mncharity: do you know some lisp? :P
22:59 Auzon joined #perl6
23:01 fglock mncharity: re kp6 and pugs - I'm now trying to make kp6 and perl6-parrot converge
23:01 fglock unfortunately, I don't know enough haskell
23:02 fglock mncharity: and pmurias has been working on merging v6.pm into kp6
23:02 mncharity re lisp, a bit. :)
23:03 mncharity re converges, oo, nifty
23:03 mncharity though converging with parrot... well,
23:05 mncharity hmm.  I note that, in the past, attempts to converge with parrot have proved troubled and time absorbing.  so...
23:05 cathyal joined #Perl6
23:05 cathyal hi
23:05 pbuetow hi
23:05 mncharity perhaps just keep an eye on the slippery slope, and don't let it absorb all your time?  perhaps?
23:07 fglock kp6 can be developed simultaneously in several platforms, so Parrot features are not really blocking kp6 itself
23:11 fglock re absorb - I don't think it makes sense to have more than one Perl6-in-Perl6 compiler
23:11 fglock so I'm trying to work on perl6-parrot too
23:12 mncharity re pugs/haskell, one random idea might be to dump the pugs front-end's incomplete PIL for t/, in some form more easily manipulated, into svn.  So one could then generate kp6 compatible something... kp6 ast?  To provide an additional source of exercise for kp6 components.
23:12 mncharity re parrot, ok
23:13 Samsta joined #perl6
23:14 Samsta how do I XOR the hexadecimal values of two strings together?
23:14 mncharity fglock: do you have any feel for how easy/hard it might be to translate PIL to kp6?
23:14 fglock hmm
23:15 fglock easy, but I don't think it's a good idea
23:15 mncharity :)
23:15 fglock we need to fix kp6 instead
23:16 fglock which means (current milestone) to integrate the STD grammar
23:17 mncharity hmm
23:18 fglock the grammar refactoring is stalled, we've been working in the bootstrap and optimizations instead
23:18 mncharity the last time I looked at STD, long ago, it was kind of scary how much p6 had to be working to use it as written.
23:19 mncharity s/much p6/much of p6/
23:19 fglock we seemed to need bootstrap and optimizations before refactoring the grammar - now I'm not so sure
23:19 fglock kp6 implements most of the scary parts
23:20 fglock it still needs a longest-token algorithm in regexes
23:21 Limbic_Region joined #perl6
23:21 vainguard joined #perl6
23:22 mncharity re scary parts implemented, :)
23:22 fglock re t/ - some problems are VM problems, not compiler problems
23:23 mncharity i don't understand
23:24 fglock kp6 has some tools to work around missing virtual-machine features, but the run-time cost is high
23:26 fglock features == OO, closures, variable scopes, threads, ...
23:26 mncharity ahhh
23:28 fglock most of last year's work has been focusing on working around these features, instead of focusing on the compiler
23:30 mncharity yeah.  I keep looking for a backend language which makes it easier.  p5, ruby, CL, etc.  but a lot of the value of p6 lies in its being able to do this set of things which currently aren't easy to get together.  so for bootstrap, it's a pain. :)
23:33 vainguard_ joined #perl6
23:33 mncharity is kp6 self compiling?
23:34 fglock re pain - kp6 strong point is working around missing features in the backend
23:34 mncharity ah, interesting
23:34 fglock it does compile itself,
23:35 fglock but you need to compile using "less features" in order to have reasonable performance
23:35 mncharity /me pictures "use v6;  use less features;"
23:35 fglock that's why we are working on optimizations
23:37 mncharity backend performance or compiler?
23:37 fglock either you have the perfect VM, or you emulate+optimize and hope it still works reasonably fast
23:37 fglock backend
23:37 fglock the third option is, use less features
23:38 mncharity right
23:41 mncharity is it plausible to picture "optimizing" the backend by swapping in a different language/runtime?  eg, something with a good JIT?
23:42 fglock obra: we'll be in Porto on sunday until 17h
23:42 mncharity how straightforward would it be to implement p6-style oo at this point?  on top of some random modern non-strongly-typed oo language.
23:44 fglock that's what ruoso is working on - hmm, but C is strongly typed and not modern
23:44 fglock do you mean python or what?
23:45 fglock I did implement mp6 on Groovy, but that was just an experiment
23:47 jferrero joined #perl6
23:52 fglock sleep &
23:56 mncharity good night fglock.  nice talking with you.
23:56 mncharity re what?, I was just looking... :)
23:59 kingkongrevenge joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo