Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2008-02-14

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:03 Limbic_Region joined #perl6
00:06 wknight8111 joined #perl6
00:11 Auzon joined #perl6
00:21 reZo joined #perl6
00:24 meppl good night
00:48 thorat joined #perl6
01:12 Zygo joined #perl6
01:27 jjore joined #perl6
01:38 japhb joined #perl6
02:09 Daveman joined #perl6
02:43 meteorja1 joined #perl6
02:43 diakopte1 joined #perl6
02:43 mofino joined #perl6
02:44 exp_evalbot joined #perl6
02:47 diakopter joined #perl6
02:48 yahooooo joined #perl6
02:48 shachaf joined #perl6
02:48 nnunley joined #perl6
02:48 peepsalot joined #perl6
02:48 Caelum joined #perl6
02:48 pmichaud joined #perl6
02:48 lidden joined #perl6
02:48 GeJ_ joined #perl6
02:48 rhr_ joined #perl6
02:49 exp_evalbot joined #perl6
02:49 mofino joined #perl6
02:49 ilogger2 joined #perl6
02:49 marmic joined #perl6
02:49 lisppaste3 joined #perl6
02:49 gbacon joined #perl6
02:49 whiteg joined #perl6
02:49 tewk joined #perl6
02:49 Grrrr joined #perl6
02:49 bphillips joined #perl6
02:49 awwaiid joined #perl6
02:49 SubStack joined #perl6
02:49 Yappo_ joined #perl6
02:49 gugod joined #perl6
02:49 ingy joined #perl6
02:49 perlbot joined #perl6
02:51 Gothmog_ joined #perl6
02:56 stevan_ joined #perl6
02:59 zakame joined #perl6
03:00 jjore joined #perl6
03:08 justatheory joined #perl6
03:09 jjore joined #perl6
03:10 nothingmuch @tell ruoso c.f. meta slots in MO
03:10 lambdabot Consider it noted.
03:24 REPLeffect joined #perl6
03:33 thoughtpolice joined #perl6
03:46 felipe joined #perl6
03:56 saoler joined #perl6
04:37 pbuetow joined #perl6
04:43 stevan_ joined #perl6
04:52 alester yessir
04:58 Lunchy joined #perl6
04:58 clkao joined #perl6
04:58 obra joined #perl6
04:58 sunnavy joined #perl6
05:28 monomorph joined #perl6
05:31 stevan__ joined #perl6
06:03 zakame joined #perl6
06:26 iblechbot joined #perl6
06:31 pravus joined #perl6
06:48 REPLeffect joined #perl6
06:59 devogon joined #perl6
07:13 araujo joined #perl6
07:17 Psyche^ joined #perl6
07:21 baest joined #perl6
07:22 Aankhen`` joined #perl6
07:55 nothingmuch joined #perl6
08:09 nothingmuch h
08:09 lambdabot nothingmuch: You have 1 new message. '/msg lambdabot @messages' to read it.
08:10 nothingmuch @tell ruoso re what stevan was talking about... p6opaque living together with p5 types, unboxed types, etc all fully introspectable
08:10 lambdabot Consider it noted.
08:50 zakame joined #perl6
08:54 zakame_ joined #perl6
08:58 masak joined #perl6
09:07 zakame_ joined #perl6
09:09 jferrero joined #perl6
09:18 masak what happens in perl6 if you assign to undef?
09:23 meppl joined #perl6
09:30 zakame joined #perl6
09:35 pbuetow joined #perl6
09:52 Zygo joined #perl6
09:54 moritz_ pugs: undef = 3;
09:54 exp_evalbot OUTPUT[*** Can't modify constant item: VUndef␤    at /tmp/ZAEY1V1HM3 line 1, column 1-10␤]
10:00 jisom joined #perl6
10:14 Aankh|Clone joined #perl6
10:14 laye joined #perl6
10:43 Lorn_ joined #perl6
10:43 cognominal_ joined #perl6
10:45 ruoso joined #perl6
11:15 ruoso hi
11:15 lambdabot ruoso: You have 2 new messages. '/msg lambdabot @messages' to read them.
11:15 moritz_ hi ruoso ;)
11:16 ruoso hi moritz_
11:19 riffraff joined #perl6
11:31 ruoso nothingmuch, I don't think I understood what you said...
11:34 pbuetow joined #perl6
11:52 Aankhen`` joined #perl6
11:58 Schwern joined #perl6
12:01 ebassi joined #perl6
12:06 pbuetow joined #perl6
12:10 iblechbot joined #perl6
12:20 pugs_svnbot r19913 | ruoso++ | [smop] runtime declared constants now working... All tests pass! the problem was SMOP__Object** x SMOP__Object* confusion...
12:20 pugs_svnbot diff: http://dev.pugscode.org/changeset/19913
12:20 lambdabot Title: Changeset 19913 - Pugs - Trac
12:21 RayMagini joined #perl6
12:57 cmarcelo joined #perl6
12:58 moritz_ ruoso++ # all tests pass ;)
13:03 andara joined #perl6
13:07 `nipra joined #perl6
13:07 rakudo_svn r25711 | jonathan++ | [rakudo] Initial work on parsing rule, token, regex and grammar, plus a first-cut implementation to make regex work. rule and token currently have regex semantics, however.
13:07 sri_work joined #perl6
13:12 sri_work joined #perl6
13:26 rakudo_svn r25712 | jonathan++ | [rakudo] Junctions should not have a pick method, so remove it. Also remove now-unsed attempt at auto-threading.
13:32 nodboy_ joined #perl6
13:34 rindolf joined #perl6
13:39 zakame joined #perl6
13:40 pbuetow joined #perl6
13:48 alester joined #perl6
14:12 rakudo_svn r25713 | jonathan++ | [rakudo] Tweak to allow you to do all(@array) as well as all(42,45,...).
14:12 pugs_svnbot r19914 | rhr++ | [smop] fix a test number
14:12 pugs_svnbot diff: http://dev.pugscode.org/changeset/19914
14:12 lambdabot Title: Changeset 19914 - Pugs - Trac
14:16 bphillips joined #perl6
14:18 bphillips joined #perl6
14:23 zakame_ joined #perl6
14:26 nodboy joined #perl6
14:35 njbartlett joined #perl6
14:36 kyrbe joined #perl6
14:36 pugs_svnbot r19915 | andara++ | [pugspc]
14:36 pugs_svnbot r19915 | andara++ | A stand-alone Perl6-to-PIR compiler branched off from Pugs. I basically resurrected Pugs' -CPIL1 and -CPIR backends and removed all the rest.
14:36 pugs_svnbot r19915 | andara++ | First commit, all help welcome.
14:36 pugs_svnbot r19915 | andara++ | Needs ghc 6.8, on feather set your path to /home/andara/usr/local/bin
14:36 pugs_svnbot diff: http://dev.pugscode.org/changeset/19915
14:36 lambdabot Title: Changeset 19915 - Pugs - Trac
14:36 kyrbe left #perl6
14:37 moritz_ andara: no need to put it under misc/, if you are serious ;)
14:39 andara moritz_: serious? it was just for fun of course :-D
14:39 moritz_ andara: serious fun, that is ;)
14:41 andara moritz_: aye, rather. It's not far behind rakudo and mainly due to incomplete PIR builtins
14:42 moritz_ andara: did you build debian packages for ghc 6.8?
14:42 andara moritz_: no. never did that, is it hard? I just took the binary from haskell.org
14:43 moritz_ andara: dunno, if you did I would have used them as well ;)
14:45 andara moritz_: have a look here: http://haskell-unsafe.alioth.debian.org/haskell-unsafe.html
14:45 lambdabot Title: Haskell Unsafe
14:46 moritz_ andara: I just looked at it, it's far too old
14:48 andara moritz_: yeah, I see. Is it against your principles to install a binary locally without .deb ;-)
14:49 moritz_ andara: no, I'll install it locally. Installing globally is evil, though ;)
14:50 chris2 joined #perl6
14:50 andara moritz_: agree. Say, you seem to be online often. I've been away from per6 for a few months, did I miss much excitement?
14:51 moritz_ andara: depends on your notion of "excitement"
14:51 lisppaste3 joined #perl6
14:51 moritz_ are you asking about spec changes? or implementation?
14:51 andara rather implementation
14:52 moritz_ kp6 is nearly bootstrapped, waiting for a faster backend
14:52 moritz_ ruoso++ is working on it, called "smop"
14:52 andara "smop"?
14:53 moritz_ A C preprocessor and runtime lib that takes care of the meta object stuff
14:53 moritz_ "simple meta object programming"
14:53 andara ok
14:53 moritz_ or "small matter of programmiing"
14:53 andara :-)
14:53 moritz_ today he got to the "all test pass" status ;)
14:53 moritz_ perl6 on parrot is now called rakudo
14:54 andara Yes, I gathered that
14:54 thepler joined #perl6
14:54 moritz_ and it's progressing
14:54 andara Yes, I checked it out, looks very promising.
14:54 moritz_ but slowed by some personal issues (pmichauds wife got sick, and a few other things)
14:55 moritz_ but looks bright ;)
14:55 moritz_ TimToady has hacked a preprocessor for the tests, called "fudge"
14:56 moritz_ cosimo and a few others started to check tests, reorganize them, and move to t/spec/*
14:56 andara very brave :-)
14:58 andara I knew about the work on rakudo, but it seemed a shame to just drop the brilliant Pugs code, that's why I tried to resurrect the PIR backend
14:58 moritz_ the 'fudge' thing is there for making implementation specific TODO marks
14:58 IllvilJa joined #perl6
14:59 DarkWolf84 joined #perl6
15:06 manfred joined #perl6
15:06 zakame_ joined #perl6
15:15 zakame_ joined #perl6
15:17 allbery_b joined #perl6
15:18 rdice joined #perl6
15:20 ruoso pugs: class A { method a { say $!foo } }; A.new().a();
15:20 exp_evalbot OUTPUT[␤]
15:21 [particle] hrmm, no error?
15:22 ruoso pugs: class A { method a { say $!foo }; method b ($a) { $!foo = $a }; my $a = A.new(); $a.a(); $a.b(1); $a.a();
15:22 exp_evalbot OUTPUT[*** ␤    Unexpected end of input␤    expecting ";" or "}"␤    at /tmp/m53tbYqVAg line 2, column 1␤]
15:22 ruoso pugs: class A { method a { say $!foo }; method b ($a) { $!foo = $a } }; my $a = A.new(); $a.a(); $a.b(1); $a.a();
15:22 exp_evalbot OUTPUT[␤1␤]
15:23 ruoso so, pugs autovivifies the private storage
15:23 ruoso pugs: class A { method a { say $!foo.WHAT }; method b ($a) { $!foo = $a } }; my $a = A.new(); $a.a(); $a.b(1); $a.a();
15:23 exp_evalbot OUTPUT[Scalar␤Int␤]
15:24 ruoso $!foo.WHAT should be Object when uninitialized, shouldn't it?
15:25 ruoso VAR($!foo).WHAT would be Scalar
15:25 ruoso anyway...
15:25 ruoso smop p6opaque current design would make it behave like this...
15:26 ruoso (autovivifying private storage)
15:27 ruoso I need a different API for declaring the private storage and later accessing it
15:27 ruoso so it can Fail on non-existent private slots in the second phase
15:27 [particle] autovivifying private storage isn't what i'd expect, but i'm not sure what the spec says
15:27 ruoso it's probably just wrong...
15:27 [particle] ok. good.
15:28 ruoso considering Perl 6 is strict by default
15:28 [particle] right.
15:28 ruoso although there must be a way to allow it
15:30 Lorn_ joined #perl6
15:34 ruoso hmm...
15:35 ruoso I need a second BUILD submethod that cannot be overrided by the user (at least not easily)
15:35 ruoso which is the BUILD that initialize the instance using the REPR API
15:35 moritz_ ruoso: but can't non-strict behaviour be detected at compile time, and morphed into 'strict' code?
15:36 ruoso moritz_, I'm not sure... can you do $!"foo"?
15:37 ruoso pugs: class A { method a { say $!"foo" }; method b($a) { $!foo = $a } }; my $a = A.new(); $a.a(); $a.b(1);
15:37 exp_evalbot OUTPUT[*** ␤    Unexpected "\""␤    expecting term postfix, operator, ":", "," or "}"␤    at /tmp/FpBafdN9rk line 1, column 28␤]
15:37 moritz_ ruoso: like symbolic refs? don't think so, but not sure
15:37 ruoso at least pugs doesn't support it
15:37 Juerd andara: GHC 6.8.2 is in Debian; installing it on feather as I type
15:38 andara Juerd: brilliant, thanks a lot!
15:46 stevan_ joined #perl6
15:46 Lorn joined #perl6
15:47 ruoso TimToady, is $!"$var" allowed?
15:48 andara Juerd: is there an extra library package for GHC 6.8.2? I seem to be missing some libraries
15:48 Juerd Let's see
15:49 Juerd There are many
15:49 Juerd I'll just install them all :)
15:49 andara Juerd: I'm missing in particular stm
15:49 Juerd Oh, all won't work because some are still for 6.6
15:49 andara Juerd: cool, thanks!
15:50 andara bbl &
15:50 TimToady I'm not even sure that $."var" is allowed
15:50 TimToady if you really want indirection, we should probably force use of the long form in either case
15:50 loki666 joined #perl6
15:50 TimToady self!"$var" should presumably be allowed
15:50 Juerd Installing stm
15:51 TimToady though I don't think that's in STD yet
15:51 loki666 hi, sorry for my bad english... i need construct one module to create syn packages in perl
15:51 loki666 help please
15:52 moritz_ loki666: you're only right here if you want to use perl 6 ;)
15:52 Juerd loki666: Perl version 6?
15:52 Juerd loki666: If not, have a look over in #perl
15:52 moritz_ ... and I doubt that it's much fun right now
15:52 loki666 one moment please.
15:54 loki666 sorry,
15:54 loki666 ok, thanks
15:59 Juerd I wonder why people looking for help join #perl6
16:00 Juerd In a channel list, it's sorted right under #perl probably, and I think using a channel list is kind of weird anyway :)
16:00 loki666 left #perl6
16:00 [particle] maybe because they tried # perl 5 first and were disappointed
16:01 [particle] grr.
16:01 [particle] you know what i mean
16:03 moritz_ we all know what you mean
16:03 moritz_ perhaps we need #perl5helpforreal ;)
16:14 [particle1 joined #perl6
16:20 Aankhen`` joined #perl6
16:49 jferrero joined #perl6
16:57 monomorph joined #perl6
17:01 rindolf joined #perl6
17:02 zamolxes joined #perl6
17:14 jisom joined #perl6
17:28 Lorn joined #perl6
17:36 reZo joined #perl6
17:40 Psyche^ joined #perl6
17:47 Jamtech joined #perl6
17:47 TJCRI joined #perl6
17:56 baest joined #perl6
17:56 njbartlett joined #perl6
18:09 njbartlett joined #perl6
18:11 jjore joined #perl6
18:15 meppel-san joined #perl6
18:22 justatheory joined #perl6
18:27 shlomif joined #perl6
18:27 shlomif joined #perl6
18:36 Lorn_ joined #perl6
18:50 Auzon joined #perl6
19:00 rindolf joined #perl6
19:13 njbartlett joined #perl6
19:19 spinclad joined #perl6
19:20 mj41 joined #perl6
19:26 jjore joined #perl6
19:26 TJCRI joined #perl6
19:35 eternaleye joined #perl6
20:14 ruoso pugs: class A { has $!a; has @!a; }
20:14 exp_evalbot RESULT[undef]
20:15 ruoso pugs: class A { has $!a; has @!a; method a { say $!a; say @!a; } } A.a()
20:15 exp_evalbot OUTPUT[*** Class prototype occured where its instance object expected: A␤    at /tmp/Z3mBTtDS4r line 1, column 40-47␤       /tmp/Z3mBTtDS4r line 1, column 40-47␤]
20:15 ruoso pugs: class A { has $!a; has @!a; method a { say $!a; say @!a; } }; A.a()
20:15 exp_evalbot OUTPUT[*** Class prototype occured where its instance object expected: A␤    at /tmp/nnDoJKC45Q line 1, column 40-47␤       /tmp/nnDoJKC45Q line 1, column 40-47␤]
20:15 ruoso pugs: class A { has $!a; has @!a; method a { say $!a; say @!a; } }; A.new().a()
20:15 exp_evalbot OUTPUT[␤␤]
20:15 ruoso pugs: class A { has $!a; has @!a; method a { say $!a.WHAT; say @!a.WHAT; } }; A.new().a()
20:15 exp_evalbot OUTPUT[Scalar␤Array␤]
20:16 nothingmuch ruoso: stevan was discussing the meta isntance
20:16 nothingmuch in Moose the meta instance is a provider of "slot" access
20:16 nothingmuch slot == actual storage an attr can use, without caring how the storage is organized
20:16 nothingmuch in MO it's a little more abstract
20:16 nothingmuch the attr requests a bunch of slots
20:16 nothingmuch and gets back slot manager objects
20:17 nothingmuch these are coordinated by a meta instance
20:17 nothingmuch and more decoupled
20:17 nothingmuch a p6 opaque generating meta instance would know how p6opaques are implemented
20:17 nothingmuch an unboxed meta instance for an int would have just one slot for the value
20:17 nothingmuch a Moose meta instance for p5 hash based objects will abstract hash access
20:17 ruoso hmm... ok... in smop this is determined by the responder interface
20:18 ruoso that intercept the meta calls
20:18 ruoso instead of doing the usual dispatch
20:19 ruoso yes... so you have repr and responder interface coupled
20:20 ruoso nothingmuch, do you think that might be a problem?
20:21 nothingmuch no, ri == interface
20:21 nothingmuch meta instance == representation
20:22 ruoso yes... I know...
20:22 nothingmuch the responder interface cares what to do with the box
20:22 nothingmuch the meta instance cares what to do with the inside of it
20:22 nothingmuch only the constructor/accessors gain access to the actual data
20:22 nothingmuch and even that is indirect
20:22 nothingmuch it can be optimized to be inline
20:22 nothingmuch but accessor implementations should be representation independant
20:23 ruoso nothingmuch, but that's why there's the REPR api
20:23 ruoso I think conceptually both apply
20:23 ruoso it might be just an implementation detail
20:23 nothingmuch (e.g. the same definition of the Int class can work for real objects that has $.value, and are p6opaque, or are really moose objects which are implemented with a hash)
20:23 ruoso yes...
20:23 nothingmuch but when it's Int,new
20:23 nothingmuch then there are no other fields
20:24 nothingmuch well, i forgot if Int is infinite or not
20:24 nothingmuch if it's int
20:24 ruoso in smop, that will be controlled by the responder interface
20:24 nothingmuch why?
20:25 ruoso because even the meta methods are called through the responder interface
20:25 perigrin joined #perl6
20:25 nothingmuch so?
20:25 nothingmuch no method needs to know about the representation, ever
20:25 ruoso except the metamethods
20:25 nothingmuch the same accessor can be used with multiple implementation types
20:25 nothingmuch not even them
20:26 ruoso sorry...
20:26 ruoso except the repr methods
20:26 nothingmuch still not necessary =)
20:26 ruoso the metamethods will use the repr methods
20:26 nothingmuch it's the *slot*'s responder interface that might know more
20:26 nothingmuch but that's completely encapsulated
20:27 nothingmuch in practice the slot should be optimzied away 99% of the time
20:27 ruoso ah... wait... I think we're not talking about the same thing here...
20:27 nothingmuch OK, please resync me then =)
20:27 ruoso the slot inside p6opaque is an object like itself
20:27 ruoso or not
20:28 ruoso it's completely encapsulated by the slot's ri
20:28 nothingmuch let's talk low level for a sec
20:28 ruoso but you still need to know how to get to the slot
20:28 ruoso before talking to the slot
20:28 nothingmuch somewhere, soemthing is going to actually deref a pointer and write a value, right?
20:28 ruoso yes, but that's in a very late stage
20:28 ruoso the slot is a container
20:29 ruoso you'll STORE on the container
20:29 nothingmuch yes
20:29 ruoso by calling a method
20:29 nothingmuch exactly
20:29 nothingmuch it's the same level of metacircularity that Invocation has
20:29 nothingmuch or the fact that each responder interface has it's own responder interface
20:29 rindolf Hi all.
20:29 rindolf Hi nothingmuch
20:29 nothingmuch hola
20:29 rindolf nothingmuch: what's up?
20:30 rindolf nothingmuch: would you suggest Moosifying Test::Run? At the moment I'm using Class::Accessor.
20:30 nothingmuch not much perl 6 stuff, tbh
20:30 rindolf nothingmuch: oh.
20:30 nothingmuch sure, that should be a fun endaveor
20:30 rindolf nothingmuch: I enjoyed your presentation at the Perl Workshop.
20:30 nothingmuch thanks =)
20:30 rindolf About Devel::Events.
20:30 * nothingmuch was very antisocial
20:31 rindolf There's a recording of it.
20:31 nothingmuch i had internets issues so I arrived only in time to give mine
20:31 nothingmuch missed the whole day
20:31 ruoso nothingmuch, the metacircularity is broken when a low-level implementation implements a container in C struct terms...
20:31 nothingmuch ruoso: precisely
20:31 rindolf ruoso: meta-circ of what?
20:32 nothingmuch the object that breaks this circularity is closed over in the responder interface of the resultant object
20:32 ruoso rindolf, by the fact that the attribute of an Object is an Object
20:32 nothingmuch ... and the fact that a method is an object
20:32 nothingmuch and that to call a method call you need to call a method call on an object that dispatches method calls =)
20:33 ruoso what do you mean by "closed over"
20:33 ruoso ?
20:33 nothingmuch the metaclass gathers the meta attributes
20:33 nothingmuch asks them for their slot information
20:33 nothingmuch and provides these bundles to the meta instance
20:34 nothingmuch more accurately it constructs a meta instance with these slots
20:34 nothingmuch slot descriptions
20:34 ruoso in fact, you *can* implement it that way... but smop doesn't *require* you to do it
20:34 ruoso you can implement a responder interface that short-circuits everything to a C struct
20:34 nothingmuch then when the methods of the attribute are compiled by the attr (using the meta instance)
20:34 nothingmuch yes, but that's not extensible
20:35 nothingmuch might as well ditch meta altogether =)
20:35 IllvilJa joined #perl6
20:35 nothingmuch the meta instance will give the attr meta slot object to use for value access
20:35 nothingmuch the accessors/constructor will close over these objects
20:36 ruoso nothingmuch, did you see the SMOP OO API and SMOP p6opaque Implementation wiki pages?
20:36 nothingmuch the p6opaque page no
20:37 nothingmuch wait, actually i think i see where our misunderstanding is
20:37 nothingmuch let's go back to Foo isa Int and a real Int
20:37 nothingmuch their responder interfaces though related are completely independant
20:37 ruoso might be or might be not
20:37 nothingmuch completely unrelated means "could possibly be" in this context
20:38 nothingmuch it *is* the responder interface who at the end of the line is responsible for locating (probably indirectly) the correct low level impl for the value access
20:38 ruoso if both use the same representation, they will probably use the same RI
20:38 nothingmuch no, because they have different methods
20:38 ruoso the RI will dispatch to the meta
20:38 ruoso s/dispatch to/talk to/
20:39 ruoso to do the dispatch
20:39 nothingmuch do you mean same RI class?
20:39 ruoso same RI instance
20:40 ruoso but different invocants
20:40 nothingmuch why?
20:40 ruoso ok... wait... RI prototype
20:40 ruoso an RI is never an instance
20:41 ruoso or almost never
20:41 ruoso there's no much point in it being instantiated
20:41 nothingmuch por que?
20:41 ruoso because every call is always invocant-dependant
20:42 ruoso so, in a higher-level-sense
20:42 nothingmuch well, for protype object RIs, yes
20:42 ruoso they will be two RI instances
20:42 nothingmuch but 'int' can't be a prototype object
20:42 nothingmuch because it's just n bits of integer data
20:42 ruoso nope... int is an SMOP__Object...
20:42 nothingmuch lowercase int, not Int
20:43 ruoso yes...
20:43 ruoso the only difference between int and Int
20:43 ruoso is that I can know for sure the repr of "int", and not of "Int"
20:43 nothingmuch well, it *can* be completely unboxed
20:44 ruoso in C? how?
20:44 ruoso when will that value be destroyed?
20:44 ruoso who will care about its destruction
20:44 nothingmuch because the prototype of all 'int's are statically known then the method set can be copied over to a static method table responder interface
20:44 ruoso but how do I know that something is an int?
20:44 nothingmuch if it needs to be destroyed then this is a specific responder interface variant for 'int' that supports tracking
20:45 nothingmuch the int constructor knows
20:45 ruoso how?
20:45 nothingmuch it binds the RI and the value
20:45 nothingmuch because it's the constructor
20:45 ruoso ah.. ok
20:45 ruoso that's what a SMOP__Object* is
20:45 nothingmuch if the constructor doesn't know what kind of object it makes, then we're way too meta ;-)
20:45 nothingmuch right, but you can go further
20:45 ruoso a SMOP__Object is simply something with a RI
20:45 nothingmuch in the case of 'int'
20:45 nothingmuch there is never any finalization guarantee, IIRC
20:46 nothingmuch since the class is closed
20:46 nothingmuch when you know that in the low level an 'int' value can live as parameters only
20:46 nothingmuch and get thrown away with it's continuation when it's no longer needed
20:46 nothingmuch then you don't need to box it at all, the value can just be the actual C repr of the int
20:47 nothingmuch the constructor will have two variants (Whether by some special optimizer flag, or really two distinct variants)
20:47 nothingmuch one returns an int, and the code calling on it is responsible for tracking the responder interface
20:47 ruoso how can I send a plain int into a capture and recognize it in the other side?
20:47 ruoso if it's not tagged with its RI?
20:47 nothingmuch the other returns a pointer to "something" boxed with a responder interface
20:47 nothingmuch that is something you must statically know
20:47 nothingmuch this is an optimization
20:47 ruoso ah... ok...
20:48 nothingmuch if you have a type annotation, for instance
20:48 ruoso we're in the JIT-land in that matter
20:48 nothingmuch but wait, i will actually take this further ;-)
20:48 nothingmuch now, in the case of a boxed int
20:48 nothingmuch it's a pointer to "something"
20:48 nothingmuch but that something can still be just an int*
20:49 nothingmuch so autoboxing a low level int is just a matter of allocating space for that int, writing it there, and and sending an object box with the right int
20:49 nothingmuch a third variant for the constructor would create a p6opaque
20:49 nothingmuch with one slot for value
20:49 nothingmuch *the value
20:49 nothingmuch this and the second variant are completely polymorphic
20:50 nothingmuch the calling code can never know which is which
20:50 nothingmuch without deconstructing the responder interface
20:51 nothingmuch this third object looks similar to what subclasses of int do
20:51 ruoso if "something" is just an int* how will you call it the same way as other things
20:51 nothingmuch it's a touple
20:51 nothingmuch (int*, ri)
20:51 ruoso ah...
20:51 ruoso ok..
20:51 ruoso that's SMOP__Object
20:51 nothingmuch wheras the third variant is
20:51 nothingmuch (dict*, ri)
20:51 nothingmuch yes
20:52 nothingmuch dict* in our case is a p6opaque
20:52 nothingmuch or HV
20:52 nothingmuch the responder interface for these guys doesn't need to know the difference though
20:53 nothingmuch if it's a method table
20:53 nothingmuch (it's expensive to copy the whole method table in every prototype object if it can be deduced that the slots for the methods are unused by everyone except the responder interface itself)
20:54 ruoso I won't copy the whole method table...
20:54 ruoso not even in p6opaque
20:54 nothingmuch s/whole/local/;
20:54 nothingmuch if it's a "real" prototype object, in the sense that it's a dictionary of values
20:54 nothingmuch and some values are methods
20:54 nothingmuch and the responder interface walks the parent chain at runtime
20:55 nothingmuch then the responder interface is compiled with slot access into it
20:55 nothingmuch but in 99% of the cases you can create a simpler responder interface
20:55 nothingmuch that knows the entire set of methods statically
20:55 nothingmuch and is just a dumb vtable
20:56 nothingmuch (fwiw, even in the prototype object case, the responder interface should delegate for the meta attr of each method)
20:57 ruoso nothingmuch, that's what I'm calling "low-level implementations"
20:57 ruoso for instance...
20:57 ruoso the Array of Method returned by .^!methods()
20:58 ruoso it will simply navigate into the p6opaque structure of the given object
20:59 ruoso it's what allbery_b was calling a "community" yesterday
21:00 ruoso but I need to go...
21:00 nothingmuch just briefly before
21:00 nothingmuch please disambiguate 'navigate'
21:01 ruoso it will go access the members of the C struct directly
21:01 ruoso because it *knows* the structure of that specific object
21:01 nothingmuch as an optimization
21:01 ruoso yes
21:01 nothingmuch ?
21:01 ruoso not only, actually
21:01 ruoso it needs to do that to avoid circularity also
21:03 nothingmuch ah right
21:03 ruoso several optimizations in smop have that same function
21:03 ruoso the constant identifiers are the best example
21:04 ruoso it's an optimization in the sense that it allows string matching with plain C pointer identity check
21:04 smtms joined #perl6
21:04 ruoso but it breaks circularity because it avoids the need of another method call to do the comparing
21:04 ruoso which would require other identifiers to be used
21:05 ruoso other is the constant capture returned when the invocant is the interpreter
21:05 ruoso it avoids creating and destroying an unecessary object
21:05 Squern joined #perl6
21:06 ruoso but it break circularity on the "current" call
21:06 ruoso that returns the current continuation
21:06 * ruoso signing of in 5...
21:06 ruoso 4..
21:06 nothingmuch well, in any case of circularity breakage
21:06 ruoso 3.. 2...
21:07 nothingmuch there should always be a low level accessible unbreaking
21:07 ruoso basically, ues
21:07 nothingmuch so that in the level just slightly higher it doesn't appear to be broken
21:07 ruoso s/ues/yes/
21:07 nothingmuch OK, so we were in agreement after all, it seems
21:07 ruoso heh... yeah...
21:07 ruoso and it looks smop survived another massive peer review ;)
21:08 ruoso actually... massive review from a peer
21:08 ruoso heh
21:08 nothingmuch stevan too
21:08 nothingmuch =)
21:09 * ruoso pressing the eject button
21:10 nothingmuch ciao
21:11 Squern joined #perl6
21:17 thoughtpolice joined #perl6
21:20 buchetc joined #perl6
21:55 rdice joined #perl6
22:26 dmq joined #perl6
22:41 Limbic_Region joined #perl6
22:46 wknight8111 joined #perl6
22:58 jferrero joined #perl6
23:05 lumi joined #perl6
23:16 lumi joined #perl6
23:31 justatheory joined #perl6

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

Perl 6 | Reference Documentation | Rakudo