Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2008-07-11

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:29 Alias_ joined #perl6
00:29 Limbic_Region joined #perl6
00:36 bacek joined #perl6
00:37 pugs_svn r21303 | ruoso++ | [smop] fixing memory leak in p6opaque. test/12 is valgrind clean again...
01:05 alester_ joined #perl6
01:13 pugs_svn r21304 | ruoso++ | [smop] test/14_p6opaque_methods compiles and runs, but it is obviously not passing yet.
01:58 redicaps left #perl6
02:01 Southen_ joined #perl6
02:03 speckbot r14561 | larry++ | [S12] s/bool/Bool/
02:16 alanhaggai joined #perl6
02:16 simcop2387 joined #perl6
02:24 Jamtech joined #perl6
02:28 [particle]1 joined #perl6
02:51 ingy hola
02:52 * ingy fires up his Perl 6 machine
02:53 kanru joined #perl6
03:00 pmichaud TimToady: Are there more changes in the queue for the synopses wrt .Bool, .true, etc?  Or should I go ahead and start asking questions?
03:00 TimToady feel free
03:01 pmichaud what's the relationship between .true and .Bool ?
03:01 TimToady true is an Any method
03:01 TimToady Bool is a coercion via type name
03:02 pmichaud so, given an object in a boolean context, how do we decide what to return?
03:02 pmichaud e.g., for prefix:<?>
03:04 TimToady true() and prefix:<?> coerce to 0 or 1, I think
03:04 pmichaud what logic do they use to decide the boolean value of an object?  Do they check .True first, and fall back to .true?
03:05 TimToady I think all types should define .true, probably
03:05 pmichaud yes, .true is defined in Any
03:05 pmichaud er, Object
03:05 TimToady defaults to .defined, I think...
03:05 pmichaud (S02 says .true is defined in Object)
03:05 pmichaud (and yes, it defaults to .defined)
03:05 pmichaud but if I have
03:06 pmichaud my $x = $a but True;   say ?$a;
03:06 pmichaud how does that "but True" get handled in prefix:<?>
03:06 pmichaud sorry, I meant say ?$x
03:07 pmichaud (I really can't type these days.  I should type slower.)
03:07 TimToady prefix:<?> calls .true on the object, and the anon type overrides the .true method
03:07 pmichaud it overrides the .true method because...?
03:07 TimToady it mixes in a role that defines .true, I guess
03:08 pmichaud but that role isn't the Bool role?
03:08 TimToady why not?
03:08 pmichaud oh.  Bool isn't strictly an enum, then
03:09 pmichaud i.e., it's not just   our bit enum *Bool <True False>     because there's also a .true method in there somewhere
03:09 TimToady Bool is a valid type for an object or a property.  True and False are subset types
03:10 TimToady well, .true may be built-in to bit as a 1 bit int already
03:10 pmichaud but then bit would autobox to Bit in that case?
03:11 TimToady bit :: uint1
03:11 TimToady if you had to pass it somewhere as an object, it would box to some variety of Int
03:11 pmichaud (since native types autobox to their uppercase counterparts when treated as objects)
03:12 TimToady not sure if that always has to be the case
03:12 pmichaud ah.  I was reading from S02.
03:12 TimToady native types are really a funny kind of subset type
03:13 TimToady except the hardware enforces the limit :)
03:13 pmichaud yes, but adding methods to native types sounds.... tricky
03:13 TimToady well, you have to know the container type; you can't ask it what it is...
03:14 pmichaud okay, that lost me.
03:15 TimToady an "int" is a container, but not an object, so you have to implicitly know the .HOW of it
03:15 pmichaud okay
03:16 pmichaud so, .true is a method on bit (or int)
03:17 pmichaud and role composition causes it to override
03:17 TimToady mixin, not composition
03:17 pmichaud mixin, thanks.
03:17 pmichaud (still learning all the terms here)
03:17 pmichaud okay, I can follow that, I think.
03:18 * TimToady hides the hands he was waving...
03:18 pmichaud one more question:   what's the output of   say (?0).perl   ?
03:19 TimToady perl6: say (?0).perl
03:19 p6eval elf 21304: OUTPUT[0␤]
03:19 p6eval ..pugs: OUTPUT[Bool::False␤]
03:19 p6eval ..rakudo 29275: OUTPUT[Bool::False␤]
03:19 redicaps joined #perl6
03:20 pmichaud (rakudo does Bool::False simply because that's what Pugs and the test suite do.)
03:20 TimToady I am still slightly undecided on whether ? should be returning a bit or a Bool.  can argue it either way, typologically
03:21 pmichaud oh, I was able to see lots of ways to argue it, which is why I asked :-)
03:22 TimToady there's probably a lot to be said for trying to preserve enumness
03:23 TimToady and the Bool-is-really-bit-at-runtime is kind of a compiler-centric view
03:23 TimToady where compiler is defined as that thing that throws away all the useful type info :)
03:24 TimToady certain +?$x should return 0 or 1
03:24 pmichaud I just think of it as lossy compression  :-)
03:24 TimToady but darn it, computers treat all bits as booleans, in some sense...
03:25 TimToady and certainly P5 programmers are used to thinking of booleans numerically
03:25 TimToady (if you consider "" to be a variant of 0...)
03:29 TimToady I also get a bit tired of seeing Bool::True and Bool::False everywhere...
03:30 pmichaud also Order::Decrease, Order::Same, Order::Increase (from cmp)
03:31 TimToady for most purposes, if there is no conflict, True/False or Decrease/Same/Increase is sufficient for clarity
03:32 TimToady but maybe it's a false economy
03:33 TimToady maybe a pragma is the appropriate solution here
03:34 TimToady use perl :enum<explicit>
03:34 TimToady hmm
03:35 TimToady pugs: say perl(1+2);
03:35 p6eval pugs: OUTPUT[3␤]
03:35 TimToady perl6: say perl(1+2);
03:35 p6eval elf 21304: OUTPUT[Undefined subroutine &GLOBAL::perl called at (eval 119) line 3.␤ at ./elf_f line 3861␤]
03:35 p6eval ..pugs: OUTPUT[3␤]
03:35 p6eval ..rakudo 29276: OUTPUT[Could not find non-existent sub perl␤current instr.: '_block11' pc 36 (EVAL_11:16)␤]
03:36 TimToady 'nother one of them little spec holes...
03:36 pbuetow_ joined #perl6
03:37 TimToady I wonder if we should make .repr spit out Python code.  :)
03:37 pmichaud :-)
03:37 pmichaud I don't need an immediate answer to any of these -- just want to be able to answer questions for Rakudo and the test suite
03:39 TimToady in some of these cases there really isn't a best answer, but it'd be nice if the implementations all agree at least
03:39 TimToady (but I do hate arbitrary decisions...)
03:40 pmichaud I have another question from the earlier questions, but I'm not quite sure how to phrase it
03:40 pmichaud so bear with me
03:40 pmichaud (keeping in mind I still don't _completely_ understand roles/properties)
03:41 pmichaud if we have  our bit enum *Bool <False True>
03:41 pmichaud and then   my $x = 0 but True;
03:41 pmichaud then $x has a .Bool method, a .True method, and a .False method mixin'ed, yes?
03:44 pmichaud and it also gets all of the methods defined on the 'bit' type as well?
03:45 TimToady if so, it would indicate the object in $x is of type Bool rather than just type bit
03:46 TimToady and the "bit" type is really just a storage hint for compaction purposes
03:47 TimToady presumably 1.False returns a Failure
03:48 cain_22 joined #perl6
03:48 TimToady you automatically get all typenames as methods, I think
03:49 pmichaud as methods on.... ?
03:49 TimToady and maybe those are special cased as coercions, so can be defined either incoming or outgoing to a type
03:51 pmichaud well, that kinda brings up another question:    my enum Foo @foo;     # valid?
03:52 TimToady would have to value of @foo at compile time
03:52 pmichaud okay.
03:52 TimToady like in use Foo @foo;
03:52 TimToady family calling; will backlog &
03:53 pmichaud no problem.  I still don't quite understand the "indicate object in $x is of type Bool" and how .true ends up in the mixin'd value
03:54 pmichaud (I can understand that it's in 'bit', but I don't see how we get the methods from 'bit' into the mixin'd value -- that seems like more than a simple role mixin)
04:07 pmichaud afk for a while
04:50 simcop2387 joined #perl6
05:03 kanru joined #perl6
05:17 pugs_svn joined #perl6
05:18 TimToady joined #perl6
05:18 Grrrr joined #perl6
05:18 Patterner joined #perl6
05:18 Ara5n joined #perl6
05:18 kanru joined #perl6
05:18 simcop2387 joined #perl6
05:18 cain_22 joined #perl6
05:18 pbuetow_ joined #perl6
05:18 redicaps joined #perl6
05:18 Southen_ joined #perl6
05:18 alester_ joined #perl6
05:18 bacek joined #perl6
05:18 Alias_ joined #perl6
05:18 ruoso joined #perl6
05:18 rhr joined #perl6
05:18 jfredett joined #perl6
05:18 frobnitz joined #perl6
05:18 Lorn joined #perl6
05:18 sri_work joined #perl6
05:18 xinming joined #perl6
05:18 Auzon joined #perl6
05:18 breinbaas joined #perl6
05:18 ilogger2 joined #perl6
05:18 gugod joined #perl6
05:18 smtms joined #perl6
05:18 BinGOs joined #perl6
05:18 Helios- joined #perl6
05:18 gbacon joined #perl6
05:18 ingy joined #perl6
05:18 wolverian joined #perl6
05:18 agentzh joined #perl6
05:18 felipe joined #perl6
05:18 kane_ joined #perl6
05:18 jan_ joined #perl6
05:18 smg joined #perl6
05:18 Gothmog_ joined #perl6
05:18 charsbar joined #perl6
05:18 fullermd joined #perl6
05:18 GeJ_ joined #perl6
05:18 nnunley joined #perl6
05:18 araujo joined #perl6
05:18 yahooooo joined #perl6
05:18 dmq joined #perl6
05:18 apeiron joined #perl6
05:18 r0bby joined #perl6
05:18 cggoebel joined #perl6
05:18 integral joined #perl6
05:18 PZt joined #perl6
05:18 lambdabot joined #perl6
05:18 japhb joined #perl6
05:18 rafl joined #perl6
05:18 stevan_ joined #perl6
05:18 baest joined #perl6
05:18 Khisanth joined #perl6
05:18 buubot joined #perl6
05:18 mj41_ joined #perl6
05:18 jjore joined #perl6
05:18 cosimo joined #perl6
05:18 s1n joined #perl6
05:18 scrottie joined #perl6
05:18 silug joined #perl6
05:18 Ara4n joined #perl6
05:18 SamB joined #perl6
05:18 PerlJam joined #perl6
05:18 Juerd joined #perl6
05:18 dalek joined #perl6
05:18 pmichaud joined #perl6
05:18 sunnavy joined #perl6
05:18 broquaint joined #perl6
05:18 yath_ joined #perl6
05:18 clkao joined #perl6
05:18 obra joined #perl6
05:18 hcchien joined #perl6
05:18 IRSeekBot joined #perl6
05:18 awwaiid_ joined #perl6
05:18 moritz_ joined #perl6
05:18 pjcj joined #perl6
05:18 lumi joined #perl6
05:18 Lunchy joined #perl6
05:18 diakopter joined #perl6
05:18 jrockway joined #perl6
05:18 speckbot joined #perl6
05:18 perlbot joined #perl6
05:18 zostay joined #perl6
05:18 thepler joined #perl6
05:18 audreyt joined #perl6
05:18 mtve joined #perl6
05:18 kolibrie joined #perl6
05:18 pengrate joined #perl6
05:18 Tene joined #perl6
05:18 nipotaway joined #perl6
05:18 TreyHarris joined #perl6
05:18 spinclad joined #perl6
05:18 arguile joined #perl6
05:18 Maddingue joined #perl6
05:18 allbery_b joined #perl6
05:18 rakudo_svn joined #perl6
05:18 pasteling joined #perl6
05:18 SubStack joined #perl6
05:18 jiing joined #perl6
05:18 Caelum joined #perl6
05:18 funktio joined #perl6
05:19 bacek joined #perl6
05:20 baest joined #perl6
05:21 Psyche^ joined #perl6
05:24 alanhaggai joined #perl6
05:25 c1sung joined #perl6
05:30 s1n joined #perl6
05:38 cj joined #perl6
06:30 alanhaggai joined #perl6
06:46 barney joined #perl6
06:53 pmurias joined #perl6
06:53 pmurias TimToady: how does an object specifiy it's hash function?
06:53 lambdabot pmurias: You have 1 new message. '/msg lambdabot @messages' to read it.
07:16 nothingmuch joined #perl6
07:18 mtve joined #perl6
07:20 redicaps joined #perl6
07:36 pmurias pugs: module Foo {our $foo=7};say $foo;
07:36 p6eval pugs: OUTPUT[*** ␤    Unexpected ";"␤    expecting "::"␤    Variable "$foo" requires predeclaration or explicit package name␤    at /tmp/y87Qe9eh8O line 1, column 33␤]
07:36 pmurias pugs: module Foo {our $foo=7;};say $foo;
07:36 p6eval pugs: OUTPUT[*** ␤    Unexpected ";"␤    expecting "::"␤    Variable "$foo" requires predeclaration or explicit package name␤    at /tmp/ikMRRsLrnP line 1, column 34␤]
07:36 pmurias pugs: module Foo {our $foo=7;};say $Foo::foo;
07:36 p6eval pugs: OUTPUT[␤]
07:36 pmurias pugs: module Foo {our $foo=7;};say $*Foo::foo;
07:36 p6eval pugs: OUTPUT[␤]
07:36 pmurias pugs: $Foo::foo=7;say $Foo::foo;
07:36 p6eval pugs: OUTPUT[7␤]
07:36 pmurias pugs: $Foo::foo=7;say $*Foo::foo;
07:36 p6eval pugs: OUTPUT[␤]
07:36 pmurias pugs: $*Foo::foo=7;say $*Foo::foo;
07:36 p6eval pugs: OUTPUT[7␤]
07:39 tuxdna joined #perl6
08:01 pmurias ruoso: hi
08:04 iblechbot joined #perl6
08:07 pmurias ruoso: is there any sort of reference counting debugging mode?
08:27 pmurias i have found SMOP_LOWLEVEL_MEM_DEBUG, but it floods me with not very usefull data
08:46 jiing joined #perl6
09:07 pmurias moritz_: the current evalbot backends don't offer any security right?
09:08 moritz_ pmurias: pugs does
09:08 moritz_ pmurias: and the others offer security by inability ;)
09:08 moritz_ at least a bit ;)
09:08 moritz_ actually kp6 also has a safe mode
09:09 moritz_ let's ask the other way round - how much would you benefit from evaling sm0p code on evalbot?
09:17 ruoso pmurias, SMOP_LOWLEVEL_MEM_DEBUG is one way... other way is valgridn... it will show you where the unfreed memory was allocated...
09:20 pmurias moritz_: kp6 does not have a *working* safe mode
09:22 meppl joined #perl6
09:23 pmurias ruoso: i'm debuggin memory being freed twice
09:24 chris2 joined #perl6
09:24 pmurias * debugging
09:26 pmurias is there an equivalent of caller in c?
09:30 elmex joined #perl6
09:32 pmurias i could add a log of reference counter increments and decrements to SMOP__Objects if it did
09:34 rakudo_svn r29285 | bernhard++ | [Rekudo] Some tidbits in docs/compiler_overview.pod and README
09:35 pmurias maybe scripting the gdb would work...
09:38 pmurias ruoso: would a tool showing where was the reference counter of a prematurly free'ed of leaking smop counter changed be helpfull to you? (i don't know if it's worth doing something like that)
09:42 pmurias buying a gsm modem&
10:15 wknight8111 joined #perl6
10:19 donaldh joined #perl6
10:22 Kattana joined #perl6
10:25 meppl joined #perl6
10:34 redicaps left #perl6
10:54 b_jonas joined #perl6
11:31 pbuetow joined #perl6
11:39 ruoso joined #perl6
11:43 wknight8111 joined #perl6
11:59 broquaint joined #perl6
12:07 mjk joined #perl6
12:07 alanhaggai joined #perl6
12:36 rindolf joined #perl6
12:40 cmarcelo joined #perl6
12:43 iblechbot joined #perl6
12:54 * moritz_ is offline for the weekend, see you call
12:57 alc joined #perl6
13:00 rurban joined #perl6
13:05 rakudo_svn r29290 | pmichaud++ | [rakudo]: spectest-progress.csv update:  95 files, 1691 passing tests
13:32 rindolf joined #perl6
13:37 Schwern joined #perl6
13:37 pmurias joined #perl6
13:46 rdice joined #perl6
13:56 wknight8111 joined #perl6
14:01 rindolf joined #perl6
14:01 rurban Can somebody please update the pugs webpage with the recommended installation method? (Install ghc, Cabal, cabal-install, HTTP, zlib, Pugs)
14:02 thepler_ joined #perl6
14:04 rurban BTW: How to submit an pugs installation guide for cygwin?
14:18 pmurias rurban: isn't the general windowsy best practice to make a installer?
14:18 rurban win32 yes, cygwin not.
14:18 rurban I'm just writing it to my use.perl journal....
14:22 rindolf joined #perl6
14:29 pugs_svn r21305 | pmurias++ | [smop]
14:29 pugs_svn r21305 | pmurias++ | hashes are DESTROYEDALL'ed corretly
14:29 pugs_svn r21305 | pmurias++ | fixed sm0p.pl bug
14:29 pugs_svn r21305 | pmurias++ | added untested infix:eq
14:34 hercynium joined #perl6
14:39 jhorwitz joined #perl6
14:44 rurban cygwin pugs installations at http://use.perl.org/~rurban/journal/36897
14:44 lambdabot Title: Journal of rurban (7989)
14:50 alanhaggai joined #perl6
14:57 alester joined #perl6
15:08 rdice_ joined #perl6
15:15 barney joined #perl6
15:28 nothingmuch joined #perl6
15:35 lambdabot joined #perl6
15:37 lumi joined #perl6
15:40 Lorn_ joined #perl6
15:47 justatheory joined #perl6
16:07 zamolxes joined #perl6
16:12 b_jonas joined #perl6
16:58 ruoso joined #perl6
17:04 ruoso @tell pmurias, please remember of adding your changes to the Changelog in the smop wiki
17:04 lambdabot Consider it noted.
17:06 cain_22 left #perl6
17:45 pmurias joined #perl6
17:46 pmurias ruoso: rehi ;)
17:46 ruoso pmurias, hi
17:47 pmurias the changelog should contain only full changes ?
17:47 pugs_svn r21306 | ruoso++ | [smop] More advances in p6opaque_methods. skeleton for the p6opaque methods array proxy object
17:47 ruoso pmurias, not really... I tend to log as something advances, even if not finished yet...
17:47 ruoso my idea is that someone would have how to help in this something I still am working on
17:48 pmurias why do we need a changelog, isn't svn log enough?
17:48 ruoso hmmm... well...
17:48 ruoso I don't know... to have it side-by-side with the roadmap?
17:48 ruoso for instance... you're working in a lowlevel hash
17:49 ruoso that is in the roadmap...
17:53 pmurias ruoso: any other reasons?
17:53 ruoso it will also serve as a report on the progress for the grant
17:53 pmurias having the svn log side by side could be arranged
17:54 ruoso pmurias, I know... but I usually don't add in the changelog as often as I commit...
17:54 ruoso Usually, for an unfinished activity, I log once a day
17:58 pmurias food&
18:05 pmurias ruoso: once i finish the Hash i'll add my changes to the changelog
18:05 ruoso that's cool
18:06 pmurias ruoso: i haven't finish it yet ;(
18:06 pmurias * finished
18:06 ruoso no problem...
18:07 pmurias it's strange that $a eq $b compiles to &infix:<eq>($a,$b) not to $a.infix:<
18:07 rindolf joined #perl6
18:07 pmurias sorry, it's the reverse actually
18:07 pmurias rindolf: hi
18:07 pmurias how is your lisp dialect
18:07 pmurias ?
18:07 rindolf Hi pmurias
18:07 rindolf pmurias: what's up?
18:08 rindolf pmurias: it's in deep design stages.
18:08 rindolf pmurias: and it would be hard for me to work directly on Parrot.
18:08 rindolf Because I'm banned from both IRC and email.
18:09 pmurias rindolf: you can write a smop backend (once smop matures a bit)
18:09 rindolf pmurias: ah.
18:09 rindolf pmurias: what is smop?
18:11 ruoso rindolf, http://www.perlfoundation.org/perl6/index.cgi?smop
18:11 lambdabot Title: SMOP / Perl 6
18:11 rindolf ruoso: checking.
18:12 rindolf My Internet is stupid now.
18:12 pmurias my internet is stupid two after the so called upgrade
18:13 rindolf pmurias: not sure I understand what it is exactly.
18:13 pmurias * stupid too
18:14 pmurias rindolf: it's a vm/interpreter
18:14 rindolf pmurias: ah.
18:15 ruoso rindolf, it's actually a runtime library for Perl 6 very much in the same sense perl 5 is the runtime library for Perl 5
18:15 rindolf ruoso: ah.
18:16 ruoso several ideas were stolen from the p5 runtime...
18:20 pmurias ruoso: how should i pass a value from a q:sm0p {...} to the enclosing C?
18:20 ruoso you don't
18:20 ruoso because the code inside q:sm0p won't be executed at that time
18:21 ruoso so you can't get the value from that result
18:21 ruoso you can have a callback method in your object
18:21 ruoso that will receive the value you want
18:21 ruoso and do something about it...
18:21 ruoso take a look at the p6opaque DESTROYALL code...
18:22 pmurias a SM0P_RUN(q:sm0p {...}) would be handy
18:22 ruoso pmurias, you don't want to do that
18:22 ruoso because you will be recursing in the C stack
18:22 ruoso and that's a bad thing when you want to interact with interpreted code
18:23 pmurias ruoso: interpreted code = sm0p?
18:23 ruoso yes
18:24 ruoso sm0p is interpreted in the interpreter runloop
18:24 ruoso that's why I always return immediatly with false from the functions where I have a sm0p block
18:24 ruoso to let the interpreter call the sm0p instructions later
18:26 pmurias callbacks and c don't play very well
18:26 ruoso why not?
18:27 ruoso but you can always think of your callback as a method call
18:27 ruoso as I do in p6opaque.DESTROYALL
18:27 ruoso which in the sm0p block calls .^!DESTROY
18:28 ruoso that call is received as a standard method call...
18:32 pmurias i'll have to implement sm0p labels ASAP
18:32 ruoso pmurias, yes... it's starting to be a real pain
18:34 pmurias will need something like SM0P_RUN if we want sm0p to be embeddable
18:35 ruoso but you can call loop on the interpreter
18:35 ruoso as the tests do
18:35 ruoso but you shouldn't do that inside the code...
18:35 tuxdna joined #perl6
18:35 ruoso because you would be recursing in the C stack
18:36 Alias_ joined #perl6
18:36 pmurias re callbacks c doesn't even have closures and complex control flow gets turn into state machines
18:36 pmurias * turned
18:36 pmurias ruoso: the Hash is temorary
18:37 ruoso pmurias, but you have a capture that you can build in the sm0p block and call your method
18:37 ruoso instead of returning the value, use it as a parameter to a method call
18:37 ruoso you can build the capture in the sm0p block
18:37 ruoso and receive the value in the other dispatch call
18:38 pmurias the sm0p call is in a loop
18:40 gaal joined #perl6
18:40 pmurias the s1p Hash will be replaced by a Hash in perl6 shortly after in the initialisation sequence
18:40 Exodist joined #perl6
18:40 ruoso pmurias, but still, recursing in the C stack is a bad idea...
18:42 pmurias i don't think any body will be calling continuations at this stage
18:43 ruoso pmurias, smop is doing it already
18:43 ruoso smop_lowlevel counts on continuations...
18:43 ruoso it already uses Continuation-Passing-Style
18:43 ruoso that's how it intercepts the execution to call DESTROYALL
18:45 pmurias i'm using only constat identifiers keys than
18:45 pmurias * constant
18:45 ruoso that's an acceptable restriction for the moment
18:46 ruoso no object is accepting non-constant idenfier for method dispatch yet
18:47 pmurias shower&
18:54 Alias__ joined #perl6
18:59 pmurias ruoso: how do you plan to achive half-decent performance with smop?
19:00 ruoso pmurias, by someday replacing SLIME with something less lame
19:00 ruoso but do you think the performance is too bad already?
19:01 ruoso I still couldn't find anything worth benchmarking
19:07 pmurias ruoso: we don't execute anything yet, and most of the objects are still in C
19:08 ruoso I think test/14 will already give us some idea on how heavyweight it is, since the method dispatch will already be delegated by non-c code...
19:09 pmurias was just comparing the way we do things with parrot
19:10 * ruoso not used to handle parrot...
19:11 ruoso how do we do things with parrot?
19:11 pmurias i meant i compared the way we do things with the way parrot does them
19:12 ruoso and I meant, how do parrot do them?
19:12 ruoso ;)
19:12 pmurias faster
19:12 pmurias ;
19:12 pmurias )
19:13 pmurias they have vtables, int and string registers
19:13 ruoso hm... but they still don't know how they will handle representation polymorphism
19:13 tuxdna left #perl6
19:14 ruoso I was talking with jonathan some time ago, and they're assuming they'll find a way to handle it
19:14 pmurias handle is as a special case most likely
19:14 pmurias s/is/it/
19:14 Chillance joined #perl6
19:15 ruoso but if the vtable is visible to the interpreter... there isn't really a way to special case it
19:16 ruoso (of course they are probably smarter then me and they'll find a way... but I just can't think on a way to do it)
19:16 pmurias you could use SMOP_OBJECT's as pmc if you want
19:16 pmurias ruoso: the vtable contains only the most common methods
19:16 ruoso the most common being?
19:17 ruoso smop abstracts one more level
19:17 spinclad i expect vtables will not map one-to-one with .HOWs
19:18 ruoso spinclad, I'm not sure about it... but afaics... it's something like that...
19:18 ruoso pmichaud and [particle] could probably shed a brighter light on it
19:19 pmurias ruoso: the most common ones are the ones parrot developers feel will be called most
19:19 ruoso pmurias, but at which level?
19:19 ruoso pmurias, is it just an optimization?
19:20 pmurias MESSAGE in smop terms
19:20 pmurias sort of
19:20 pmurias it's designed in
19:20 ruoso except that in smop, the vtable is abstracted inside the message call
19:20 pmurias which is slower
19:20 ruoso but might be required to support different representations
19:21 ruoso which in turns can result in faster again
19:21 ruoso because I can use optimized low-level values as if they were standard objects
19:21 pmurias the parrot folks can to
19:21 ruoso well...
19:22 ruoso as I said... I'm not really aware on the internals of parrot...
19:22 pmurias they sort of assume standard objects are optimized low-level values
19:22 ruoso but from what I've talked with jonathan, they still didn't sort out how to deal with different representations...
19:22 pmurias * as special case of optimized low-level values
19:22 Alias_ joined #perl6
19:23 spinclad vtable perhaps corresponds with responder interface
19:23 pmurias spinclad: no
19:23 ruoso spinclad, that's what smop does
19:23 spinclad no?
19:23 ruoso parrot is one level more concrete
19:23 pmurias spinclad: sort of yes
19:23 pmurias ;)
19:24 ruoso smop is one level more abstract
19:24 ruoso spinclad, the vtable in parrot is exposed, in object is hidden inside a responder interface
19:24 pmurias spinclad: they are responder interfaces with hard coded common operations
19:24 ruoso s/object/smop/
19:25 spinclad the vtable is exposed to parrot opcodes, unlikely (as i see it) exposed to Perl 6 (or other HLL) level
19:25 ruoso pmurias, it would be like if we take the lookup inside the message calls of smop and turn it into some static vtable lookup
19:26 ruoso the difference is one level of abstraction
19:27 spinclad sorry, is exposed to parrot opcode dispatch, as RI is to operation invocation
19:28 ruoso but again.. I'm not familiar with parrot internals... pmichaud and [particle] would probably give a correct explanation on that
19:28 pmurias ruoso: but if an operation is not in the hard-coded set it's handled by a special method code operation, just as in sm0p
19:30 ruoso pmurias, which means that in the end parrot will need as much indirection as smop does?
19:30 pmurias for the less common operations yes ;)
19:30 Jedai joined #perl6
19:31 ruoso is the vtable subject to cache invalidation or something like that?
19:31 pmurias it's propably pmc specific
19:32 pmurias i haven't seen one with cache invalidation but i haven't looked much
19:32 spinclad if you replace a sub it points to?  you may generate a new vtable and start using it; don't think that's a core operation now.
19:32 ruoso well...
19:34 ruoso btw... it's intersting to make clear that I really think parrot in the end will be a full fletched vm that supports Perl 6 entirely... but one core feature (representation polymorphism) is not addressed yet...
19:35 [particle] parrot has four core data types, with register types to support each: int, num, string, pmc
19:35 [particle] pmc is an abstract data type
19:35 [particle] each core data type can be converted to the other, for example $I0 = $S0
19:36 [particle] parrot uses ops for this
19:36 [particle] set_i_s $I0, $S0
19:36 * pmurias get back to coding seeing much more competent people took up the discussion ;)
19:37 [particle] these are hardcoded for int num string types
19:37 spinclad i think vtables apply only to pmcs?
19:37 [particle] since pmcs are abstract, the vtable is there to allow pmc writers the ability to write their own functions
19:37 [particle] for example to convert pmc to int
19:37 [particle] set_i_p $I0, $P0
19:38 [particle] this calls the pmc's get_integer vtable function
19:38 [particle] $I0 = $P0.'get_integer'()
19:38 [particle] all pmcs inherit from default.pmc to get some common methods
19:38 [particle] and all vtable methods can be overridden
19:39 [particle] freeze, thaw, init, invoke, get_string, etc
19:39 [particle] additionally, pmcs can have attributes and methods
19:39 [particle] for example, the p6meta pmc has a 'register' method to register a class
19:40 [particle] so, you're not limited to use vtable functions in your pmcs
19:40 spinclad for get_attribute operation, does this go through the vtable?
19:40 [particle] in fact, the Exporter pmc (for namespace export) only uses methods, no vtable functions
19:40 [particle] (other than freeze/thaw)
19:41 [particle] get_attribute is a vtable function.
19:41 ruoso get_attribute meaning high-level object attributes?
19:42 [particle] meaning pmc attribute
19:42 [particle] pmc is an abstract data type. it defines an structure and an api
19:42 spinclad mid-level anyway; not necessarily high-level
19:42 ruoso let me rephrase
19:43 ruoso is get_attribute vtable function going to be used to fetch the attribute of some Perl 6 Object?
19:44 ruoso or that is never part of the HLL runtime...
19:44 spinclad yes, 'has $.x' translates to a pmc-level attribute
19:44 spinclad and accessing it to get_ and set_attribute
19:44 [particle] actually, get_attribute is a macro
19:45 [particle] something like SET_ATTR_ns_src(interp, SELF, src);
19:45 lde joined #perl6
19:45 [particle] sorry, GET_ATTR_ns_src(interp, SELF, tmp_ns_src);
19:45 spinclad (at C level?)
19:45 [particle] yes
19:45 [particle] this is converted to PMC *tmp_ns_src = exp->ns_src;
19:46 [particle] where exp is Parrot_Exporter *exp = PARROT_EXPORTER(pmc);
19:46 [particle] Parrot_Exporter is a c struct
19:46 [particle] pointer
19:46 [particle] obviously :)
19:46 [particle] i mean, exp is a pointer. uggh
19:46 ruoso so every PMC must have the same Parrot_Exporter struct format...
19:47 [particle] every Parrot_Exporter has the same format
19:47 [particle] this is for exporter.pmc
19:47 [particle] float.pmc has a Parrot_Float struct
19:47 ruoso so the attribute lookup is static...
19:47 [particle] the pmc header is the same struct everywhere
19:47 spinclad (i would say 'details, details', but some of the details at least matter for judging how things map between smop and parrot)
19:48 [particle] the pmc data segment is different, based on the attributes it contains
19:48 ruoso but the attribute-lookup-process is static, I mean
19:48 [particle] what do you mean by static?
19:48 ruoso meaning that if you have a Glib object, you need to make a proxy object that map the glib object attributes to pmc attributes
19:49 [particle] yes, then you do your access through the proxy
19:49 spinclad the glib object might be a single attribute
19:49 ruoso that's the major difference between parrot and smop
19:49 [particle] but it's not an incompatible difference
19:50 ruoso sure...
19:50 ruoso but it's the same difference smop has from perl 5...
19:50 ruoso one more level of abstraction...
19:52 ruoso in smop, the attribute lookup will be entirely delegated to glib
19:52 spinclad one difference i see: the RI for an object need not be found at a fixed slot in it; as long as at invocation time you have the object and its RI, you can invoke an operation of it
19:53 ruoso yes... and that's everything smop defines... not a milimeter more...
19:53 ruoso everything is delegated to the object itself, not a single static lookup....
19:54 ruoso (except for the RI, of course)...
19:55 spinclad as in haskell the type of an object need not be stored in it, and may be compiled away entirely
19:55 spinclad merely implicitly known throughout the code
19:55 ruoso that's where the one more level of indirection might buy extra room for optimization...
19:56 pmurias ruoso: i'm giving up on writing hash tests and hacking in labels to get rid of those stupid integers
19:56 ruoso pmurias++ heh
19:56 ruoso that's why it's called SLIME ;)
19:57 pmurias the target integer in capturize is relative forward :(
19:57 ruoso pmurias, yes.
19:58 icwiener joined #perl6
19:58 ruoso spinclad, for instance... in p6opaque, the REPR api returns other objects... but this objects will belong to the p6opaque "community", which means that they will know the internal format of p6opaque and navigate directly in it... but the interpreter doesn't know about it, so it is still completely dynamic...
19:59 ruoso in fact... the only way to get instances of the other types of the p6opaque "community" is by calling p6opaque REPR methods
19:59 pmurias ruoso: it's possible to that in parrot too
20:00 pmurias sometimes you will just end up having an extra layer of indirection to esacape the optimalisation
20:00 pmurias * escape
20:03 ruoso anyway... I think it doesn't matter if smop is superceded by parrot in the very near future... the experience of stressing the representation polymorphism is already fruitfull enough imho...
20:04 spinclad then in the interpreter either you pass around two things for the object (object and RI) or you put together one (p6opaque?) thing that refers to both
20:04 ruoso spinclad, actually every smop object either has a RI or is a RI
20:05 ruoso p6opaque implements the REPR api
20:05 spinclad 'has an RI': perhaps implicitly? does it have to be represented in its storage footprint?
20:06 ruoso spinclad, in smop, yes...
20:06 ruoso spinclad, I couldn't think on a way of doing it other way...
20:07 ruoso spinclad, http://www.perlfoundation.org/pe​rl6/index.cgi?smop_oo_bootstrap
20:07 lambdabot Title: SMOP OO Bootstrap / Perl 6
20:07 spinclad an int object, for instance:  when used in a community where its RI is known to be Int_RI (say), that could be supplied whenever an operation on it happens
20:07 spinclad and the int itself takes up just its 2^n bits
20:08 ruoso but how do you introspect?
20:08 pmurias ruoso: re superceded, do you plan on throwing away smop?
20:08 spinclad i.e. in the scope of my int $n
20:08 ruoso pmurias, not really... in fact I think smop will merge with p5 loop somewhere in a not-so-far future
20:08 ruoso and I think smop will be specially succesfull in the p5-p6 bridge
20:09 ruoso spinclad, hm... the thing is that in smop even the interpreter is a SMOP__Object*
20:09 spinclad introspection is just such operations, you supply the Int_RI (at least implicitly) and do introspection ops through it
20:09 ruoso spinclad, probably some optimizations could be done like that...
20:10 ruoso but the standard is that the object must be self-contained
20:11 pmurias spinclad: as i have it planned such optimalisations belong to the JIT
20:11 pmurias s/to/in
20:11 spinclad if by 'the standard' you mean the same as 'outside its community, e.g. the interpreter', i agree, it will need some wrapping then
20:12 ruoso yes... but inside p6opaque, for instance, the additional data that builds p6opaque is not SMOP__Object*
20:13 ruoso the objects in the same "community" can use the data as plain C structs...
20:13 spinclad agreed
20:13 ruoso spinclad, but a simple test like if (SMOP_RI(foo) == SMOP__NATIVE__int)
20:13 ruoso allows me to call C-level functions for native types
20:13 ruoso instead of high-level method calls
20:14 ruoso and that is how SMOP is bootstrapping its type system
20:14 ruoso by special casing the known responder interfaces
20:14 ruoso and using the high-level calling convention otherwise
20:15 ruoso for instance...
20:15 spinclad at that point, within the community, that '(SMOP_RI(foo) == SMOP__NATIVE__int)' constant-folds to 'true'
20:15 ruoso yes...
20:15 ruoso in smop_lowlevel.sm0p
20:15 spinclad and if you have to ask what its SMOP_RI is, you're not a full insider
20:16 ruoso if the object is SMOP__NATIVE__int, the destruction code recurses in the C stack, otherwise it uses CPS to call DESTROYALL on the object...
20:17 ruoso spinclad, although it's probably a good idea to always ask that, to avoid segfaults...
20:17 pmurias what is a good label sigil?
20:17 spinclad i see great potential to compile away overhead here
20:18 ruoso pmurias, ^\s*([A-Za-z]): ?
20:18 ruoso ah... you mean to use the label later...
20:18 ruoso can you use bare word?
20:19 pmurias ruoso: not really
20:19 ruoso and check for a label before assuming it's a constant identifier?
20:19 spinclad (another representation:  foo lives in a pair of variables/registers, $foo and ^$foo;  SMOP_RI(foo) -> ^$foo)
20:20 pmurias ruoso: i can only check for a label after assuming it's a constant identifier
20:20 [particle] can you use the colon?
20:20 ruoso spinclad, except that ^$foo means $foo.HOW which is something completely different...
20:20 spinclad (if all references to the latter in the code get constant-folded away, the register can go too)
20:20 pmurias [particle]: you mean $SMOP__SLIME__CurrentFrame.​move_responder(:foo,:bar); ?
20:21 ruoso I like that
20:21 [particle] yeah, that
20:21 spinclad sorry, i do mean the low-level SMOP_RI, not the high-level .HOW here
20:21 ruoso except that it looks like named arguments
20:22 ruoso but that's ok for sm0p
20:23 [particle] you can use `
20:23 [particle] that's reserved for the user, so not in any normal perl 6
20:24 ruoso spinclad, anyway... compiling away overhead happens all the time in smop... it happens by hand yet ;) but it does
20:24 ruoso and it's actually the way smop is bootstrapping the type system
20:25 spinclad (sure, it has to be, to break the meta-loop)
20:25 spinclad (the MOP loop)
20:26 ruoso spinclad, have you seen the SMOP slides?
20:26 pmurias ruoso: :label or `label?
20:26 spinclad i read at least part way through them, sometime in the spring
20:26 ruoso pmurias, `label... :label is named arguments (although sm0p doesn't support it)
20:27 ruoso spinclad, please, consider taking another look, after this conversation it will probably have another meaning ;)
20:29 spinclad sure.  i also got partway through the wiki pages but got bogged down by a slow browser... i'll read them again in links (much easier i expect)
20:31 pmurias spring? are the SMOP slides so old?
20:34 spinclad unless i misremember, which is not at all unlikely, i thought there was some slide set early on.  please remind me of a best slide set's URL?
20:34 spinclad might as well read afresh or anew, whichever it be.
20:35 spinclad (misc/sm0p/README could use a pointer to the wiki at least)
20:35 pmurias ruoso: what was the slides url? ;)
20:35 ruoso pmurias, the wiki has a link
20:36 pmurias spinclad: misc/sm0p/ is not smop
20:36 ruoso spinclad, the sources are in v6/smop
20:36 ruoso pmurias, moving misc/sm0p to v6/smop/sm0p is probably a good idea
20:37 * pmurias is trying to get label to work
20:37 spinclad thanks
20:38 spinclad (i've been in there before, and keep forgetting.  forget me own head next.)
20:52 pmurias i can only one label per q:sm0p to parser, argh
20:53 pmurias even though i have <node_with_label>*
20:58 pugs_svn r21307 | ruoso++ | [smop] $p6opaque.^!methods() works. "push" and "shift" are not implemented yet, but the test metaclass already tries to call the method. three values leaking atm.
21:00 pmurias i'll attempt labels in the near future again (tommorow likely), in the meantime if anybody is intrested feel free
21:04 * ruoso home &
21:12 donaldh joined #perl6
21:12 pugs_svn r21308 | pmurias++ | [smop] primitive label support
21:12 pmurias got something working somehow...
21:12 pmurias sleep&
21:39 jan__ joined #perl6
22:54 armagad joined #perl6
23:02 yewenbin joined #perl6
23:19 Alias_ joined #perl6
23:39 nothingmuch joined #perl6

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

Perl 6 | Reference Documentation | Rakudo