Camelia, the Perl 6 bug

IRC log for #parrot, 2010-01-10

Parrot | source cross referenced

| Channels | #parrot index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 Tene the regex stuff comes from the 'match' rule, fwiw.
00:03 cconstantine http://github.com/tene/steme/blob​/master/steme/pct/grammar.pg#L33
00:03 Tene Yes, that declares a protoregex variant.
00:04 Tene just like L42, L47, ...
00:05 Tene or were you asking about the contents ofthe macro rule itself?
00:05 cconstantine yes
00:05 Tene What do you want to know about it?  You're very terse. :)
00:06 cconstantine sorry, trying to read your code
00:06 cconstantine umm, so.. I'm mostly lost
00:06 Tene $*foo is dynamicaly scoped.
00:07 Tene when I parse 'macro' and then a symbol, I save that symbol into a context variable so that it's then available when I parse _ in a pattern later (_ matches the name of the macro being matched)
00:08 cconstantine so if this gramar sees: (macro foo ...) it stores a macro named 'foo'?
00:08 Tene Yes, steme implements basic macros.
00:09 cconstantine there is so much more to macros
00:09 Tene It actually modifies the parser by installing additional protoregex variants after parsing the macro definition.
00:09 cconstantine ok
00:09 cconstantine what does line 39 do?
00:10 Tene line 39 is the same as "$<action>=<.q_item>"
00:10 Tene It just assigns a different name in the match object produced.
00:11 Tene the leading . before q_item says to not include that match under that name in the match object produced.
00:11 Tene just like you'll see people use <.ws> to match whitespace, but not save the matched whitespace in the match object.
00:15 cconstantine line 34 is really 'macro' ?  or... <sym> is replaced with 'macro' ?
00:15 Tene cconstantine: <sym> in a rule will be replaced with whatever was in the :sym<...> in the rule declaration.
00:16 cconstantine ok
00:16 Tene So yes, <sym> is replaced with 'macro'
00:18 cconstantine cool
00:18 cconstantine so, starting with http://github.com/tene/steme/blob​/master/steme/pct/actions.pm#L69 could you explain each line in that method?  (sorry, I'm just seeing a lot of new-to-me features)
00:19 Tene That's using something that's likely to go away eventually, I hear.
00:19 Tene The summary is that {*} means "call the appropriate method in the action class"
00:20 Tene the #= foo on a line with a {*} means "pass 'foo' as a second argument to the action method"
00:20 cconstantine uh, I'm looking in actions.pm now
00:21 cconstantine and {*} is going away?
00:21 Tene Oh, right.
00:21 Tene >.>
00:21 cconstantine :)
00:21 Tene I didn't look at the email closely.
00:21 Tene The #= foo thing might be going away, according to vague murmuring from TimToady.
00:22 cconstantine ok, I'm mostly ok with that
00:22 Tene okay, action.pm:69
00:23 Tene the way I handle macros is that when I parse them, I actually install additional regexes in the grammar and methods in the actions class.
00:24 cconstantine I get the feel of that from the code, I just don't know how it's done
00:24 Tene so if I have: (macro foo (_ a) (...)), then I install a regex named special:sym<foo> that matches like {'foo' $<a>=<.item>}.
00:25 cconstantine (Q:PIR {%r = ....} ) executes '...' as PIR code and it's value is %r ?
00:25 Tene That's what happens in lines 71-75
00:25 Tene Yes.
00:25 Tene %r is the return reguster.
00:25 Tene register
00:25 purl somebody said register was working with vs 2008 and strawberry perl
00:25 cconstantine thank you purl
00:25 purl You're welcome
00:26 Tene the method that I install in the actions class is the 'macroeval' method that you see below.
00:26 cconstantine ok, so it just executes the stuff in {}s
00:26 Tene 81-99
00:26 purl -18
00:26 Tene Yes.
00:28 cconstantine ah, so 70 adds the body of the 'macroeval' method to the 'Steme';'Grammar';'Actions' namespace under the name 'special:sym<' ~ $<symbol> ~ '>'
00:28 Tene Yes.
00:28 Tene Exactly.
00:29 Tene in line 66, I save the macro body (the "(...)" from above) in a global hash.
00:30 Tene Then in macroeval, I fetch the body back out, keyed on the macro name (I only support macros that start with _ right now, which sets that), and then do some setup (awkward right now) and re-evaluate it.
00:31 cconstantine you save the macro as a string literal?
00:31 Tene cconstantine: Yes.
00:32 cconstantine ah, so you can compile it... it's hard to start the compiler at a stage
00:32 cconstantine at a named stage that is
00:32 Tene Well, no, you just invoke a different compiler.  I'd love to have parameterizable ASTs, but that wasn't the part I was concerned about right then.
00:33 Tene My main concerns were: 1) modifying the parser at parse time, and 2) generating a regex from a s-exp, for the match part of the macro.
00:34 Tene so I just did the simplest thing I could think of that worked for that.
00:34 cconstantine simple :)
00:34 cconstantine speaking of simple... here's my state: http://github.com/cconstantine/Reason
00:35 cconstantine it's not nearly as complete
00:35 cconstantine but it generates 'cons' trees in the 'expr' action, and compiles the cons trees in the only way it knows howto (to method calls)
00:36 Tene I have more intelligence in the code than I probably want.  I need to think more about storing things as s-exprs, and then compiling those to PAST, like you might be doing.
00:37 cconstantine I'm pretty sure that's waht I'm doing
00:37 cconstantine and I mostly stumbled upon it so it can most likely be cleaned up a lot
00:37 Tene Add another compiler stage, so instead of parse->past->..., it goes parse->sexp->past->...
00:37 cconstantine I found that I didn't need another stage
00:37 cconstantine at least not yet
00:37 Tene Is a plan I'm considering, I meant.
00:38 cconstantine ah
00:38 cconstantine i tried that and found it problematic
00:38 Tene I really have negligible experience with lisp and scheme, so I don't know if I'm doing anything vastly stupid yet. :)
00:39 cconstantine ah
00:39 cconstantine wait
00:39 cconstantine to define a macro that returns code equivalent to (if cond a b) you write:
00:39 Tene Right now I have a separate set of rules for quoting, that mirror the rules for actual code.
00:39 cconstantine (macro (_if cond a b) (if cond a b))
00:39 cconstantine ?
00:40 Tene (macro my-if (_ cond a b) (if cond a b))
00:40 Tene _ in a match is the same as <sym> in a regex.
00:40 Tene http://github.com/tene/stem​e/blob/master/t/05-macro.t
00:40 cconstantine ok, so that works for template sty macros....
00:41 Tene oh, I still left it like that?  Ew, that's not right...
00:41 cconstantine can you write a macro that generates a list?
00:41 Tene apparently I left it using :foo to interpolate macro arguments.
00:41 cconstantine (defmacro (foo a b) (list if a b))
00:42 Tene I'm not sure if I know what that means.  'sec.
00:42 cconstantine macros are code that executes at compile-time, and the result is what's compiled
00:43 Tene So if I called (foo 1 2) it would be the same as '(if 1 2) ?
00:43 cconstantine it would be the same as (if 1 2)
00:43 cconstantine because the (list ...) would execute at compile time and return a list (if 1 2)
00:43 Tene No, I don't handle that at all.
00:44 cconstantine and the compiler would see the list (<a symbol named if> <constant 1> <constant 2>) and compile it
00:44 cconstantine ok, that's the heart of what a macro is
00:44 Tene As I said, I don't have a s-exp compiler.
00:44 cconstantine ok :)
00:46 cconstantine My plans for the s-exp compiler is basiclly a table of methods (key: form/macro name, value: compiler_func)
00:46 cconstantine and for each s-expr to compile if the first element of an s-expr is a string/simple-symbol (undecided about this) I lookup the compiler
00:47 cconstantine if a compiler isn't found I use the default s-expr-is-method-call compiler
00:47 cconstantine so things like 'or', 'lambda', 'if', would be in the method table
00:50 cconstantine I currently need a) that table, b) the ability to go from PAST to code I can execute before leaving the parse stage
00:50 Tene b) is easy.
00:50 cconstantine I hope so :)
00:50 Tene my $compiler := Q:PIR { %r = compreg 'PAST' };
00:50 Tene my $code := $compiler.compile($past);
00:51 Tene actually, don't even need the Q:PIR
00:51 cconstantine how do I execute $code then?
00:51 Tene my $compiler := pir::compreg__PS('PAST');
00:52 cconstantine or is $code the return value of the $past
00:52 Tene it's an Eval object.  It contains a list of Subs.
00:52 Tene for each .sub generated, you get a reference in the $code object.
00:52 cconstantine fantastic.  what's an Eval object and a Sub?
00:52 szabgab joined #parrot
00:52 Tene Sub is parrot's function class.
00:53 Tene so if your past only compiles to one pir .sub, you can get that in $code[0], and then it's a code reference that you can invoke like anything else.
00:54 cconstantine so, "$code[0]()"
00:54 Tene so what you want to do for testing is first just compile it to pir, with: my $pir := $compiler.compile($past, :target('pir'));
00:54 Tene Then print the pir to confirm that it has what you expect.
00:54 Tene Yes.
00:54 cconstantine PAST::Block objects are Subs?
00:55 Tene Yes.
00:55 cconstantine w00t, I got it :)
00:55 Tene :D
00:55 cconstantine so if I got multiple Subs I could iterate over them and execute them all
00:55 Tene Yes.
00:55 cconstantine awesome
00:56 cconstantine Oh the ironies... I'm using perl to make a lisp because I hate complicated syntax :)
00:57 Tene I really need to get the existing languages up to date with HLL interop support, and then add that to create_language.pl
00:57 cconstantine existing languages?
00:58 Tene Rakudo, partcl, cardinal, pynie, steme, lolcode, etc.
01:07 cconstantine and create_language.pl doesn't add in HLL support?
01:08 cconstantine HLL interop I should say
01:10 Tene Kinda.  It registers a compiler that inherits from HLLCompiler, which does some of it.
01:12 cconstantine Ahhh
01:13 cconstantine and yup, doing the code given above I can execute user code at compile-time w00t w00t
01:19 ZeroForce joined #parrot
01:20 allison joined #parrot
01:20 allison do we need big deprecation tickets for PGE and NQP?
01:38 ZeroForce1 joined #parrot
01:41 dalek TT #1405 created by allison++: [DEPRECATED] get_results opcode before call
01:47 ZeroForce joined #parrot
02:13 dalek TT #1406 created by allison++: [DEPRECATED] get_results opcode used to fetch exception object
02:13 dalek TT #1407 created by allison++: [DEPRECATED] CPointer and CPointer-style return argument handling
02:15 ZeroForce joined #parrot
02:17 cognominal joined #parrot
02:20 dalek tracwiki: v8 | allison++ | AllisonTasklist
02:20 dalek tracwiki: http://trac.parrot.org/parrot/wiki/All​isonTasklist?version=8&amp;action=diff
02:59 Psyche^ joined #parrot
03:57 bacek allison, CPointer isn't used for PCC already.
04:26 allison bacek: yes, I know, but we're still using the pointer technique
04:28 allison bacek: and the PMC is still floating around and needs to be cleaned out
04:28 allison bacek: (removed)
04:36 dalek parrot: r43415 | allison++ | trunk/DEPRECATED.pod:
04:36 dalek parrot: Add a some deprecation items from the calling conventions.
04:36 dalek parrot: review: http://trac.parrot.org/parrot/changeset/43415/
05:43 dalek cardinal: 62ad078 | fperrad++ |  (14 files):
05:43 dalek cardinal: Merge remote branch 'cardinal/master'
05:43 dalek cardinal: review: http://github.com/cardinal/cardinal/commit​/62ad07823c6401259ffc84280f05d9ed83c3cc0c
05:43 dalek cardinal: 10dca74 | fperrad++ |  (5 files):
05:43 dalek cardinal: update infrastructure with setup.pir (distutils)
05:43 dalek cardinal: review: http://github.com/cardinal/cardinal/commit​/10dca746dccb5b0d6c17d1fe68cfc0c53afdf16f
05:43 dalek cardinal: e68c574 | fperrad++ | plumage/cardinal.json:
05:43 dalek cardinal: add a Plumage description
05:43 dalek cardinal: review: http://github.com/cardinal/cardinal/commit​/e68c574ddc2126d2aa3f79478629a9b0c4fb0038
05:43 treed Fucking github's pull request thing is broken.
05:43 treed I had to do the merge locally.
05:43 cognominal joined #parrot
05:45 allison joined #parrot
06:11 bacek joined #parrot
08:16 nuba joined #parrot
08:45 cognominal joined #parrot
09:27 dalek parrot: r43416 | bacek++ | branches/gc_encapsulate:
09:27 dalek parrot: Branch for encapsulate GC more
09:27 dalek parrot: review: http://trac.parrot.org/parrot/changeset/43416/
09:37 szabgab joined #parrot
09:38 fperrad joined #parrot
10:17 bacek joined #parrot
10:18 bacek o hai
10:55 szabgab joined #parrot
11:10 iblechbot joined #parrot
11:44 barney joined #parrot
11:52 dalek parrot: r43417 | barney++ | trunk/t/codingstd/copyright.t:
11:52 dalek parrot: Mark 'tools/dev/create_language.pl' as having duplicate copyright statements.
11:52 dalek parrot: review: http://trac.parrot.org/parrot/changeset/43417/
12:13 jsut_ joined #parrot
12:40 AndyA joined #parrot
12:51 joeri joined #parrot
13:58 payload joined #parrot
14:02 dalek parrot: r43418 | barney++ | trunk/tools/dev/install_dev_files.pl:
14:02 dalek parrot: Improved code comment, mentioned invocation from test scripts.
14:02 dalek parrot: review: http://trac.parrot.org/parrot/changeset/43418/
14:02 dalek parrot: r43419 | barney++ | trunk/t/tools/install (3 files):
14:02 dalek parrot: Mention install_doc_files.pl in POD.
14:02 dalek parrot: review: http://trac.parrot.org/parrot/changeset/43419/
14:09 mikehh_ joined #parrot
14:36 mikehh joined #parrot
15:11 cognominal joined #parrot
15:13 Psyche^ joined #parrot
16:11 payload joined #parrot
17:06 cognominal joined #parrot
17:11 theory joined #parrot
17:21 cconstantine How do I detect (in nqp) that a key is not in a hash?
18:04 allison joined #parrot
18:05 davidfetter joined #parrot
18:38 tetragon joined #parrot
18:40 theory joined #parrot
19:24 mikehh joined #parrot
19:37 mj41 joined #parrot
19:53 ZeroForce joined #parrot
20:10 payload joined #parrot
20:24 joeri left #parrot
20:27 mikehh manifest_tests FAIL - all others PASS (pre/post-config, make corevm/make coretest, smoke (#31587), fulltest) at r43419 - Ubuntu 9.10 amd64 (g++ with --optimize)
20:29 nopaste "mikehh" at 81.149.189.7 pasted "manifest_tests failures at r43419" (33 lines) at http://nopaste.snit.ch/19248
20:34 bacek joined #parrot
20:35 bacek good morning
20:36 bacek msg kid51 I can't reproduce TT#1393 on my Linux/i386 box... Debian, gcc 4.3.4.
20:36 purl Message for kid51 stored.
20:52 payload1 joined #parrot
21:04 cognominal joined #parrot
21:25 dalek tracwiki: v139 | DurfWerzel++ | WikiStart
21:25 dalek tracwiki: http://trac.parrot.org/parrot/wiki/W​ikiStart?version=139&amp;action=diff
22:08 mikehh can someone enlighten me if the change by DurfWerzel - trackwiki: v139 is legit
22:09 cotto definitely not
22:09 mikehh and if so it needs clarification
22:10 cotto It'd be less suspicious if the url didn't contain a misspelling.
22:12 mikehh it seems to go to some Wordpress login page
22:13 cotto It's clobbering time.
22:14 dalek tracwiki: v140 | susieb++ | WikiStart
22:14 dalek tracwiki: http://trac.parrot.org/parrot/wiki/W​ikiStart?version=140&amp;action=diff
22:15 cotto this does not bode well
22:16 mikehh who is the tracwiki admin
22:18 cotto coke iirc
22:31 dalek tracwiki: v141 | cotto++ | WikiStart
22:31 dalek tracwiki: clean up some spam
22:31 dalek tracwiki: http://trac.parrot.org/parrot/wiki/W​ikiStart?version=141&amp;action=diff
22:34 patspam joined #parrot
22:46 Coke coke is /A/ tracwiki admin. whatchu need?
22:47 Coke crap. I don't have my trac password atm.
22:48 cotto we have a couple more spammers
22:51 Coke I need to fix a few things locally before I can re-open my password vault.
22:53 AndyA joined #parrot
22:53 payload joined #parrot
22:59 nuba joined #parrot
23:38 theory joined #parrot
23:39 dalek TT #1408 created by mikehh++: manifest_tests failures introduced at r43406
23:55 cconstantine joined #parrot

| Channels | #parrot index | Today | | Search | Google Search | Plain-Text | summary

Parrot | source cross referenced