pugscode.org/ | nopaste: sial.org/pbot/perl6 | pugs: [~] <m oo se> (or rakudo:, kp6:, smop: etc.) || We do Haskell, too | > reverse . show $ foldl1 (*) [1..4] | irclog: irc.pugscode.org/
Set by TimToady on 25 January 2008.
ruoso pmurias, hi 00:40
meppl good night 00:50
ruoso meppl, good night 00:51
meppl ;) 00:53
ruoso pmurias, I'm not sure how you're going to be able to differentiate public methods from private attributes 00:58
ruoso pmurias, but just a sanity check... 01:05
you're thinking about a special "metadata" key in the storage hash that would contain isa, does, method definitions, attribute definitions? 01:06
or are you planning on doing a simple class-based implementation?
pmurias, I think I understand how you mean to implement it 01:07
pugs: say Int.HOW 01:09
p6eval pugs: OUTPUT[<obj:Class>␤]
ruoso pugs: say 1.HOW 01:13
p6eval pugs: OUTPUT[^Int␤]
ruoso sa 1.WHAT
pugs: say 1.WHAT 01:14
p6eval pugs: OUTPUT[Int␤]
ruoso say Int.WHAT
pugs: say Int.WHAT
p6eval pugs: OUTPUT[Int␤]
ruoso pmurias, I've been thinking too much prototype-oriented in the last few months... 01:15
pmurias, but one way or another, it seems you also need to have a "$.what" in the p6opaque structure 01:18
pmurias, actually... I can't really think how you can eliminate any of the items in www.perlfoundation.org/perl6/index....ementation (besides the optimal_* stuff) 01:20
lambdabot Title: SMOP p6opaque Implementation / Perl 6, tinyurl.com/2z5spt
ruoso pmurias, I've updated the p6opaque wiki description... take a look at www.perlfoundation.org/perl6/index....ementation 01:49
lambdabot Title: SMOP p6opaque Implementation / Perl 6, tinyurl.com/2z5spt
pmurias ruoso: hi 03:08
i suppose i should get to sleep now though as it's 5 in the morning and i have been watching movies all night 03:09
pugs_svn r21435 | fglock++ | [PCR] added unicode property 'isLr' 11:13
pugs_svn r21436 | fglock++ | [PCR] better error message 12:00
pmurias ruoso: hi 12:26
what are the proto_storage keys? 12:28
should it be a scalar instead of a hash 12:32
ruoso pmurias, yes... a scalar... sorry 14:03
ruoso pmurias, the point is that all of the elements in proto_storage are actually required by Perl 6 features 14:10
pmurias ruoso: and what is the difference between isa and does? 14:23
ruoso role composition is different from class composition
pmurias soup& 14:24
ruoso pmurias, remember that the proto_storage has no caching at all
so every information needed for a rebuilding the composition need to be available 14:25
pmurias i wouldn't bother about caching and other optimalisations now 14:39
does only deals with runtime role composition? 14:42
pugs_svn r21437 | fglock++ | [PCR] fixed character-class name rule 14:55
pugs_svn r21438 | fglock++ | [PCR] grammar tweak 14:59
pmurias japhb: got my copy of OpenGL Superbible today ;) 15:30
pugs_svn r21439 | fglock++ | [PCR] some unicode fixes 15:33
pmurias @seen fglock
lambdabot I haven't seen fglock.
moritz_ perlbot, seen fglock
japhb pmurias: good! 15:39
pmurias: let me know if you have questions, there's a chance I might be able to answer ... 15:40
[particle] moritz_: it's likely that TimToady, pmichaud, and i won't be available for perl6-soc this week due to oscon 16:47
tomorrow at about that time has a whole bunch of perl 6 talks going on
moritz_ [particle]: ok, I'll bore Auzon++ on my own then ;-) 16:48
[particle] ):
:) even
Auzon .oO(oh no!)
moritz_ Auzon: or, if you have no questions yet, we might drop it 16:49
moritz_ (assuming you write a report for week 8) 16:50
Auzon Yeah, I'll do that real soon now. Last week was pretty bad :-; 16:51
:-/
moritz_ happens from time to time 16:52
moritz_ Auzon: so do we meet tomorrow? 16:55
Auzon No, I don't see a need 16:56
you'll be here for questions, right?
moritz_ wrote Perl6::Str over the weekend, other than that no time/motivation for hacking
Auzon: ok, and yes
Auzon Sounds good :)
[particle] Auzon: i have a paper that may help you... sorry i didn't think of it earlier
www.benderrbt.com/Ambiguityprocess.pdf
lambdabot Title: The Ambiguity Review Process
[particle] it's a great reference for writing spec-based tests 16:57
pugs_svn r21440 | lwall++ | [STD] now does reduce tokens correctly; we now use a variable length
r21440 | lwall++ | string as pattern cache key to parse zillions of reduce operator
r21440 | lwall++ | tokens without blowing up TRE
r21440 | lwall++ | [t/spec] various bugs found by STD. We now parse >80% of t/spec.
Auzon Thanks [particle] :)
[particle] TimToady++ # nice progress! 16:58
moritz_ TimToady: it seems that STD can't parse 'my @array[10]' 17:09
[particle] does that create an array of size 10? 17:10
moritz_ yes
moritz_ current version of trystd fails after use v6; in most test files 17:19
ruoso pmurias, yes... does is only about runtime role composition (which other type there is?)... 17:25
moritz_ class Foo does Num { ... }? 17:26
moritz_ from a language level POV 17:26
ruoso moritz_, yes... but in the end it translates as a runtime composition... 17:29
moritz_, unless the class composition happens at compile time (which I doubt) 17:31
moritz_ ruoso: why not? in clas {...} the ... is executed at compile-time as the body of a method of the meta class 17:32
moritz_ and class foo does bar {...} is the same as class foo { does bar; ... } 17:32
ruoso moritz_, "compile-time"? are you sure? doesn't it require a BEGIN to be executed at compile-time?
moritz_ perlcabal.org/syn/S12.html In either case, the code represented by ... executes at compile time as the body of a method of the metaclass, ... 17:33
lambdabot Title: S12
ruoso moritz_, that's unexpected 17:35
how does that relate with bytecode?
pmurias class Foo does Bar {} must be done at compile times, as classes can be closed at compiletime 17:38
moritz_ oh, but compile time is also just run-time of a BEGIN-block 17:39
ruoso anyway... in the end that translates as runtime operations...
in fact... that's one point I'm not sure on how you're goin to be able to actually split compile-time/run-time 17:40
meaning...
ruoso a perl module in bytecode will have limited functionality 17:40
a Perl 6 module that can use any feature can only be stored in some "bytecode" format, as long as this bytecode format is actually a freeze of the machine state 17:41
pmurias bytecode meaning a storage format in general in this case 17:42
ruoso unless you consider you have a multi-pass compiler and your bytecode is just a first stage of the compilation 17:43
pmurias i think freezing the vm state is a good option
ruoso pmurias, it's not a good option for modules in general
it is only usefull as to freezing an entire application
pmurias we can only freeze a part of the vm state 17:44
ruoso can we? 17:46
is it possible to guarantee a consistent state?
pmurias consistent state - explain please 17:46
ruoso pmurias, dependencies and stuff 17:47
pmurias i'm assuming the freezing of the state is done in a relatively smart way, not just dumping the memory 17:48
it shouldn't be significatly more complex than a normal compile 17:49
and likely easier than the way kp6 collected side effects from BEGIN blocks 17:51
ruoso: dependencies - you are refering to the other modules used by the one we are compiling, we can look where the things which are part of the vm state come from and emit code to load them 17:53
ruoso pmurias, and the way we can't really know what modules do in terms of side-effects 17:54
pmurias ruoso: they can either export stuff, or do thing in BEGIN {...} blocks 17:55
* things
ruoso which means that the module can do absolutely anything
and that this side-effects might be part of the state required after the compile-phase 17:56
moritz_ ruoso: they can do very much. Like exporting grammar rules ;-)
ruoso yes...
moritz_ ruoso: but the general perl 6 design favors pre-compiled modules, iirc
ruoso yes... but it doesn't explain how to make the compilation state mergeable with other compilation states 17:57
pmurias ruoso: my carefull coding ;)
* by
ruoso I'm not sure that is possible...
it's the same reason perlcc doesn't work very well
pmurias side affects like io happen at compile time
ruoso pmurias, side effects like changing the namespace 17:58
pmurias we can serialise this
one
pmurias i could start a mockup compiler to shake out the issues 18:00
pmurias and if other will be willing to help it might grow into a real one (as at least i need a vaguely decent perl6->perl5 one) 18:02
ruoso pmurias, it would be even more interesting to see how that relates with the SMOP runtime 18:05
pmurias ruoso: i think it would be mostly runtime independent, as after the parsing the namespace and the lexical scope will be traversed and everything found will be serialised by the emitter 18:08
ruoso pmurias, I don't really see how it won't be specific for the runtime where the compiler is running on
moritz_ do you have an example of how a module can change the namespace (I think that example popped up earlier) 18:09
pmurias the things to be serialised are perl6 objects 18:10
moritz_ rakudo: say (1, 2, 3).perl 18:13
p6eval rakudo 29681: OUTPUT[[1, 2, 3]␤]
ruoso pmurias, I'm not sure if all .perl serializations are possible as implementation-independent 18:15
perl6: class Foo { has $!a; has $.b; has %.c }; say Foo.perl;
p6eval elf 21440: OUTPUT[Parse error in: /tmp/npf6EZ3mui␤panic at line 1 column 12 (pos 12): Missing right brace␤WHERE: class Foo { has $!a; has $.b; has %.c }; s␤WHERE: /\<-- HERE␤ STD_red/prelude.rb:99:in `panic'␤ STD_red/std.rb:255:in `_block_rest'␤ STD_red/std.rb:242:in `block in
..block'...
..pugs: OUTPUT[::Foo␤]
..rakudo 29681: OUTPUT[Method 'perl' not found for invocant of class ''␤current instr.: '_block11' pc 24 (EVAL_13:15)␤]
ruoso perl6: class Foo { has $!a; has $.b; has %.c; }; say Foo.perl;
p6eval elf 21440: OUTPUT[Parse error in: /tmp/kDQ4jXyKxY␤panic at line 1 column 12 (pos 12): Missing right brace␤WHERE: class Foo { has $!a; has $.b; has %.c; }; ␤WHERE: /\<-- HERE␤ STD_red/prelude.rb:99:in `panic'␤ STD_red/std.rb:255:in `_block_rest'␤ STD_red/std.rb:242:in `block in 18:16
..block'...
..pugs: OUTPUT[::Foo␤]
..rakudo 29681: OUTPUT[Method 'perl' not found for invocant of class ''␤current instr.: '_block11' pc 24 (EVAL_12:15)␤]
moritz_ ruoso: the class name holds the proto-object, not the class definition
ruoso: I don't know if that's accessible at all
ruoso it's even worse than, how that relates with prototype-based and class-based support 18:17
pmurias ruoso: yes, some object might require a bit more reflection that it's currently speced but none major smop redesignes would be nessesary 18:19
ruoso anyway... that's one reason I'm not really concerned about splitting compilation and runtime
ruoso I think specific compiler options would allow forbidding any side effect at compile time to allow a splitted compile-time 18:20
pmurias it's best to push as much as possible to compile-time 18:22
ruoso I think we would need a "shared object" compilation 18:24
pmurias like in c shared object files 18:25
pugs_svn r21441 | moritz++ | [spec] one more test for @list.perl
ruoso and to compile a "shared object" some restriction are set
no-side-effects might be one of them 18:26
pmurias modules are noops withought side effects 18:28
ruoso pmurias, no side-effects at compile-time I mean, not at run-time 18:36
pmurias ruoso: modules have to export stuff at compile-time as they change extend the lexical pad 18:37
ruoso pmurias, this specific compiler option could process the "export" as something specific to be executed at "use" time 18:38
masak pugs: class A is B {}; class B is A {} 19:45
p6eval pugs: RESULT[undef]
masak I guess there should at least be a warning for that... 19:46
moritz_ unless the implementation deals properly with it 19:47
masak moritz_: you mean it is allowed in Perl 6?
moritz_ masak: dunno
masak moritz_: I wouldn't allow it, if I were in charge :) 19:47
ruoso moritz_, class A is B {}; is a statement that requires "B" to exist... 19:49
masak moritz_: well, it does exist... later in the code
moritz_ ruoso: that's what forward declarations can be used for
class A {...}; class B is A {}; class B {}; 19:50
masak ruoso: what are forward declarations? 19:50
masak ruoso: oops 19:50
ruoso Perl 6 doesn't really have forward declarations
masak moritz_: but do I have to forward declare?
ruoso it has declaration and "is also" declaration
class A {...}; class B is A {...}; Class A is also {...}; 19:51
moritz_ class A is also { is B; }
masak moritz_: it seems to me that the compiler would just have an 'overview' over the whole file, and that I could declare classes in any old order 19:52
moritz_ masak: I think for some cases the compiler needs to know if an identifier is a sub name or a type name 19:53
masak moritz_: ah. then a bug report of mine for rakudo the other day was wrong 19:54
ruoso moritz_, that's again a point where compile-time × runtime gets really confusing...
moritz_ masak: I'm not sure, though
masak I reported that `class A is B {}; class B {}` didn't work
moritz_ yes, I remeber
ruoso the runtime is the one that can emit a warning about a circular class hierarchy
masak lambdabot: ask TimToady is `class A is B {}; class B {}` allowed in Perl 6? 19:55
moritz_ ruoso: but again, from a language POV, inheritance is done mostly at compile time
masak @ask TimToady is `class A is B {}; class B {}` allowed in Perl 6?
lambdabot Consider it noted.
masak @thanks
lambdabot you are welcome
ruoso moritz_, but what is the language without the runtime? 19:56
the AST?
moritz_ ruoso: I don't understand your question. The backend is free to do whatever it wants, as long as user visible the runtime/compiletime distinction looks as specced 19:58
ruoso moritz_, I mean, how can the compiler check wtf is B without the runtime? 19:59
moritz_ ruoso: well, class declarations happens at compile time
ruoso: so it knows at compile that B is actually a class
ruoso: and 'class A is B' also happens at compile time 20:00
ruoso so B must be *loaded* and not only *compiled*
which makes the difference between runtime and compile-time very hard 20:01
moritz_ why? loading happens with 'use', and 'use' happens at compile-time again 20:01
ruoso but you need to be able to introspect B when compiling A... which means that you're in runtime already for a long time, and just compiling/loading more modules 20:03
just like p5
moritz_ so the compiler needs access to the runtime libs 20:04
that can be done, I think
and needed anyway for BEGIN blocks
ruoso so we end up with a confuse distinction of compile-time × run-time 20:06
just as we have in p5 20:07
moritz_ not confused, mixed ;-)
pmurias the compile-time is the compilers run-time
moritz_ bascially use and BEGIN promote run-time to compile-time, and eval() does it the other way round
pmurias moritz_: eval is still run-time 20:08
pmurias or a different compile time if you view it from a different perspective 20:08
moritz_ pmurias: yes, but you have a compile-time phase in an eval()ed string 20:09
ruoso just like p5
moritz_ aye 20:10
pmurias eval is not nice
ruoso evil eval
zamanfou is now away: In the rain my tears are forever lost.
ruoso zamanfou, can you please remove this f* away notice? 20:11
I have a strong feeling that Perl 6 will require a very p5-like approach to modules initialization... 20:12
masak ruoso: in what sense?
ruoso masak, in the sense that it will be very very hard (if not impossible) to compartimentalize each module's initialization... you'll have a complete state of your interpreter, and that's very hard to serialize or to generate a bytecode of some form... 20:13
moritz_ except that Perl 6 allows modules to be compiled only once (as opposed to perl 5)
I don't say it's easy to do, though
ruoso the only possibility I see ATM to support that is a strict "shared object" compilation mode which denies any side effect at compile-time and defers "exports" to be run at "use time" 20:14
moritz_ the rakudo folks are working on that now (pre-compiling modules)
ruoso: it's just specced that side effects like IO from modules can be ignored by the compiler 20:16
so a BEGIN { say "hi" } in a module that is used in script might have no effect at all if you compile and run your script
ruoso moritz_, the problem is all the state-building that can be done at compile-time 20:17
ad-hoc modifications of the namespace
intialization of native libraries
masak ruoso: could you give a concrete example? 20:18
ruoso class CSVGtkTreeModel does GtkTreeModel {...} 20:19
masak how is that a problem?
ruoso masak, for that to be evaluated it needs a GtkInit call 20:20
pmurias GtkTreeModel is a C class
masak aha
pmurias native classes need a custom hook 20:22
ruoso reads custom hook as XS 20:23
ruoso hides
ruoso and you always have the modules that change the grammar globally (including for the eval'ed strings) 20:25
moritz_ I don't think you can change the grammar globally (ie not for modules in different files) 20:26
ruoso anyway... even then there are a lot of side effects... 20:27
pmurias you can only change it lexicaly (unless you beat the compiler to a pulp with unspecced evils)
ruoso pmurias, that doesn't seem very unlikely 20:28
pmurias shower& 20:29
pmurias ruoso: re custom hooks, i meant the future XS replacement will have to make sure native libraries get appropriatly serialized 20:44
ruoso pmurias, which basically means they will not be initialized at compile time or that they will be intialize twice, or else we have something like p5 20:49
(the other option is still to have the special "shared object" compilation option)
moritz_ I think in the general case it needs to be initialized twice, and perhaps uninitialized once 20:50
ruoso moritz_, and then the question is... how do you guarantee that at the second time you have the exact same state you had at the other time? 20:51
moritz_ ruoso: I don't think you can
pmurias ruoso: i guess the will be initalized twice
* they
moritz_ ruoso: if your runtime looks up class definitions in a database, and the database changes between compile time and run time, you're basically screwed 20:52
ruoso moritz_, the changes can be more subtle than that 20:53
pmurias but it's your fault
ruoso you would have something as sensible as c binary dependency
pmurias you mean sensitive? 20:54
ruoso yeah yeah...
that one ;) ;)
pmurias those are tricky issues, but the p5 way is unacceptable 20:55
ruoso I think the "shared object compilation with no compile-time side effects" might be a solution
pmurias compile-time side effects are unclear 20:56
pmurias their definition is 20:56
the C(++) compilation model is extremely bad, so being simpilar to it is likely a warnings sing 20:57
* warning
i'm opposed to having a seperatly and non-seperatly compiled modules 20:59
pugs_svn r21442 | fglock++ | [PCR] unicode fixes 21:14
ruoso home & 21:39