Pugs t-shirts www.cafepress.com/pugscode | Pugs 6.2.9 released | pugscode.org | pugs.kwiki.org | paste: sial.org/pbot/perl6 | www.geeksunite.net
Set by stevan on 15 August 2005.
stevan geoffb: ping 01:50
geoffb stevan, pong 01:56
well gee, I was a little slow in replying, but not THAT bad . . . 02:17
stevan LOL
sorry geoffb was doing $work
revdiablo: PIL and no class support
I head iblech say that too
geoffb nodnod 02:18
stevan but I know little more than that
it did not have multimethod support until very recently either 02:19
geoffb oh, do tell! :-)
stevan iblech asked me about a multimethod for the JS metamodel
i hacked one which dispatched based on arity
it was total crap, but just to get things started
then autrijus came in and added it to PIL 02:20
but all it really did was just allow 2 things with the same name IIRC
geoffb So MMD is broken in PIL1 . . . what about PIL2? Or is PIL2 not even ready to ask that question? 02:21
stevan I think it is not broken so much as not directly addressed by PIL1
geoffb fair enough 02:22
and PIL2?
stevan I am not sure 02:23
I think only autrijus knows that :)
geoffb fair enough. :-)
stevan I think MMD will likely not be addressed in PIL2 though
other than to allow 2 things with the same short name
because how it is done is really somewhat of an implementation detail for the runtime
geoffb The backend is expected to call into the OOMM for that, yes? 02:24
stevan geoffb: no descision is made as to if the MM will handle that or not
geoffb wheee
stevan I tend to think that given the existence of multi subs there is little need to implement specific multimethods
geoffb nod 02:25
stevan all methods are in the MM are closures around the sub body
geoffb k
stevan the MM2 shows this fairly well (IMHO that is :) 02:26
chaos.pl, there are some ::make_method() functions
it basically just binds $?SELF and $?CLASS in the methods scope
then private methods and submethods just add checks before the actual method code 02:27
they are checks wrapped around methods which are wrappers around the subs
now eventually I think this part will get replaced by some kind of Sub object which is part of the runtime 02:28
so I assume that a mutlimethod will just be a wrapper around the multisub from the runtime
geoffb fair enough
(getting to be my favorite response tonight -- maybe need to abbreviate to FE) 02:29
stevan :)
of course,.. all these details will be ironed out as more metamodel integration of runtimes and such are done 02:30
nothing like other people using your code to find all the ugly corners in it :)
geoffb
.oO( Man, I have *got* to arrange for more time for this stuff, it's just too fun)
heh
stevan :)
me too,.. I should be $working
dudley stevan: do you see the MM being implemented in perl6 any time soon?
stevan dudley: I think the plan is as follows 02:31
1) get PIL2 working
2) get MM2 working
geoffb I like Conway's idea of having people send you their sample scripts, after giving them only the module's name and purpose -- but I wonder who he knows that has the tuits for that
stevan 3) port MM2 to Haskell (actually they may be developed simultaniously)
4) port MM to Perl 6 using the Haskell MM to bootstrap
putter hi all. 02:33
geoffb putter! 02:34
putter geoffb: any remaining questions?
geoffb Well, actually, I had some info for you, re: t/01-sanity
putter ooo, info always appreciated.
stevan hullo putter
geoffb I was the original author of the whole dir.
putter hi stevan. 02:35
geoffb The reasons for the huge functional jump from 06-use to 07-test are:
putter (ah, the suspense...;) 02:36
geoffb 1) I was running low on tuits after 6, so knew it was important to get what I had committed (and it looks like it has been valuable, yay!)
2) I knew Test.pm was needed by virtually everything else,
putter indeed. definite yay.
geoffb 3) Test.pm is such a completely crazy piece of code (using advanced features in the module that is used to test basic features is WRONG to me) 02:37
4) I planned to rewrite Test.pm in much simpler version, then build a replacement 07 -> 99 or whatever that included each needed feature one by one,
in the same fashion as 01-06
So basically: 07 was a stopgap, just until I got more tuits, 02:38
which of course, I didn't.
putter :)
geoffb So:
putter ahh.
hmm....
geoffb I'd like to see 07 change number to 99 or so,
and fill in 07-98 with granular tests.
The key in my mind, was that Test.pm should also get MUCH SIMPLER. 02:39
putter I started on a simple Test. It quickly revealed that if you want to use a simple test, then you need a notably tolerant compiler.
geoffb It's using inappropriate features for a self-test
by which I assume you mean "pugs is not sufficiently tolerant"?
putter with pugs, there was this eval_ok, etc, game. each new backend doesnt get to play. so it either very quickly catches up with pugs, or it need to tolerate "all sorts of stuff is going on which I dont understand... continuing" 02:40
geoffb ls
oops, wrong window :-)
nodnod 02:41
Hmmmm.
putter remembers a gnu window manager writen by a mob of paranoid people. a _real_ warning message said segfault... bus error... continuing... ;) 02:42
geoffb ouch
OK, one thing I did long ago was run a script through the test trees determining which subs in Test.pm were used at what percentage. 02:43
putter neat.
geoffb As I recall, something like half the tests were just using ok() and plan(), and there was a pretty nice inverse drop off as you went to rarer calls 02:44
So perhaps we can just do a Test::Mini that contains only like 4-5 extremely basic functions (plan, ok, is, ...) 02:45
and do 07-test-mini, before 99-test. 02:46
Do you think that would help the backend people?
putter I've just uploaded my simple-Test experiment. 6460.
geoffb pulling 02:47
putter I'm not sure,
a question is what the right way to go about building a backend is.
geoffb It seems like people comment about going through 01-sanity's 01-06, and then there's this big delay while they work on 07. 02:48
That seems like too high a cliff, and I think you've said that very thing within the last day. :-)
at least autrijus and iblech have worked through 01-sanity, and I thought at least one person on the P5 team was doing so as well. 02:50
svnbot6 r6460 | putter++ | PIL-Run/lib6/Test.pm: created. A _simple_ Test replacement for PIL-Run. use Test; Its usefulness is not clear.
putter Ok, bottom up. My puzzle is that even with this simple Test, likely none of the .t files will do anything but compilefail. Perhaps that's a compiler issue. Pehaps each bit of file should be wrapped in an eval, so performance always degrades gracefully. But if not, 02:52
then Test, and its complexity, isnt really the problem. Rather that the big-test-file approach is fine when program and tests grow together, but not when "second class - dont mess with the test files" programs are trying to bootstrap. 02:54
geoffb I think I failed to mention a step in my thinking: 02:55
putter s/each bit of file/each bit of compiled code/ 02:56
geoffb bah, I'm confusing myself
dammit 02:57
putter ! ;)
having small sanity tests, like the current ones, allows one to do a hill-climbing design-a-bit, code-a-bit, test-a-bit, recurse. But I'm not sure that's actually useful... If PIL2 was done, I'd say you document and annotate it, sketch implementation approaches, and then do a broad push implementation. The design-a-bit part is just asking for pain, if you have access to the big picture. And if you have a broad implementation front, 03:00
bitesize test files are less important.
s/actually useful/actually useful long-term/
geoffb sorry, was AFK to deal with kid 03:01
putter Eg, JS has a nice spec. I can with some confidence mechanically transform it into an implementation, and expect to hit it at the end with a test suite, and have things go well. 03:02
np. I understand completely.
geoffb well, here's my thought, which I think has finally coagulated: 03:03
putter There, microtests just wouldn't be of interest. So there is something about the state of spec-ness which determines the ideal shape of testing.
geoffb Your plan would be generally correct, *if* PIL2 was finished, but: 03:04
1) PIL2 isn't finished, so we've got people like iblech still working with finding the corner cases in PIL1 (which will have to be handled by PIL2 anyway)
2) It's almost guaranteed that even if there was a spec, there would be bugs in either the spec or the new backend implementation, so 03:05
3) It's best to be able to test the whole big all-at-once PIL2 backend in little bite sized pieces anyway,
because I guarantee that the first test run after getting all the code written will explode in a thousand points of light,
and then you have to work from the bottom to figure out what you did wrong. 03:06
And the jump from 06-use to 07-test is so high that you have no idea why 06-use is working but 07-test is not.
EOL
Did that all make sense? 03:07
putter yes, but ;)
geoffb :-) 03:08
putter one question is what does PIL2 look like vis PIL1. the fuzzy impression I've gotten from autrijus is the PIL1-ish aspects of PIL2 are very similar to PIL1. (I should go back and reread the log (of a couple of days ago?) where autrijus argues PIL-Run development doesnt have to wait on PIL2). 03:10
geoffb ah, didn't backlog that far
putter if PIL1 isnt "going away real soon", then rather than tweaking PIL-Run, I should probably be documenting PIL and _designing_ PIL-Run. the key is 03:12
sigh. if the test files were all maximally aggressive oo p6, then there would be a step function. you have no hope of running the tests at all until it's likely your about to pass most of them. 03:14
so a question is, how do we characterize the _current_ state of the tests. the "language subset" required to reasonably run them. if 03:15
geoffb (that very need, to express a working language subset at a time, is about half of why I created 01-sanity in the first place) 03:16
putter it is something that isnt very deep, that one can approach with a combination of coding from spec, and little hand-written debugging cases, then having little test-file cases buy you... what?
right. with sanity, PIL-Run wouldnt exist. (err, there's an obvious variant on that which I wont mention) 03:18
geoffb heh
so what exactly is different between 01-sanity and "little hand-written debugging cases", except that 01-sanity is part of the test suite? 03:19
Yes,
I know that hand-written cases will uncover stuff that tests just can't.
I guess I'm saying, as much as possible of those hand-written cases should become part of 01-sanity, so that all backends will just have it. 03:20
Part of all of this is I don't want to see each backend have to reinvent all the tests they'll need to get to having a large enough language subset working to run the main test suite
putter err, at least in its current form. micro-history of PIL-Run... whatever happend before I saw it... nothing much say it will be a long time before there are backends... thus challenged (and because a said backends were to be important rsn), putter creates p5 backend in a day or so... iblech explodes with JS backend... putter punts p5 backend... autrijus says, no, do it now... putter goes back to hacking on it a bit... present day. ;)
geoffb heh 03:21
putter re difference, similar in size, but hand-written is throwaway to debuggingly lubricate the convergence of backend and suite. hmm, if suite were 10k test files of one test each, rather than 500 of 20, would we be having this conversation? 03:25
geoffb yes, we would, because the test suite as it is now generally has every test file assume that all other features are working, if they were working in base pugs (haskell runloop) when the test file was written 03:27
I would LOVE to be able to refactor the test suite not to have that behavior,
but that's MASSIVELY more tuits than I have
dudley (debuggingly lubricate)++
geoffb So I'm advocating starting bit by bit in 01-sanity
putter really? I thought most tests were like ok(<testexpr>) or is(<testexpr>,<very simplee xpected result>) 03:28
geoffb and maybe doing 02- and so on directories later, which might be largely movement of existing test files
lemme find example
wow, the very first one I checked. 03:29
t/builtins/undef.t
just keep scrolling.
MANY language features get tested in there.
putter while you're looking, I'll do the correlary. if the tests would be fine if done independently, then the problem is the file-compile coupling of tests in the same file. the file-compile succeeding or failing as a whole. 03:30
looking...
geoffb yes, I do think that's a problem, 03:31
putter though my fuzzy recollection is undef.t ended up a slush of tests for any aspect of any feature which returns undef.
geoffb but also there's this case: I want to test whether feature bar works with feature foo. So I test foo + bar. Even though foo and bar may not have been tested yet. So I could get foo + bar fails before finding out that the real problem is that bar is broken. 03:32
In math terms, there's a partial ordering that we could apply to the test suite, but right now, that's not done, except in 01-sanity
putter ok, so undef.t points out at least two issues. the setup for a test may depend on a breadth of language feature incidental to the test. and tests may be coupled together by a common setup. 03:33
geoffb NODNOD
.oO( I wish IRC supported seeing whether someone else was typing )
03:36
putter, if you're still typing, hit enter -- otherwise, I should amble off and visit $spouse 03:38
putter if you can get your implementation within a short distance (few debugging steps) of working, then even the undef tests are small enough to hand-generate tests to close the gap. agreed? then the question is, is the space of such tests small enough that one can write some useful subset of them before hand, as part of the test suite. one point here is that a failing tests doesnt just test and flag what it is officially there to test, bu
t other stuff too. if everything *should* be working, this is a feature, not a bug. its only a bug if the entire test suite gives you lots of "well, yes, I know *that* isnt working. I just wanted to test *foo* in isolation".
geoffb holy crap
putter lol
geoffb And I contend that we are currently in that latter case of conflated test hell. 03:39
putter the state-of-spec ties in by making "everything *should* work" more likely, so test isolation is less important.
geoffb iblech has been slowly moving up in % test success, but that % has had little correlation with actual work done, because stuff like eval() working suddenly makes a whole bunch of tests work that have nothing to do with the features supposedly tested. 03:41
putter agreed. but is the way out to change the tests, or to document PIL1?
geoffb Would you buy "Do both, this is Pugs we're talking about?"
putter right. but is % anything but a spectator metric?
jql don't undervalue the spectators
jql sits back down on the bleachers 03:42
putter ;)
hmm, one question is whether the test noise hides useful information which would help PIL2JS development.
geoffb I think it is, actually, though only by proxy -- because when iblech sees a bunch of red in his smoke, he has to mentally filter out which are real problems, and which are just because something implicitely expected by a block of tests isn't there
and jql is absolutely right, I might add
putter, yes, I think so 03:43
putter if iblech isnt really using the tests to figure out what needs to be done next, what is or isnt or regressingly isnt working...
geoffb that parsefailed.
I'm saying, the original idea that autrijus had was to do pugs as test-driven development. Except now, major portions of the project aren't depending on the test suite, because it doesn't help them. 03:44
And I think that's BAD
s/aren't/can't/ 03:45
OK, so:
luqui geoffb, what portions are those?
putter i think you answered it... iblech is looking at the test failures to guide development... though the next question is, what is the cost of the noise, are his mental filters working...
ah.
geoffb I think in iblech's case, his mental filters work fine. 03:46
The problem is, that only works because iblech is uncommonly smart.
putter but for "test driven development', you want something more accessible...
geoffb That's not reasonable to expect from everyone
yes
that's my point exactly
putter is tempted to do some bulk analysis of the test suite to see how much coupling happens and where... 03:47
jql it's one of the perils of mixing the standardization committee's code repository with the reference implementation test suite 03:48
geoffb It reminds me in a way of Linux kernel dev before Linus got version control religion. People were trying to explain that he was only holding things together by the fact that he's a genius, but not having version control just doesn't scale . . . .
putter but... say I did that, and every test became minimal and independent... PIL-Run would still be unable to run any test file.
geoffb But as iblech pointed out, PIL-Run *does* run several test files -- in 01-sanity, where there is little implied requirements. 03:49
which kindof makes my point. :-)
jql: I think I understand and agree.
putter its "tests have minimal bagage" and "tests can be confronted independently" 03:50
geoffb nodnod
putter the second could be test-infrastructural, or tolerant compilation. 03:51
jql I might add "test for capability" and "test for regression"
geoffb Now, there is *absolutely* need for tests that mix features, because many pugsbugs have involved two features that work independently, but not together, I'm just saying that the test suite *also* needs independent tests
putter jql: ?
jql I'm nattering on about my standardization-committee tests 03:52
geoffb nattering++
jql tests which define perl6 vs. tests which detect broken implementation/features
geoffb right
<voice character="obi-wan">Use the [enter] key, putter . . .</voice> 03:54
:-)
putter hmm. two ideas come to mind. reaching into PIL-Run's EvalX and wrapping the generated code for every PStmt in an eval. and _then_ see what happens with the test suite.
;)
geoffb interesting idea 03:55
OK, I really must get AFK, so as to remain friendly with better half. 03:56
I'll backlog later/tomorrow.
putter and bulk massaging the test files, ripping out chucks (test lines, ^^{...^^} blocks, etc) and seeing if pugs/JS/PILRun can deal with each chunk..
ok.
thanks geoffb 03:57
that was most interesting and useful.
geoffb sure, np, good discussion. :-)
putter notice my many enters. ;)
geoffb heh
THANK YOU
putter good night.
geoffb ditto
putter for completeness, I note one aspect of testing we didnt discuss... automated test generation. spew regex and strings to test rules. spew code to test the parser. spew PIL to test the backends. 04:19
svnbot6 r6461 | putter++ | Added missing "use v6;" to 3 test files. 04:46
putter fyi, ~410 t/ .t files with ~7600 tests. 04:47
2/5 outliers account for 20/30% of tests. the rest average a bit more than 10 tests / file. 04:58
landover hi all 05:11
dudley hello 05:12
luqui hello 05:17
nothingmuch hi ho 08:21
QtPlatypus Hi nothingmuch 08:22
nothingmuch what a long morning
nothingmuch sorted out something like 25 expense receipts
anyway, someone is in need of help... ciao!
svnbot6 r6462 | Stevan++ | Perl6::MetaModel 2.0 - 08:27
r6462 | Stevan++ | * added the META:: pseudo package so things will
r6462 | Stevan++ | get disapatched from META to non-META properly
r6462 | Stevan++ | - however this is currently somewhat broken.
r6462 | Stevan++ | basically it all works fine until I make
r6462 | Stevan++ | $::Object the superclass of $::Class and then
r6462 | Stevan++ | things start to spin out of control. I will
r6462 | Stevan++ | have to investigate this more after sleeping :)
nothingmuch *sigh*... 4.18% (7454.14 MB) @ 3.24MB/s ETA: 52733s 08:46
scook0 nothingmuch: that's a lot of megs... 08:51
nothingmuch scook0: 200gb
one file being split into 8 files 08:52
i wonder if I can optimize the script
scook0 yeowch
nothingmuch currently it does <$in>, matches a field, hashes the field into an index, and finds the output handle in an array 08:53
scook0 what on earth are you doing?
nothingmuch (hashing is a modolu and an addition)
splitting an unsorted data file that has dated fields into 6 month periods
actually I don't know what I'm doing - this is for someone else
he had a script that used egrep 08:54
with huge |||| patterns, to match each of the 6 months in a year
the script would run through the file 8 times, filtering the needed data
my script is about 15x faster, and it will take it 15 more hours
i wonder if there's something I don't know about the data 08:55
if it's fixed width, it could be faster
shit, tab separated 08:56
what's more this is on windows via cygwin. I hope i was pedantic enough with 'use bytes' and 'binmode' everywhere
scook0 sounds like something I had to help out with recently
helping with my brother's follow-up to an honours thesis involving log analysis 08:57
the program the previous guy had was a scary C++ thing
nothingmuch thesis and log analysis sounds scary 08:58
when the two are combined there is *ALWAYS* something wicked going on
scook0 which took over a week, at 50% CPU time on the uni server
nothingmuch oh my
scook0 we rewrote it in perl, because the original was too cryptic
and it finished in minutes on my wussy machine 08:59
nothingmuch heh 09:00
oh man, it's slowed down to 2.9MB/s
it's not leaking any memory though, that's odd 09:02
constant 1.5MB
oh, someone else is using the box
heh, someone was an understatement... there are like 9 sessions, and this is a windows box
kungfuftr seen theorbtwo 09:42
jabbot kungfuftr: theorbtwo was seen 3 days 9 hours 54 minutes ago
kungfuftr seen castaway
jabbot kungfuftr: castaway was seen 4 days 18 hours 18 minutes 2 seconds ago
kungfuftr is there a public irc log available somewhere? 09:43
09:55 kungfuftr is now known as kgftr|konobi
kgftr|konobi bounces 09:55
scook0 kgftr|konobi: colabti.de/irclogger//irclogger_logs/perl6
kgftr|konobi ta
nothingmuch kgftr|konobi: you can find them on perlmonks.org 09:57
or maybe not... 2 days ago too 09:58
aw1 Hi! Is that a channel to ask (tricky) questions about perl? 09:59
kgftr|konobi nothingmuch: they're mid-transit iirc
nothingmuch aw1: #perl is for that
integral aw1: about perl6, yes.
nothingmuch this is for discussing perl 6
aw1 Ah, ok, so I rather head over to #perl then! Thanks and bye.
QtPlatypus wonders how people get confused. 10:20
nothingmuch QtPlatypus: many people don't know they're running on perl 65 10:21
*cough*. perl 5
because they didn't even know that perl 4 existed 10:22
what I really don't know is how they find #perl6 the channel
QtPlatypus learned using perl 4 "And I still see perl 4 code written for perl 5"
QtPlatypus tests something 10:23
nothingmuch Real programmers can write fortran in any language
-- Larry
QtPlatypus Perhaps they use list?
nothingmuch started with perl around the time 5.8 came out
maybe a bit earlier
i first use MacPerl 5.004 or so, but only for a very short time 10:24
QtPlatypus nods.
scook0 wow, luqui just posted a scarily similar p6l reply at exactly the same time as me... 10:25
(or maybe I didn't refresh my inbox for an hour...) 10:26
nothingmuch and still no one replied to my post =( 10:27
scook0 nothingmuch: I feared as much
sadly, it's tooooooooooooooooooooooo long -- everybody is probably scared
nothingmuch it's a big subject... the linker is not a simple piece 10:28
scook0 perhaps you need pretty visio diagrams :)
nothingmuch and everybody wants it to be fast, and to work with eval, and what not
there's too much transformation and polymorphism to graph it
or i don't know how to graph transformation and polymorphism
scook0 well, I shall read it again, and see if I have anything useful to say to de-warnock you 10:29
nothingmuch =)
what's your post subject?
under demagicalizing? 10:30
scook0 nothingmuch: aye
nothingmuch i liked that proposal =)
i think we need to find a better disambiguation though 10:31
scook0 nothingmuch: which one?
the parens?
nothingmuch well, more than that
do { } for the pairs is not nice
and parens should be used for precedence in argument lists 10:32
and to clarify stylistically
scook0 I'm not really a fan of the parens
nothingmuch i think maybe a marker is in order 10:33
scook0 do{} is nice because it doesn't involve any new syntax
nothingmuch or a marco for do { }
right
scook0 I suppose you could just say `pair(a=>'b')`
nothingmuch sub pairs (*%pairs){ return %pairs.pairs }
scook0 where &pair checks its slurpy hash
checks there's only one arg
nothingmuch heh =)
scook0 and returns it as a value 10:34
nothingmuch tries to speak in code when possible
perl 6 is very powerful in that it lets you describe most of perl 6's behavior with other parts of perl 6
scook0 what do you think of `my $pair = :a<b>; foo( *%$pair )`?
(I was rather proud of it, though I'm not sure it fits exactly with the semantics of %{}) 10:35
nothingmuch that was kind of sick ;-)
i think that we should have the pairs() and named() functions though 10:36
named($pair);
scook0 but you shouldn't be using it much
nothingmuch and pairs(:foo("bar"));
scook0 and it isn't new syntax or anything
nothingmuch as symmetric operations
sub named (*@pairs) { map { *%$_ } @pairs }; # even more line noise... Who said perl 6 was readable, eh? 10:37
scook0 `named` would have to be a syntactic form, of course
nothingmuch sub pairs (*%names) { map %names.pairs }
it could be just a macro
that evaulates it's parameters with a *% 10:38
scook0 true
(syntactic form) ~~ macro
nothingmuch what if we just subclass pair
NamedArg isa Pair 10:39
scook0 and named-syntax in arg-list denotes NamedArg, and Pair elsewhere
nothingmuch yup
it's just a different constructor
scook0 that re-introduces the concept of magical values, but at least they're under the hood 10:40
nothingmuch and then pairs() and named() just rebless
as I see it it's just an implementation strategy for your demagicalized semantics =)
scook0 a problem with magical-values (vs. syntactic-forms) is that they might make it harder to tell statically which args are named, and which aren't 10:42
(from the compiler's point of view)
nothingmuch what about this: foo(my $x = :foo<bah>); bar($x); # named or pair? 10:43
scook0 ooh
I reckon pair, for both of them 10:44
nothingmuch hmm
scook0 because they're both expressions
nothingmuch i think a named for the first, a pair for the second... writing up in my email
scook0 (rather than just pair literals)
possibly with a warning for the first, since it kinda breaks the mnemonic
nothingmuch yeah 10:45
"possibly unintended pair instead of named argument in function call"
you're right
scook0 I imagine that the parser tries to parse a pair-literal or splat 10:46
and if it doesn't find one, it parses an expression instead 10:47
and assumes it's not a named-arg
(or something along those lines)
after macro-expansion, probably 10:48
nothingmuch replied 10:49
shit, I think I didn't group reply 10:52
did you get it? because I think p6l did not
scook0 I see no reply here 10:53
nothingmuch odd, I see it as sent 11:22
(sorry, meeting)
scook0 ooh, it's arrived!
and it seems to have been sent to the list
nothingmuch multi bene
xinming seen autrijus 12:22
jabbot xinming: autrijus was seen 3 days 8 hours 48 minutes 9 seconds ago
xinming is thinking if the 6.2.8.0 version will be out when autrijus comes. 12:23
masak xinming: :) 12:51
nothingmuch ingy: 13:26
you are drunk
kwiki can't build without Kwiki::Test, but Kwiki is a prereq for Kwiki::Test 13:27
wait, no, i think this is an env problem
ingy++ nothingmuch--; # sorry, false accusations 13:29
13:43 Maddingue__ is now known as Maddingue
fglock nothingmuch: how about PIL2Forth for an interesting project 13:45
nothingmuch fglock: uh, you go ahead
fglock putter: ping 13:46
nothingmuch my forth fu is not that good
fglock next would come PIL2Postscript. Then we would be able to compile P6 to pdf :) 13:48
iblech Hm, does PS have closures? 13:49
nothingmuch fglock: i don't think PDF is turing complete
integral PDF can embed JS luckily :) 13:50
Odin- PDF is "just" a page description format. 13:51
Unlike PostScript, which doubles as a programming language.
kgftr|konobi PDF can embed PS though 13:52
iblech Wow, my provider just borked their router configuration -- all IPv4 traffic gets TTL exceeded errors, but IPv6 works fine :) 13:54
fglock iblech: forth uses the stack for everrything, I think closures can be faked 14:00
everything
nothingmuch: pdf is compressed postscript, which is a forth dialect (AFAIK)
nothingmuch i thought pdf is a subset of postscript functionality
putter fglock: pong 14:01
fglock putter: I'm trying to find a way to make things like 'Array::fetch' automatic in PrimP5 14:02
because it is already a Array method
putter automatic? 14:03
fglock so that you don't need to declare it in PrimP5
putter ponders... 14:04
Is Array's fetch already a Sub? A Scalar? 14:06
fglock Array fetch is a method in the MetaModel. I think it is not an object in the current version of MM 14:07
putter hmm... so the idea is basically to expose p5 methods... 14:10
fglock yes! 14:11
xinming hmm, I ever heard that autrijus said that there is a bit hard to make pugs support perl 6 rules,
So, I wonder, Is it possible to use pugs to write most perl 6 codes to pharse perl 6 rules?
I mean, If pugs suports full perl 6 oo mechanism ( except the pharsing rules ), will it possible to use pugs to write some class to pharse perl 6 rules? 14:13
putter so like... p6_apply taking the invocant, if any, and UNIVERSAL::can()ing it, against the function variable name...
fglock xinming: yes - you can write a library
xinming hmm, well, This is just my humble opinion,
fglock: then, which is harder? Using haskell or using pugs? 14:14
putter xinming: posible, once oo works better.
xinming putter: do you mean, My Humble Opinion is right? :-) 14:15
Or it is the way you all plain to go?
fglock xinming: you can write libraries in pugs, but you can't integrate them in the language yet. There are a few bits missing. 14:16
putter has anyone written a p5 module which takes a list of keys and walks array structures, stopping and _not_ autovivifying if one is missing? 14:17
s/array/array&hash/
xinming fglock: hmm, then, which part is missing? :-S 14:18
fglock putter: you can test with 'exists'
putter k
xinming putter: hmm, maybe can make something like "convert" rules into "class" :-P 14:19
oops. worng
fglock xinming: you can create classes, but you can't redefine what a 'rule' is 14:20
but you certainly can write your own class with rule functionality, and integrate it in a future version of pugs
xinming hmm, well, It's just a piece of inspiration which just came out of my head just now. 14:21
svnbot6 r6463 | iblech++ | * Usual svn props. 14:23
r6463 | iblech++ | * t/statements/loop.t: Oops, I accidentally removed the "use Test" line in
r6463 | iblech++ | r8382, fixed.
r6463 | iblech++ | * PIL2JS: ~~33% speedup! putter++!
r6463 | iblech++ | * You can now write primitives as macros written in Perl 5 -- they take a
r6463 | iblech++ | list of (already compiled to JS) parameters (and the cc, of course), and
r6463 | iblech++ | return the resulting JS code. See new lib/Prelude/JS.pm.
r6463 | iblech++ | * Implementing &statement_control:<if> and &statement_control:<unless> as a
r6463 | iblech++ | P5Macro already gives ~~13%, implementing most two-ary standard ops gives
r6463 | iblech++ | another speedup.
putter fglock: err, doesnt the mm use lots of AUTOLOAD? does it implement a matching can()? 14:24
fglock putter: I'm not sure if can() will work. You may have to use an eval 14:25
Scalar and Ref are particularly tricky
because they do auto-deref
putter wonders if the waters are getting too deep... 14:26
fglock sorry
putter oh, np...
exploring...
is there an official way to ask a Scalar if it contains an undef? or just defined($s->fetch) ? 14:32
fglock $x->defined 14:33
putter tnx
fglock: p6 test expression to see if fetch is now working? 14:47
svnbot6 r6464 | fglock++ | * PIL-Run - implemented ^.. ..^ ^..^ infix:<->
fglock (1,2).fetch(1) 14:49
putter trying...
fglock it thinks it is a Scalar fetch
putter iblech: hmm... in PILRun one can do macros in p5 because one has access to the runtime environment, to see if the variables are indeed bound to macros... but how can one do that in p5 when one's runtime is js...? or are the "non-overrideable, compiled away at compile-time" primitives? 14:50
iblech putter: The latter. But I'm currently hacking in a guard so the macro versions are only called if the subs weren't rebound 14:53
putter: Ala &infix:<+>.is_pil2js_compiletime_macro ? ($a + $b) : &infix:<+>($a, $b)
putter iblech++ :) 15:12
svnbot6 r6465 | fglock++ | * PIL-Run - implemented coerce:as($x, $type)
iblech Hm, looks like I run into a perl5 memory leak 15:15
putter $a = Array->new(); $a->push(3,4); $a->fetch(1); $s = Scalar->new(); $s->store($a); $s->fetch(1)
Array=HASH(0x113f800)
fglock: is that right?!?
(I thought the Scalar was supposed to proxy the call...)
fglock I have to check this - I'm going for lunch now - bbiab 15:16
putter k 15:17
iblech putter: I'd say what you're doing can't work -- you store an Array container into a Scalar container. But if Scalar should autoref in this case, it should, of course, work
kgftr|konobi anyone got any contact (phone) details for theorbtwo or castaway? 15:19
svnbot6 r6466 | putter++ | PIL-Run - Began a bypass to treat some PApps as p5 method calls, since the current mm methods Array::fetch etc are not yet(?) objects, nor in the namespace. Also tweaked name lookup(). 15:27
putter iblech: currently PVar yields a bound, possibly new, Scalar. $x=3 becomes (find('$x')||$x=newScalar).store(3). sortof. not the right thing? 15:31
iblech putter: That's correct for scalars. But if the LHS is a scalar, and the RHS is an aggregate, you've to autoref ($s = @a is really $s = \@a). If Scalar->new does this autoreffing, then everything's fine 15:33
putter ok. thanks. 15:35
iblech And, while we're at it, @array = $scalar is really @array = ($scalar,) (= &infix:<,>($scalar))
putter ;) putter didnt even know Array's were in there. fglock++ 15:36
PerlJam iblech: is @array = list $scalar; the same thing? 15:38
iblech PerlJam: I think so.
PerlJam if so, I prefer that form over the dangling comma. (That's one bit of python's syntax that continues to bother me) 15:39
putter hah! sprinkle in a few eval()s, and crude_repl happily bumbles drunkenly through t/*/*.t... 15:49
time for a smoke... 15:50
(though I suspect most of the success with be "and check x _didnt_ occurr" flavor tests. ;)
svnbot6 r6467 | iblech++ | PIL2JS: 15:53
r6467 | iblech++ | * PIL2JS.js: Fixed numification of junctions.
r6467 | iblech++ | * PIL::P5Macro: Optionally check if (say) &statement_control:<if> is still
r6467 | iblech++ | bound to our macro. But, as perl5 seems to leak memory (2 GiB in 2min), this
r6467 | iblech++ | currently needs %*ENV<PIL2JS_MACROS_CORRECT_BEHAVIOUR> to contain a true value.
putter eeep! 15:55
# ~ 1 machine-memory/min ;)
wilx Circular references? 15:57
iblech wilx: Thought so too, but didn't find any (and the code in question is only 10 lines or so long (with a 5 line here-doc)) 15:58
putter: (5 GiB swap)++ :)
wilx Heh.
putter ;)
wilx Nice achievement with 5 lines of code :) 15:59
iblech :D
fglock putter: ping 16:07
putter pong 16:11
svnbot6 r6468 | fglock++ | * PIL-Run - ?x ~x works
putter crude_repl is smoking...! (hmm... have to find a way to skip the ext/ tests...) 16:12
err,
fglock: pong 16:13
fglock do you still have that problem with Array?
putter checking...
yes. behavior unchanged. 16:15
fglock the problem is - "how to store an array item when the array is inside a scalar" ? 16:16
I haven't written tests for that - it might not work yet
putter right. perhaps incorrectly, the current implementation uses Scalar as the named in namespace <name,named> tuples. it thus relies on Scalar's proxing behavior. I've no idea if this is all spec, fudged-spec, or bizarrely incorrect. 16:19
svnbot6 r6469 | fglock++ | * PIL-Run - +x
fglock what does "Scalar's proxing behavior" is? 16:20
putter all namespace lookups currently return a Scalar. so "do something to a variable" means "do something to a Scalar". 16:22
though it may be the only thing we were consistently using variables for was to hold subs. so atleast ->do() works. ;) 16:23
Some of the sanity tests must of exercised them a bit more. 16:24
svnbot6 r6470 | fglock++ | * PIL-Run - pop, push, unshift, Array::values
fglock does it mean that @a[1] should return a Scalar that holds the second cell in the Array? 16:25
putter wonders if he should svn up and restart the smoke... ;)
xinming putter: go ahead. :-P
fglock was lunching while putter was smoking 16:26
putter no. it means given $a = (3,4); $a[1] if fetch is just a p5 method, this gets converted to a ->fetch(1) on the Scalar returned by name lookup of '$a'.
fglock ok - I'll test that 16:27
putter which currently returns the Array, rather than the 4.
xinming: :)
fglock is there a way to reduce the 'tab' size in Data::Dumper? 16:32
iblech fglock: $Data::Dumper::Indent = 1
fglock thanks
if you have a Scalar that holds an Array: does $s->fetch returns Array, and $s->fetch(1) returns Array element? 16:37
putter ? 16:39
I'm afraid I haven't been following the mm closely... sorry.
stevan: ping? ;)
fglock I mean in Perl 6 - $s=@a; how to you get the array back from $s? (I think you don't) 16:40
putter stevan: btw, will mm2.0 have macros?
iblech fglock: @$s 16:41
putter ah.
iblech fglock: But $s[index] will work, too, because $s autoderefs
fglock ah too
ok - I'm verifying the implementation 16:42
svnbot6 r6471 | putter++ | PIL-Run - make smoke-perl5 runs. 16:48
fglock I fixed this bug, but now I've got to fix the other tests 16:53
putter: can you test fetch() now? I'm going to fix store() 16:56
putter testing... 16:57
woot! :) 16:58
works. fglock++
svnbot6 r6472 | fglock++ | * perl5/ Scalar - autodereference array->fetch(1)
putter so (3,4)[1] and $a[1] and $a.fetch(1) all work. but (3,4).fetch(1) doesnt. exploring... 17:00
hmm... perl5.t takes a long time... even when you dont have regexs implemented... ;) 17:01
svnbot6 r6473 | fglock++ | * perl5/ Scalar - Arrays stored in a Scalar can be accessed using indexed store/fetch 17:10
fglock putter: 'Inf - 2' dies looking for "Math::BigInt" 17:13
svnbot6 r6474 | fglock++ | * PIL-Run - several new primitives
r6475 | iblech++ | * t/pugsrun/*.t: skip if $*OS eq "browser"
r6475 | iblech++ | * PIL2JS:
r6475 | iblech++ | * PIL: $vars with associated PPos information was incorrectly
r6475 | iblech++ | compiled, fixed.
r6475 | iblech++ | * P5 Prelude::JS: All ops working on Strs *booleanified* their arguments
putter p6_new('Array',p6_new('Int',3)).fetch(p6_new('Int',0)) gives an error You cannot call $AUTOLOAD from outside of a MetaModel defined method
svnbot6 r6475 | iblech++ | instead of stringifying them, fixed (2-char-patch).
r6475 | iblech++ | * PIL::PVar: Variables in void context don't discard the cc now.
iblech fglock: That's probably because -CPerl5 serializes Inf as Math::BigInt->binf
putter fglock: add Math::BigInt to MainX? 17:14
hmmm... 17:15
fglock about Array - Array->() new takes no arguments, you have to push elements into it 17:18
I mean Array->new()
putter yes. 17:19
I saw that in p6_new.
fglock The problem might be that fetch needs un unboxed value 17:20
an
putter re Inf, I think Int doesnt know what to make of 'inf'.
fglock I'm defining an 'Inf' sub 17:21
putter ah, no. its just that VNum isnt expand()ed yet. 17:22
what should a num be? (in the mm) Num?
fglock yes 17:23
putter k
hmm. :5 p6_to_s(p6_new('Num','inf')) is... "0". :/ 17:24
fglock try 100**100**100 17:25
putter while I'm here, Int, Num, Str, any other easy literals?
Inf :)
fglock that's all - the other values are Ref, Pair, List
putter k 17:26
cleaning up and checking in...
what ever happened to Rat? 17:28
in, 6476.
fglock Rat is 2 Num together
putter k
fglock it can be defined at a higher level
putter is there a Decimal?
fglock I don't think so - I've seen a discussion years ago, I think it was agreed not to have it 17:29
many errors in Math::BigInt while executing Inf+2 17:30
svnbot6 r6476 | putter++ | PIL-Run - Num support added.
putter Err, ok, not _quite_ what I expected. 408 files 26 test cases: 24 ok, 2 failed, 2 todo, 2 skipped and 0 unexpectedly succeeded 92.31% 17:31
k # re Decimal
fglock 92% of all tests? 17:32
putter all 26 of them.
putter goes to try and figure out what's up with smoke...
re Inf+2 and BigInt errors, that's so 20th Century. Here in the future, Inf**Inf == ... what is it, Aleph_0? 17:34
fglock TODO: Value::Transfinite 17:37
putter lol :) 17:38
have you seen Magma? (looks for url...)
magma.maths.usyd.edu.au/magma/htmlhelp/MAGMA.htm 17:39
fglock @a[1]=3 try to store to an Int
putter magma.maths.usyd.edu.au/magma/Featu...tures.html but that's still not it... where's the manual... 17:41
nothingmuch evening 17:43
putter ah, no, it was the first link. magma.maths.usyd.edu.au/magma/htmlhelp/MAGMA.htm 17:44
'evening nothingmuch.
nothingmuch: so, while you were gone, you were volunteered ("the person who misses the meeting is _always_ ""volunteered""") to implement finite groups ( magma.maths.usyd.edu.au/magma/htmlhelp/part4.htm ). 17:46
nothingmuch what are finite groups?
fglock putter: (undef,1,undef,2) returns (1,2) - I defined undef as multi sub undef () { my $x }; 17:47
nothingmuch are they like sets?
putter ah, wikipedia is really getting nifty. en.wikipedia.org/wiki/Group_(mathematics) mathworld.wolfram.com/FiniteGroup.html 17:48
fglock: is this a good thing?
nothingmuch: sorry, tongue firmly in cheek. though... it would be really neat if p6 could become a decent algebra system... 17:49
fglock in pugs it returns (undef,1,undef,2)
putter who was it that was doing Set?
fglock me
putter ah! ;)
fglock oops - not Set
putter oh. :/ 17:50
fglock I did Infinite Sets (Set::Infinite)
putter ah! :)
fglock and Recurrence, Span and related thingies
Recurrence is nice if you like math
ext/Recurrence/lib/Recurrence.pm 17:52
putter www.math.uiuc.edu/Software/magma/text129.html hmm... do we have predicate subsets of infinite sets? intersection, etc?
fglock sure 17:53
putter too many distractions. bbiam
weee. back. 18:01
is there a mm Undef? I dont think the runtime is doing anything unusual with undef. does Array->push? 18:02
fglock I'll test - maybe 18:03
putter nothingmuch: re groups, they are <set,operator> tuples, where operator is set set -> set, and it behaves like multiplication. 18:04
putter wonders if anyone has does a haskell algrebra system
fglock putter: see ext/Recurrence/lib/Recurrence.pm 18:05
svnbot6 r6477 | iblech++ | * PIL2JS: 18:09
r6477 | iblech++ | * PIL2JS.js: +undef is 0 now, not undef.
r6477 | iblech++ | * P5 Prelude::JS: Added comment about that.
r6478 | fglock++ | * PIR-Run - !x (negation)
nothingmuch returns dramatically 18:12
svnbot6 r6479 | iblech++ | PIL2JS: PIL2JS.js: &prefix:<+>: Unbroke numification of bools.
putter holds his breath, anticipating drama
nothingmuch dramatically unveils cap, cane and tap dancing shoes 18:13
nothingmuch sings a corny song and expects to be recognized as talented 18:14
ods15 poke poke, nudge nudge 18:16
18:18 saorge_ is now known as saorge
fglock putter: is it already possible to define classes in PIL-Run? 18:22
in order to implement Pair 18:23
svnbot6 r6480 | putter++ | PIL-Run - Can now be run outside of PIL-Run/.
putter re Recurrence.pm, neat! I wonder if there is a nice way to support things that dont know if they are infitite or not? There are some predicates like is_infinite that I sometimes which had cost meta information associated with them. is_inf_cheap() sometimes writing them I want the method to gossip "you DO reallize I'm a possibly infitite set?" "do you really want me to spend the day calculating that?" "how about I give you odds ins
teald?" (all said in a wise-ass voice). ;)
s/which/wish/ 18:24
fglock see Span - if you intersect a Recurrence with a Span, it knows what to do 18:25
(see Set::Infinite, actually)
iblech fglock: WRT defining classes, no, that can't be possible, as -CPerl5 can't compile class declarations 18:27
fglock putter: re infinite computations - List emits a warning if you try to instantiate an infinite list 18:29
bbiab 18:35
geoffb putter: funny, you commented a few minutes after I left that we didn't discuss autogenerated tests. And of course I fell asleep thinking about autogenerated tests . . . . 18:43
putter The hall is gone now, but you can still see the outline of the foundation on the ground. And they still tell the story of putter's ghost. "He was just about to applaud nothingmuch when he lost it. Trashing, memory exhausted by his smoking. He was disconnected." And sometimes, on a quiet night, you can still hear the clapping. 18:46
geoffb *chuckle*
geoffb idly wonders which of his umpteen projects he should apply some tuits to right now 18:48
putter geoffb: :) now if only we could all code in our sleep consistently...
geoffb I can't even tell you how many times in the last week I wish I had a brain implant that could take notes . . . . 18:49
I hate getting a pile of ideas while falling asleep, then having to spend an hour trying to remember them all after waking up the next morning
And ideas while stuck in slowly moving traffic are pretty painful too -- though I'm considering getting a digital voice recorder for that issue 18:50
putter really looks forward to... whatever its called... digital personal assistant... watches/listens, records, and indexes your day. provides framework for moving behaviors off the wetware. "I dont *what* talk it is. My planner just told me to come here." (real;) 18:51
geoffb heh
putter bah. s/dont/dont know/
geoffb funny, I read it correctly, even though there was a word missing.
putter ;) 18:52
geoffb (human pattern-matching engine)++
And tuits of the moment go to: eating cookie dough. brb
putter When I'm in that kind of mode, I keep a paper, pen, and a very dim light by my bed. Roll over, brain dump, back to sleep. Otherwise sometimes I just cant let go. 18:53
Sometimes though, and hour later and the dump is still in progress.
Good choice. Even better with icecream.
geoffb bak 18:55
mmmm, cookie dough . . . .
yeah, sometimes I just give up, wander down the hall to the home office, and brain dump into the computer 18:56
I have huge directories of "notes"
putter fglock: re classes, due to PIL limitations, not in p6. can in p5... but you knew that. I was tempted to do Rul and Match classes in p5, just to get rules (and the 20% coverage boost;). But it seemed a waste to write soon(hopefully)-to-be-disposed of code. 18:57
geoffb Speaking of which, I think next tuits will go towards updating parts of www.broadwell.org/graphics/pigge/do...rends.html 18:58
putter I'm acutally faster to dump on paper. Spacial is dominant brain mode, and paper does that better.
geoffb I'm more language-oriented, even when talking about graphics. I think the linguistic influences on Perl are why I like Perl so much. 18:59
Often when I need a small amount of spacial notes, I just do ascii art. Occasionally I'll fall back to paper, but then I instantly think "dammit, now I have to transcribe this someday" 19:00
spatial, sheesh, no wonder that word looked wrong 19:01
putter lol :) 19:03
408 files 6062 test cases: 219 ok, 5843 failed, 2 todo, 2 skipped and 0 unexpectedly succeeded 3.61% 19:08
svnbot6 r6481 | putter++ | PIL/Run/Container moved to Container_old_not_used.
putter !
hey, almost 4%!!!
geoffb putter: w00t! 19:09
putter ah well, not really. about 3%. 1/7 of tests are still awol. 19:11
feature request: tests.yaml with individual file times. 19:13
nothingmuch putter: that's easy to do wioth Test::TAP::Model 19:14
if you save the timing info, load the YAML (takes 40 seconds... =(
walk the files
and iterate the timing info
putter nothingmuch: re tap dance, just in case you dont backlock, I mention campfire tale. 19:15
nothingmuch aha
i don't backlog, except when I'm really curious
++ on the tests
putter now-29min 19:16
fglock is back 19:17
putter welcome back.
fglock re classes - it means I can't define classes in PrimP6 either :( 19:18
putter nope... :( we need to find autrijus some $$ 19:19
fglock I'm getting "Method (defined) not found for instance (Sub=..." in several operations that were already working 19:24
such as '2.perl' 19:25
svnbot6 r6482 | fglock++ | * PIL-Run - 1=>2 - Pair constructor
nothingmuch goes to see a movie 19:28
putter geoffb: very neat doc. re www.broadwell.org/graphics/pigge/do...rends.html 19:30
svnbot6 r6483 | fglock++ | * PIL-Run - pair value, key
r6484 | fglock++ | * PIL-Run - rand()
geoffb putter, thanks! 19:31
putter fglock: ah, Scalar is passing on its ->defined() call to Sub, which doesnt understand it?
fglock maybe - I'll fix it 19:32
putter k
svnbot6 r6485 | putter++ | PIL/Run/EvalX.pm: better warnings from PStmt. 19:36
r6486 | putter++ | PIL/Run/ApiX.pm: Squash warning "Scalar value @_param{$xx} better written as...". 19:47
fglock putter: it's not calling Scalar::defined 19:48
I'll try creating Sub::defined and see what happens 19:49
putter is there a // nearby? 19:50
fglock it works now 19:51
putter ah, ok.
fglock what's the superclass for Str,Int,Num? (what elese goes into this superclass?) 19:53
svnbot6 r6487 | fglock++ | * perl5/ Code - defined() method
fglock else
putter Object?
fglock I think there is something between Int and Object. Int is a subclass of Num? 19:54
putter That sounds familiar... I'm looking for docs... 19:58
I havent found anything definitive. My impression is Num and Int both does() Number (and Int does Integer), but that Int is not isa() Num. 20:02
p6 type hierarchy is very flat and roley. 20:03
fglock $a=(1,2) works, but $a=@a doesn't 20:10
ods15 heh that remins me mirc scripting 20:13
putter does the mm have a concept of inspect() or "intended for debugging" stringification? eg, more like what p5 objects strigify to be default (though some languages nicely include field values too).
ods15 when i used to name functions 'c='...
fglock most objects have the '.perl' method
can't run crude_repl.pl in windows - PxPerl pugs is tool old 20:14
ods15 ?eval say say.perl 20:15
evalbotzy Error: unexpected "p" expecting block construct, ":", term, term postfix, operator, ",", postfix conditional, postfix loop, postfix iteration, ";" or end of input
ods15 ?eval say.perl
evalbotzy Error: unexpected "p" expecting block construct, ":", term, term postfix, operator, postfix conditional, postfix loop, postfix iteration, ";" or end of input
ods15 oh, heh, functions don't methods
fglock pugs's 'say' is not an object
ods15 si i figured 20:16
so*
?eval say "hello"
evalbotzy hello bool::true
fglock p6's 'say.perl' should return 'sub { ... }'
ods15 ?eval say("hello").perl
evalbotzy hello 'bool::true'
ods15 ?eval say say("").perl
evalbotzy bool::true bool::true
ods15 ?eval say().perl 20:17
evalbotzy 'bool::true'
ods15 hmm
ohh
?eval (say().perl).perl
evalbotzy '\'bool::true\''
ods15 right
iblech ?eval &say.perl
evalbotzy '\\sub {...}'
fglock :) 20:18
ods15 ?eval &say
buu What the hell?
evalbotzy \sub {...}
ods15 buu: what
iblech ?eval say.perl # same as say().perl, i.e. bool::true.perl
evalbotzy Error: unexpected "p" expecting block construct, ":", term, term postfix, operator, postfix conditional, postfix loop, postfix iteration, ";" or end of input
iblech oh, parse error
ods15 ?eval (say).perl
evalbotzy 'bool::true'
buu ods15: Is .perl?
ods15 ?eval (&say).perl
evalbotzy '\\sub {...}'
ods15 buu: ??
buu ods15: What does it do?! 20:19
ods15 ?eval &say "hello"
evalbotzy Error: unexpected "\"" expecting operator, postfix conditional, postfix loop, postfix iteration, ";" or end of input
fglock .perl is more or less like Dump
buu ?eval "test"
evalbotzy 'test'
buu ?eval "test".perl
evalbotzy '\'test\''
ods15 buu: turns anything into a string
even a string
buu ods15: Consisting of the code?
iblech ods15: WRT &say "hello" -- you either need ()s, or you have to drop the & 20:20
buu ?eval my $x = sub { say "zomg" }; $x
evalbotzy \sub {...}
ods15 ?eval &say("hello")
evalbotzy hello bool::true
buu ?eval my $x = sub { say "zomg" }; $x.perl
evalbotzy '\\sub {...}'
buu Is that an error in my approach or an error in evalbot, or am I missunderstanding things?
fglock ?eval (2,\"test",1, sub{},[3]).perl
evalbotzy '(2, \\\'test\', 1, sub {...}, [3])'
ods15 fglock: dump the
err
fglock: dump the 'perl' in the end 20:21
buu Why aren't we seeing sub code?
iblech buu: It hasn't been decided yet whether $subref.perl should return a stub string (i.e. "sub {...}") or the real contents
ods15 buu: cause thats "unknown"
iblech: heh, shouldn't
fglock buu: that's implementation dependent
buu fglock: Er, what the heck?
How can that be implementation dependent? OR rather, why would it be?
fglock pugs doesn't dump the code inside sub{...} 20:22
iblech buu: Also consider &NativeCModule.some_sub.perl
buu: How could perl print something meaningfun in this case?
buu iblech: I have no idea, but it would be really cool. 20:23
iblech buu: ..and it's be impossible ;)
fglock iblech: 'sub { nci_call( "NativeCModule" ) } ' ?
buu iblech: Don't bother me with your picky technicalities!
iblech fglock: Right, but more meaningful would be something along the lines of sub { use Grammar::C; int x = 3; ... 20:24
buu: :D
ods15 lol 20:25
buu I also want a dwim operator
So when my code has syntax errors, I just randomly insert it until it works.
Hrm. Is undef still a function now? 20:26
fglock from PIL you can return 'sub { ** line 1322 ** } '
iblech buu: No, use &undefine to make a var contain undef
buu Yay! 20:27
I just had some code that looked like: foo( "bar", undef
baz );
And I could not figure out why foo wasn't getting the proper arguments
fglock undef() returns undef in pugs 20:28
stevan: ping 20:32
svnbot6 r6488 | putter++ | PIL-Run - p6_eval() again defaults to Root::main. crude_repl.pl :5 <p5exprs> also defaults to there, simplifying debugging.
putter fglock: patch in. now you can p5ugs> @a=(3,4) :5 $array_a and play with it.
this looks odd... 20:33
:5 $array_a->fetch()
Use of uninitialized value in numeric eq (==) at /home/net1/perl6/pugsxpl1/perl5/PIL-Run/../Perl6-Container/lib/Perl6/Container/Array.pm line 361.
Int=HASH(0x12cce70)
where p5ugs> :5 $array_a
Scalar=HASH(0x12cccb0)
fglock :5 $array_a->fetch(1) 20:34
putter and you get that same error message during $s=@a.
fglock fetch without parameters is fetch(0) - and a warning
putter re fetch(1), yes, but Scalar's talk to each other with fetch(), I suspect. 20:35
Scalar $s2->store($s1) may include a $s1->fetch()
fglock but $s=@a is $scalar_s->store( $array_a ) 20:36
putter and $array_a is a Scalar.
the scalar_ and array_ are the sigils.
fglock so $array_a->fetch() should return the array?
I mean, scalar->fetch() always returns the cell contents; scalar->fetch(0) try to dereference to array 20:38
putter _if_, Scalar store(), when given another Scalar $s1, asks that $s1 to ->fetch(), then either Scalars cant delegate the no-argument form of ->fetch(), or... (I cant immediately think of another possibiility) 20:39
fglock I'll implement this and see if it works 20:40
iblech FYI, in PIL2JS, @array.FETCH returns a JS array, $arrayref.FETCH returns a Ref (which has .autoderef set to true), and Scalar::STORE calls autorefs the RHS of an assignment if the RHS is an aggregate 20:41
putter Maybe Array containers shouldnt implement zero-ary fetch()?
iblech Maybe s/fetch/fetch_elem/? 20:42
fglock bbiab ...
putter bottom line - I am too unfamilliar with the MM to say how the container classes should interact.
iblech: what is your... bound object? the second half of a <name,thing> namespace entry? 20:44
iblech putter: Binding is *not* only a change in the symbol name -> container table (i.e., the pad) (consider @a[$idx] := $val, which is really &postcircumfix:<[ ]>(@a, $idx) := $val) 20:46
putter: Binding set the LHS's .FETCH and .STORE to RHS's .FETCH and .STORE in PIL2JS
putter: Which is basically the same as setting the LHS's .cell to RHS's .cell
putter Do you have a cell object distinct from Scalar? 20:47
iblech Not technically, but: 20:48
Instead of varname -> container -> cell -> value, I do varname -> container -> .FETCH .STORE -> value, and then I do appropriate magic so users could *think* there's a cell involved, where there is no one actually 20:49
(This is only an optimization, I'm saving one (otherwise needed) indirection)
putter where Scalar is a container? 20:50
iblech Right.
(But, another implementation detail, I don't have separate Scalar,Array,Hash classes, but only a generic Box class, but again I fake things appropriately so you can't see the difference) 20:51
fglock back. Array doesn't implement fetch() - Scalar does - the problem is that Scalar sends the fetch to Array, which doesn't know what to do
putter ok, so as I understand it, in the p5 mm, .FETCH and .STORE are spelled ->fetch and ->store, and the same cell-less magic scheme is used.
fglock so Scalar must know that Array doesn't do fetch() 20:52
putter iblech: would a Scalar container ever contain an Array container? 20:53
iblech putter: No, never. $scalar = @array (and even $scalar := @array) always autorefs the RHS
putter so that's the problem. the full stack looks like varname -> varcell -> container -> cell(s) -> value(s) 20:54
fglock works :)
putter I used Scalar as my varcell, so fetch was being overloaded to mean varcell.get. 20:55
;)
svnbot6 r6489 | fglock++ | * perl5/ Scalar - scalar fetch/store without index returns/store the whole Array/Hash
putter sounds right?
iblech What's varcell?
The P5 variable holding the container object? 20:56
putter sure.
iblech Then it's correct, I think :)
putter ok. fixing...
leo__ iblech: wrt @a[$idx] := $val - what should the implementation do if: the array changes, gets, spliced, the item isn't there, gets deleted, ... the array is undefed, rebound, ...
iblech leo__: 1) if $val changes, @a[$idx] gets changed as well, and vice versa 20:57
leo__: 2) spliced -- see 3)
leo__: 3) item isn't there -- fatal error, can't (re)bind non-existing container. if splice deletes an element, $val will still exist (think Unix hardlinks with refcounting) 20:58
leo__: 5) @a = () causes the binding to cease to exist, but accessing $val will still work. But chaning $val won't change @a 20:59
putter fglock: I think the key is, $s = @a, should read $scalar_s = $array_a, with $array_a an Array rather than a Scalar containing an Array, rather than $scalar_s->store($array_a).
iblech leo__: 6) @a is rebound -- same as 5)
putter no ->fetch message, no problem. 21:00
leo__ 4) item is there but changed due to splice -- see 1) 21:01
putter fglock: sounds plausible?
(and faster;)
iblech leo__: Hm, haven't thought of that. This depends on the implementation of splice -- if it simply does @a[some_index] = ..., then 1), but if it @a.delete(some_index); @a[some_index] = ..., then 5) 21:03
fglock putter: I thought it was doing exactly that
leo__ not good - depends on implementation ... 21:04
putter fglock: nope. sorry. the :v toggle to crude_repl will show the compiled p5 code for subsequent entries... 21:05
fglock iblech: each array element must have a cell?
iblech leo__: Right, @Larry has to spec it
leo__ iblech: can you please forward the relevant snippets to p6l - thx 21:06
svnbot6 r6490 | iblech++ | * Makefile.PL: Unbreak make smoke-js (4-char-patch).
r6490 | iblech++ | * t/data_types/array_ref.t: Added another test.
r6490 | iblech++ | * t/general/atoms.t, t/operators/filetest.t: Skip IO tests if $*OS eq "browser".
r6490 | iblech++ | * PIL2JS:
r6490 | iblech++ | * PIL2JS.js: More unbreaking to &prefix:<+>.
r6490 | iblech++ | * P5 Prelude::JS: Fix all the standard ops implemented by P5Macros WRT
r6490 | iblech++ | junction autothreading.
r6490 | iblech++ | * Prelude::JS::Array: Add "is rw" to &shift, &pop, etc. This was not
r6490 | iblech++ | previously necessary because PIL2JS assumed "is rw" on all subs (because
r6490 | iblech++ | -CPerl5 didn't give us that information, but this is fixed now).
r6490 | iblech++ | * Prelude::JS::Hash: Add "is rw" to &postcircumfix:<{ }> (same reason).
r6490 | iblech++ | * README: Update WRT P5Macros and TODO
iblech fglock: An Array contains pointers to other *containers* (the elements). These containers are regular Scalar containers containing a cell
leo__: Will do 21:07
leo__ iblech: then are of course more cases - what happens if the array becomes tied (or was already), passed to a function, slurped, and what not ...
thanks & 21:08
iblech leo__: Dunno about tied, you've to ask autrijus for that :)
leo__: Passed to a function -- no problem, the bindings are preserved
leo__: Slurped -- bindings are lost, as with 5)
fglock putter: $a=@a works now: my @a=(1,2); my $a=@a; - $a[1] shows '2' 21:10
I'll add '$a[1] is Scalar' to TODO 21:12
svnbot6 r6491 | fglock++ | * perl5/ Scalar - fixed $a=@a (again)
putter fglock: yes, but 21:13
I still have to fix the excessive/incorrect use of scalars as part of the variablespace system. 21:14
does p6 still have lhs expression lvalues? (0 ?? $a :: $b) = 3; ? 21:17
fglock @a[1] == Scalar should make @a[1] assignable 21:18
re lvalues - don't know
revdiablo putter: that works in pugs. I don't remember seeing anything saying they are going away. 21:19
putter it does. sigh. looking at the PIL, I dont see an obvious pattern of nodes wherein $a safely goes from being a potentially written varcell to being just a container.
iblech fglock: Right. PIL2JS's &infix:<,> creates fresh containers for the array it's about to build 21:20
fglock: I.e. instead of @new_array[$idx] := @input_array[$idx], it calles @new_array[$idx] = new_scalar_container; @new_array[$idx] = @input_array[$idx] 21:22
putter promises himself to go study all existant documentation on PIL before the next round of flailing.
fglock is there documentation on PIL? 21:23
putter code, mailinglist discussions, and such.
fglock iblech: does PIL creates the scalar container or Array has to implement this? 21:24
iblech fglock: Either &infix:<,> or Array have to implement this. Definitely not PIL.
fglock ok 21:25
putter Does the metamodel include any cell objects? either container -> cell(s) or varname -> varcell -> container? 21:29
which, if the namespace is a hash, are the same thing
iblech leo__: mail sent
fglock no - the cell is a standard p5 object
defined in Container/Scalar.pm 21:30
putter hmm... what else proxies besides Scalar? Ref? anything else? 21:35
fglock I've got @a[1]=3 almost working (some weird behaviour left to fix)
iblech putter: Proxy
putter: (sub foo is rw { return new Proxy: FETCH => {...}, STORE => {...} }) 21:36
putter hmm...
fglock iblech: a Proxy is more or less like a tied Scalar? what's the difference? 21:37
just syntax?
iblech Yes, I think so.
putter in sub f($x is rw) { } f(3), Int 3 gets wrapped in a Scalar? 21:39
or no, a Ref?
err. 21:40
fglock putter: try this - @a=(1,2); @a[1]=3 -- @a is now (1,3) !!! (update Container first :) 21:42
iblech The 3 has to be promoted to a constant container (if it isn't one already). It's still unspecced whether f(3) should fail at invocation-time (as the constant container holding a cell pointing to 3 isn't rw) or only when $x is actually assigned to
svnbot6 r6492 | fglock++ | * perl5/ Array - elements fetched from the array are aliases
putter ^_^ fglock++ 21:43
"constant container"? containers Scalar, Array, and "constant"? 21:44
fglock iblech: I'm creating cells lazily - because I can't create cell in a lazy Array - but it works the same 21:45
putter ooo, fglock, what mechansm did you use for your array element aliases?
fglock putter: black magic :)
putter can I have some for the namespace? 21:46
iblech putter: I expressed myself badly. Not the containers are constant, but the cells of the containers are marked immutable. It's like new Proxy: FETCH => { 3 }, STORE => { die "Can't modify constant...
fglock I'm doing a check during fetch/pop/shift - if the element isn't a Scalar, then I create a new Scalar and put the element inside
putter imagines a varname -> index -> big-magical-array[index] -> magical-varcell 21:47
fglock if the operation was a fetch, then I store the Scalar back into the Array
putter is there a p5 Proxy anywhere?
svnbot6 r6493 | fglock++ | * removed debugging info
fglock putter: what do you need for the namespace? 21:48
iblech putter: tie? But I personally would refrain from implementing P6 Proxy with P5 tie
fglock putter: you can implement p6 proxy with p6 Scalar tie 21:49
very easily
putter ah, wright. you get to use the arrays fetch/store. sigh.
fglock but what are you looking for? 21:50
does p6 have @a[1..2]=(1,2) ? 21:52
putter ok, bottom up. p5 runtime's $scalar_foo, representing p6 $foo. p6_lookup, variable lookup, represented in PIL by PVar, returns something. A "varcell". Something which is read-writable. There is no clear place where the wriable-ness can be dropped, so you cant really plan on stripping varcell down to the contained value. varcell will be doing a *lot* of proxying for that value. 21:53
iblech fglock: It has.
fglock: &postcircumfix:<[ ]> has to be "is rw"
fglock: And, while we're at it, &infix:<,> has to be is rw, too (think ($a, undef, $b) = (1,2,3))
putter Previously, Scalar was playing this role. But it should have been. So we need something else. 21:54
s/value/"value"/. not a value in the sense if varname->varcell->container->cell(s)->value(s).
varcell will spend it's life proxying for containers. Scalar, Array, and Hash. If I could tuck away a \$scalar_foo reference in the container meta-information, for PAssign to use later, I'd be all set. 21:56
fglock it really looks like a Scalar
putter almost. 21:57
fglock or a Ref - both would work. but a Scalar is lighter
putter you could have $scalar_foo is a Scalar, but then when you do $s = @a, you want to do $r = $scalar_s->gimme_reference; $$r = $array_a->hold_this_reference($r) 21:59
$array_a->copy()->hold_this_reference($r) 22:00
fglock $array_a->clone would work
objects are already references in p5 22:01
putter $s := @a would be without the copy()
fglock $s = @a doesn't copy - it just stores the array in the scalar
iblech putter: Larry ruled that $s := @a is the same as $s = \@a 22:02
putter fglock: right, but for assignment, I need a reference to the symbol table entry. since I'd be using the containers to fake an enclosing symbol-table-entry-object.
iblech fglock: err, it just stores a *Ref* to the array in the scalar
fglock sure, but the Ref autoderefs 22:03
putter so the PIL is wrong?
fglock (I don't like autoderefs - you never know what's really happening)
iblech fglock: but only when accessing, not when storing 22:04
putter anyway, that is, I think, secondary. err, but wait. so if varname starts out being bound to a Scalar container, is there any way it can be rebound to an Array container? 22:05
no, because we have typed varnames here in perl. 22:06
fglock iblech: I just checked - it is implemented right (I must have misunderstood what we were talking about)
iblech putter: Right, a $-var *always* points to a Scalar container, and a @ always to an Array, etc. (and a & always to a Scalar which only accepts cells of type Code) 22:07
putter $s and @a are always resolve to Scalar and Array containers respectively?
iblech putter: Right.
putter ok.
iblech fglock: Ah, ok
putter slowly collects twigs, and dust bunnies, and patient guidance, and begins to assemble a clue. 22:08
fglock putter: I also find it difficult to understand. 22:09
most of the bugs I've fixed were because I didn't know what I was doing :) 22:10
landover que es tu problema?
fglock mi problema es que perl6 no esta totalmente especificado
putter iblech++ fglock++ revdiablo++ etal++ # helping putter assemble a clue 22:11
iblech We should probably document this somewhere 22:12
landover si si esta grande problema es la documentaciōæ½xF3n eso mala
putter one last lose end. the PIL currently generated for $s = @a is incorrect, yes? (no Ref anything)
fglock putter: almost everything is in Container/Scalar.pm, if you dare to read it
landover so do you guys have an actual project plan / course of action etc? 22:13
Supaplex the secret to life, the universe, and oh yea, perl itself is housed there
landover just curious
iblech putter: Asked autrijus about this once. The answer was: No, PIL is correct, consider $s = some_sub() -- PIL can't know whether some_sub will return an array or a scalar 22:14
landover ah life = h/v4
iblech putter: Therefore I put the appropriate magic in .STORE
putter ah. ok. more magic comming up. fglock! :)
iblech putter: See PIL2JS/libjs/PIL2JS.js, lines 104-174
putter is there a mm Ref?
fglock must go now :( 22:15
putter: Ref is defined in Value.pm
putter ohhhhh.
ok.
svnbot6 r6494 | fglock++ | * perl5/ Array - more TODO
putter I'll patch and polish. 22:16
You've done a nifty job today.
Now we know why it was "almost" working... it was "almost" correct... ;) (just the bit about array variables having Array containers) 22:18
fglock bye!
putter good night!
svnbot6 r6495 | iblech++ | STATUS: 22:19
r6495 | iblech++ | * PIL2JS passes about 2/3 -> more than 2/3 (73.46% currently :))
r6495 | iblech++ | * putter is merging make targets -> putter merged make targets, and added
r6495 | iblech++ | examples (test-perl5, test-js, etc.)
iblech needs to sleep too. Night all :) 22:20
putter I hereby note for the record that PIL-Run would just sooooooo not be happening at all without fglock and putter.
good night iblech!
iblech oh and putter++ fglock++ # progressing *rapidly*
:)
putter err, that's fglock and iblech.
eeps. *face red*
iblech quits. now *face very red* 22:21
oy 22:22
iblech: please note above. ;) 22:24
to repeat, 22:25
I hereby note for the record that PIL-Run would just sooooooo not be happening at all without fglock and iblech.
ah. done.
svnbot6 r6496 | putter++ | PIL-Run - array variables now get Array containers. p6_set treats $s = @a; as $s = \@a; fglock++ iblech++ Some problems: @a = @b doesnt seem to work, and p5ugs> $s = @a; dies, perhaps because Ref doesnt stringify. 22:54
brentdax Does splat-in-subcall not work yet? 23:07
putter ?eval my @a=(3,4); sub f(@b){join ",",@b} f(*@a) 23:08
evalbotzy '3,4'
brentdax I'm trying to do something like $subref($foo, *@bar) and it's not working--the sub gets an array with the contents of @bar, rather than the contents separated out into parameters.
putter hmm... 23:09
brentdax ?eval my @a=(3,4); sub f($x,$y) { return $x * $y } f(*@a)
evalbotzy Error: No compatible subroutine found: "&f"
brentdax Guess I'll work around it...probably tomorrow, though, rather than tonight. 23:10
putter guess not... 23:11
the PIL looks ok, so maybe on the JS backend? 23:12
brentdax I'm using the default backend.
putter yes 23:13
brentdax I think I ran into this earlier in the project too, but I didn't realize what was going on.
putter hmm, could you zip @a with qw(x y) and call it with the tuples? 23:15
brentdax I don't believe so--that was one of the things I tried the first time I hit this. 23:16
?eval my @a=(x=>3,y=>4); sub f($x,$y) { return $x * $y } f(*@a)
putter ?eval my @xya=(x =>3,y=>4); sub f($x,$y) { return $x * $y } f(@xya) 23:17
evalbotzy Error: No compatible subroutine found: "&f"
putter ?eval my @xya=(x =>3,y=>4); sub f($x,$y) { return $x * $y } f(x=>3,y=>4)
evalbotzy 12
putter ?eval my @xya=(x =>3,y=>4); my $f = sub ($x,$y) { return $x * $y } $f(@xya) 23:18
evalbotzy Error: unexpected "$" expecting term postfix, operator, ";" or end of input
putter ?eval my @xya=(x =>3,y=>4); my $f = sub ($x,$y) { return $x * $y }; $f(@xya) 23:19
evalbotzy 0.0
putter ?eval my @a=(3,4); my $f = sub ($x,$y) { return $x * $y }; $f(@a)
evalbotzy 0.0
putter ?eval my @a=(3,4); my $f = sub ($x,$y) { return $x * $y }; $f(*@a)
evalbotzy 0.0
brentdax ?eval my @a=(3,4); my $f = sub ($x,$y) { return $x.ref ~ $y.ref }; $f(@a) 23:20
evalbotzy 'ArrayScalar'
putter bah. so both function resolution and argument binding seem to be troubled.
brentdax er,
?eval my @a=(3,4); my $f = sub ($x,$y) { return $x.ref ~ $y.ref }; $f(*@a)
evalbotzy 'ArrayScalar'
putter or, maybe just prefix:<*>.... 23:21
?eval my @a=(3,4); map{.ref} *@a 23:22
evalbotzy (::Int, ::Int)
brentdax There's a problem with the ref-to-sub stuff too, I think--calling through a subref should defer signature checking, not disable it.
putter ?eval my @a=(3,4); my $f = sub ($x,$y) { return $x * $y }; $f(map{$_} *@a)
evalbotzy 0.0
putter ??
brentdax ?eval my @a=(3,4); my $f = sub ($x,$y) { return $x ~ $y }; $f(map{$_} *@a) 23:23
evalbotzy '3 4'
brentdax ?eval my @a=(3,4); my $f = sub ($x,$y) { return "$x,$y" }; $f(map{$_} *@a)
evalbotzy '3 4,'
putter ?eval my @a=(3,4); map{.ref} 'a',*@a,'b' 23:24
evalbotzy (::Str, ::Int, ::Int, ::Str)
putter ?eval my @a=(3,4); map{.ref} *@a,'b'
evalbotzy (::Int, ::Int, ::Str)
putter ?eval my @a=(3,4); my $f = sub ($x,$y,$z) { return "$x,$y,$z" }; $f(77,*@a) 23:25
evalbotzy '77,3 4,'
putter ?eval my @a=(3,4); @a.ref 23:26
evalbotzy ::Array
putter ?eval my @a=(3,4); my $f = sub ($x,$y,$z) { return "$x,$y,$z" }; $f(map{$_} 77,*@a)
evalbotzy '77 3 4,,'
putter sorry brentdax, no quick fixes come to mind. 23:28
brentdax I expected as much. Nasty workaround time, I suppose, which means I'll wait until tomorrow. 23:29
putter ok. (we need to find autrijus some funding...) 23:30
end of day for me too I think.
geoffb g'night, putter 23:31
brentdax G'night.
putter good night &