pugscode.org/ | nopaste: sial.org/pbot/perl6 | ?eval [~] <m oo se> | We do Haskell, too | > reverse . show $ foldl1 (*) [1..4] | irclog: irc.pugscode.org/
Set by diakopter on 11 July 2007.
pugs_svn r19423 | cosimo++ | Testing commit bit 00:25
pugs_svn r19424 | lwall++ | Defined .bytes, .codes, .graphs, and .chars 00:48
r19424 | lwall++ | Defined samecase and samebase
pugs_svn r19425 | cosimo++ | Refactored substr.t tests into S29-functions\str\substr.t 00:57
pugs_svn r19426 | lwall++ | Add svn props to substr.t 01:07
r19427 | lwall++ | [STD] added ugly p5=> operator 01:08
pugs_svn r19428 | rhr++ | [Unicode.pm] implement samebase 01:26
TimToady 'course, samebase is rather misnamed, should really be sameaccent... 01:43
rhr transfer_grapheme_extenders hey nobody will ever use it anyway :) 01:47
araujo hello 06:40
what the '|' does inside a subroutine call subcall(|arg) ? 06:41
TimToady it binds the entire Capture to the variable 06:50
araujo thanks TimToady 07:02
TimToady, so, it's a way to say ... pack all these variable into this one variable? 07:13
er, values
TimToady it's a way to defer deciding which of the arguments bind to scalar parameters and which to list parameters 07:18
araujo I see
TimToady for instance, if you want to pass the exact same arguments off to some other function, but you don't know what the exact signature of the other function is. 07:19
it's kinda like call-by-name but on the whole argument list rather than the individual arguments
araujo ah, get it 07:20
I was checking some functional-like code, so now it makes sense
pugs_svn r19429 | ruoso++ | [smop] Updating the roadmap. The Stage 1 Language for SMOP will be called S1P, readed as "swamp". 10:55
moritz_ ruoso: is the plan to emit C code from kp6 that uses smop as a runtime lib? 10:58
ruoso moritz_, S1P is that... 11:00
moritz_ ruoso: ok
ruoso but I expect it to be used as a interpreter in the full Perl6-on-SMOP
actually, s1p will be used to write the built-in types 11:01
because the built-in types will have to be stack friendly already
after that, the best will be to make KP6 to generate a SMOP-Compatible C AST Dump of the parse 11:02
moritz_, if you take a look at the roadmap you'll see what I mean 11:03
moritz_ ruoso: ok
ruoso I've been wondering, SMOP will require each "code block" to build the stack nodes when calling it... how much will it cost in performance terms? 11:43
is there something that can be simplified or changed to create more room for optimizations?
ruoso are lvalue subroutines return values always evaluated as Scalar? 12:34
S06 seems to imply that 12:35
by saying that a tied return would have to implement STORE and FETCH
and actually... thinking better... it's the only thing that makes sense... 12:36
pugs_svn r19430 | ruoso++ | [smop] As every operator in Perl 6 is a multi sub, lets put multi earlier on the ROADMAP... 13:02
pugs_svn r19431 | ruoso++ | [smop] Detailing a little more the ROADMAP, effectivelly, multi sub is a very important feature for the bootrap 13:13
ruoso lunch &
root____1 so quiet... 14:06
pbuetow root____1: yes 14:10
pugs_svn r19432 | ruoso++ | [smop] smop_lowlevel.h is an optional API (not included by smop.h) for ResponderInterface implementations that wish to use the same lowlevel management (libc malloc, refcount gc and pthread_rwlock) as the default smop objects. smop_lowlevel will use Continuation-Passing-Style for 15:56
..the DESTROY phase of the objects.
ruoso keeps getting happier and happier on how things are fitting together in SMOP 16:00
CPS for DESTROYALL made me smile :)
[particle] me too :) 16:03
ruoso feels that he may be able to learn lisp now ;) 16:04
[particle] sure, while porting it to your new shiny vm :)
ruoso heh
pugs_svn r19433 | ruoso++ | [smop] moving src to old_src, in order to have a fresh start... 16:51
mncharity I'm going to attempt to quickly create a ruby-based backend for kp6, in the hope of its giving us a bootstrapped kp6 which is usably fast. Basically by using ruby oo directly, rather than the p5 backend's much heavier approach. Your questions, comments, and assistance would be most welcome. 17:10
pugs_svn r19434 | ruoso++ | [smop] Starting to port YAP6__CORE__Value* to SMOP__Object*, lowlevel management ported... tests missing...
lambdabot mncharity: You have 2 new messages. '/msg lambdabot @messages' to read them.
ruoso mncharity, I wouldn't expect to be able to implement Perl 6 semantics on ruby oo 17:11
avar He can probably use ruby dispatch, no? 17:13
mncharity ruoso: is there some specific aspect you expect to be problematic? it's my hope that it might be 'good enough' for the bootstrapped kp6, and then for supporting the next kp6 task of working on the grammar. no? 17:13
avar mncharity: Just implement add_method and the rest of the MOP early:) 17:14
mncharity lol
ruoso avar, yeah... and end up with another runtime on top of ruby's runtime
just like kp6 does
does ruby support prototype objects? or anon-classes? 17:15
ruoso doing it without anon-classes will be very hard 17:15
TimToady you get an anon-class in Ruby every time you do a mixin
though I don't know if there's a way to declare one from scratch 17:16
pmurias multi-inheritance? 17:17
avar yes
pmurias mncharity: why do you prefare ruby to perl5?
mncharity an anon-class is automagically created when you do something which requires it. like some_object.instance_eval("def new_method()...end") 17:18
pmurias * prefere
argh, prefer
mncharity no multiple inheritance unfortunately, but there is enough introspection to fake it dynamically at runtime (eg, when a method gets added, scurry around adding it to derived classes as needed) 17:19
ruoso today really believes that any attempt to implement the Perl6 object system in some non-p6-oriented already existing object system will end up with too much emulation and probably being as slow as kp6
mncharity an alternate approach is there's a hack to be able to mixin classes rather than modules, but it's a reach-down-into-the-C and noone-really-uses-it-in-production kludge. 17:20
pmurias ruoso: if you do caching you pay the price only when you add a method
mncharity ruoso: so re, does ruby support prototype objects? or anon-classes? yes
ruoso I mean... I'm really not stopping you from doing it, but what I'm saying is that from what I've seen so far, you'll end up building a very complex emulation at some point that will give you very poor performance... 17:22
like, do ruby support continuations and coroutines? 17:23
mncharity re MOP and runtime, I was thinking of doing one level of indirection to handle namespaces - eg, method c_foo() returns the &foo Code object. Similarly for methods, etc. ruby oo is faster than p5 oo, so it's not much of a hit.
ruoso multi dispatch?
lazy evaluation of context?
pmurias ruoso: ruby does continuations
(even GNU C does them ;) 17:24
mncharity one might be able to take the MOP approach, and that's something to explore, but the other I know works and gives acceptable performance (from redsix), and I'm afraid I don't really understand the mop yet, so... something for version 2. :)
re why ruby instead of p5, ruby oo is faster than p5 oo, and I hope close enough to p6 oo to allow it to be used more or less directly, rather than p5's using it to implement an additional layer. 17:26
ruoso mncharity, as en exercise, take some codes from the kp6 tests 17:27
and try to figure out which ruby code would execute it
but without cheating differently for each test
if you cheat, the cheat must be there for every case
mncharity re multi dispatch, no, there are libraries, but not quite the right thing, but they are small, because the dynamic flavor of ruby makes it easy to implement. my feeling is the risk there is low. i'm not sure kp6 even needs multi to bootstrap? nor for grammar. but it would be nice to have for the prelude. 17:28
[particle] sounds like test-driven development to me
ruoso [particle], I mean, exercising the code before trying to write a full kp6 backend 17:29
mncharity not sure if kp6 bootstrap uses multiple inheritance either.
ruoso s/the code/the ruby code/
mncharity, does ruby have roles? if not, you must do it with MI...
mncharity re lazy, they're libraries. not sure how critical for kp6 bootstrap. ruby continuations, while my fuzzy impression is they are not up to smalltalk/scheme standards, are real continuations, not exceptions, like C's. 17:30
(it would be very very nifty if gnu c did continuations... and there are (or have been) spagetti stack hacks using it... but nothing very widely used... no?) 17:32
mncharity ruoso: redsix used the approach described, and was passing... some not large but non-trivial percent of the pugs t/ tests. 17:33
ruoso well, I'm just playing devil's advocate here 17:34
mncharity so the project risks don't seem all that great, given the limited objectives of fast bootstrapped kp6, and supporting just the next step using it (grammars).
ruoso: very much appreciated :) 17:35
mncharity re risks... redsix didn't do signature/capture. so getting enough of them for kp6, both in development pain and performance impact, seems a biggy. 17:36
ruoso mncharity, one thing that might help would be to bootstrap mp6 in ruby before...
as a great part of kp6 is compiled by mp6 17:37
pmurias ruoso: i don't think that would help
ruoso I think if you're planning to bootstrap kp6 it will...
mncharity ruoso: ooo, please go on. my understanding of mp6 is minimal. what would doing that buy?
pmurias s/would help/be a good idea/ 17:38
ruoso the kp6 grammar is compiled by mp6, at least a big part of it...
avar 1/w 25
ruoso mncharity, and also, mp6 doesn't implement a runtime on top of p5 as kp6 does... which is closer to what you want 17:39
pmurias ruoso: kp6 can also compile it
ruoso pmurias, yeah... but it is still compatible with mp6... 17:40
and if mncharity is planning to use the ruby runtime as is, mp6 is closer
while kp6 enforces the "kp6" runtime 17:41
pmurias but he will need to port it over to kp6 for the compiler to bootstraped
* bootstrap
mncharity i'm not sure the closeness is an issue. kp6 provides an ast, and the backend-specific emitter can do what it pleases. though it may have to add an ast munging pass if it needs any non-local information which can't be gathered as part of the emit. 17:42
pmurias mp6 is less pleasant to work on 17:43
mncharity re 'kp6 can also compile it', hmm, there's a point. so we know mp6 can compile the grammar, because it gets used all the time for that, yes? are we sure kp6 can compile its grammar?
pmurias the bootstraped version sort of parsed stuff 17:45
mncharity "sort of"?
pmurias mncharity: there was one bug
in the bootstraped parser 17:46
ruoso pmurias, it doesn't seem to be compiling right now
or the makefile is broken
pmurias mncharity: do you know how to translate := into ruby 17:48
?
mncharity are mp6's requirements from a backend a subset of kp6's? wrt supported p6 language features
pmurias mncharity: yes 17:49
ruoso pmurias, kp6-kp6 seems to be completely broken right now
it doesn't even starts compiling anything
pmurias mncharity: but a mp6 ruby backend won't give us anything
ruoso: perl Makefile.PL --target=KP6-BOOT? 17:51
ruoso ah... ok... I was trying KP6-KP6
as the Makefile.PL says
mncharity re :=, maybe = (s_x = whatever vs s_x.assign(whatever)), maybe s_x.bind(whatever). not sure. don't remember if redsix's Cell (box? - Container-like-thing) did :=. 17:53
ok, redsix did = for := and ::=, s_x.assign(whatever) (actually (s_x)._(whatever)) for = 17:56
ruoso pmurias, perl script/kp6 -Cperl5rx --noperltidy -o compiled/perl5-kp6-kp6/lib/KindaPerl6/Ast.pm src/KindaPerl6/Ast.pm 17:58
this is failing
mncharity well, xS rather than s_x. new cleaner encoding for the backend, as being pretty for hand writing the code doesn't matter anymore.
pmurias mncharity: i use $lvalue = $rvalue for assignment in perl5v6 and bind_op("$lvalue",\$rvalue) (from Data::Bind) for :=
mncharity right, so that's identical. 17:59
re failing, :(
ok, so that's a risk I didn't take seriously enough. that bootstrapped kp6 might not be working at the moment. 18:01
pmurias mncharity: i don't think it's broken by anything serious 18:03
just minor bitrot
ruoso: it worked here 18:04
pugs_svn r19435 | pmurias++ | [perl5rx] fixed DISPATCH.new into ::DISPATCH
pmurias no,it's still compiling here :(
mncharity :) ^H :( 18:05
ruoso mm... in fact it worked now
mncharity ^H :)
ruoso I think I had something borked in my working dir 18:06
but if you try to recompile it it faile
anyway... I'm away from kp6 for too much time to understand it :) 18:07
mncharity re 'but if you try to recompile it it faile', so the 'perl script/kp6 -Cperl5rx --noperltidy -o compiled/perl5-kp6-kp6/lib/KindaPerl6/Ast.pm src/KindaPerl6/Ast.pm' runs, but the resulting compiled Ast.pm breaks kp6? 18:08
ruoso no.... I've tried cleaning the kp6-kp6 files and calling make again
it failed somewhere else
but it seems like a Makefile issue 18:09
pmurias ruoso: doing make forcerecompile;make 18:10
mncharity: i think someone fill will have fixed when you have the backend complete enough 18:11
ruoso pmurias, I think the makefile depends on files that are in the compiled dir
i mean
I understand that kp6-kp6 depends on the kp6-mp6 files for the bootstrap
but if I remove the compiled/ ... kp6-kp6... it should rebuild correctly 18:12
mncharity hmm, ok. so kp6-on-mp6 can compile kp6, and the result is known to run small bits of code. has the result done more? compiled any of the kp6 files? passed the kp6 test suite?
re 'someone will have fixed', right. good point.
ruoso hmmm make test with target kp6-boot is a noop 18:13
pmurias ruoso: the bug wrong parsing of my broke almost every test
mncharity oky. well, doing much of a ruby backend seems like it would only take a day or two. if not, something unexpected is going on, the finding of which could be worthwhile in itself. so I'm still inclined to make it this weekend's project. and if it turns out kp6 has bootstrap issues, finding them could be useful too. and no doubt any will get resolved. no? 18:28
s/no?/sound plausible?/ 18:29
pmurias yes
ruoso mncharity, one thing I know for sure, bootrapping exercises always fixes a lot of bugs ;) so, yes, it's a very usefull thing 18:30
mncharity re 'bootrapping exercises always fixes a lot of bugs', sigh, right. :) 18:31
ok, many thanks for all the help bashing on the idea.
it's appreciated. 18:32
TimToady It's particularly useful if you discover missing tests
ruoso oh yeah... I probably wrote like 10 or 15 new test cases when bootstrapping kp6 18:33
as I like to say about TTD
TDD
a bug report is only successfull if it includes a test case reproducing the bug
mncharity re missing tests, ah, ok. (wistful chant "don't hit any kp6 bugs, don't hit any..."). re successful, modulo a quibble vis heisenbugs, understood. 18:37
mncharity I'm hoping to simply be able to do a ruby version of Emit/Perl5.pm. and otherwise not reach into kp6, or do anything different wrt kp6 than the existing p5 backend does. effort/risk would seem to shoot up dramatically if that proves not to be the case. 18:42
hmm, that's a good clarification of objectives. a new, fast backend, no less capable than the existing p5 backend. if it turns out that's not sufficient to fully bootstrap, well, that's a separate project. 18:44
with quite different skill requirements, flavor, etc. 18:45
skids wonders if it is his brain broken or Proxy accessors, they return <obj:Proxy> rather than call FETCH 19:01
pugs_svn r19436 | ruoso++ | [smop] Added a goto method to the stack. It will be used to implement Continuation-Passing-Style
ruoso home & 19:57