Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2008-02-13

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:04 Limbic_Region joined #perl6
00:11 alester joined #perl6
00:13 jjore-w joined #perl6
00:36 cathyal joined #perl6
02:15 samdc joined #perl6
02:32 zakame joined #perl6
03:07 Auzon joined #perl6
03:10 alester joined #perl6
03:10 hcchien joined #perl6
03:29 fridim_ joined #perl6
03:34 Psyche^ joined #perl6
03:35 eternaleye joined #perl6
04:11 stevan_ joined #perl6
04:13 lisppaste3 joined #perl6
04:36 pbuetow joined #perl6
05:22 drbean_ joined #perl6
05:31 zakame joined #perl6
05:37 monomorph joined #perl6
05:40 araujo joined #perl6
05:47 drbean joined #perl6
05:50 krumms_ joined #perl6
06:05 jjore joined #perl6
06:22 iblechbot joined #perl6
06:53 lambdabot joined #perl6
07:01 luqui joined #perl6
07:14 psapo joined #perl6
07:22 Schwern joined #perl6
07:51 Aankhen`` joined #perl6
08:00 masak joined #perl6
08:14 laye joined #perl6
08:17 devogon joined #perl6
08:22 marmic joined #perl6
08:22 pugs_svnbot r19904 | lwall++ | latest whackage on longest-token lexer using TRE (requires re-engine-TRE-0.02)
08:22 pugs_svnbot r19904 | lwall++ | can now use tagged DFA info to determine nested alternation fates
08:22 pugs_svnbot diff: http://dev.pugscode.org/changeset/19904
08:22 lambdabot Title: Changeset 19904 - Pugs - Trac
08:30 lidden joined #perl6
09:02 qmole joined #perl6
09:11 mattz joined #perl6
09:15 zakame joined #perl6
09:23 zakame_ joined #perl6
09:41 krumms_ left #perl6
09:42 ebassi joined #perl6
09:47 meppl joined #perl6
09:53 zakame__ joined #perl6
10:02 chris2 joined #perl6
10:34 ruoso joined #perl6
10:36 xinming_ joined #perl6
10:55 avar joined #perl6
11:17 sri_work joined #perl6
11:30 wknight-away joined #perl6
11:38 Botje joined #perl6
11:55 lambdabot joined #perl6
12:21 diakopter pugs: say NoName.HOW.name
12:21 exp_evalbot OUTPUT[*** No such subroutine: "&NoName"␤    at /tmp/EmSlgudhqX line 1, column 5 - line 2, column 1␤]
12:25 aindilis joined #perl6
12:30 aindilis joined #perl6
12:35 zakame_ joined #perl6
13:06 lidden joined #perl6
13:23 cmarcelo joined #perl6
13:26 masak which is the most complete perl 6 rules implementation to date?
13:26 moritz_ masak: PGE
13:26 masak moritz_: ah, good. just checking
13:27 masak it's in parrot, right?
13:27 moritz_ yes
13:27 moritz_ thoug it's partly written in C, I guess
13:27 masak yes, most likely
13:28 masak I wonder what it would take to port it to Java?
13:28 masak sometimes I long for more power than java.util.regex.Pattern and Matcher
13:29 moritz_ PGE's output is PIR
13:29 masak a native p6rules library would be awesome
13:29 moritz_ so perhaps you better reimplement kp6's re engine in java ;)
13:29 masak :)
13:29 * masak wonders how seamless that would be
13:30 masak it might just work
13:30 moritz_ but that compiles the rules as well
13:30 moritz_ don't know if that is a good idea for a java implementation
13:32 masak probably not
13:32 masak a pure Java implementation would be more interesting
13:35 zamolxes joined #perl6
13:38 aindilis joined #perl6
13:50 ilogger2 joined #perl6
13:52 aindilis joined #perl6
13:56 monomorph joined #perl6
13:59 rakudo_svn r25692 | jonathan++ | [rakudo] Big refactoring to the objects implementation to remove a lot of inline PIR from the actions file and to make it earlier to allow different metaclasses to give meaning to various keywords later, as we'll need to do S12. No doubt we'll need futher clear-ups later, but
13:59 rakudo_svn ..this is further in the right direction.
14:07 rakudo_svn r25693 | jonathan++ | [rakudo] Remove another bit of inline PIR in favor of generating PAST nodes.
14:15 IllvilJa joined #perl6
14:15 iblechbot joined #perl6
14:21 pugs_svnbot r19905 | moritz++ | [t] S03-operators/assign.t: more rakudo skips
14:21 pugs_svnbot diff: http://dev.pugscode.org/changeset/19905
14:21 lambdabot Title: Changeset 19905 - Pugs - Trac
14:22 rakudo_svn r25694 | jonathan++ | [rakudo] Fix accessor/mutator generation for attributes, which got broken.
14:26 njbartlett joined #perl6
14:27 thepler joined #perl6
14:36 pugs_svnbot r19906 | moritz++ | [t] assign.t: skip rest that makes rakudo loop
14:36 pugs_svnbot diff: http://dev.pugscode.org/changeset/19906
14:36 lambdabot Title: Changeset 19906 - Pugs - Trac
14:39 pugs_svnbot r19907 | moritz++ | [t] fixed previous commit
14:39 pugs_svnbot diff: http://dev.pugscode.org/changeset/19907
14:39 lambdabot Title: Changeset 19907 - Pugs - Trac
14:42 pugs_svnbot r19908 | moritz++ | [t] fudge doesn't like trailing ';'
14:42 pugs_svnbot r19909 | moritz++ | [t] ok, fudge needs ; statement separator for 'emit' statements
14:42 pugs_svnbot diff: http://dev.pugscode.org/changeset/19909
14:42 lambdabot Title: Changeset 19909 - Pugs - Trac
14:53 ruoso lunch time is a great time to have intersting ideas..
14:53 ruoso I've just realised that I can use the constant identifier and native values more powerfully than I first thought
14:54 ruoso If I define a lowlevel interface for runtime definition of new constants (checking for matching an already defined constant, of course)
14:54 ruoso The compiler will be able to define every bareword and constant string as a constant value...
14:55 TimToady you've just discovered Lisp symbols  :)
14:55 ruoso the awesome thing about it, is that most method dispatching will be able to use simple C pointer identity check to find out the method (or methods) by name
14:55 TimToady you are now officially as smart as the inventers of Lisp :)
14:56 ruoso hehe
14:56 ruoso at least I know I'm reinventing a good wheel
14:56 TimToady only about 50 years late...
14:56 ruoso maybe that's a sign that I *should* lern lisp now...
14:56 TimToady we should build a Smop Machine, oh wait...
15:03 viklund joined #perl6
15:05 jhorwitz joined #perl6
15:05 rdice joined #perl6
15:06 alester joined #perl6
15:12 Psyche^ joined #perl6
15:30 meppl joined #perl6
15:32 SinDoc joined #perl6
15:37 ruoso pugs: say "foo" === "foo"
15:37 exp_evalbot OUTPUT[1␤]
15:38 ruoso pugs: say "foo".WHERE === "foo".WHERE
15:38 exp_evalbot OUTPUT[*** No such method in class Str: "&WHERE"␤    at /tmp/wybV0bT3vp line 1, column 5 - line 2, column 1␤]
15:39 ruoso kp6: say "foo".WHERE
15:39 exp_evalbot r19909: OUTPUT[no method 'WHERE' in Class 'Str'␤ at compiled/perl5-kp6-mp6/lib/KindaPerl6/Runtime/Perl5/MOP.pm line 345␤  KindaPerl6::Runtime::Perl5::MOP::__ANON__('HASH(0x8e4bd28)', 'WHERE') called at compiled/perl5-kp6-mp6/lib/KindaPerl6/Runtime/Perl5/MOP.pm line 169␤
15:39 exp_evalbot ..main::DISPATCH('HASH(0x8e4bd28)', 'WHERE') called at - line 11␤]
15:39 ruoso rakudo: say "foo".WHERE
15:39 exp_evalbot OUTPUT[Method 'WHERE' not found for invocant of class 'Perl6Str'␤current instr.: '_block10' pc 12 (EVAL_10:9)␤called from Sub 'parrot;PCT::HLLCompiler;eval' pc 789 (src/PCT/HLLCompiler.pir:459)␤called from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 1063 (src/PCT/HLLCompiler.pir:586)␤called from Sub
15:39 exp_evalbot ..'parrot;PCT::HLLCompiler;command_line' pc 1246 ...
15:39 TimToady pugs: say "foo".WHICH
15:39 exp_evalbot OUTPUT[foo␤]
15:39 TimToady the identity of an immutable value is just the value itself
15:40 ruoso what I'm trying to realise is if pugs optimize "foo" and "foo" to be a single object
15:40 ruoso but I would need WHERE to check that
15:40 TimToady I don't know if it does, but it may, if they're both immutable
15:41 ruoso I'm starting to plan on how to implement that in smop
15:42 ruoso I'll do it before implementing p6opaque, to maximize constant identifier usage in method dispatch
15:42 ruoso as well as private storage dispatch
15:43 Zygo joined #perl6
15:44 SinDoc joined #perl6
15:44 ruoso TimToady, when resolving private storage in the object I'm planning about checking if the Package is the same object, considering that a name should always refer to only one package
15:44 ruoso I mean...
15:45 ruoso when fetching a private slot, you give the package where it belongs
15:46 ruoso hmm... reviewing S02, it makes sense, as Package is a mutable type...
15:46 ruoso so, using === seems like the right thing to do...
15:48 ruoso pugs: say Object.WHO
15:48 exp_evalbot OUTPUT[*** No such method in class Object: "&WHO"␤    at /tmp/pdFxhSqAjP line 1, column 5 - line 2, column 1␤]
15:49 ruoso can it be said by syntax when someone is talking about Object the class and Object the package?
15:50 dalek joined #perl6
15:51 SinDoc left #perl6
15:53 fridim_ joined #perl6
15:57 rakudo_svn r25697 | jonathan++ | [rakudo] Fix role composition so methods in the class resolve conflicts and get priority over methods from roles.
15:57 kcwu joined #perl6
16:00 rakudo_svn joined #perl6
16:02 bloonix joined #perl6
16:14 allbery_m joined #perl6
16:17 pugs_svnbot r19910 | ruoso++ | [smop] test of the new SMOP__NATIVE__idconst_create behaviour added, still failing.
16:17 pugs_svnbot diff: http://dev.pugscode.org/changeset/19910
16:17 lambdabot Title: Changeset 19910 - Pugs - Trac
16:18 TimToady .WHO is supposed to give the package, but pugs doesn't implement it yet
16:18 TimToady .WHAT is the protoobject
16:18 TimToady and .HOW is the metaobject
16:18 TimToady (there is no class :)
16:19 ruoso by Class I mean the protoobject that the bare name points to
16:19 TimToady .WHAT
16:19 TimToady Object.WHAT is a no-op
16:19 TimToady pugs: Object.WHAT
16:19 exp_evalbot RESULT[::Object]
16:20 TimToady pugs: Object
16:20 exp_evalbot RESULT[::Object]
16:20 TimToady (pugs likes to put :: on the front of protoobjects for some reason)
16:20 ruoso and how do I get the package?
16:20 moritz_ is :: for "global"?
16:21 TimToady that's supposed to be .WHO
16:21 ruoso sure...
16:21 ruoso but the question is...
16:21 TimToady pugs: Object::
16:21 exp_evalbot OUTPUT[*** ␤    Unexpected "Object"␤    expecting program␤    at /tmp/FxlhnpnGX6 line 1, column 1␤]
16:21 TimToady pugs: Object::{}
16:21 exp_evalbot OUTPUT[*** ␤    Unexpected "Object"␤    expecting program␤    at /tmp/Qy10eAkUiA line 1, column 1␤]
16:21 ruoso Object points both to the package and to the prototypr
16:22 TimToady it points to the prototype, and the package just happens to have the same name :)
16:22 ruoso so, the syntax is the one defining when I'm wanting the package
16:22 ruoso as in
16:22 TimToady In :: context it follows the pun to the package
16:22 ruoso Object::foo
16:22 ruoso otherwise I need an explicit .WHO
16:22 ruoso or else I'll be getting the prototype
16:23 TimToady Object:: should always be the package, but I don't think pugs does that either
16:23 ruoso so, Object:: === Object.WHO
16:23 ruoso rakudo: Object:: === Object.WHO
16:23 exp_evalbot OUTPUT[Statement not terminated properly at line 1, near ":: === Obj"␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤called from Sub 'parrot;Perl6::Grammar;statementlist' pc 15007 (src/gen_grammar.pir:2402)␤called from Sub
16:23 exp_evalbot ..'parrot;Perl6::Grammar;statement_block' pc 12194 (src/gen_grammar.pir:1396)␤called f...
16:23 ruoso oops
16:23 ruoso kp6: Object:: === Object.WHO
16:23 exp_evalbot r19910: OUTPUT[syntax error at position 0, line 1 column 0:␤Object:: === Object.WH␤^ HERE␤]
16:24 TimToady almost nobody does the meta stuff yet
16:24 TimToady it's all chewing gum and bailing wire
16:24 Lion2 joined #perl6
16:25 ruoso you know... that's an interesting fact that I still couldn't figure out... why is smop the only one starting by that?
16:25 rakudo_svn joined #perl6
16:25 moritz_ ruoso: you don't get fast results with that approach
16:25 ruoso but can you get correct results without it?
16:27 TimToady that's an excellent question
16:27 TimToady I wish I had an excellent answer...
16:29 TimToady certainly many of the current ills of pugs stem from never having quite incorporated MO
16:30 TimToady but to be quite fair, we hadn't specced .WHO, .WHAT, etc when most of these efforts started out
16:32 ilogger2 joined #perl6
16:32 ruoso one could ask... wasn't the need for WHO, WHAT etc realised as the implementation started to get to that point?
16:32 [particle] i'm sure the next implementation of perl 6 will approach construction even better than smop
16:33 TimToady well, parrot has been mostly trying to bootstrap the p5ish subset of p6, but jonathan is getting some of the metagoop in now...
16:34 ruoso [particle], sure it will... my point was actually that smop seems to be the first to try stressing S12 from bottom-up
16:36 ruoso but anyway... it doesn't really matter
16:36 TimToady and that is precisely why it is already being so useful
16:37 TimToady if you were stressing p6 from an angle that someone else is stressing it, you'd be redundant :)
16:38 ruoso :)
16:38 ruoso that would be an interesting thing to write down in the wiki
16:38 TimToady me, I'm stressing it from the longest-token matching angle, and have just about got it working, for some definition of working
16:39 ruoso it would be nice to have a page listing which aspect is each implementation trying to stress
16:39 blindfish joined #perl6
16:39 [particle] it'd be nice to have an implementation trying to stress completeness :)
16:39 TimToady translation: "where each implementation is having trouble"  :)
16:40 ruoso heh
16:45 TimToady the main problem with developing this longest-token matcher is that it takes pugs about 2 minutes to compile STD_meth.pm...
16:45 TimToady and I don't have any way of saving the compilation for next time
16:45 pmurias joined #perl6
16:46 pmurias ruoso: kp6 does some meta stuf
16:46 pmurias f
16:48 ruoso pmurias, but it doesn't deal with different representations or native types
16:48 pmurias smop doing everything on bare C suits itself better to dealing with representation
16:50 pmurias it would be mostly the choice between the hash based,array based and inside out representation in kp6
16:50 ruoso not really
16:51 ruoso in p5 you could still have different representations
16:51 TimToady and that's why p6opaque is supposed to be opaque even to Perl 6 code...
16:52 Lion3 joined #perl6
16:53 ruoso pmurias, you could even have a Moose repr
16:53 alester Indirect object syntax goes away, right?
16:53 alester Please please say yes.
16:53 pbuetow joined #perl6
16:53 ruoso alester, kinda
16:53 ruoso it requires a :
16:54 ruoso foo $obj:
16:54 ruoso foo $obj: 1,2,3
16:54 TimToady it's completely unambiguous now
16:55 alester that's good news.
16:56 alester http://perlbuzz.com/mechanix/2008/02/the-perils-of-perl-5s-indirect.html
16:56 lambdabot Title: The perils of Perl 5's indirect object syntax - Mechanix, http://tinyurl.com/2enjt4
16:56 pmurias ruoso: Moose objects are hash based (by default)
16:57 ruoso pmurias, the repr thing will allow you to create an instance of Int, for instance, using other representation
16:58 ruoso Moose and plain blessed hash are different representations in that sense
16:58 mj41_ joined #perl6
16:59 ruoso I even think that p5Moose is a reasonable option for a P6 representation (even for smop, once libperl is embedded)
17:01 pmurias ruoso: what's the big diffrence between p5Moose and p5hash?
17:01 ruoso p5Moose would create a moose object,
17:01 ruoso p5hash would create a stand-alone blessed hash
17:02 ruoso that would probably use the keys of the hash directly as private storage
17:02 pmurias a p5Moose is a blessed hash
17:02 ruoso sure, but it's built and maintained differently
17:02 ruoso it has its dependencies
17:02 pmurias according to data Dumper
17:03 ruoso while p5hash would create a more simpler representation
17:03 ruoso probably supporting less features...
17:03 Khisanth I thought you aren't even supposed to care what a p5Moose is? :)
17:03 TimToady p5hash doesn't do well at preventing attribute name clashes
17:04 TimToady Khisanth: depends on who "you" are
17:04 pmurias math&
17:04 ruoso if you're the p5 code on the other side, you probably care
17:05 * ruoso understands that the repr feature is specially important for interoperability means
17:05 ruoso like...
17:05 ruoso Int.CREATE(:repr<Glib>)
17:08 rindolf joined #perl6
17:20 rindolf joined #perl6
17:24 Lion2 joined #perl6
17:29 kyrbe joined #perl6
17:30 kyrbe left #perl6
17:33 stevan_ ruoso: re: p5Moose being diff from p5Hash,.. would the p5Moose version use the Moose instance protocol?
17:33 stevan_ if it did, then this would allow it to not care about what Moose uses for it's repr type
17:34 stevan_ in fact, the instance protocol came directly out of the repr issues nothingmuch and I were looking at in p6 metamodel stuff
17:38 macae joined #perl6
17:39 pmurias stevan_: is there an alternative representation for Moose objects available ?
17:41 Psyche^ joined #perl6
17:41 ruoso stevan_, yeah... p5Moose would certainly use the Moose instance protocol
17:43 cognominal_ joined #perl6
17:44 stevan_ pmurias: yes, MooseX::GlobRef::Object and MooseX::InsideOut are two curently out on CPAN
17:44 njbartlett joined #perl6
17:45 ruoso so, we would probably have perl5:MooseX::GlobRef::Object as a repr
17:45 ruoso where p5Moose would just use the default
17:45 ruoso for moose
17:46 stevan_ ruoso: well, it all depends on how you want to use it
17:47 stevan_ if you are talking about the p5 space, then the author controls it through Moose
17:48 ruoso yes, I think using the object in p5 space would be the only reason for using p5Moose
17:48 stevan_ k
17:49 stevan_ if p6 uses some variant of the instance protocol, there is no reason why you would *have* to use that
17:49 stevan_ p6opague objects would just work
17:49 stevan_ assuming that the embedded p5 is able to understand their stucture
17:49 stevan_ an C struct based Moose instance type has been on the TODO list forever actually
17:50 ruoso well.. maybe SMOP p6opaque may be that implementation
17:50 ruoso but it would only work inside smop
17:50 ruoso because of the run loop stuff
17:50 stevan_ ?
17:50 stevan_ forgive me I only skimmed the SMOP docs
17:50 ruoso smop implements a stackless run loop on its own
17:51 stevan_ k
17:51 stevan_ but why does p6opaque care about that?
17:51 ruoso because even p6opaque code relies on that
17:51 ruoso as "everything is an object" in somp
17:51 ruoso smop
17:52 stevan_ but how is that connected to the runloop? for the method dispatching?
17:52 ruoso all p6opaque code is stackless
17:52 stevan_ what I am thinking is that the p6opaque structure itself could have an XS based wrapper to allow it to be used in p5
17:52 ruoso calling something in p6opaque won't really do anything most of the time
17:53 stevan_ then the wrapper in SMOP would connect it with the runloop
17:53 ruoso it will just set something as the current continuation
17:53 stevan_ but again,.. I dont know SMOP that well, so I am just ahndwaving here
17:53 pmurias stevan_: thanks
17:53 ruoso I'll need to create a cross-runloop between smop and p5 at some time
17:54 ruoso where one can hand over control to the other at any time
17:54 stevan_ ruoso: I guess I am confused what that has to do with accessing elements in the p6opaque structure
17:54 stevan_ pmurias: no problem
17:54 ruoso because accessing elements of the p6opaque structure may require performing method calls
17:54 ruoso and that, by definition,
17:54 ruoso don't recurse using the C stack
17:55 ruoso it replaces the current continuation of the given interpreter instance
17:55 stevan_ ruoso: hmm, that shouldnt be true
17:55 stevan_ you should have method-free access to your instance structure
17:55 stevan_ no I get the contuation stuff, and why you are doing it
17:55 stevan_ but I think its potentially going to be problematic for you
17:55 ruoso the problem is, how do you ~~ the signature of a candidate method to a given capture without a method dispatch/
17:56 stevan_ in terms of playing well inside p5 space
17:56 stevan_ ruoso: why are methods involved at all?
17:56 ruoso because the method object may have an unknown representation
17:56 stevan_ the slots in an instance should be accessible through some kind of protocol
17:57 stevan_ which totally bypasses the methods
17:57 stevan_ and you should always have some kind of idea what the repr would be
17:57 ruoso I can guess in some specific cases
17:57 stevan_ otherwise how could you get at the slots in the first place
17:57 ruoso that's the reason for the "constant identifier" thing
17:58 stevan_ I am not familiar with that
17:58 stevan_ something i can read on that?
17:58 ruoso http://www.perlfoundation.org/perl6/index.cgi?smop_oo_api
17:58 lambdabot Title: SMOP OO API / Perl 6
17:58 ruoso the point on not knowing the representation is exactly so I can cheat
17:58 stevan_ yes
17:58 ruoso and put in a low-level object
17:58 stevan_ Moose does the same thing
17:59 ruoso but it only works as far as I don't count on knowing the representation
18:00 stevan_ ok,.. so ^!initialize_instance_storage
18:00 stevan_ that should also have a !^access_instance_slot or some kind too
18:00 ruoso it has
18:00 stevan_ where is that?
18:01 ruoso method ^!private_storage($object: $package --> Hash ) {...}
18:01 ruoso where the returned Hash will *not* use p6opaque as its repr
18:01 stevan_ ah I see
18:01 ruoso but a lowlevel implementation that can access the p6opaque data directly
18:02 stevan_ sort of a tied HASH to put it in p5 terms?
18:02 ruoso yeah...
18:02 ruoso sort of...
18:02 stevan_ which follows the Hash API, but accesses the underlying p6opaque object
18:02 ruoso because that applies for absolutely any built-in type
18:03 ruoso except the native ones
18:03 stevan_ yes
18:03 stevan_ so I guess what I am thinking then
18:03 pugs_svnbot r19911 | lwall++ | [autolexing] subrules now successfully use precalculated fates for alternation dives
18:03 pugs_svnbot diff: http://dev.pugscode.org/changeset/19911
18:03 lambdabot Title: Changeset 19911 - Pugs - Trac
18:03 stevan_ is that you could take that low-level/native repr and wrap it in XS and make a Moose instance type out of it
18:03 * stevan_ is talking about things below the p6 language level
18:04 ruoso yes... as long as you have the run loop integrated
18:05 stevan_ then (I assume) you would be able to shuffle it over to p5, without needing the runloop
18:05 stevan_ oh
18:05 stevan_ hmm, I guess I am just not getting why the underlying native instance structure needs to care about the runloop
18:05 stevan_ but I suspect I just need to read up on SMOP some more
18:05 ruoso because one of the methods declared there may even be a Glib method
18:05 stevan_ :)
18:06 stevan_ again,.. why does accessing instance slot need to involve methods?
18:06 stevan_ there should be a non-method related way to do it
18:06 stevan_ I am failing to see the rationale for coupling those together so tightly
18:07 ruoso when you do %{$foo.^!private_storage(Foo::)}{$name}, you can't presume to know the repr of $name
18:07 ruoso you may need to call WHICH
18:07 ruoso which may need to recurse
18:07 stevan_ yes, but I am talking about *below* the p6 language level
18:08 ruoso so am I
18:08 ruoso but SMOP have a bootstrapped OO system
18:08 ruoso "everything is an object"
18:08 ruoso really
18:08 stevan_ ok,.. so you dont have a native instance type then?
18:08 ruoso I only have a few
18:09 stevan_ ok,.. those are what I am talking about
18:09 ruoso and no, Object is not a native one
18:09 ruoso natives are int, bool etc
18:09 ruoso Method is not a native type
18:09 stevan_ so what is an instance created from?
18:10 ruoso from Object
18:10 stevan_ where does Object get it?
18:10 ruoso which is bootstrapped in low-level as a p6opaque
18:10 stevan_ k
18:10 stevan_ so the low-level p6opaque
18:10 stevan_ is created at the C level correct?
18:10 stevan_ not assembled in p6 space
18:10 stevan_ but some kind of
18:10 ruoso not really
18:10 stevan_ call_native_func('create_p6opauqe')
18:11 ruoso there's no such thing as call_native_func in smop
18:11 * stevan_ is making stuff up there
18:11 stevan_ how do you allocate the actual space in memory
18:11 ruoso ok... sure... I'll have a SMOP__OO__p6opaque_create somewhere
18:12 stevan_ yes
18:12 stevan_ what that returns, should be wrapped in XS and made Moose compat
18:12 ruoso but that is only the CREATE part of creating an instance
18:12 stevan_ yes
18:12 ruoso which is, basically, a malloc
18:12 stevan_ then you can fill it with data
18:13 ruoso calling the .^!foo API
18:13 stevan_ yes
18:13 ruoso which is already a method dispatch
18:13 meppel-san joined #perl6
18:13 ruoso a special one, but a method dispatch
18:13 stevan_ so, the value that SMOP__OO__p6opaque_create returns should be wrapped
18:13 stevan_ er wrappable
18:14 ruoso in a SV*, sure...
18:14 stevan_ them the p5 side will just need that value and should be able to do whatever it wants without invoking method dispatch on the p6 end
18:14 stevan_ s/them/then/
18:15 * stevan_ wonders if we are not discussing two different things here :)
18:15 ruoso except that the value already implements smop interpreter semantics
18:15 stevan_ expand on that please
18:15 ruoso you need a SMOP interpreter instance to do anything with the p6opaque object
18:15 ruoso you can always use the interpreter prototype, which is stackfulll
18:16 stevan_ I guess this is where I am lost
18:16 stevan_ I dont understand *why* you need SMOP to mess with the C-struct that SMOP__OO__p6opaque_create returns
18:16 stevan_ if the XS wrapper is well behaved, then I dont see why the coupling
18:17 ruoso because the features of p6opaque are implemented through SMOP_DISPATCH
18:17 stevan_ hmm,.. that sounds problematic
18:17 * stevan_ again mentions that he is only midly familair with SMOP
18:17 stevan_ but that just has a smell to me
18:17 ruoso the good thing about that
18:18 ruoso is that SMOP have a polymorfic eval
18:18 ruoso which means you can implement a naive p5-glue interpreter
18:18 * spinclad wonders if smop is trying to hard to believe its own story... that is, implement everything the way it really only has to _appear_ to be working
18:18 ruoso http://www.perlfoundation.org/perl6/index.cgi?smop_interpreter_implementation_api
18:18 lambdabot Title: SMOP Interpreter Implementation API / Perl 6, http://tinyurl.com/yv6sur
18:18 ruoso http://www.perlfoundation.org/perl6/index.cgi?smop_inter_continuation_communication
18:18 lambdabot Title: SMOP Inter Continuation Communication / Perl 6, http://tinyurl.com/yuqcgm
18:19 ruoso spinclad, it's the exact opposite.... smop is trying hard to believe what anyone says...
18:19 ruoso if you say you're a Hsah
18:19 ruoso Hash
18:19 ruoso nice, we can talk... no matter how you're implemented
18:19 stevan_ ruoso: I think perhaps your p6opaque type is just too coupled,.. some outside-of-SMOP resource should be able to mess with it
18:20 ruoso stevan_, if you implement an interpreter instance you can do it
18:20 ruoso it can be simple as recurse in the C stack and hold a reference to the p5 interpreter so it can callback
18:21 ruoso or it can be complex as interfacing the p5 run loop natively and add the OPs you need to
18:21 ruoso where the first uses XS and the later uses direct OP manipulation
18:22 ruoso that's the pretty plan on how I to have p5 integration in smop
18:24 stevan_ ok
18:26 spinclad (aiui:) if i say i'm a Hash, then i'm presenting a Hash interface, and outsiders must access me through that. this uses SMOP_DISPATCH, and method name, and capture... (more)
18:26 ruoso spinclad, exact
18:30 ruoso it's important to realise that SMOP_DISPATCH represents a single C call
18:31 spinclad within a community, however, insiders may know more strictly: this is a p5hash, that a p5key; this a smop_native_responder_interface, that a smop_native_symbol, the other a .._capture; and be able to access each other by their community protocol
18:31 ruoso sure... but I like to consider it an optimization
18:32 ruoso in fact... smop does it already
18:32 ruoso the native capture handles differently named arguments when you give it a SMOP__NATIVE__idconst or a regular Object
18:32 ruoso SMOP__NATIVE__idconst can be matched by C pointer identinty
18:33 ruoso while a regular Object will require method calls
18:33 spinclad right
18:33 ruoso the important thing is avoid presuming you know the how something is implemented
18:34 manfred_ joined #perl6
18:34 ruoso you can test for some known cases
18:34 ruoso but you must always have a fallback
18:34 ruoso (except for the Perl 6 native types)
18:34 ruoso which are the only ones you can be sure to know how they are implemented
18:35 ruoso and that's why smop defines a native capture object
18:35 ruoso (which I hope TimToady puts in the spec sometime) :)
18:38 spinclad using multidispatch:  class Hash { method lookup (Key -> Object) {...} }; class p5hash { method lookup (p5key $key -> Object) { #{ here you know the subtype, can hash its string directly, etc } } }
18:39 spinclad *class p5hash does Hash; class p5key does Key
18:40 ruoso spinclad, yeah... kindof...
18:40 pugs_svnbot r19912 | ruoso++ | [smop] the code for creating runtime constant identifiers is already here... The tests are still failing, the problem is probably in the bsearch call on the list of current declared constant identifiers.
18:40 pugs_svnbot diff: http://dev.pugscode.org/changeset/19912
18:40 lambdabot Title: Changeset 19912 - Pugs - Trac
18:41 lumi joined #perl6
18:42 spinclad as you say, smop already does some of this, and it must, to break Zeno's regress...
18:42 ruoso yeah... I must be able to reduce everything to the known types at some time
18:42 spinclad (the arrow can neither start nor finish moving)
18:43 riffraff joined #perl6
18:47 ruoso btw... spinclad, stevan_, thanks for the peer review... this is the most important thing that smop needs now...
18:48 pmurias joined #perl6
18:48 spinclad i haven't reviewed the docs enough yet...
18:48 TimToady I'm glad you guys are talking
18:50 spinclad meantime, i see multidispatch, while heavy and begging to be optimized away when possible, as the way to enter a community, to take part in possibly much lighter-weight interactions with known peers.
18:50 ruoso spinclad, yeah... I see that too...
18:51 pmurias ruoso: why do you base constlist-1 as the size argument to qsort?
18:51 ruoso what I don't know is how to keep multi dispatch in the correct order so you dispatch better...
18:51 ruoso pmurias, it was segfaulting otherwise
18:53 spinclad yes, need a good rep'n for a lattice of types ...
18:54 spinclad need a community of types and type comparison...
18:54 ruoso that's why ~~ is one of the nearest things in the roadmap :)
18:55 TimToady actually, ~~ is basically single dispatch on the right arg
18:56 TimToady so a bad example of multiple dispatch
18:56 TimToady even if p5 did borrow the old botched mmd semantics
18:56 * ruoso need to go... later &... will backlog, as usual...
18:56 spinclad multi dispatch is more    given $capture { when $signature { ... } ... }
18:56 pmurias ruoso: keeping the indentifiers in an unsorted list would be faster
18:57 wilx` joined #perl6
18:57 ruoso pmurias, would it?
18:57 ruoso anyway... need to go...
18:57 ruoso later
18:57 ruoso &
18:57 spinclad the whole given statement
18:57 pmurias O(n) vs O(N*log(N))
18:58 spinclad ruoso: i don't think i said anything you're not well aware of;  (same page)++
19:01 spinclad class Multi does Hash(Signature --> Single)
19:01 spinclad *s/Single/Code/
19:02 TimToady well, you'd want to apply the optimization back to given if all the patterns are signatures :)
19:02 TimToady just as you can optimize all numbers or all strings
19:03 spinclad except it's called with $multi{$capture} ---> $code is Code($signature)
19:03 TimToady and a switch on native int could be as fast as C's
19:03 spinclad right
19:04 TimToady 'course, thing about mmd is you can't really write a switch unless you're willing to rewrite it every time someone adds a routine of that short name...
19:05 pmurias ruoso: sorry misread the code, it wouldn't be (lookups are more common the insertions) but it's possible to insert new elements faster then with qsort
19:05 spinclad class smop_Multi = Multi(smop_Capture, smop_Signature, smop_Code)  # specializing
19:07 TimToady probably have to work the lexical location in there too, since the candidate lists can vary lexically
19:08 spinclad i think i'd take that as already so in Multi, though it takes part in the big specializing homomorphism
19:10 spinclad i may try to make this model runnable...
19:10 spinclad then i'll know what i meant
19:13 spinclad time to shovel snow
19:13 spinclad ~~ &
19:13 chris2 joined #perl6
19:20 peeps[work] joined #perl6
19:21 rindolf joined #perl6
20:15 japhb joined #perl6
20:26 Helios_ joined #perl6
20:36 jferrero joined #perl6
20:36 buu joined #perl6
21:05 Jamtech joined #perl6
21:23 [particle] hrmm, so, i've got a private method, and i want to call it inside another method
21:23 [particle] if it's a regular method, i can do '.my_private_method()' yes?
21:23 [particle] or do i need to say 'self.my_private_method()'
21:24 TimToady self!my_private_method() if it's really private
21:24 [particle] so, you're forced to put self there.
21:25 [particle] because !my_private_method() won't do what you expect.
21:25 [particle] er, what i thought i might expect.
21:31 TimToady well, there's presumably $!my_private_method() as well
21:32 [particle] do i need to declare my $!my_private_method = method { }; in order for that to work?
21:32 [particle] or, has $!... ?
21:33 TimToady you use "my method my_private_method"
21:36 [particle] my method process_commandline(@args) { ... } ; my @pass_thru_args = $!process_commandline(@*ARGS); # works?
21:40 Jedai joined #perl6
22:07 feb joined #perl6
22:22 Lorn_ joined #perl6
22:28 buchetc joined #perl6
22:32 buchetc left #perl6
22:39 justatheory joined #perl6
22:46 mj41___ joined #perl6
22:50 justatheory joined #perl6
22:50 buu joined #perl6
22:50 peeps[work] joined #perl6
22:50 kcwu joined #perl6
22:50 hcchien joined #perl6
22:50 jjore-w joined #perl6
22:50 r0bby joined #perl6
22:50 Southen joined #perl6
22:50 kane_ joined #perl6
22:50 GeJ joined #perl6
22:50 nodboy joined #perl6
22:50 yves joined #perl6
22:50 ead joined #perl6
22:50 cookys joined #perl6
22:50 nipotaway joined #perl6
22:51 cj joined #perl6
22:53 GeJ_ joined #perl6
22:54 feb joined #perl6
22:54 jferrero joined #perl6
22:54 Helios joined #perl6
22:54 lumi joined #perl6
22:54 pbuetow joined #perl6
22:54 Zygo joined #perl6
22:54 viklund joined #perl6
22:54 IllvilJa joined #perl6
22:54 avar joined #perl6
22:54 apple-gunkies joined #perl6
22:54 kst joined #perl6
22:54 jrockway joined #perl6
22:54 silug joined #perl6
22:54 simcop2387 joined #perl6
22:54 nothingmuch joined #perl6
22:54 arguile joined #perl6
22:54 Maddingue joined #perl6
22:54 cognominal joined #perl6
22:54 Eidolos joined #perl6
22:55 buubot joined #perl6
22:55 [particle] joined #perl6
22:55 japhb joined #perl6
22:55 broquaint joined #perl6
22:55 mugwump joined #perl6
22:55 Zygo joined #perl6
22:56 justatheory joined #perl6
22:56 buu joined #perl6
22:56 peeps[work] joined #perl6
22:56 kcwu joined #perl6
22:56 hcchien joined #perl6
22:56 jjore-w joined #perl6
22:56 r0bby joined #perl6
22:56 Southen joined #perl6
22:56 kane_ joined #perl6
22:56 nodboy joined #perl6
22:56 yves joined #perl6
22:56 ead joined #perl6
22:56 cookys joined #perl6
22:56 nipotaway joined #perl6
22:56 pravus joined #perl6
22:58 buubot joined #perl6
22:59 buubot joined #perl6
23:24 rakudo_svn r25700 | jonathan++ | [rakudo] Remove now-unused regex.pir.
23:43 alester joined #perl6
23:45 charsbar joined #perl6
23:52 renormalist joined #perl6

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

Perl 6 | Reference Documentation | Rakudo