Pugs 6.2.6 uploaded by cpan-upload.p6! | pugscode.org/ <Overview Journal Logs> | pugs.kwiki.org | paste at sial.org/pbot/perl6
Set by integral on 2 June 2005.
Alias_ Hi folks 00:02
Juerd Hello, :=
Alias_ Anyone know where I can find the docs for the 'as' function
Alias_ is debating turning Params::Coerce into a more general as.pm P5 module
Juerd No, but should you find it, let me know :)
Alias_ I'd like not to cause terminology clashes withy P6
Juerd: Well... there's something already that lets you define a Foo as Bar type thing 00:03
right?
Juerd There are IIRC $object.as(SomeClass) for explicit coersing
Alias_ that's it
hmmm
Juerd And as(format, LIST) to replate sprintf
Alias_ Where is that documented?
Juerd And there is a postfix as that joins is and but, that does the same thing
Alias_: p6l 00:04
Alias_ So not in the docs?
Juerd nafaik
Alias_ ok then...
hmm
use as something => 'method';
use as something => sub () { }; 00:05
use as something => \&function;
look good to you?
Juerd No
Looks perl5ish.
Alias_ Well, this is a Perl5 as.pm
Juerd I don't know what as.pm does, but this syntactic sugar is very perl6 ish
Realise for example that => now creates a pair 00:06
Alias_ as.pm doesn't do anything in P5 now, it doesn't exist
Apparently I'm the only person doing coercion
A pair may well still be appropriate in that case 00:07
Juerd Yes, but "as" reads like a prefix 00:08
"use as $pair"
That should make sense as well as the literal pair, for this syntax to look good to me.
Alias_ fair nuff
But then we have a syntax for P6 already
And it's some sort of multi-method declaration 00:09
Juerd "use foo as bar" makes more sense, and this really makes me wonder if you should use a "pragma" for this. We have better syntactic sugar through macros now.
Again, I have no idea what this as.pm should do
Alias_ Well, provide a declaration point for coercion in P5
maybe asa, instead
Task on UNIVERSAL::asa :) 00:10
s/Task/Tack/
That would be even more Perl5ish
Juerd It's really unclear to me.
Alias_ $Object->isa(Foo)
$Object->asa(Foo)
etc etc
Juerd is this "can coerce to Foo"? 00:11
Alias_ yes
Juerd That's does
Alias_ See Param::Coerce for my existing implementation
sorry/
Juerd And whether it coerces or just fakes it, shouldn't be relevant, should it?
Alias_ hmm... possibly
Juerd (Same reason why you use isa, not ref, in p5)
Alias_ Depends if you want something that obeys an API, or you want the ACTUAL is 00:12
Juerd afk
Alias_ ok
luqui I think ACTUAL is should be hard
and obeys API should be easy
Alias_ luqui: The big difference is that it might not be trivial to get the ->as thing... 00:13
You might need to create a whole new object
And doing that per-method call could be bad
Juerd Alias_: $foo as Str
(~$foo)
Alias_ The trivial ones are trivial, yes :) 00:14
Juerd I don't know if that clones.
Alias_ That's hard too
To clone or not to clone is a bitch
Juerd Yes, because if you don't clone, you mutate, and that may cause action at great distance
Alias_ Although there could be clues if you wanted the as thing to be rw or ro 00:15
Juerd At least with IOKs NOKs and POKs you know what you can expect ;)
Alias_ But then that's got other issues
anyways
back to work
Juerd wonders if autrijus has stopped writing journals altogether 02:11
Alias_ You mean other than the daily summary? 02:12
ingy seen autrijus 02:29
jabbot ingy: autrijus was seen 18 hours 2 minutes 29 seconds ago
Arathorn presumably post-release fatigue 02:35
svnbot6 r4385, ingy++ | ingy the human spelling/grammar checker 03:16
Alias_ heh
PerlJam Arathorn: or he could have been hit by a truck. 03:17
(pugs' truck-number is 1 I think as autrijus *is* the momentum of the project)
Alias_ Hey ingy, any news in the last month of Kwiki::Publish related work? 03:28
gaal hola! 03:34
Darren_Duncan hola 03:40
ingy hola 03:41
Alias_: :p
Alias_ Tell me that's a yes :)
Darren_Duncan if I remember right, there'll be a hackathon in about a week in Europe 03:43
so it probably makes sense to me that 6.2.7 will go out just before that, and perhaps 6.2.8 soon after 03:44
likewise just bounding the larger one in Toronto 03:45
in any event, I plan to revisit Locale-KeyedText in a day or two, or today, and try to get *all* of the tests to pass before the Europe hackathon 03:46
likewise for SQL-Routine prior to the Toronto hackathon
fyi
04:13 batdog|gone is now known as batdog 04:35 theorbtw2 is now known as theorbtwo
autrijus er, I'm alive. 04:46
I'm just, like, working on the paper and other preflight -- literally -- things
theorbtwo autrijus: I'm dropping castaway off at a flight soon... 04:48
When is yours?
IIRC there's not going to be much connectivity at the Vienna hackathon?
autrijus the vienna hackathon will be at Leo's no? 04:49
which means ISDN
I think there's also network around the conference
my flight is some 60 hours from now
Alias_ autrijus: You know what happened to Dan?
theorbtwo Oh.
Alias_ out of curiosity...
autrijus what happened to Dan?
Alias_ He quit parrot...
autrijus oh. Leo changed his design and things. 04:50
Alias_ ah
so subsystem wars?
autrijus and communication problems, yeah
mm he's not in #parrot anymore 04:51
so probably quitted for real
Alias_ it's on his Parrot blog
autrijus reading 04:52
Alias_ little information
autrijus hmm he thinks only Larry remains of the original Perl 6 team. 04:53
Schwern is still around -- kind of
Alias_ He had to get a job or something
I tried to find a project for him, but $client pulled out. 04:54
autrijus aw.
Alias_ So I imagine he's doing whatever work he could find 04:55
autrijus k.
blah.
I'm now _really_ glad that I'm not involved with the cabal whatsoever :) 04:56
Alias_ Still... it's a bit annoying seeing Perl 6 wandering off in the cabal's personally prefered direction
autrijus hm? 04:57
Alias_ doesn't like several parts of Perl 6 :)
autrijus not sure what you mean
Alias_ For starters, attribute addition
Alias_ is not a huge fan of attributes... It's never caused a problem for me to not have them 04:58
Except now I can't dictate the order in which my constructors get called
autrijus uh p5 has attributes. 04:59
not sure how it relates to constructor order though.
Alias_ As an optional extra
Oh, when you have attributes and so on, there seems to be a natural progression to having to have constructor automation
gaal hey autrijus, welcome back. how do i cause a fail to raise an exception from Prim.Eval? :)
Alias_ And thus, defining one true way to do constructors
gaal (see the FIXME on line 82) 05:01
autrijus Alias_: you mean BUILD and BUILDALL? 05:04
Alias_ shudders
autrijus there's a well-defined order but you can override it freely, I think
Alias_ I hope so
autrijus er, it works in pugs 05:05
you can see it in action :)
gaal goes to $work - will backlog. &
autrijus gaal: fail"" will throw exception no?
Alias_ I was extremely handy to be able to either call superclass first, and do additional init, or be able to get in BEFORE the super and modify the constructor params before passing through, or both
Not to mention BUILD is a horrible name :)
autrijus Alias_: er sure... by definition your own "new" you still have exact control 05:06
Alias_ I thought we couldn't do that because the autoconstructy stuff had to run properly
Alias_ throws further problems aside till he gets the chance to play for real 05:10
Wish I had a good reason to use P6
;)
autrijus :)
all that changes is there's a minimal implementation of UNIVERSAL::new.
Alias_ hrm... 05:11
ok
BTW, I've finally gotten sick and tired of others talking about JSAN and not going
autrijus JSAN?
CPAN?
Alias_ JavaScript CPAN
ali.as/devel/PSJS/
ali.as/devel/PNJS/
nothingmuch morning 05:12
Alias_ So I've started it myself
autrijus oh cool... I think. where do I upload?
Alias_ You don't yet :)
There's some missing pieces still
autrijus oh. well. :) 05:13
Alias_ Need to get stuff like base.pm ported over
QtPlatypus Shouldn't that be CJAN?
Aankhen`` Yeah...
autrijus that'd be Java ;)
Alias_ QtPlatypus: The term being throw around the net has been JSAN
thrown
Aankhen`` JavaScript Comprehensive Perl Archive Network? :-S
autrijus JEAN for ecma maybe 05:14
Aankhen`` Oh, sorry, I read it wrong.
JavaScript Archive Network, hmm?
Alias_ Mine is still PNJS for just "Phase N JavaScript"...
autrijus hm, that'd be CEAN
Alias_ ECMAPAN
CECMAAN
erk 05:15
ECMASAN ...
Aankhen`` stares in fascination at Alias_.
Alias_ blushes
autrijus: Anyways, two main issues to resolve, being some class creation helper stuff, and how to not have one giant tree, then I'll open it for business 05:16
Oh, and the JavaScripdt::Pod parser
Alias_ couldn't resist the combination of POD and JavaScript
svnbot6 r4386, autrijus++ | * Pugs's contributions; PGE and PAST 05:28
nothingmuch what's PAST? 05:32
Aankhen`` Parrot AST? :-D
nothingmuch uh, ok =) 05:33
autrijus yup.
Aankhen`` ^_^
Aankhen`` BBL.
&
nothingmuch ciao
05:34 batdog is now known as batdog|gone
Darren_Duncan just got back ... re the conversation an hour ago ... 05:36
sorry to hear about Dan
for some reason I thought all those people were a big happy yadayada and not that there were problems (other than having bread money) 05:37
I'd hate for the group to become disfunctional 05:38
svnbot6 r4387, autrijus++ | * minor reorg of paragraph
autrijus indeed.
however my brain is feeling quite dysfunctional 05:44
05:44 batdog|gone is now known as batdog
autrijus writing English is definitely not my forte 05:45
Alias_ How about speaking? 05:48
autrijus I can manage but not either
Alias_ If your code wasn't so twisty sometimes, it probably wouldn't matter so much :) 05:49
not bad, just very "advanced" 05:50
I speak here of M:I :)
autrijus :)
gaal|work heyagain. autrijus, no, fail does not raise an exception - you can comment out the trace in Pugs.Prim.Eval ~ 80ish and see (eg "use" a nonsense file)
autrijus gaal: it just silently fails?
gaal|work yes
autrijus gaal: do you want the failure to be trappable? 05:51
gaal|work that block is entered all right
autrijus i.e. inside eval""
try simply return a VError?
gaal|work hmm, it's for evals which have the EvalErrorFatal style
(your suggested refactorings are in)
okay, that's an idea :)
autrijus if you want to force failure, ioError 05:52
gaal|work also: how do i get a VCode from an env? without looking up $&SUB
autrijus ioError :: IOError -> IO a
you want to what?
what VCode?
liftIO $ fail "this will always fail" 05:53
is the way to raise ioError
gaal|work sorry, different subject. in doing caller, i want the subname etc., not just the line and filename.
autrijus you can read $?SUBNAME
gaal|work i will try the ioError thingie.
autrijus if you want more things, you need &?SUB.
gaal|work okay, i was sorta under the impression i should be able to do it without going throuh symbols 05:54
ingy autrijus: working on a little surprise for pugs dev 05:55
autrijus when we switch to CC_2CPST we'll have that sort of introspection.
ingy: oooh
ingy hopefully it will be of use 05:56
autrijus gaal: the current reductino has no notion of tree position
gaal|work all right, i'll go that way for now. we can always refactor.
thanks.
autrijus gaal: the plan is to switch the Eval monad to a ZipperD that can remember where in the entire envExp we are
np :)
gaal++
ingy anyone know how to redirect STDOUT or STDERR to a string at runtime? 05:57
gaal|work in p5?
ingy nod
gaal|work Test::Output has some nifty code to lift
autrijus $*OUT = open(...)
Alias_ ingo: overwrite it with a IO::Scalar
oh wait, wrong channel
:/
Alias_ wanders off 05:58
autrijus it's actually the right channel.
$*OUT = open('>', $scalar); # ought to do that, but not yet implemented
ingy autrijus: perl*5*
autrijus it's a matter of implementing the IHandle class
gaal|work autrijus, prolly not!
autrijus ingy: oh. heh.
gaal|work hmm 05:59
autrijus you can tie STDOUT. easiest that way
ingy thanks
gaal|work well or maybe yes
autrijus np :)
gaal|work but the open will be spelled differently
autrijus *nod* 06:03
Darren_Duncan I plan to continue hacking LKT tomorrow or monday, to get all the tests working ... see y'all then
meanwhile, its perl 5 for me
autrijus cool. see ya! 06:05
Darren_Duncan fyi, the last thing I was trying to do during my commit last week was explicitly return a hash reference from a function, and not a list; I never figured out yet how to get that working 06:07
at least, no matter what I did in the function that returned the value, calling .ref() on the result always returned List and not Hash, what I wanted 06:08
svnbot6 r4388, autrijus++ | * fixes from obra's review
r4389, eric256++ | Apparently this commit didn't stick last time so i'm trying agian. Unit module start. Not much here yet
eric256 autrijus any ideas when overloading with class's in the signature should work?
Darren_Duncan anyway, I'll bring this up again next day if necessary 06:09
good night
autrijus overloading as in overloading operators? 06:10
multi sub &infix:<+> (Unit $x, Unit $y) { .. .} 06:11
it should work -- Set.pm uses that
hey chromatic. I managed to finish the non-haskell part of my paper!
eric256 i've heard that before. but when we investigated it looked like that part of Set.pm wasn't actualy working, and the OO tests for it where marked as todo...unless that changed since last night
chromatic Excellent. Did you check it in? 06:12
autrijus chromatic: yes. I'd appreciate a sanity check because I had no first-hand knowledge.
chromatic Alright, I'm looking through that as I'm waiting for my compile to fail. 06:13
sial.org/pbot/10701
:)
autrijus chromatic: it's in docs/talks/hw2005.txt
chromatic Hm, there was/is an attempt in Parrot's languages/perl6. It's on its second or so version right now.
autrijus chromatic: er, this is about which sentence? 06:14
chromatic The problem was three-fold. First, there were very few people working on it. Second, it's really hard to write parsers for Perl 6 with any sort of performance. Third, Parrot wasn't very mature.
First paragraph, final sentence. I think my comments are semantic quibbles though.
autrijus (I gave a treatment of P6C in the "related work" thing)
better wording than "materialise" welcome :) 06:15
chromatic "flourish"?
autrijus eric256: it wasn't? ext/Set/t/overload.t worksforme
"take off" perhaps/
?
eric256 i'm updating right now and i will check it agian
autrijus chromatic: er, hey, $?SELF 06:16
chromatic In the sentence about the unusual execution model, my understanding of the current understanding of the plan is that the parser and compiler will be overridable in Perl 6, sort of like how you can rewrite the VM in Smalltalk... if you really want to. 06:17
autrijus chromatic: I think you can take (Val (argValue $ head bound))
chromatic I mean GC.
autrijus to be the invocant.
chromatic I'll try that, thanks.
autrijus "to be overridable in Perl 6" 06:18
how is it different from my "implemented as a Perl 6 program"?
chromatic There's some doubt that it will actually be Perl 6 code.
Think CPerl not Perl. 06:19
autrijus I cannot easily think how you can override a nonperl6 compiler with perl 6 code.
unless the said compiler embed perl6
chromatic You can override built-in functions of Perl 5 with Perl 5 code, even though PP code is C.
autrijus I fail to understand. 06:21
chromatic Look things up by name and swap names or look things up by pointers in vtables and swap vtables.
autrijus this is maybe confusing Perl 6 the self-hosting language
chromatic Just don't always jump to memory addresses! 06:22
autrijus with something that is more like Perl 5 where the compiler and runtime are the same thing.
or is the plan no longer for Perl 6 to be self-hosting?
if so that is not yet well-known :)
chromatic The plan is for Perl 6 to be able to be self-hosting. 06:23
That does not change.
The pragmatic is that the lowest-level parser may not actually be self-hosting Perl 6 rules.
autrijus say I'd like to port perl 6 to llvm. 06:24
chromatic I can hook you up with $4500 if you do!
autrijus the procedure to do that is very differnt for a self-hosting language
and a language that depends on some other language for compilation.
chromatic Okay, I will try to be clearer. 06:25
Yep, self-hosting is a goal and a plan.
The default implementation may cheat by not self-hosting until you override that.
That's a *may*.
autrijus oh then it's just optimisation hack. 06:26
that's fine.
chromatic Yes.
autrijus "Perl 6 proposes an unusual execution model to address this problem. The parser
and compiler are implemented in Perl 6, with an initial set of Rules to parse
source code into ASTs."
better?
chromatic Wiggle room. Better.
autrijus 'kay.
chromatic I'm not sure about the intent that Perl 6 should run on CLR or JVM.
I do admit to some personal dubiousness about at least one of them. 06:27
autrijus okay. it's however widely advertised though. 06:28
for example, dev.perl.org/perl6/ -- "Interchangable runtime engines let you interpret your bytecode or convert it to something else (e.g., Java, C, or even back to Perl)."
among several places.
chromatic Hm. Stick with the wide advertisement then. 06:29
autrijus ;)
chromatic Hm, my new code still isn't working.
Were you suggesting that I replace the Var "$?SELF" with the code you posted? 06:30
autrijus yeah.
btw, today I encouraged Bestian to apply for summer of code's perl 6 hacking.
chromatic I have
autrijus not sure if he'll end up going to OOo or something else, though 06:31
chromatic (Syn "=" [Syn "{}" [(Val (argValue $ head bound)), Val (VStr key)], Val val]) ...
at the start of the list comprehension in applyExp.
autrijus yes, that's the idea. doesn't work?
chromatic I'm still seeing the undeclared $?SELF errors. 06:32
autrijus so you're seeing the errors with writing $?SELF
you sure it passed compilation?
chromatic Yep, everything went fine.
In the second paragraph of 3.1, there's a possible interpretation that Perl6::Rules might have worked on older versions of the regex engine. No chance! :) 06:33
autrijus it did pass tests. 06:34
chromatic Damian bumped up against the regex size limit a few times. I don't remember if he had re-entrancy issues, though I know that the closure problems are troublesome.
eric256 autrijus almost all the tests in \ext\Set\t\overload.t are marked as todo.
autrijus 132552 PASS 5.8.2 on Freebsd 5.2-current (i386-freebsd)
eric256: are we looking at the same file? 06:35
I see 4 todo tests
and 7 skipped
chromatic ahh, I do remember P6::Rules failing on 5.8.3 or something. Good point.
autrijus with some 20ish working
closure problems? 06:36
chromatic In 3.2, another of the problems with P6C is that Parrot changed calling conventions a few times.
(?{}) constructs in regexes.
They're sort of code and sort of not. They're really weird lexically.
eric256 the first test in the one i am looking at is the infix one on line 17 which is marked as todo... my early guess at most was wrong, but many more than 4 marked as :todo(somereason) 06:37
autrijus chromatic!
class Foo { has $.z; method bar ($.z) {} } my $x = Foo.new; $x.bar(3); say $x.z
this yields "3"
chromatic Which revision?
autrijus the same code as you pasted -- I'll commit
chromatic Try the T::B tests. 06:38
autrijus sec. 06:39
the 4 are in line 17, 21, 41, 47
eric256 is confused
svnbot6 r4390, autrijus++ | * chromatic's initial review
r4391, autrijus++ | * Support for `method foo ($.x) {}` to set $.x.
r4391, autrijus++ | Submitted by: chromatic
autrijus the bottom 7 are skipped and arguably shouldn't be supported at all
note the "exit" in line 88 and "skip_rest" 06:40
eric256 that test file takes forever to run
autrijus literally? :-/
eric256 the skipped one is infix:<+> though, so is this a bug with just + (/me missed the exit)
i started the test when you mentioned it, and it just failed the second todo (~) 06:41
autrijus chromatic: which test you want me to try? 06:44
chromatic 021*t
02[1-4]*t all give the same failure.
autrijus there's no $?SELF errors.
also I see 06:45
ok 5 - diagnostic() should report the default diagnostic if needed # TODO feature
chromatic Odd.
Why am I seeing errors and you aren't?
I just updated and am rebuilding.
eric256 thinks autrijus has a secret advanced copy of pugs. ;)
autrijus right, and I'm just handing out bits at a time.
wouldn't that be nice :) 06:46
gaal|work ghc-6.4 is still ok, right?
autrijus gaal|work: I use 6.4
is 6.4.1 out?
gaal|work no, but 6.5-snapshot is always an option :)
autrijus years of freebsd experiences taught me to not trust snapshots :) 06:47
gaal|work (new machine here. compiling perl5.8.7 as i speak)
so *that's* why you release pugs so often! :)
autrijus exactly! 06:48
nothing better to keep people honest than relenging
chromatic autrijus, now I think they're only getting the default values and not any passed-in values.
autrijus class Foo { has $.z; method bar ($.z) {} } my $x = Foo.new; $x.bar(3); say $x.z;#3 06:49
chromatic method bar ($.z = 6)
autrijus you really want a ?.
?$.z=6
chromatic Yes.
autrijus the parser should maybe warn for syntax error.
chromatic So should my brain, but I don't think it runs any language either of us know. 06:50
gaal|work we don't have warnings at all, do we? also: how would we write tests for them?
autrijus chromatic: in fact writing ($.z=9) gives out syntax error.
chromatic Good. 06:51
autrijus gaal|work: well, we can call op1 "warn" or refactor it to "warn" primitives in the eval monad
gaal|work: but I'm not at all sure what perl 6's warning model is 06:52
rebinding &warn makes it testable.
eric256 finaly discovers he is fighting with operator precedence without even knowing it 06:53
autrijus eric256: sometimes the ":d" command in pugs shell helps
:D too
eric256 my $x = 5`F; my $y = 6`M; my $z = $x + $y; # works
while
lathos What on earth does that mean? 06:54
eric256 my $z = 5`F + 6`M; #fails very quitly
` is an overloaded operator to pretend to handle units
pasteling "geoffb" at 69.110.115.185 pasted "Something not right with use Foo--perl5; supposedly equivalent code in p5 and p6 don't act the same (but don't crash, either)" (42 lines, 1.1K) at sial.org/pbot/10733
lathos oh.
autrijus ah. wait. damian said something that makes it tighter (or looser) than plus
geoffb autrijus, can you look at the above paste and give me an idea whether it's a known problem, or how to start debugging it? 06:55
autrijus he suggested looser than <+> by default.
that will also mess with your 5`F thing.
eric256 btw i had a problem in the debuger i loaded the unit file, but then executing the above line worked while :d ing it failed... let me go get the error it gave 06:56
autrijus geoffb: try forcing a cast.
glClear(+GL_COLOR_BUFFER_BIT);
eric256 any way to specify precedence?
autrijus glClear(~GL_COLOR_BUFFER_BIT);
glCleaint (~GL_COLOR_BUFFER_BIT);
glClear(int GL_COLOR_BUFFER_BIT);
geoffb: it is possible that glClear doesn't grok overloaded SVs.
forcing a cast will ensure we only pass back a single SvIV (or SvPV etc)
chromatic IIRC, those are constant subs in Perl 5.
geoffb Hmmm, OK, lemee give it a try 06:57
autrijus chromatic: yeah, but I don't think the wrapper groks that
they will become compound values after roundtrip
there's a todo for that too I think
lathos autrijus: Has anyone offered to proof your Haskell Workshop paper yet? If not, consider this an offer
chromatic S'okay, SDL constant handling gives me the howling fantods anyway.
pasteling "eric256" at 69.234.147.101 pasted "odd" (8 lines, 236B) at sial.org/pbot/10735
geoffb + didn't work, trying int
autrijus eric256: "is tighter" and "is looser" and "is equiv" -- see S03 -- there's no tests! please write some. 06:58
chromatic autrijus, see t/oo/attributes.t test 59 please.
autrijus (also, not implemented yet)
eric256 watches clock tick towards midnight and thinks... maybe tommarrow.
autrijus eric256: ok :)
eric256 i've just been having a heck of a time narrowing this down because i thought it was a signature error and it turned out to be a precedence error. check my paste there, made debuging a little hard 06:59
autrijus chromatic: eerie
eric256: ok, will check.
eric256: get some sleep first then :)
eric256 later ;)
autrijus lathos: offer gladly taken.
chromatic "but I LIKE having the default value!"
autrijus lathos: please commit ahead in docs/talkes/.
gaal|work beh, 5.8.7's cpan is broken, i think. 07:00
autrijus I'll 3-way merge as needed
svnbot6 r4392, chromatic++ | Added tests for optional default attribute/non-attribute values in methods.
geoffb int and ~ no workie as well. Hmmm, perhaps num cast for the args to glClearColor . . .
autrijus geoffb: :-/. you can debug the roundtrips in src/perl5/perl5.c
if clkao is around, bug him as well -- I may need to run for food soonish 07:01
geoffb autrijus, OK, thanks.
autrijus lathos: I need to submit it before APW, though, so it'd be best if you can proof it this weekend 07:02
chromatic Eerie?
gaal|work ngg!@#!@#! why does perl5 still not ship with something that can do http!? bootstrapping cpan with ftp.exe is such a pain. 07:03
lathos I'll do it this afternoon.
autrijus lathos++ 07:06
chromatic: 07:07
class Foo { has $.z; method BUILD (?$.z = 9) {} }
my $x = Foo.new( z => 10 );
say $x.z
# 10
chromatic: I'd love to triage from this to the t/oo failure 07:09
but I really gotta run. bbiab
chromatic Sure, I need to sleep now too.
autrijus =)
geoffb I should probably do the same, given that I share chromatic's timezone. 07:11
gaal|work gnight, geoffb. 07:12
geoffb autrijus, what's your usual time range in here? I have the sinking feeling it's almost precisely centered over my sleep cycle. :-(
gaal|work autrijus nevre sleeps (except for when he does)
geoffb That's why I said "in here" . . . :-) 07:13
ah well, looks like I managed to hit his food cycle. :-) 07:14
OK, g'night all. 07:15
gaal|work bye.
autrijus geoffb: so I'm GMT+8 07:18
geoffb: and I usually sleep at anywhere between 2pm to... 2pm
of the next day, thatis.
or maybe the same day and I only sleep for an instant. hard to tell sometimes 07:19
svnbot6 r4393, gaal++ | "critical" evals (use, require, prelude) now raise exceptions on comilation errors (autrijus)++ 08:28
r4393, gaal++ | TODO: figure out why error coordinates for Prelude are wrong;
r4393, gaal++ | Have the build process sanity-test the Prelude
gaal|work in make, is there no (nice) way of saying "this rule must be run *after* a target is built"? 08:42
like a dependency, but post-
the problem i want to solve: 08:43
Prelude.pm is now loaded on every pugs start
so if someone breaks prelude, it's an immediate pugs breakage, but will only be seen when pugs is run 08:44
i want 'make' to do 'pugs -e1'
but i also want make [un]?optimized to do that
integral hmm, make make test faster so we can all run it before check in ;-) 08:48
svnbot6 r4394, gaal++ | cosmetics
gaal|work make pugs blazingly fast so we can all run a full smoke test, you mean :)
ah 08:49
that *is* what you said
i didn't see the word 'test'
we're at the end of the weekend here, you see.
integral or have some subset of tests that just run some basic tests
gaal|work t/sanity? good idea. 08:50
nothingmuch i hate online bank policies 09:03
i have a good password I use for few things 09:04
i remember it well
i could use it for the bank, but no
gotta change password every 3 months
this way i forget it, and i have to write it down somewhere
so obviously my account is much more secure this way. =P
Enveigler Anyone know of any examples that use Haskell FFi to map over a Cstruct that contains two or more fixed-sized C-style byte arrays? 09:40
10:49 sbkhh is now known as Odin-
nothingmuch Enveigler1: did you ask on #haskell? they are usually very helpfufl 11:18
svnbot6 r4395, simon++ | Style and grammar nits.
Enveigler1 nothingmuch: I haven't found my way over there yet. Mostly cos I don't think that I can express my questions in a way that will engender answers. A complement to the Haskel LibRef that gave a few examples would be so nice. Especially if I could type those examples into GHCi and have them do something other than give me a message that isn't even clear as to whether what i've done is an error or not!. 11:35
nothingmuch i think you should give #haskell a try, they are good folk 11:36
Enveigler1 What does "module `Foreign' is a package module" mean? Is that an error? A statement of fact? A random quote?
nothingmuch as for refs... sorry, can't help you, not enough of a know-how myself
i think it's a statement of fact
in relation to an error
Enveigler1 :) Thanks!
Sorry if that wasn;t meant to be funny, but it made me laugh anyway! 11:37
I'll try #haskell. 11:38
Hmmm. Safe sex and non-monogomous relationships seems to be th etopic over there at the moment :( 11:41
crysflame heh
lightstep Enveigler1, don't fear. on-topic is always on-topic 11:42
Enveigler1 I was trying to think of some connect between safe-sex and referential transparency?
lightstep don't 11:43
they just like talking about sex every few weeks
Enveigler1 'K :)
sri_ hmm...wonder if Dan ever looked at Pugs...no wonder one gets bitter when he just sees Parrot... 11:56
crysflame he was in #perl6 from time to time
at least, i saw him once and i think twice
could have been a different Dan 11:57
sri_ we have 2 or 3 dan's alone in #catalyst ;)
crysflame lightstep++ # "they" could be any community
sri: mm, yes
wolverian sri_: don't use the apostrophe for plurality :) 11:59
sri_ oh, not another inquisitor...
wolverian the others are just mild copies of me! 12:00
sri_ hah, i'm used to having an editor of the oxford english dictionary around ;P
wolverian "I'm" 12:01
(that's the only capitalization rule I'm going to nit about)
sri_ you would like each other... 12:02
scook0 wolverian: even when I'm typing in all lowercase, I can't bring myself to type 'i' :)
sri_ i even use the oxfor comma now "1, 2, and 3" :) 12:03
oxford
wolverian scook0: right. I think mostly lower case is okay for IRC, but lowercasing 'I' is just nefarious.
sri_: are you british?
sri_ i'm german ;)
i should invite jesse... 12:05
svnbot6 r4396, iblech++ | hw2005.txt -- Typo fixes.
sri_ :)
crysflame i use apostrophes on irc to differentiate plurals from nicknames 12:06
lathos's
if you consider 'lathos' a pictogram formed of a series of strokes known as 'ASCII'..
wolverian lathoses 12:08
okay, food! bye.
nothingmuch lathoss 12:11
that looks like a typo
Enveigler so much for #haskell :( 13:03
svnbot6 r4397, autark++ | * Made the \q[...] interpolation in singelquoted strings accept all q-structures. 13:51
r4397, autark++ | * Added tests for \q-interpolation
gaal|work i want to introduce a deprecation warning to the "open" builtin (people should now use File::open). is adding a call to op1 "warn" "blah blah blah" in the open Prim the way to do it?
pjcj Do things need to be deprecated at the moment? I thought they just needed to be made to work according to spec. 13:54
integral would take the view that if something's never been in a synopsis, it doesn't need deprecation 13:55
gaal|work okay, then i'll just go ahead and break open :-) 13:56
i wanted to be nice to module/tests authers
authors
autrijus er. open() is not builtin anymore?
gaal|work i can't type
autrijus I thought it's imported from File:: by default
gaal|work do we have import?
autrijus I may be imagining things though
we do have "is export" and aliasing
gaal|work there's a Prim
autrijus if you declare File::open as "is export" it will be exported to main 13:57
gaal|work cool, then this should be almost a silent move
integral it still shouldn't be a prim
gaal|work except that ">filename" no longer works that way.
it isn't a prim.
autrijus wouldn't it be nice to say
gaal|work i mean the one called from prelude
autrijus is (unsafe & primitive & export)
but I'll not jump to implement that
integral that would be nice :-)
gaal|work though it does rely on Pugs::Internals::openFile, which is. 13:58
autrijus that is an implementation detail
gaal|work okay, breaking some code. ;-)
autrijus people are not supposed to call that anymore than calling Internals::rehash_seed 13:59
or "Internals::hv_clear_placeholders
(both are perl 5 primitives.)
gaal|work right.
integral or Internals::SvREADONLY on arrays... 14:00
autrijus or (GHC.Prim.State# GHC.Prim.RealWorld)...
theorbtwo Or Internals::SvREADONLY on true and false.
integral hmm, implementing Prelude.pm for perl5 might be interesting
theorbtwo integral: Largely you could steal the algos from other modules.
For example, there's a sin in Math::BigFloat that I don't think relies on the core's sin. 14:01
Allo, all.
integral I'd like to get rid of opcodes like ghbyname (gethostbyname)
svnbot6 r4398, autrijus++ | * change RuleState constructor to MkRuleState to agree with
r4398, autrijus++ | the Pugs convention.
autrijus I think it's fine for pugs -- like any runtime -- to have internal primitives that may change from time to time :) 14:03
āˆ€ moon. āˆƒ side āˆˆ moon | side ā‰‘ dark 14:04
integral hmm, what's the difference between a primitive and something like XS?
gaal|work giggles. autrijus' lambda looks like the hebrew letter gimmel.
autrijus gaal|work: there's no lambda :)
gaal|work really?
my name starts with that letter.
ōæ½xE2ōæ½xEC 14:05
autrijus that line (in UTF8) reads: "forall moon. there exists a side that is member of the moon geometerically equal to dark"
but maybe I'm not setting encoding correctly...
integral no, you're find autrijus, that's utf-8 14:06
gaal|work in what calculus?
integral I can't see gaal|work's character(s) though
autrijus gaal|work: in #perl6 calculus
integral *fine
autrijus integral: curiously, neither can I
autrijus checks in an entire section 4 14:07
50% done, only 90% to go
er, I mean 100% to go 14:08
scook0 autrijus: are caller side splatted arguments broken, or just unimplemented yet? (responding to andras on p6l)
autrijus scook0: they are unimplemented. 14:09
scook0 I thought so
autrijus currently the splat acts somewhat like "list"
but that's the extent of what it does
theorbtwo I thought caller side was working, and callee side was parsed-but-ignored?
autrijus I wouldn't say it's ignored...
?eval *[1,2], *[3,4] 14:10
evalbot6 (1, 2, 3, 4)
autrijus ?eval [1,2], [3,4]
evalbot6 ([1, 2], [3, 4])
knewt gaal|work: could you just repeat the letter from earlier please?
autrijus but in function argument position, it does not automagically promote the corresponding parameters to slurpy
gaal|work knewt: ōæ½xE2 14:11
Aankhen`` scook0 >> Are you planning to respond to the Rules question too, by any chance? 14:12
autrijus it requires some analysis for args in bindParams -- not trivial but is a quite contained change
lathos++ # proofreading
knewt gaal|work: excellent, i've got charset conversion set up properly for you now :)
scook0 Aankhen``: no I'm not, so feel free
svnbot6 r4399, autrijus++ | * hw2005.txt -- section 4 complete!
Aankhen`` Mmm.
gaal|work amn't i sending utf-8? 14:13
Aankhen`` tries.
autrijus gaal|work: looks not
knewt gaal|work: nope, iso8859-1
or something very similar
lumi iso8859-8?
autrijus it's iso-8859-8.
the big5 of the hebrew world ;)
knewt heh
theorbtwo I'm not sure describing rules as a sub-language of perl6 is a clean thing to do. It's not a subset, or a superset -- in fact, it's logically disjoint. 14:14
knewt ok, changed the conversion from -1 to -8, just in case
Aankhen`` Indeed.
autrijus an embedded language then? 14:15
theorbtwo I don't know about that; isn't iso-8859-8, likes the other iso 8859 series encodings, purely 8-bit.
Sounds good, autrijus.
s/bit\./bit?/
theorbtwo needs to get irssi to think it's terminal is utf8.
gaal|work figures. this is the first mass-market OS to use unicode in the kernel, yet all apps use stupid 8 bit encodings. 14:16
autrijus /set term_type
which kernel is that?
gaal|work windows
ucs-2 14:17
autrijus ah. I thought mac os did it first. I may be wrong though 14:18
autrijus was briefly thinking that gaal is running Plan 9
then I read the "mass-market"
knewt runs purely utf8 himself, and converts incoming messages from people who don't do so into utf8. have to explicitly turn on the conversion though; i turned off the guessing code because it was getting it wrong too much
autrijus knewt: irssi/recode?
theorbtwo The NT series has been ucs-2 for a while.
knewt autrijus: irssi/charsetwars
autrijus ooh wars.
gaal|work actually, i may be wrong too. :) 14:19
theorbtwo (Which is sad, since it means that they still need ugly hacks to deal with characters over 0xFFFF, so have all the slowness of utf8, with all the size of utf-16.)
gaal|work i wasn't really giving it a compliment, you know.
autrijus the first Mac OS to use unicode internally is 8.5, released on 1998
gaal|work i think nt 3.5 was around then, too. 14:20
autrijus nt is two full years earlier
gaal|work don't remmeber whether unicode came in in 4 or 3.5
autrijus nt4 I think.
in 1996
so (windows nt)++ 14:21
but (notepad.exe)-- for insisting to save BOM marks in utf8 ;)
gaal|work notepad-- for 1..Inf;
autrijus $notepad -= Inf;
gaal|work i have that set up as an async coro 14:22
autrijus lol
gaal|work notepad -= ōæ½xE0_0
theorbtwo Hm, still can't see Autrijus's unicode, but I'm beyond caring.
_0?
gaal|work superscript zero
subscript
theorbtwo Ah.
autrijus theorbtwo: ā˜¹ 14:23
(U+2639, white frowning face)
gaal|work let's see if i can tell trillian to use utf8....
wolverian hmm, andale mono doesn't have U+2639 :/ 14:24
gaal|work hey, what good unicode terminal font do you all use?
knewt oh, in case anyone doesn't know, when in gnu screen, you can easily enter unicode codepoints by doing ctrl-a ctrl-v U+NNNN (literal U and +)
wolverian gaal|work: I use Terminus. I'm not sure how much of unicode it implements, though 14:25
gaal|work i use courier new because it's the most complete that i've seen, but i don't really like it.
wolverian (on windows I use Andale Mono)
gaal|work knewt++ yay!
screen++
theorbtwo Ugh.
Set screen's encoding to utf8 utf8, and now it's even worse; I see three characters for autrijus' two-byte utf8 character. 14:26
autrijus knewt: wow, I didn't know that. I ā™„ this function
wolverian is your terminal in UTF-8? is your IRC client in UTF-8?
knewt autrijus: i figured it out when code diving the source a while back 14:27
theorbtwo They both should be.
knewt theorbtwo: what does :dinfo report?
theorbtwo (125,48) UTF-8 xterm color iso2022 14:28
autrijus hm, I need a font that can display ā§ŗ (U+29FA double plus)
knewt autrijus: heh, i don't see that either
nothingmuch evening
autrijus hey nothingmuch
wolverian autrijus: monospaec?
QtPlatypus Oddly thats one I can see.
theorbtwo wonders if he wants to get around to a web site that previews free fonts.
wolverian s,ec,ce,
nothingmuch goes to add user words to harrorth 14:29
theorbtwo (Where you can ask "what fonts do you know of that contain U+29FA?"
autrijus installs x11-fonts/texcm-ttf
knewt theorbtwo: hmm, so screen thinks you're using utf8 then. are you using xterm? if so, when you ctrl-rightclick, is utf-8 ticked at the bottom of the menu?
wolverian windows's charmap sucks.
autrijus ooh there's x11-fonts/mathfonts too 14:30
knewt theorbtwo: and what's your $LANG?
theorbtwo I'm using gnome-terminal; it's encoding is set to utf-8.
LANG seems to be "", which is odd. locale reports "posix" for evert 14:31
everything.
knewt heh, that's probably causing you problems then. what does locale -a report? 14:32
i'm very minimal myself; i only have C, POSIX and en_GB.utf8
theorbtwo en_US.utf8, amongst a few other things.
Could have sworn I set that in .bashrc... 14:33
svnbot6 r4400, gaal++ | Obsolete the old open builtin. Everything should use Prelude's File::open.
knewt ok, what does [[ LANG=en_US.utf8 locale ]] say?
theorbtwo "en_US.utf8" for everything.
Ah, .bashrc sets LOCALE instead of LANG (which does nothing). 14:34
The Prelude is ignored when in safe mode... should this be the case?
autrijus theorbtwo: well, currently everything in Prelude.pm is unsafe 14:35
so it makes no difference
theorbtwo ā€½
Woo, works.
autrijus woot
theorbtwo Currently, yeah. 14:36
integral you can always have two preludes, one safe only, and one which loads the first and adds unsafe stuff
knewt theorbtwo: ā™€ ā™
autrijus I'd like to have two preludes independent of each other.
but yes, the safe one should load first.
the unsafe one may use functions defined in the safe one
integral ah :-) 14:37
theorbtwo knewt: See them.
Thanks for the help, all.
autrijus so maybe PreludeUnsafe.pm or something.
PreludeIO.pm
theorbtwo wonders if nethack supports unicode yet.
autrijus theorbtwo: it still only does the ibm console charset
and I can't find a font for that :-/
integral that would be better than yucky tiles ;-)
gaal|work i have an open task to make loading prelude files more generic - now we hardcode the one file 14:38
svnbot6 r4401, gaal++ | open transition: missed some files in ext/
r4402, gaal++ | and some more in examples/
theorbtwo I don't see the point of two preludes at all.
autrijus gaal++ # transition
gaal|work if anyone has any perl6 code at large, please note this incompatible change 14:39
autrijus theorbtwo: mostly to save the parsing-and-discarding-everything for safe mode
gaal|work open ">file" attempts to open a file named ">file"
theorbtwo OK, that works.
gaal|work in read mode
theorbtwo: my own prelude task is mostly for easing code development, so that not everything has to be in one file in the perl6 subdir 14:40
i haven't thought about the safeness issue at all yet.
theorbtwo Nod, gaal.
It would be nice to have unsafe functions not exist, rather then erroring when called, so you can safely check if you can do something. 14:41
integral (compile time safety checking)++
theorbtwo (Not try to open your config file if in safe mode, for example, rather then trying and dying... though I suppose you could scatter around try blocks instead.)
gaal|work how's having them not exist better? 14:42
theorbtwo if (&open) {open_config_file("foo")}
gaal|work sounds easier to me to open err die
or
open err cant_open
theorbtwo You have a point. 14:43
Though "running in safe mode" shouldn't neccessarly be the same as "I have no config file", which should probably not be the same as "I have a config file, but can't open it".
gaal|work actually open err cant_open isn't very good, at least not always, because sometimes you care why you can't open.
exactly :)
how often do we write code that doesn't know at authoring time if it's going to be run in safe mode? 14:44
iblech autrijus: Just read hw2005.txt -- two issues: line 332 (s/1..$x/1 + $x/, add "our" before &add1?) and line 376 ("We choose it..." -- shouldn't it be "We've chosen it" or "We chose it"?) 14:45
gaal|work i see integral's point...
integral it's would be nice just to say: perl6 -c --safe-mode myprog.p6
theorbtwo integral: But then you can't "use" anything. 14:46
gaal|work that can't work in perl, though, *if* safe mode allows some sort of use.
theorbtwo Safe mode is pretty limited.
integral hmm!
gaal|work and i think it should, to be useful for anything except bots
theorbtwo I'm not sure about that. 14:47
osfameron p5 Safe mode isn't particularly, iirc
theorbtwo But safe mode should be enterable from within the session.
autrijus iblech: both please fix away
iblech autrijus: Ok 14:48
gaal|work i still like my lexical safe mode idea, but i have no idea how to implement it :(
lexically scoped
autrijus I still think lexical scope safe mode is just runEvalSTM.
svnbot6 r4403, iblech++ | autrijus++'s hw2005.txt -- Two minor fixes.
theorbtwo Sounds right to me. 14:49
autrijus it needs to eliminate the few places that we (ab)use liftIO and unsafePerformIO for debugging etc
gaal|work i'm afraid what i just said obtains -- i have no idea how to implement that :-)
autrijus but should really be doable. plus we gain atomically{} for free.
which is big win.
knewt gah. i just did a xrdb .Xresources, instead of xrdb -merge .Xresources. any easy way to get everything back that was there before? 14:50
gaal|work we have plans for a 'no' keyword, right?
let's just remember to make 'no safe' a special case which is a noop :-) 14:51
theorbtwo Hm, the downside of making the Prelude an AST instead of a string of perl code is that we'd have to compile a pugs, do the pugs -CPugs (or whichever), create the new Prelude.hs, and recompile. 14:52
autrijus gaal|work: right but it's just calling unimport()
theorbtwo ...and compile is slow enough already.
autrijus speaking of that, currently
use Foo; # does not call import
use Foo (); # calls import with ()
that's backwards and needs to be fixed
nothingmuch jesus christ
doExp i@Interp{ dict = dict } (NewWord word body) = return i{ dict = insert word body dict }
doExp i@Interp{ dict = dict } (Invoke userWord) = interpret i $ dict ! userWord
that's all there's to it 14:53
: foo 1 2 ; foo .
2
Interp {stack = [1], dict = {"foo":=[Push 1,Push 2]}}
harrorth has user words
theorbtwo Whee!
gaal|work autrijus, it's just opRequire True 14:54
brb
theorbtwo Oh, blast. I never finished my ~-on-VObject, and now it's broken. 14:58
autrijus nothingmuch: let me know when you are willing to monadise it :)
theorbtwo Oh, wait. Nevermind, it was always broken. 14:59
nothingmuch autrijus: monadize how?
like we talked?
theorbtwo I need findSub and applySub from Pugs.Eval in Pugs.AST.Internals, but Pugs.Eval needs Pugs.AST.Internals itself. 15:01
The circularity semisupportedness is really annoying.
Odd. If I just do the changes from castV to fromVal in the definition of instance Value VStr, I get "Warning: Pattern match(es) are overlapped". 15:05
Why do I get that with fromVal, and not castV?
Oh... because there's a fromVal v, with some sort of strange special handling for Hash. 15:07
Oddly, it doesn't mention that as one of the overlapping patterns.
autrijus nothingmuch: yes... basically StateT or ReaderT or WriterT 15:10
nothingmuch okay
autrijus or indeed RWST
nothingmuch lets do it now
5 minutes
how do i turn an Integer into an Int? 15:11
autrijus fromInteger
fromInteger :: (Num a) => Integer -> a 15:12
nothingmuch will that do error if it can't downgrade?
autrijus no idea
do you worry about that?
nothingmuch nope
just curious 15:13
autrijus so check in user words first
theorbtwo: vCast is same direction as fromVal
castV is something else entirely.
theorbtwo Er, right, sorry. 15:14
autrijus nothingmuch: hm? 15:16
nothingmuch one second
autrijus ok. I'll type ahead.
the idea is to make anything of form 15:17
interpret :: Interp -> Forth -> IO Interp
into the form
eval :: Forth -> Eval Literal 15:18
(or something like that)
eval :: Forth -> Eval Interp -- maybe this
depending on how you want the final result
or even
eval :: Forth -> Eval ()
nothingmuch i think Eval () is the best 15:19
so that it can be dumped on the screen at the end of the program
but for now I like Eval Interp
darcs pull, btw
autrijus ok. say we have 15:20
type Eval a = ReaderT Interp IO a 15:21
it means that the eval monad has access to interp at all times via "ask"
and can change the interp state for sub-computation using "local".
so we have 15:22
interpret [] = ask
nothingmuch wow, pretty
autrijus interpret (exp:exps) = local (doExp exp) (interpret exps)
doExp becomes:
nothingmuch btw, ReaderT stores one state per instance of the type variable? 15:23
autrijus doExp :: Exp -> Interp -> Interp
nothingmuch: "ReaderT Interp" maintains a single Interp, yes
look at signature of "local":
nothingmuch no, i mean a single interpreter for every type that can be in `a`? 15:24
autrijus local :: (MonadReader r m) => (r -> r) -> m a -> m a
nothingmuch or a single interpreter period?
autrijus a single interpreter period... the "a" is result type
like "IO a"
think Eval as a super-IO
in the IO monad you can do lots of different computations 15:25
like (IO Int) or (IO Char)
nothingmuch but they are the same monad
autrijus but they don't touch the real world
nothingmuch okay, i get it
autrijus you can think that ReaderT augments the real world with Interp. 15:26
that would not be far from truth.
ok. so "local"'s signature is kind of hard to read.
local :: (MonadReader r m) => (r -> r) -> m a -> m a
the context head says "given the monad m that implements a reader of type r"
nothingmuch what's MonadReader?
oh
autrijus it's a type class. 15:27
a type class with two parameters
nothingmuch what's a reader of type r?
autrijus that usually means a relationship between the two types.
Eval is a monad type
it implements a reader of type Interp.
nothingmuch type readerOfTypeR = Reader Int -- r is t?
r is int
so a reader of type Interp in our case?
autrijus yup. 15:28
wolverian I need a "how Haskell concepts map to normal languages" handbook
autrijus nothingmuch: so. "local" takes two arguments.
nothingmuch so local takes a function that does stuff to an Interp
autrijus the first one, (r -> r), dictates how to update an Interp
nothingmuch and uses it to change the value that will be returned on the next 'ask'?
autrijus the second one, (Eval a), is the sub-computation we are about to perform
"local" applies the (r->r) to our current Interp 15:29
cognominal autrijus, about w2005.txt, "Perl 5 has no static grammar" is very confusing. I would say something like "the lexing is very context dependant which affects the parssing"
autrijus then returns a (Eval a) that would evaluate the original (Eval a) argument, but in an modified Intepr.
cognominal yacc is not a very dynamic grammar...
nothingmuch okay, Reader sort of makes sense 15:30
so local changes the Interp permanently?
autrijus cognominal: thanks, fixed
nothingmuch: no. that would be StateT
nothingmuch so how does ReaderT roll it back? 15:31
autrijus x <- local fun actionA
y <- local fun actionB
nothingmuch and why is it a ReaderT and not a Reader?
autrijus interp <- ask
in that example, actionA and actionB will always evaluate in the same interp 15:32
and the "interp" will always be the same interp before evaluating x and y
because "local" only changes the interp "lexically", so to speak.
nothingmuch right, how does it do the lexical behavior? 15:33
cognominal autrijus, do you mind if I translate that into French for French linuxmag?
autrijus cognominal: not at all
cognominal oki
I will see how it works moneywise 15:34
autrijus nothingmuch: the second question is easier so I'll handle that first.
nothingmuch: "Reader" would be pure.
it's just a monad.
"ReaderT" however transforms another monad
in this instance IO
and imbue it with extra super power
so you can both "print" and "ask".
if it was a single "Reader" you could not print. 15:35
because it's not IO.
nothingmuch: now, the hard part. how does Reader implement the lexical behaviour?
newtype Reader r a = Reader { runReader :: r -> a } 15:36
this defines a reader of "r" that computes type "a" 15:37
what is the signature of runReader?
svnbot6 r4404, autrijus++ | * fixes from cognominal and theorbtwo to hw2005
autrijus let's recall that, in definition like 15:38
data Interp = Interp { dick :: Dict }
er, typo ;)
data Interp = Interp { dict :: Dict } 15:39
the "dict" accessor is of type
dict :: Interp -> Dict
so, similarily, runReader would have type
nothingmuch freudian finger slip
autrijus runReader :: Reader r a -> r -> a
yup
nothingmuch isn't that runReader r a -> (r -> a)? 15:40
oh wait, it doesn't matter
autrijus yeah.
nothingmuch *blush*
autrijus this is the autocurrying haskell after all
so we can read out that type: 15:41
runReader takes a computation in the Reader monad that reads type r and yield type a
and an initial environment r
and runs the computation to yield a.
clear?
nothingmuch i think
what does `asks` look like? 15:42
autrijus asks f = do { r <- ask; return (f r) }
so maybe you'd like to learn what "ask" look like for "Reader r a".
surprisingly, the defintion is
ask = Reader id
that's all.
understanding it will instantly enlighten you to the theta level 11. 15:43
er, I mean, to the reader monad.
let's look at an concrete example.
askInterp :: Reader Interp Interp 15:45
askInterp = ask
runReader askInterp someInterp
this will yield... someInterp.
askInterp is "Reader id" 15:46
which is
Reader { runReader = id }
so "runReader askInterp" turns out to be reading that field out again.
runReader (Reader { runReader = id })
is just id
so that computation turns out to be 15:47
"id someInterp"
nothingmuch okay
maybe
autrijus finally we ponder "local" :D
local f m = Reader (runReader m . f) 15:48
ask = Reader id
so what "local" does is that it constructs a new Reader
if the body of the reader is "runReader m" 15:49
say
notLocal m = Reader (runReader m)
that may be written as
notLocal m = (Reader . runReader) m 15:50
that may be written as
notLocal = Reader . runReader
which means
notLocal = id
yay. ;)
but "local" is unlike "notLocal"
"notLocal" simply runs the "m" computation and re-return the result 15:51
"local" however, puts the initial function thru "f" first, before handing it to "runReader m"
so it means that saying "local (+1) someComputation" will pretend to run that someComputation 15:52
but before it runs it via runReader, it prepends the environment with (+1)
then hand the modified environment with someComputation to runReader. 15:53
nothingmuch what would be the type of someComputation?
autrijus so that's why the change is lexical; there is no mutable variable involved.
the type of someComputation is 15:54
nothingmuch wait, does it matter?
eek, too much data
autrijus Reader someNumType someReturnType
the someNumType is there to make (+1) make sense :)
nothingmuch yeah, that much i gathered 15:55
autrijus the type "Reader Interp Literal" can be understood as a function that turns Interp into Literal.
will that make it easier to understand? 15:56
clkao hola autrijus
autrijus instead of thinking Interp as environment
think of it as initial input.
strangely, that's what you've always been doing!
as your eval functions all begin with (Interp -> ...)
nothingmuch hmm
autrijus and "local" is like taking a
Interp -> Interp
and a
Interp -> Foo -> Bar 15:57
nothingmuch i need to re-read this more slowly, too hungry to think clearly right now
autrijus and gives you back something that is still
Interp -> Foo -> Bar
but underneath it takes the first argument, transform it using that Interp->Interp
then re-hand the modified interp to the second argument, the original Interp->Foo->Bar
and return its result as the result.
nothingmuch so actually why is it necessary? 15:58
autrijus why was Reader neccessary?
nothingmuch yes
just to move this out of the param list?
autrijus uh, it's not "just" :)
by moving it out of the param list, you decouple the (Interp->) context from the underlying implementation. 15:59
nothingmuch hmm
ook
autrijus so the same evaluation code, composed with "ask" and "local"
nothingmuch okay, i need to try it
i'll bbiab though
autrijus can be re-used in different monads.
nothingmuch and i'll continue in 10 mins 16:00
autrijus it can be used in a pure context that involves no IO
or it can be used on top of IO via ReaderT
nothingmuch hmm
autrijus or even as a compiler that emits parrot code!
nothingmuch aha
autrijus see, in the Compile monad
"ask" would actually produce some PIR code.
nothingmuch how does that compare to making Interp a polymorphic thingy? 16:01
autrijus you mean something like
nothingmuch Interp = RuntimeInterp | ParrotEmitter ?
autrijus interpret :: (InterpThingie i) => i -> Forth -> IO Interp ?
bzzt, because that IO is still there
nothingmuch ok, i think i get it 16:02
autrijus there's no way to reuse "interpret"
nothingmuch okay, i'll try to wrap my head around this in a bit
autrijus because it's fixed in a rigid abstraction layer :)
cool. but in implementation it's actually dead simple. I'll try to nopaste something before I sleep :)
nothingmuch okay
put "spoiler" in the title 16:03
i want to try before reading
autrijus lol. ok
gaal|work shudders 16:06
i was interrupted an hour ago by a new coworkre 16:07
theorbtwo Why is that shudderable?
gaal|work gave him a spiel on perl5 symbol tables, runtime sub wrapping,
dynamic class generation etc
then i showed him perlmonks
then i showed him wikipedia
theorbtwo Oh, that reminds me, I wanted to get the symbol table hashes working. 16:08
%MY:: and friends.
gaal|work (i'm a wandery kinda guide)
here comes the shudderable part:
after showing him PM and wikipedia, he came up with the briliant idea of SPAMMING ONLINE COMMUNITIES! yes.
theorbtwo Ugh.
gaal|work you can advretise cheaply *and* increase your google ranking! 16:09
theorbtwo Did he suggest putting up advertising, or really spamming?
There's at least /something/ of a difference.
gaal|work the real thing.
theorbtwo Uggh.
gaal|work he's still convinced he thought of an excellent idea!
shudder! 16:10
anyway, theorbtwo, if you do add symtable stuff, i'm appy to inform you there are already some tests for this.
theorbtwo Oooh, good!
Where? 16:11
gaal|work symtable.t
in syntax/ i think
autrijus nothingmuch: you gave identical implementation of DUP and OVER
theorbtwo Ah: ./syntax/symbol_table.t:
autrijus that can't be right
theorbtwo Oh, there's a new chapter?
autrijus theorbtwo: in hw2005?
gaal|work they don't include the (undecided) hierarchical symbolic lookups mentioned somewhere in the Syns 16:12
theorbtwo No, for harroth.
gaal|work you may want to hit p6-l on that
oh: s02 sayeth 16:15
Package names are searched for from inner lexical scopes to outer, then from inner packages to outer.
tricky. 16:16
this is for $::( )
i didn't write tests for that, though, to2.
theorbtwo Gaal: I'm not sure that's related. 16:17
gaal|work symbolic lookup.
not symtable
symhash is always a hard comparison
theorbtwo Well, the first thing to do is to make ruleVarNameString accept that variable names can end in a ::. 16:18
iblech ...but only if the sigil is %, right? Or is $bar:: allowed? 16:19
theorbtwo iblech: I don't know. 16:20
autrijus nothingmuch: [SPOILER] autrijus.org/tmp/readerT-spoiler.txt
we'll talk about writerT tomorrow ;) 16:21
pasteling "autrijus" at 220.132.132.105 pasted "[SPOILER] ReaderT for Harrorth" (74 lines, 1.9K) at sial.org/pbot/10747 16:22
autrijus the code is much, much cleanr.
(as one would expect from a monadic transformer)
need to sleep now. see you tomorrow. :) & 16:23
nothingmuch: oh, another answer for the "why monad?" question. imagine if Parsec is implemented as a simple 16:24
parse :: String -> Tokens 16:25
combinator. that would not be very composable; it'd be impossible to add user state; there would be no way to decouple the input token type with output token type
and most imporatntly, things like <|> cannot be reused at all.
as you need to define a <|> for each combination of UserState -> InputStream -> SourcePosition -> OutputToken function type. 16:26
theorbtwo wonders why the haddocks of Parsec do not include the information from the reference guide at www.cs.uu.nl/~daan/download/parsec/...enceGuide. 16:32
Sigh; I have been corrupted by perl. 17:02
I keep trying to write '...' strings in my Haskell.
Odd. 17:06
I just made what seems like a very simple change, and started a make test run.
Now there seems to be a very very long (several seconds?) startup delay.
theorbtwo wonders why adding a option "" (string "::") just before the end of Pugs.Parser.ruleVarNameString doesn't do what I want in the slightest. 17:33
It seems to return "" if there isn't a ::, and die if there is... That is, %x parses as before, and %x:: dies with a syntax error. 17:34
I've got no clue where to begin debugging this, other then to note that it's not just completely ignoring it, since option "x" (string "::") works as I expect. 17:35
Bah. 17:40
iblech try: option "" (try $ string "::") -- but I'm just guessing 17:41
gaal hey, if something :: Int, to turn it into a VInt shouldn't I just "VInt something"? 17:54
ah, do i need toInteger? 17:55
ah: yes. don't you love solving yer own damn problems? :-p 17:58
yippie! caller works on the internals side. 18:38
what is the P6 type of the object that caller returns? (that has methods sub, line, etc.?) 18:39
iblech Don't think that has been speeced yet. Just pick an appropriate type, e.g. Caller or so 18:41
gaal eval in S29 is blessed into Control::Basic. maybe I should pick Control::Caller then? 18:42
hmm, this is the first oop builtin! :) does "has" and BUILD actually work now, iblech? 18:44
iblech Sounds reasonable
svnbot6 r4405, gaal++ | caller, internals side
iblech IIRC, they both work
gaal cool. i forsee a flourish of Prelude commits as people discover this fact :) 18:45
iblech :)
gaal actually pipe can be refactored now in light of this. 18:46
oh, maybe not, since not having weak refs will spoil the fun of having the object contain itself. 18:47
i want to use zip to construct a hash. how? 19:01
map { $^a => $^b}, @a, @b won't work, would it? 19:02
errr
@a Y @b that is
iblech map { $^a => $^b; } @a Y @b 19:05
(I think.)
gaal no go in current pugs
"undeclared variable: $b" 19:06
sucks, because i never mentioned $b
i mentioned $^b
iblech $^X is $X internally
integral hmm, I thought that'd been fixed. You just have to use pointy subs for now
gaal ?eval map -> $k, $v { $k => $v }, (1,2,3) Y (<o t th>)
evalbot6 ((1 => 2), 'o', (3 => undef), 't', undef, 'th')
gaal oops :) 19:07
iblech ?eval map { ;$^k => $^v } (1,2,3) Y (<o t h>)
evalbot6 Error: unexpected "{" expecting "::", ":", term postfix, operator, postfix conditional, postfix loop, postfix iteration, ";" or end of input
iblech ?eval map { ;$^k => $^v }, (1,2,3) Y (<o t h>)
evalbot6 Error: unexpected "{" expecting "::", ":", term postfix, operator, postfix conditional, postfix loop, postfix iteration, ";" or end of input
iblech meh
gaal beh
iblech Ah, old evalhelper.p5
gaal urgh?
shto eta? 19:08
iblech the old evalhelper.p5 escaped ^ incorrectly
therefore, $^X doesn't work in ?eval
gaal doesn't workforme in interactive pugs.
(undeclared $v)
iblech pugs> map { ;$^k => $^v }, (1,2,3) Y (<o t h>) 19:09
({ref:<Pair>}, 'o', {ref:<Pair>}, 't', undef, 'h')
gaal that's the br0kage.
after fixing this we can be cute and write a List::Utils func called 'vk', so called because it does the opposite of %hash.kv 19:11
okay, the more practical question then: 19:14
my internals function returns a list in dependable order, of n values
they map reliably to n attributes of my prelude class.
what's the elegant solution to construct an object? 19:15
okay, goind with the inelegant solution. 19:17
nothingmuch phoeey 19:18
gaal wow, must have been so ugly that he really had to leave
is there a "short zip" operator? zip until one list ends 19:23
if i have class Froop { has $.hop }, shouldn't Froop.new(:hop<111>).hop.say' say 111 ? 19:30
hmmm, it *does* say that. ulp, my problem must be elsewhere.
Aankhen`` Heh. 19:31
wolverian gaal: YY has been proposed, or the other way around.
gaal: (Y = until shorter ends, YY = until longer ends. that's more logical, anyway. nothing definite has been decided I think.) 19:32
gaal cool. 0 .. Inf is infinitely useful.
wolverian yes.
well.
since @array.kv works, it's not _as_ useful as without it
gaal though in *that* particular case,
yeah.
even (List).kv works.
wolverian right. 19:33
gaal and you can flip (which isn't a builtin in Pair, is it?)
Aankhen`` Is `multi submethod BUILD` acceptable? 19:34
gaal %revidx = flip @arr.kv, 0 .. Inf;
i keep forgetting to say Y
wolverian gaal: flip? I don't know that one. 19:35
svnbot6 r4406, Aankhen++ | * refactored &HTTP::Message::BUILD.
wolverian (it's not in S29)
iblech Aankhen``: I think so, although I've never seen multi submethod
Aankhen`` iblech >> Check the new versions of &HTTP::Message::BUILD and you'll see it. ;-) 19:36
iblech Jep, just done :)
Aankhen`` ^_^ 19:37
(using a type junction and the smartmatch operator was looking ugly to me)
iblech Think so, too 19:38
Aankhen`` Do you think you could take a look at the &content method and offer a better way of doing it? :-) 19:40
svnbot6 r4407, Aankhen++ | &HTTP::Message::BUILD -- be more explicit about assigning properties.
iblech Ah... I think you've have to "my multi sub FETCH (...) {...}", and then "new Proxy: FETCH => &FETCH" 19:42
But I think in this case, it isn't worth it
Aankhen`` What would be worth it? 19:44
Er... should I be using $:foo instead of $.:foo? 19:46
svnbot6 r4408, Aankhen++ | * &HTTP::Message::parse -- small changes for (hopefully) better code.
r4408, Aankhen++ | * marked &HTTP::Message::content as C<is rw>.
iblech I mean, it's ok to ~~ in this case, as the subs aren't large and there's only one distinction (want ~~ List or want !~ List). You *could* refactor this using lexical multisubs, but I'd leave it as it is
IIRC $:foo is correct
gaal k, need some internals help. my internals caller returns a list, which i can print and which so far looks correct. but when i try doing fancy stuff with this list on the perl stuff, eg map, i get this:
Aankhen`` OK.
Thanks for both answers. :-)
gaal cannot cast from VList [VStr "",VStr "file",VStr "line",VStr "package" ,VStr "subname",VStr "subtype"] to Pugs.AST.Internals.VCode 19:47
iblech What's the snippet which yields this error?
gaal oh wait, this probably has nothing to do with the internals side.
here:
desis Hello 19:48
pasteling "gaal" at 192.115.25.249 pasted "blow" (15 lines, 680B) at sial.org/pbot/10753
Aankhen`` iblech++ # helpful as always! 19:49
gaal (incidentally: for some reason i can't put %idx outside that sub)
Aankhen`` perlbot karma iblech 19:50
perlbot Karma for iblech: 414
desis any know wht is cpan used for 19:51
please
iblech gaal: Try say %idx.perl -- I think %idx is not really a hash or so 19:54
svnbot6 r4409, Aankhen++ | * HTTP::Message -- n00b mistake, s:P5/\$.:/$:/
r4409, Aankhen++ | * fixed &HTTP::Message::add_content.
r4409, Aankhen++ | * cleaned up &HTTP::Message::content_ref somewhat.
r4410, Aankhen++ | * added stringification for HTTP::Message.
r4410, Aankhen++ | * fixed stringification overload for HTTP::Headers (I hope).
gaal my bad - that first line wasn't crashing; the one after w/o the leading semicolon was. 19:55
sorry, just noticed myself.
iblech ah, k 19:56
gaal coding to beat fatigue causes fatigue causes slowness causes to lose against fatigue.
iblech desis: CPAN is the Comprehensive Perl Archive Network, a large collection of Perl software and documentation. You can begin exploring from either www.cpan.org/, www.perl.com/CPAN/ or any of the mirrors listed at www.cpan.org/SITES.html and mirror.cpan.org/.
desis: (Got that from cpan.org/misc/cpan-faq.html) 19:57
;)
svnbot6 r4411, Aankhen++ | * HTTP::Message -- small formatting changes, bumped up version number. 20:04
iblech Aankhen``++ # hacking on libwww-perl :) 20:07
Aankhen`` Heh, I've only resumed after a fairly long hiatus. 20:09
svnbot6 r4412, Aankhen++ | * HTTP::Message -- uncomment delegation since it apparently parses alright.
iblech Gonna sleep, cu tomorrow :) 20:14
gaal caller(5555), if there's no such stack frame, returns undef.
problem is, often people would like to do caller(5555).line 20:15
should i let that raise an exception on undef, or should i have a dummy object created?
probably let it raise an exception, right?
caller in, /me off 20:18
night everybody! zzzZZZ & 20:19
svnbot6 r4413, gaal++ | caller, Perl side. Please add tests to t/builtins/caller.t 20:20
r4414, Aankhen++ | * HTTP::Headers -- :parts should be an array, not a scalar. 20:33
Aankhen`` Oh bleh.
That should have been HTTP::Message.
G'night. 20:39
svnbot6 r4415, Aankhen++ | * &HTTP::Message::parts should respect :parts being an array.
21:09 Limbic_Region_ is now known as Limbic_Region
Corion I have an old smoke report at datenzoo.de/pugs/win2k.html - r4404 - some unexpected successes in Test::Builder, but also some breakage of pugsbugs/ and pugsrun/ and File::Spec::Win32 that shouldn't happen... May be out of date, but a smoke run takes 40 minutes here and I'm going to bed now :) 21:33
Good night ;)
flgr I guess this is getting asked a lot right now, but what about the future -- will perl6 officially switch over to pugs completely until it is self-hosting? 22:01
theorbtwo Once it is self-hosting, you mean? 22:02
obra That's not quite the right questoin
question.
theorbtwo I don't know, flgr.
I also don't know if it much matters.
obra pugs is _an_ implementation of perl6. At the moment, it's the most solid and the most complete.
The eventual intent is to have perl6 written in perl6 on a parrot virtual machine. 22:03
Certainly one of pugs aims is to be able to compile perl6 source code to parrot bytecode running on the parrot virtual machine.
at that point, someone could "easily" implement perl6 in itself, making the haskell implementation (pugs) unnecessary. 22:04
flgr obra: I am just not sure how Larry Wall will react so I am wondering how all this is going on
obra flgr: larry is fascinated by pugs and seems quite excited by it. 22:05
He's been giving lots of language-design support to autrijus and the rest of the pugs team
flgr ah, that is good to know
wolverian I just wish he could work more on perl6.
obra larry will be at the pugs hackathon in toronto later this month
flgr hm, could parrot be implemented in perl6 (the non-parrot-bytecode version) as well? 22:06
OTOH that would be starting over from scratch
theorbtwo We could write a haskell to perl6 compiler, probably with a helper module. 22:07
Or we could write a haskell to pasm compiler, which is looking somewhat more reasonable.
flgr that is an interesting idea
I just hope that parrot will still somehow be completed -- having dynamic languages talk to each other would be very wonderful indeed 22:08
theorbtwo It would be.
parrot is pretty well along.
What it's missing is sometimers that target it.
Er, compilers. 22:10
SamB did you change words three times in midword? 22:20
theorbtwo Just two -- some compilers. 22:29
SamB oh, oh, yeah, two. I got mixed between three changes and three words
23:17 MrKrueger is now known as _meppl_ 23:35 _meppl_ is now known as meppl
stevan I assume no release today :) 23:57