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. |
|||
elmex | ]a | 02:17 | |
and when speed doesn't matter, types get in your way | |||
rantanplan_ | elmex, yeah, and you have to write more code while using typeing. ;). | 02:37 | |
Khisanth | rantanplan_: haskell seems to be a nice compromise | 03:24 | |
rantanplan_ | Khisanth, yeah, i had to do some Haskell like 3 years ago. But i never got very deep into it. | 03:28 | |
Khisanth | landover: search.cpan.org/~rcaputo/POE-0.3202...POE/NFA.pm seems pretty close to what you were describing | 03:30 | |
obra | autrijus: how was the talk? | 03:54 | |
04:02
khisanth_ is now known as Khisant,
Khisant is now known as Khisanth
|
|||
buu | ?eval "A" ~~ "b" | 04:09 | |
er | |||
Evalbot went away =[ | |||
fraxtal | buu | 04:42 | |
buu | What? | 05:01 | |
fraxtal | hi | ||
buu | HAI FRAXTAL | 05:04 | |
dduncan | hai yu | 05:08 | |
QtPlatypus asks "Default value for an attribute? C<has $.server = "localhost"> " | 05:18 | ||
QtPlatypus shakes his head "No thats wrong. (searches for perl6 initlizor examples (I feel so much like a cargo cult programer)) | 05:32 | ||
QtPlatypus looks confused "I guess pugs doens't implement that, though its the correct code" | 05:40 | ||
autrijus | greetings live from CUFP! | 06:04 | |
perlcabal.org/~autrijus/cufp2005.pdf | |||
a "very informal" gathering; just started | |||
geoffb | hi! | 06:05 | |
autrijus | yo geoffb | 06:06 | |
dduncan | and greetings from where I am | 06:08 | |
geoffb | Ah, the trek officially begins 2006-02-01. I wonder what we can get done before then? | 06:10 | |
Must sleep. Best of luck at CUFP, autrijus | 06:11 | ||
autrijus | whew done | 06:49 | |
lots of laughters despite me being nervous | |||
I'm sold on Takahashi | 07:00 | ||
it takes 3x time to prepare but is worth it | |||
gaal | morning! | 07:17 | |
glad it went well :) | |||
autrijus | :D | ||
gaal | oh wait, *went* well or is still going on well? (hi! cufp!) | 07:20 | |
autrijus | it's still going on | 08:02 | |
david roundy is going to talk about darcs now | |||
the mldonkey talk was cool | 08:03 | ||
lamenting that OCaml doesn't have a CPAN (this is a recurring theme) | |||
svnbot6 | r7120 | gaal++ | add ignore property to /src/System/FilePath.hi | 08:04 | |
gaal | they just need to interface pugs then. | 08:05 | |
ah btw i don't know if you backlogged, but it turns out putter++ fixed the win32 wrapper, which is quite nice because he didn't afaik actually have a win32 box to hack on. :) | 08:07 | ||
autrijus | oooh good | ||
gaal | regardless, pugs-the-binary also understands -B now :) | ||
autrijus | that's wonderful... | 08:08 | |
so why are we keeping the .bat around? | |||
gaal | timidity :) | 08:09 | |
autrijus | I see :) | ||
gaal | is there a "proper" way to revert something that took several svn checkins? | ||
autrijus | svk reverse merge | ||
svnbot6 | r7121 | gaal++ | add tags to svn:ignore on / | 08:10 | |
autrijus | but svn merge works too | ||
gaal | but i want a little more than merge -rX:Y | ||
because there were further changes other than X | |||
should i just perform a few svn merge -rX:X-1, for all Xs I want to revert? | 08:11 | ||
autrijus | nod, that's the best you can do for svn | ||
but you can ignore that and just commit a change that reverts them | |||
we don't really need the properness :) | |||
gaal | okay, i'll go for that then :) | 08:12 | |
works; waiting for smoke to run. | 08:47 | ||
autrijus | mm "FP stands for finger-pointing" (talking about scheme48 for financial engineering) | 08:50 | |
(as in, concise enough to be reasoned with and accountable) | 08:51 | ||
avoidance of "unsound methods" | |||
gaal | autrijus: hee. (but did you mean to say that on #haskell?) | 08:58 | |
Base64 is still hanging. i'm committing anyway. | |||
autrijus | no, I'm just typing randomly | 09:01 | |
dduncan | good night folks | 09:03 | |
svnbot6 | r7122 | gaal++ | revert the wrapping `pugs` script; pugs now spawns backends | ||
r7122 | gaal++ | itself from haskell. | |||
autrijus | night | ||
dduncan | fyi, I've been doing a whole variety of code reformatting in my modules, following Best Practices suggestions | 09:04 | |
autrijus | woot! | ||
dduncan | the latest ones involved using postfix-if for flow control, such as "return if condition" or "next if condition" vs if-then or cond-and or cond-or etc that I used before | 09:05 | |
hopefully this process will wind down and be on CPAN this weekend | |||
actually, might as well commit the corresponding perl 6 updates ... | 09:06 | ||
autrijus | cool | 09:07 | |
dduncan | I hope that Pugs currently supports q{} and qq{} etc, as well as labels, since I added use for those, but haven't done a test compile yet | 09:08 | |
once I've put the perl 5 on cpan, I'll try to compile the perl 6 updates and see if perl 6 does the same things in different ways | 09:09 | ||
svnbot6 | r7123 | Darren_Duncan++ | /ext/Locale-KeyedText : resync with perl 5 version in progress | ||
gaal | d'oh! the hangs in the test suite seem to be caused by parrot | 09:27 | |
QtPlatypus: you may be interested in that fact too. haven't looked at the code for Base64, but don't use rules unless you must. | 09:30 | ||
QtPlatypus | The only time I use rules is in the tests. | 09:42 | |
QtPlatypus is wondering if he can rewrite them so that the tests down't use rules. | 09:43 | ||
QtPlatypus will have to check that in base64 though. | |||
wolverian | Juerd, right. | ||
svnbot6 | r7124 | gaal++ | don't install an empty lexical pragma set (this also broke all BEGIN{} | 10:27 | |
r7124 | gaal++ | blocks, oops) | |||
gaal | mswin32 r7121 smoke up on the smoke server, linux coming up soon too. | 10:28 | |
so, parrot simply hangs when called from pugs on win32. anyone know how to fix it? | 10:49 | ||
if parrot.exe is killed, pugs stops blocking and continues to work. | |||
svnbot6 | r7125 | gaal++ | more precise failure message for unimplemented variants of executeFile | 10:51 | |
rafl | Hello | 10:53 | |
gaal | hey rafl | ||
wolverian | damn, I've confused myself with fetchmail/postfix/procmail | 11:03 | |
this happens too often. :/ | |||
Aankhen`` | o_O | 11:16 | |
Identity crisis? :-S | |||
wolverian | heh. | 11:17 | |
just trying to make things too hard on myself. | |||
Aankhen`` | Ah, I see. | ||
BBL, stuff to do. | 11:18 | ||
integral | there's a bug with run-smoke.pl when smoking perl5: run-smoke.pl uses chdir to move to the root directory of the "pugs sandbox", and when it is calling pugs itself it uses ./pugs; but when crude_repl.pl is calling pugs it uses just pugs. But I do not have . in my %ENV<<PATH>>, so it cannot find pugs. | 12:41 | |
autrijus | nod. so have it remember Cwd first? | 12:42 | |
integral | maybe. I thought of just getting run-smoke.pl to change $PATH to include . at the front, but does this work on windows? Do I need to use File::Spec? | 12:43 | |
gaal | integral: . is always first in PATH on windows, implicitly. | 12:44 | |
autrijus | nod | ||
gaal | it's a security feature! | ||
integral | gaal: ah, so just test on $^O ne "win32"? | ||
gaal | no need -- it would just work there, except that it doesn't since perl5 doesn't work there anyway :) | 12:45 | |
integral | windows uses : as a PATH separator? | ||
gaal | no, ; | 12:46 | |
you have that in getConfig... | |||
path_sep i think, let me maek sure | |||
integral | ah | ||
gaal | yes, path_sep. | ||
but we have a use lib, no? | 12:47 | ||
oh, that's irellevant | |||
silly me | |||
maybe crude_repl shouldn't just call pugs out of the path? | 12:48 | ||
integral | hmm, the actual call to pugs must be buried in a module | ||
gaal | there's also a literal 'pugs' in the getopt block. | 12:50 | |
integral | yeah. | ||
oh well, the smoke's working now at least | 12:51 | ||
gaal | well, EvalX needs to be made configurable, either by some class method or by peeking at the environment. | 12:56 | |
no problem because it doesn't do anything with $pugs at compile time. | 12:57 | ||
shall i fix? | |||
or did you hackaround already? | |||
integral | I've done the adding . to $PATH hack, but not committed it. so go ahead if you've got something better | 12:58 | |
gaal | the idea is to add a --pugs=./pugs to util/run-smoke.pl, and have crude_repl honor that. looks a bit cleaner, no? | 13:02 | |
wolverian | hmm. is p6l dead, or is my mail setup fuxored? | 13:03 | |
(haven't released anything in a while, and I have changed things so I have reason to suspect my end is broken) | 13:04 | ||
gaal | beh, except that run-smoke doesn't want to know file_sep and exe_ext | ||
integral: your hack it is :) | |||
wolverian: last mail was from you, 13:45:00 +0300 | 13:05 | ||
wolverian | gaal, ah, came now. thanks :) | 13:11 | |
Juerd | Not anymore, gaal | ||
I sent 2 since | |||
wolverian | Juerd, you replied directly to me, so I got duplicates :) | 13:12 | |
Juerd | To you and the list. | ||
That's what mutt does by default, what many clients do by default, and the way I prefer it. | |||
It's reply to all. | |||
wolverian | Juerd, I prefer L (reply to list) for mailing lists | 13:13 | |
Juerd | Ah, it has a key for that? | ||
wolverian | yes. | ||
Juerd | Thanks! :) | ||
wolverian | you're welcome :) | ||
Juerd | The reason I preferred (until a few seconds ago) group reply was that I didn't have to type the mailing list address myself | ||
From now on, unless I forget, I'll use L | 13:14 | ||
Hm, %hash.keys really only buys one character over texas %hash>>.key, and 0 charactors over the real thing :) | |||
Still, typability wins for %hash.keys | 13:15 | ||
wolverian | what is .keys specced to do currently? | ||
Juerd | Same as in Perl 5 | 13:16 | |
wolverian | that is really asymmetric with .elems | ||
Juerd | (That is: it is not specced, and thus by default what it always was) | ||
.elems is assymmetric with everything, as specced. | |||
.chars and .keys are symmetric | |||
list in list context, number in item context | |||
Or, well, .chars I think still officially is specced a number :( | 13:17 | ||
Not entirely sure. | |||
wolverian | right, that's why I mailed | ||
I didn't find it in the AES though | |||
so I depended on pugs | |||
Juerd | !eval "foo".chars | ||
?eval "foo".chars | |||
wolverian | ENOEVALBOT | ||
Juerd | Hm | ||
Oh | |||
Who maintains it? | |||
wolverian | dunno | 13:18 | |
pugs> list "foo".chars | |||
3 | |||
same without list | |||
Juerd | I think that's annoyingly context insensitive. | ||
Especially since splitting to characters is a very, very, very common task. | |||
Also, I expect .chars to return a list of lvalues tied to the string, but that may be too much to ask for at this point | 13:19 | ||
$foo = "foo"; $foo[1] = "bar"; say $foo; # >>> fbaro | |||
ehm | 13:20 | ||
$foo = "foo"; $foo.chars[1] = "bar"; say $foo; # >>> fbaro | |||
wolverian | right, I was going to add that to the mail but forgot | ||
same for .words | |||
etc. | |||
Juerd | I was skipping one step, although I do think Str should does Array, and then pick .chars | ||
wolverian | (that was actually discussed, I think, on p6l. maybe could dig it up) | ||
Juerd | It was. | ||
wolverian | I disagree with .k and .v, by the way | ||
Juerd | Do you also disagree with .kv? | 13:21 | |
I personally really dislike inconsistent abbreviation. | |||
wolverian | I'd rather it be .each or so | ||
Juerd | It returns a list of keys and values, not pairs. | ||
Likewise, now that we abbreviate 'string' as 'str', it must be so EVERYWHERE | 13:22 | ||
wolverian | do pairs flatten? for *@foo.each -> $index, $value { ... } | ||
Juerd | There must not be any 'string' or 'String' left in the language, if we choose to use 'str' and 'Str' | ||
svnbot6 | r7126 | bsmith++ | Modified run-smoke.pl to prepend . to PATH so that crude_repl can find | ||
r7126 | bsmith++ | pugs via PATH. | |||
Juerd | No, they do not. | ||
Pairs are objects: scalars, more specifically: references. | 13:23 | ||
wolverian | then rename %foo.each to %foo.pairs | ||
and .kv to .each | |||
Juerd | I think .each doesn't specify that you get a zipped list in any way and is because of that a bad name for this feature. | ||
%foo.pairs isn't needed, for the same reason that @foo.elems isn't needed: list %foo does the trick already. | |||
for %foo { my ($k, $v) := (.k, .v); ... } | 13:24 | ||
Although of course those are still .key and .value | |||
ods15 | karma bsmith | ||
how does that work | 13:25 | ||
Juerd | wolverian: I think @Larry deliberately has not published any decision re .chars in list context yet | 13:26 | |
wolverian: It was discussed in detail before, and Larry did not rule. Later, a ruling was explicitly requested, and again, there was none. | 13:27 | ||
wolverian | Juerd, oh, right. okay. | 13:33 | |
svnbot6 | r7127 | iblech++ | * Usual svn props. | ||
r7127 | iblech++ | * PIL2JS: runjs.pl: Added --compile-only option, needed for new -CJS. | |||
r7127 | iblech++ | * Main: Added support for -CJS and unbroke -CPIR. | |||
r7127 | iblech++ | * Pugs.CodeGen: Better normalization so -h looks prettier (it's "PIL", not | |||
r7127 | iblech++ | "Pil", for example). | |||
r7127 | iblech++ | * Pugs.Help: Add JS to the list of backends supported. | |||
wolverian | Juerd, I seem to have missed it. :) | ||
svnbot6 | r7127 | iblech++ | * pugs::hack: Accomodate for the above changes. | ||
wolverian | (it being the discussions before9 | 13:34 | |
s,9,), | |||
autrijus | someone in CUFP is advocating using MDA (www.cotsjournalonline.com/home/arti...id=100276) as a vehicale of marketing code-generation, code templating, macro etc inside one's orgainzation | 13:57 | |
nothingmuch | is that a good thing or a bad thing? | 14:02 | |
;-) | |||
autrijus | it's a buzzword thing that I think is genuinely helpful. | ||
this is for pointyhairs: www.omg.org/news/whitepapers/OMG_Ar...-Oxley.pdf | |||
nothingmuch | does anybody here know XML::XPath? | 14:44 | |
rafl does, of course. | 14:46 | ||
nothingmuch | i'm having trouble with $node->find(...relative_path...) | 14:48 | |
i have <page><title>foo</title><content><items><item><title>bar</title><...></item><item>...</item></items></content></page> | |||
given $xp->findnodes("/page/content/items/item") i want to extract the title for each $_ in a mao { } | 14:49 | ||
rafl: ping? | 14:59 | ||
rafl | nothingmuch: Oh, forget about you. Hold on.. | ||
Hm.. curious. It only returns the first item to me. Does the same happen to you? | 15:14 | ||
nothingmuch | i get a big tree | 15:16 | |
i suspect it's the complete set of "title" elements | 15:17 | ||
the problem is that the text is in hebrew, so Data::DUmper doesn't help a lot (it prints \x{decaf} everywhere) | |||
rafl | Hm. What works for me us using findnodes('/page/content/items/item/title'), taking the title child node and doing getData. | 15:19 | |
nothingmuch | right, that's cool | 15:20 | |
but not as nice as I wanted | 15:21 | ||
can you do relative xpath queries from a certain node? | |||
($xp->findnodes('/page/content/items/item'))[0]->find | |||
('title/text()') | |||
s/\n//l | |||
tr/l/;/ | |||
rafl | $xp->find('/foo', $context); | 15:22 | |
findnodes also takes an optional context. | |||
nothingmuch | oh, i see | 15:23 | |
thanks =) | |||
15:24
khisanth__ is now known as Khisanth
|
|||
rafl | Some Gimp artists in here? I'd like to have only the circle from the "Peoples Republic Of Perl" picture from the state of the onion 9. :-) | 15:25 | |
nothingmuch | rafl: you'll have your circle in about 2 mins | 16:26 | |
nothingmuch.woobling.org/7peoples.png | 16:36 | ||
should wokr on a transparent background well | |||
err, dark background | |||
i can take away the white | 16:37 | ||
slightly tweaked | 16:38 | ||
gaal | how do i trace from inside the parser? the following: | ||
nothingmuch | rafl: ping | ||
gaal | unsafePerformIO $ liftIO $ print (show ne) | ||
yields: | |||
Couldn't match `GenParser Char RuleState t' against `()' | 16:39 | ||
nothingmuch | i think liftIO is unnecessary | ||
integral | you could just use trace... | ||
nothingmuch | but you have to put the result somewhere | ||
ghci :t trace | |||
i forgot where | |||
gaal | integral: trace doesn't work either | ||
nothingmuch | it wraps unsafeperform io | ||
integral | it doesn't?! | ||
trace (show ne) (return ()) -- normally works in any monad | |||
gaal | well, not the way i tried it | ||
oh, w/o the lift and stuff? let's see | |||
nothingmuch | yes, you don't need the lift, since trace does not let the data interact | 16:40 | |
gaal | wow, trace just like that did work. i thought though that print foo was equivalent to trace foo (return())? | 16:41 | |
nothingmuch goes to B.S. | |||
gaal | anyway thanks ;-) | 16:42 | |
integral | ah, I think you might have needed a return on the front of yours | ||
integral & | |||
gaal | okay, i obviously don't understand something about Env. integral, are you still there? | 16:47 | |
in Parser, ruleClosureTrait, i basically do | 16:50 | ||
env <- getRuleEnv ; putRuleEnv env{ some modifications } | 16:51 | ||
but a print after that shows the modifications aren't in. what gives? | |||
oh wait! i was overwriting the current env with the caller. yikes! | 16:54 | ||
only question is, is it kosher to try to modify my envCaller via putRuleEnv env{ envCaller = ...} ? | 16:56 | ||
is my intuition correct, that this won't work and i have to modifyRuleEnv on the caller myself, and even that might not work? :) | 16:59 | ||
bah! my approach of writing the TVar in ruleClosureTrait is completely wrong; i have to think of some other way to communicate pragma requests. | 17:26 | ||
nothingmuch | why is it wrong? | 17:28 | |
gaal | because it only gets called once | 17:29 | |
nothingmuch | as opposed to? | ||
gaal | every 'use' or 'no' on a lexical pragma | 17:31 | |
nothingmuch | oh, i see | ||
i think | 17:32 | ||
gaal | i should be in ruleUsePerlPackage or thereabouts | ||
getting warmer... | 17:40 | ||
getting warmer... | 17:42 | ||
arr, this barfs: | 17:55 | ||
unsafePerformIO $ liftSTM $ writeTVar (envInitDat env) (idat { initPragmas = [] } | |||
(with an extra ')' at the end...) | 17:56 | ||
Couldn't match `GenParser Char RuleState t' against `()' | |||
why? | |||
integral | gaal: Are you sure you don't need a return in front? | ||
gaal | i don't want to return just yet... | 17:57 | |
nothingmuch | don't STM and IO not like each other | ||
? | |||
gaal | just do the write | ||
well, this did work: | |||
integral | gaal: umm, unsafePerformIO has type IO a -> a | ||
gaal: so if you're doing that inside another monad, you'd need a return | |||
gaal | let idat = unsafePerformIO $ liftSTM $ readTVar $ envInitDat env | ||
integral | unsafePerformIO turns a *monadic* thing, into a normal pure value, that can be assigned with a let. | 17:58 | |
nothingmuch | not any monadic... an IO | ||
gaal | hmm. i don't care abot the return value actually | ||
nothingmuch | the reason it's unsafe, btw, is that it ruins referential transparency | ||
if let is applied, you don't know if it checks again or doesn't | |||
integral | gaal: you still need "return". return doesn't exit from anything, it just wraps a monad around something | ||
gaal tries | 17:59 | ||
enlightentment will come, one day. | |||
nothingmuch: i will guard against the unsaefness with NOINLINE; i hope that should be enough? | 18:01 | ||
nothingmuch | the unsafeness is probably not relevant to parsing because it isn't likely to happen more than once, right? | ||
gaal | whoo! look what i got | ||
pugs.exe: <<loop>> | |||
that must be the haskell runtime telling me something ;-) | 18:02 | ||
nothingmuch | =) | 18:04 | |
pasteling | "gaal" at 192.115.25.249 pasted "what's loopin'?" (36 lines, 1.5K) at sial.org/pbot/13305 | 18:07 | |
nothingmuch | arrf | 18:10 | |
gaal | hmmm? | ||
nothingmuch is having a hard time with a box he doesn't own, and the software that isn't installed on it | 18:11 | ||
elmex | %hash.k cool, it's huffmanized | ||
nothingmuch likes it | |||
but doesn't want it to replace .keys | 18:12 | ||
aliasing++ | |||
in fact, we should standarzie on the scheme of abbreviation | |||
gaal | urig's arguments are solid, imo | ||
nothingmuch | for example, i would like .characters method on a string, but also .chars | ||
elmex | %hash.k is ridiculous.... why not abbrev every method by 1 char? why not encode a complete perl-program in spaces and runlenght encode it ??? | 18:13 | |
nothingmuch | because .k is universally known | 18:14 | |
$str.c is not as obvious | |||
though i wouldn't use .k on a hash - it doesn't sound plural... on a pair i would | |||
gaal | orthography isn't as interesting as semantics. help me find the loop please :) | 18:15 | |
elmex | will there be also 'keys %hash' ? | ||
nothingmuch | elmex: ofcourse | 18:16 | |
i expect as a multisub | |||
elmex | ah | ||
k | |||
gaal | trace prints show the loop is happenning on the second readTVar | 18:22 | |
so that does have something to do with the unsafety :) | |||
nothingmuch | gaal: do you think you could help port the mysql utf8 patch to sqlite? | 18:23 | |
gaal | nothingmuch: sqlite is okay with utf8 last i checked | 18:25 | |
nothingmuch | it's saving data, but not inflating it | ||
DBD::SQLite, that is | |||
sqlite itself does utf8 happily | 18:26 | ||
perlmonks.org/?node_id=491787 | |||
gaal seems to remember a utf8 app he wrote with DBD::SQLite.... | |||
sec, raiding the shallow vaults of my memory | 18:28 | ||
another sec, they're shallow, but twisty | 18:33 | ||
nothingmuch | =) | ||
gaal | darn, i just can't find this. | 18:36 | |
okay, can you send me something i can 'make test' and see it fail? | 18:37 | ||
funny, someone sent me a query recently about a utf8 patch updated for DBD::mysql 3 | 18:38 | ||
nothingmuch | $c->add_trigger("select", sub { | 18:39 | |
_utf8_on($_[0]); | |||
}); | |||
gaal | har, please send me a .t :) | ||
nothingmuch | Data::Structure::Util | ||
no, that's not a test | |||
that's a solution =) | 18:40 | ||
s/(solution)/"$1"/ | |||
gaal | ?eval <har> xx 3 | ||
nothingmuch | no evalbot =( | 18:41 | |
gaal | what's $c btw, the dbh? | 18:42 | |
nothingmuch | the name of a class | ||
cdbi class | |||
gaal | oh, right. | 18:44 | |
heh, NPOV violation in latest Encode.pm docs (`UTF-8 vs. utf8`) | 18:46 | ||
so now that you have your solution | |||
s/(solution)/"$1"/; # :-) | |||
help me find mine :) | |||
nothingmuch | kay, fill me in | 18:47 | |
gaal | sial.org/pbot/13305 | 18:48 | |
nothingmuch 's hair stands | |||
gaal | traces show the loop is at the second readTVar | ||
as you said, there's some ref transparency violated. | |||
what? | |||
nothingmuch | it's long ;-) | ||
gaal | oh, ignore the parts that are too indented | 18:49 | |
the skinny on this is: | |||
when the parser sees 'use foo' | |||
it looks for foo::import and calls it | |||
(there's also handling for the case where &import doesn't exist; and for the symmetric &no, but those are immaterial now.) | 18:50 | ||
what i added was just this: | |||
before calling import, we initialize a TVar | |||
&import possibly writes to it | |||
and i just want to pick up the value it wrote to. | 18:51 | ||
s/to\././ | |||
okay? | |||
the writing side of this, btw, is in Pugs::Internals::install_pragma_value | |||
nothingmuch | hmm | 18:52 | |
so idat is read correctly | |||
then the import happpens | |||
then idat' is read | |||
and that's where it loops?. | |||
gaal | yes. | ||
nothingmuch | sounds hairy | ||
gaal | brb | ||
nothingmuch | what is getRuleEnv? | 18:53 | |
current lexical scope? | |||
gaal | current Env | ||
i may have gotten some details wrong: for example maybe install_pragma_value needs to write to envCaller, not env, but that's again immaterial. | 18:54 | ||
nothingmuch | what if the value was an IORef? | ||
gaal | well, it's very material, only not to the looping problem :) | ||
nothingmuch | remember that STM will undo and redo if there was a violation | ||
gaal | rather than STM? no idea | ||
nothingmuch | do you know exactly how STM works? | 18:55 | |
gaal | i don't actually understand that bit | ||
heh | |||
nope. | |||
nothingmuch | okay, i'll explain in a sec | ||
phone | |||
gaal | ok | ||
type ahead when you can; i'll raid the kitchen. | |||
nothingmuch | okay | 18:56 | |
STM works like this: | |||
every read and write to/from STM is recorded in a journal | 18:57 | ||
when an atomic { } finishes, the journal is checked | |||
and if it's invalid, it's rolled back, and the block of code runs all over again | |||
since IO is not permitted, it's sane | |||
since haskell is pure, and most data structures don't need journalling it's fast | |||
anyway, when two threads use a single TVar | 18:58 | ||
and they conflict | |||
then they will be rerun | |||
until there is no conflict | |||
conditions which are known to have not changed since the last fail cause a thread to block till the condition is changed, and the thread should be tried again | 18:59 | ||
effectively what you get is semantics which are sometimes inefficient but usually good enough, without the need to lock anything | |||
that's why it could loop | |||
try an IORef - they have a similar interface | 19:00 | ||
also, i think liftSTM in unsafePerformIO is silly | |||
there should be an unsafePerformSTM | |||
unsafePerformSTM $ readTVar $ envInitDat env | |||
now, WRT the writeTVar what's up with the return? | 19:01 | ||
and i think that maybe the readTVar and writeTVar, due to unsafe/lift are somehow not being finished synchronously, and are thus looping | 19:02 | ||
but i don't really know | |||
gaal | that was just to get it to compile, per integral's suggestion | ||
okay, i'll try an IORef. | |||
nothingmuch | try unsafePerformSTM | ||
then try IORefs | |||
gaal | k | 19:04 | |
with unsafePerformSTM it still loops. trying the other one. | 19:07 | ||
nothingmuch | okay | ||
gaal | it wants a Show instance now... | 19:12 | |
looking for examples of how to do that... | |||
nothingmuch | a show for IORef? | 19:13 | |
or for whatever you put in it? | |||
gaal | for (IORef InitDat), which is in Env | ||
nothingmuch | hmm | ||
that'll be hard | |||
read the IORef, and make 'data InitDat' have a 'deriving Show' in it | 19:14 | ||
gaal | data InitDat already derives Show (and Ord, which was also a problem) | ||
how do I do the "read the IORef" bit? | 19:15 | ||
nothingmuch | hmm | ||
readIORef | |||
i should thin | |||
k | |||
gaal | src/Pugs/AST/Internals.hs:1038 | ||
nothingmuch | nopaste your current code | ||
gaal | the problem is not in my new code, it's in the old code where i just s/TVar/IORef/ - src/Pugs/AST/Internals.hs:1038 | 19:16 | |
nothingmuch | svk pulling | ||
haven't done so in 2-3 days | |||
gaal | it isn't new | ||
well, i'm off for tonight. see 'ya! | 19:38 | ||
zzzZZZ & | |||
Juerd | good night | 19:40 | |
Aankh|Clone goes to sleep. | 19:42 | ||
G'night. | |||
nothingmuch | morning | 22:27 | |
or evenning | |||
22:27
khisanth_ is now known as Khisanth
|
|||
nothingmuch wonders whether he should work on anything in his present condition | 22:32 | ||
dduncan | its about 1600h here | 22:54 | |
nothingmuch | 2 here.. 0200 | ||
nothingmuch is headed to bed | |||
dduncan | then good night to you | 22:55 | |
nothingmuch | you too =) | ||
dduncan | later | ||
nothingmuch | all i have to do is get up from my current seating accomodation ;-) |