Camelia, the Perl 6 bug

IRC log for #parrot, 2011-06-17

Parrot | source cross referenced

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

All times shown according to UTC.

Time Nick Message
00:01 soh_cah_toa and honestly, unless you're playing a video game while editing a movie while you're running photoshop while you're using firefox (new firefox), you never will reach that 4GB limit
00:07 sorear whiteknight: the assertion that Ubuntu is "one of the most usable" is oft made but rarely substantiated
00:09 cotto_work seen dukeleto
00:09 aloha dukeleto was last seen in #parrot 1 days ago joining the channel.
00:25 theory left #parrot
00:27 darbelo left #parrot
00:31 plobsing bubaflub: pong
00:31 bubaflub plobsing: could you briefly describe the difference between 'p' and 'P' NCI types?
00:32 plobsing 'P' passes the PMC* through unaltered. 'p' uses the {get,set}_pointer convention for representing pointers with PMCs.
00:35 bubaflub plobsing: ok. i think i get it.
00:35 cotto joined #parrot
00:42 cotto ~~
00:42 bubaflub plobsing: so in Winxed, if i have some var ptr set to an allocated StructView, when i pass that ptr into an NCI function should that be a 'p' or a 'P'?
00:43 bubaflub if that question even makes sense
00:43 sorear do you want the NCI function to get the struct, or the PMC*?
00:44 sorear should the passed pointer point to a Parrot_Obj header, or to your own struct?
00:44 plobsing ^^
00:45 sorear plobsing: when does 'p' use set_pointer?
00:45 plobsing sorear: for returns
00:45 plobsing and pass-by-reference
00:45 plobsing which are treated like returns by the NCI layer
00:46 sorear How do returns know what kind of PMC to make?
00:46 plobsing they don't. they just make Ptr PMCs
00:47 plobsing I suppose one might conceivably want to HLL map that
00:47 sorear does NCI ever set_pointer a non-Ptr?
00:48 plobsing no. What situation would make that desirable?
00:48 sorear none; I just was getting clarification
00:56 bubaflub plobsing: hmmm, i'm still a bit foggy on all this.  almost all my functions take an mpz_t which i have for the StructView.  i've got it working with a 'p' NCI type but i'm not totally sure that's right.
00:58 plobsing unless your function takes a 'PMC*' (or in rare cases a passthrough 'void*'), you want 'p'.
01:00 bubaflub plobsing: ok, that makes sense.  i saw some NCI signatures in the extra_thunks file that took a 'P' and was wondering why that was.
01:00 bubaflub plobsing: so those functions have to be designed to *explicitly* take a PMC*
01:00 plobsing yes, exactly
01:01 plobsing such functionality is generally only useful for calling into parrot internals or parrot extensions
01:01 bubaflub plobsing: great.  also, pdd16 is still in draft mode - is there anything that's stopping that from becoming a non-draft PDD?  more docs or updates?
01:01 bubaflub (i'm willing to put in the time to edit it or fill it out, just curious)
01:01 theory joined #parrot
01:03 plobsing it looks like PDD16 describes parrot's NCI circa 1-4 years ago.
01:04 bubaflub plobsing: bummer.
01:06 bubaflub plobsing: well, i'm still willing to edit it to get it up to date but i'll need some pointers in the right direction
01:06 sorear isn't that the way PDDs always are?
01:07 plobsing bubaflub: I'm not exactly the best person to ask about writting PDDs. my view is that they are ill-conceived and are doomed to uselessness.
01:07 bubaflub sorear: yes, but i'll put some time to fix at least this one
01:07 plobsing I think we'd be much better off with docs that didn't try to define "what should be", but in stead, focused on "what is"
01:08 plobsing and documented that in a sequence meaningful to users, not devs
01:08 bubaflub plobsing: for the most part i agree - i'd love to see the PDD at least get to the point where it's describing what currently is
01:10 plobsing but that's not a PDD. a PDD is a waterfall-design-type thing.
01:11 plobsing I'd encourage you to look at writting up a "How to work with native code from Parrot" document in stead, if you have the time.
01:12 bubaflub plobsing: yeah, i'd like to incorporate that as part of my GSoC project - a tutorial documenting the steps i took to get these bindings to work
01:14 pjcj left #parrot
01:14 bubaflub plobsing: but i think my project is pretty simple and has some idiosyncrasies that won't be too relevant to others
01:15 plobsing you can use your discretion about inclusions and omissions, but perhaps those idiosyncrasies are simply "advanced material"
01:16 plobsing which would go at the bottom
01:19 bubaflub plobsing: yeah.  i have some specific scripts which "parse" (fsvo parse) the header and the docs to generate the code that i use.  that's specific but the techniques are good.  generating an extra thunk is something i think others will need.
01:44 whiteknight left #parrot
01:53 kid51 joined #parrot
01:54 kid51 msg dukeleto Something is amiss with the way planet.parrotcode.org is handling your latest post.
01:54 aloha OK. I'll deliver the message.
02:00 davidfetter left #parrot
02:05 bubaflub left #parrot
02:07 lichtkind_ joined #parrot
02:09 lichtkind left #parrot
02:09 lichtkind_ is now known as lichtkind
02:16 lichtkind left #parrot
02:20 benabik joined #parrot
02:22 kid51 left #parrot
02:24 woosley joined #parrot
02:29 rurban_ joined #parrot
02:32 rurban left #parrot
02:32 rurban_ is now known as rurban
02:33 benabik Good evening!
02:33 soh_cah_toa tcurtis: ping
02:34 benabik Random Q: Where does the value of a lexical get stored?  In the register in the .lex declaration?
02:35 soh_cah_toa i think its the LexPad pmc
02:35 soh_cah_toa or LexInfo, one of those two
02:37 soh_cah_toa benabik: look at docs/book/pir/ch06_subroutines.pod
02:38 soh_cah_toa particularly in the "Lexicals" section
02:38 benabik The LexInfo doc says that a lexical is an alias for a register.
02:39 soh_cah_toa look at that pod file. i think that section is exactly what you're looking for
02:39 benabik soh_cah_toa: Well, I'm looking at the HTML on parrot.org.
02:41 soh_cah_toa benabik: LexInfo stores compile time info about lexicals while LexPad stores runtime info about lexicals
02:42 soh_cah_toa i'm not sure what you're trying to do but i don't think you can access those two pmc's directly from pir code
02:43 pjcj joined #parrot
02:45 benabik soh_cah_toa: I'm pondering possible optimization.  If the register in the .lex declaration is the actual storage location, then there's no need to use find_lex in the same sub it's declared in.  If it's stored in the LexPad...  well, then, I'm sad.
02:45 benabik soh_cah_toa: Also just trying to understand register use and whatnot because I'm playing with PAST's register allocation.
02:46 benabik (By playing with, I may mean "screwing up"...  Getting weird compilation issues.)
02:46 soh_cah_toa alright
02:52 soh_cah_toa benabik: http://www.onyxneon.com/books/​parrotdev/parrot_dev_guide.pdf
02:53 soh_cah_toa benabik: page 41
02:53 soh_cah_toa it's outdated but i still read it sometimes :)
02:53 benabik soh_cah_toa: This seems identical to docs/book
02:54 soh_cah_toa it is
03:14 dalek parrot: 3874860 | petdance++ | src/pmc.c:
03:14 dalek parrot: consted a pointer
03:14 dalek parrot: review: https://github.com/parrot/parrot/commit/38748602fe
03:15 benabik I have the sudden urge to make a crickets IRCbot, that just sits in the channel and chirps after a given amount of inactivity.
03:52 soh_cah_toa yeah, today has been unusually quite. thursday normally sees a lot of activity
03:53 soh_cah_toa https://github.com/parrot/parrot/graphs/punch_card
04:13 benabik left #parrot
04:27 theory left #parrot
04:41 benabik joined #parrot
04:46 dalek parrot/soh-cah-toa/hbdb: 0f058bc | soh_cah_toa++ | src/hbdb.c:
04:46 dalek parrot/soh-cah-toa/hbdb: Renamed a few structs by adding the prefix 'hbdb' to avoid possible name collisions in the future
04:46 dalek parrot/soh-cah-toa/hbdb: review: https://github.com/parrot/parrot/commit/0f058bc850
04:46 dalek parrot/soh-cah-toa/hbdb: bb3a61c | soh_cah_toa++ | src/hbdb.c:
04:46 dalek parrot/soh-cah-toa/hbdb: Re-organized a few comments in src/hbdb.c to be more consistent with Parrot conventions
04:46 dalek parrot/soh-cah-toa/hbdb: review: https://github.com/parrot/parrot/commit/bb3a61ccbf
04:46 dalek parrot/soh-cah-toa/hbdb: 13887fd | soh_cah_toa++ | src/hbdb.c:
04:46 dalek parrot/soh-cah-toa/hbdb: Added skeleton for parse_command() and renamed hbdb_command_line() to command_line() because static functions shouldn't have the hbdb prefix. Also made a perldoc section for static functions
04:46 dalek parrot/soh-cah-toa/hbdb: review: https://github.com/parrot/parrot/commit/13887fdc12
04:46 dalek parrot/soh-cah-toa/hbdb: 42fc16a | soh_cah_toa++ | / (3 files):
04:46 dalek parrot/soh-cah-toa/hbdb: Added src/embed/hbdb.c to the SEE ALSO section in all relevant perldoc
04:46 dalek parrot/soh-cah-toa/hbdb: review: https://github.com/parrot/parrot/commit/42fc16a4b5
04:50 soh_cah_toa left #parrot
05:37 fperrad joined #parrot
05:39 athomason left #parrot
06:16 SHODAN joined #parrot
06:48 Drossel left #parrot
06:48 Kulag joined #parrot
06:57 dalek nqp: af3db5b | pmichaud++ | src/6model/reprs/P6opaque.c:
06:57 dalek nqp: Improve NYFI 4 message to include name of attribute not located.
06:57 dalek nqp: review: https://github.com/perl6/nqp/commit/af3db5b5d5
07:26 PacoLinux left #parrot
07:27 PacoLinux joined #parrot
07:27 mj41 joined #parrot
07:39 woosley left #parrot
07:44 dukeleto ~~
07:45 cotto nice to see you alive, dukeleto
07:45 dukeleto cotto: took a midweek vacation
07:45 cotto getting relaxed before OS Bridge?
07:46 dukeleto cotto: just in general
07:46 dukeleto cotto: surprised to hear about perl-ctypes not working. I thought it was going into p5p core
07:46 cotto orly?  That'd be amazing.
08:20 dodathome joined #parrot
08:28 dalek Heuristic branch merge: pushed 29 commits to parrot/leto/embed_grant by leto
08:49 Drossel joined #parrot
08:50 Kulag left #parrot
08:59 Drossel left #parrot
09:10 mikehh left #parrot
09:20 dalek website: rohit_nsit08++ | CorellaScript : AST and LALR parsing.
09:20 dalek website: http://www.parrot.org/content/co​rellascript-ast-and-lalr-parsing.
09:21 Kulag joined #parrot
09:23 mikehh joined #parrot
09:29 SHODAN left #parrot
10:29 rurban_ joined #parrot
10:32 rurban left #parrot
10:32 rurban_ is now known as rurban
10:59 dodathome left #parrot
11:05 redicaps joined #parrot
11:06 SHODAN joined #parrot
11:08 lichtkind joined #parrot
11:33 mtk left #parrot
11:39 mtk joined #parrot
11:59 jsut_ joined #parrot
12:04 jsut left #parrot
12:23 contingencyplan left #parrot
12:26 cosimo joined #parrot
12:30 redicaps left #parrot
12:52 estrabd left #parrot
12:52 estrabd joined #parrot
12:54 rohit_nsit08 joined #parrot
12:54 rohit_nsit08 hello #parrot
12:59 bubaflub joined #parrot
13:05 darbelo joined #parrot
13:17 whiteknight joined #parrot
13:17 whiteknight good morning, #parrot
13:17 tadzik good morning whiteknight
13:19 whiteknight hello tadzik, how are you today?
13:19 tadzik not bad. I happened to fail my yesterday exam though
13:20 moritz :(
13:20 moritz which one was that, math?
13:20 tadzik yes
13:21 whiteknight what subject in math?
13:21 tadzik I passed the exam itself, but I don't have enough points from the excercises: I wasn't present on the last of mini-exams, because I was writing physics then
13:21 tadzik it's named "Probabilistics and Statistics"
13:22 moritz that sucks, probably
13:22 tadzik if it wasn't for physics, I'll have my exercises passed too, and I'll be drinking right now. But in the situation I am, I need more points from the exam than the passing border
13:23 plobsing left #parrot
13:23 whiteknight tadzik: algebra-based or calculus-based probability?
13:23 tadzik this semester is a semester of second-attempt exams
13:24 tadzik whiteknight: I don't think my language interoperability applies to maths :) But I'll vote for algebra based, I think
13:24 tadzik there are matrixes :P
13:25 tadzik no, honestly, I don't know :) I can show you the tasks, but they're in polish
13:25 whiteknight tadzik: okay, that's the most common. I had it with a lot of calculus for the engineering curriculum. I don't recommend that for anybody
13:26 whiteknight but probability is a tricky subject to wrap your mind around no matter what. Lots of formulas to memorize and all that
13:27 tadzik covariation. Do you know such a term?
13:27 tadzik oh, we have the card of formulas with us that's not a problem
13:28 tadzik calculus is a problem. I approach the woman today and ask "why do I have 3/10 points for this task?" – "well, a calculus mistake over here, so the eventual solution is wrong" – "so I don't get no points for the good method?" – "You get, 3 points"
13:29 tadzik out of 6 tasks, I couldn't really solve one, the rest was not a problem. And still I get 31/60 points. Calculus mistakes, typos, mistakes with integrals... Sigh.
13:29 PerlJam tadzik: make fewer mistakes :)
13:30 tadzik I will have to, yes :)
13:30 moritz tadzik: I know that all too well. I usually had all the methods correct and all the results wrong
13:30 PerlJam tadzik: do you usually take the whole time to work the problems?
13:31 tadzik PerlJam: very rarely, but this time I did
13:31 tadzik there were a few tasks I saw for the first time in my life, and I needed to figure out the way to solve them
13:32 tadzik otherwise I'll re-check everything, yes
13:32 tadzik I usually do
13:32 tadzik bah, whatever. 29th is the day then
13:32 tadzik your favourite Signal Theory, whiteknight, is on monday
13:33 whiteknight tadzik: yeah, I loved that course. I took several like that.
13:34 whiteknight signals, communications, filters, random signals, adaptive filters, etc
13:35 tadzik I don't really share the love, to say it gently. But >half of the exam is information theory, which I have no problems with
13:35 darbelo_ joined #parrot
13:37 darbelo left #parrot
13:40 whiteknight that's fine, it's not for everybody
13:41 whiteknight The first thing I learned when I became a teaching assistant is that the other students didn't enjoy the subject as much as I did
13:42 PerlJam drest: I bet they enjoyed it when it was over more than you did ;)
13:42 PerlJam er, s/drest/whiteknight/
13:46 rohit_nsit08 whiteknight: hello
13:49 Coke show of hands. who can see: http://3.bp.blogspot.com/-O5-gNs4YwCk/TfsCoaU​vkmI/AAAAAAAAAKw/kcUFa9XmReE/s1600/varrj.png
13:49 Coke (i'm getting a DNS error. rohit_nsit08 is not.)
13:49 atrodo shows an image for me
13:49 rohit_nsit08 i'm able to see
13:50 rohit_nsit08 i made it in google docs ;-)
13:50 moritz fine here
13:50 bubaflub fine here
13:50 moritz Coke: should I mirror it somewhere you can see it?
13:50 Coke moritz: eh. I'll check it out when I get home.
13:50 Coke danke.
13:50 Coke rohit_nsit08: remind me of this the next time I complain about broken images. ;)
13:51 tadzik fine here
13:51 arnsholt rohit_nsit08: Small nitpick on your blog post: LR isn't Left-to-Right, but Left-to-right Rightmost derivation
13:51 rohit_nsit08 Coke: sure ;)
13:51 whiteknight good morning rohit_nsit08
13:52 rohit_nsit08 aarnsholt: thanks, I have mentioned that it produces rightmost derivation using leftmost reductions
13:52 whiteknight rohit_nsit08++ # Nice blog post
13:52 rohit_nsit08 whiteknight: good morning
13:52 rohit_nsit08 whiteknight: thanks. I'm working on toPIR functions associated with each of the nodes to get the PIR convertion
13:53 rohit_nsit08 whiteknight: found cloud9 IDE a good tool for javascript development. I am able to debug code
13:53 arnsholt rohit_nsit08: Ah, right. Just me failing reading again. Sorry =)
13:53 woosley joined #parrot
13:54 rohit_nsit08 arnsholt: thanks for reading. I am new to blogging so any feedback is valuable :-) please free to comment and correct if I made any mistake
13:55 woosley left #parrot
13:56 whiteknight rohit_nsit08: oh good, I can't wait to see toPIR working! That's a very important part of the project
13:57 SHODAN left #parrot
13:58 rohit_nsit08 whiteknight: yup , I am struggling on some topics related to PIR, just discussed few with Coke and hope to get the solutions asap.
13:59 whiteknight rohit_nsit08: okay. I can probably help answer questions too. Let me know what you need
14:01 rohit_nsit08 whiteknight: Coke suggesting me some opcodes for read ( related to namespace ). After getting clear idea of questions and my approach. I'll put them on developer list tomorrow
14:03 rohit_nsit08 suggested*
14:07 whiteknight okay, awesome. Namespaces can be tricky
14:08 lucian joined #parrot
14:20 lucian left #parrot
14:20 lucian joined #parrot
14:26 ambs joined #parrot
14:39 bluescreen joined #parrot
14:56 lucian_ joined #parrot
15:01 lucian left #parrot
15:16 dmalcolm joined #parrot
15:20 rohit_nsit08 left #parrot
15:29 dalek nqp: 5e83168 | pmichaud++ | src/6model/reprs/P6opaque.c:
15:29 dalek nqp: Improve NYFI 1 error message with attribute name.
15:29 dalek nqp: review: https://github.com/perl6/nqp/commit/5e83168c3c
15:30 whiteknight NYFI?
15:31 PerlJam Not Yet Fully Implemented
15:31 PerlJam or ... you can choose another word for the F if you like  ;)
15:31 cotto_work ~~
15:33 whiteknight okay
15:43 alester joined #parrot
15:50 rohit_nsit08 joined #parrot
15:55 mj41 left #parrot
15:56 dukeleto tcurtis: pong
16:12 alester http://blog.wikimedia.org/2011/06/​13/server-decommission-donations/
16:12 alester Do we need boxen?
16:12 whiteknight I've got a boxen under my bed that I couldn't find a place to host
16:13 dukeleto whiteknight: what kind of boxen?
16:14 whiteknight Dell Poweredge something or other
16:15 whiteknight I can't run it out of my apartment, because it's too loud
16:22 theory joined #parrot
16:26 atrodo whiteknight> I have a dell 1U in my basement.  Difference is it's running (not quiet either) and I built a shelf just for it
16:28 whiteknight atrodo: I don't have a basement. I have an apartment the size of a volkswagon
16:29 whiteknight when my kid generates too much wind, we hear it. The server will not go unnoticed
16:29 atrodo whiteknight> Then yes.  When I was in the apartment when I first bought it, it was in a closet and was borderline too loud
16:34 alester I'll host servers.  I've already got one.
16:34 alester Right now it's just running the odd build and splint.  And folding@home.  And a proxy server.
17:00 hercynium joined #parrot
17:02 whiteknight alester: where do you live? shipping on these hogs is non-trivial
17:02 whiteknight at least, not if you want to use it for more than modern art on arrival
17:02 alester Chicago area.
17:03 whiteknight I'll have to price out shipping for that.
17:04 particle1 left #parrot
17:05 particle joined #parrot
17:06 whiteknight actually, we're in the process of buying a house right now, but I promised my wife I would throw the server away if I couldn't find a home for it by the time we moved out of the apt
17:08 atrodo whiteknight> 1U? Specs?
17:09 bubaflub left #parrot
17:09 whiteknight I think it's 1U. I have to look at the specs again
17:09 whiteknight it was a hand-me-down
17:11 * dukeleto has 4U's of servers collecting dust in his closet
17:19 dukeleto and a 20U rack collecting rust outside
17:19 whiteknight if dust were worth anything, you could sell the collection on ebay
17:21 dukeleto whiteknight: can you tell me how one would go about adding coverage to the uncovered code in Parrot_ext_try ? http://tapir2.ro.vutbr.cz/cover/​latest-c_cover/src-extend-c.html
17:21 dukeleto whiteknight: it that code even reachable?
17:22 whiteknight oh wow, that's a doozie
17:22 dukeleto whiteknight: i have to cover Parrot_ext_try to hit 95% coverage in that file
17:22 whiteknight it's reachable, but...damn
17:23 dukeleto whiteknight: yeah, not simple. Do I have to install an exception handler and not pop it off?
17:23 dukeleto whiteknight: i see that i have to mess with the current context, but I don't fully understand the code. I stared at it for about an hour last night.
17:24 whiteknight yeah, this is going to take some thought
17:25 whiteknight The "do_panic" part is probably not reachable
17:25 whiteknight unless somebody craps on the curctx pretty hard
17:26 whiteknight you may need to call a Sub, create an inner runloop (through a vtable override on Object, etc) and throw an unhandled exception from there
17:26 whiteknight We added those checks because of the IMCC refactor work, so I know it's necessary
17:26 whiteknight I just cant remember the specific steps that caused us to trigger that
17:27 whiteknight that's a great example of code that needs tests, precisely because of how complicated it is
17:37 dukeleto whiteknight: joy
17:39 dodathome joined #parrot
17:39 dukeleto whiteknight: well now at least I have an idea of what needs to happen, thanks
17:40 whiteknight It's entirely possible one of those two zones is not reachable. I suspect they both are, but you might have to get pretty malicious to do it
17:40 whiteknight I *know* we added that code for the IMCC refactor work, so a test involving IMCCompiler PMC might not be a bad place to start
17:41 whiteknight IMCCompiler pushes a context on the stack, to hold space for temporary registers. If IMCC throws a parse exception, it might not clean that up.
17:41 whiteknight ]I suspect we've addressed those problems, but maybe I am misremembering
17:41 whiteknight if you're willing to get real down-n-durty, you can manually construct a faulty case
17:42 whiteknight Parrot_push_context, then throw an exception, etc
17:42 dukeleto whiteknight: i think i have triggered this thing from PL/Parrot
17:42 dukeleto whiteknight: but it was from an IMCC misparse
17:44 dukeleto whiteknight: this looks shiny: https://github.com/tolmasky/language
17:45 dukeleto msg rohit_nsit08 you may want to take a look at https://github.com/tolmasky/language
17:45 aloha OK. I'll deliver the message.
17:52 whiteknight who would have thought that something so simple as "add exception try/catch to C" would involve such complicated code
17:53 whiteknight I mean, C++ does it, and that isn't complicated at all
17:53 whiteknight :)
17:53 atrodo whiteknight> Where's your closing sarcasm tag?
17:54 whiteknight atrodo: burned by the heat of my burning wit
17:54 cosimo left #parrot
17:54 atrodo whiteknight++
18:12 bubaflub joined #parrot
18:16 lucian_ whiteknight: i may have said this before, but cyclone's exceptions are rather simple
18:17 dukeleto bubaflub: wazzup
18:17 bubaflub hey dukeleto - not much, how are you?
18:18 dukeleto bubaflub: goodly
18:18 bubaflub dukeleto: great.  my tests are coming along quite nicely - i've almost finished all the division tests
18:19 bubaflub dukeleto: there three major kinds of divisions, round ceiling, round floor, and truncate
18:19 bubaflub dukeleto: and then all the permutations for quotient, remainder, both; use an GMP integer or unsigned int, so on and so forth
18:21 rohit_nsit08 left #parrot
18:22 dukeleto bubaflub: mmmm, tests
18:23 whiteknight bubaflub: that almost sounds like something you could put into table form
18:24 whiteknight and then have a loop that runs over each row, divide A by B using method C, expect result D
18:25 whiteknight actually, I had wanted to add a similar mechanism to Rosella.Test to do parameterized tests like that
18:29 rurban_ joined #parrot
18:32 rurban left #parrot
18:32 rurban_ is now known as rurban
18:33 bubaflub whiteknight: i've seen that done with Cucumber
18:33 bubaflub that is, parameterized testing
18:33 bubaflub it can be very very nice
18:33 bubaflub and yes, there is an awful lot of the code that could be refactored and simplified
18:33 bubaflub create an Integer, set it to this, pass it to this function, get the result, check the result...
18:34 whiteknight I'll play around with that tonight
18:35 whiteknight I've got a good idea for it in my head. Problem is making it work well and be pluggable
18:36 bubaflub whiteknight: i'm also thinking of maybe adding a script to my project to generate winxed test files like that
18:37 whiteknight ok
18:38 whiteknight It will probably be something like Rosella.Test.test_data(<array>, <function>, <optional named args>)
18:38 whiteknight will execute <function> as a test on each item in <array>
18:38 whiteknight or, I guess <array> could also be a <hash> for "test name" => "test data"
18:39 whiteknight that works fine for me
18:43 lucian joined #parrot
18:46 whiteknight bubaflub: How does something like this look for you? https://gist.github.com/1032022
18:47 lucian_ left #parrot
18:47 bubaflub whiteknight: ooooh, shiny
18:48 bubaflub whiteknight: that's kinda what i was thinking, except way better
18:48 bubaflub whiteknight: i also have a random Winxed question - what exactly does the "using" statement do?  and when do i need / not need it?
18:48 whiteknight I think we're going to run into a hell of a lot of problems getting the function to be treated as a method, when it isn't declared as a method
18:49 whiteknight bubaflub: that's a great question. I don't know everything it does
18:49 whiteknight basically, it does a namespace lookup, and stores a value in a named variable
18:49 whiteknight so "using Rosella.Test.test_vector" would look up the "test_vector" function in namespace ["Rosella"; "Test"], and store it in a local variable named "test_vector"
18:50 whiteknight the "using static" sequence used to create a static reference to a named function in the same file. I don't think it does that anymore
18:50 whiteknight "using extern" will do a library load, though I've never played with that so I don't know the details
18:51 bubaflub whiteknight: ok, that makes sense.
18:51 whiteknight and I think "using namespace" makes the contents of another namespace visible to the compiler, so you can use functions from that namespace in your code without a million little "using" statement for each function you want
18:51 whiteknight but I think that only works at compile time
18:51 bubaflub whiteknight: ok, that makes a lot of sense.
18:52 whiteknight NotFound tends to put lots of namespaces and classes in a single file, so he uses those kinds of tools himself. I tend to write each class and namespace in a separate file, so I lose out on some fancy compile-time magic
18:58 mj41 joined #parrot
18:59 bubaflub whiteknight: yeah, my NCI bindings are in a PIR file under GMP::Raw
18:59 bubaflub the winxed class GMP::Integer uses those, and then has functions that wrap those with sugar
19:00 bubaflub like automatic conversion of C-strings <-> Parrot strings, type checking, constructor and destructor
19:00 bubaflub and eventually some vtable overrides
19:01 whiteknight I think there is a syntax for putting in forward-declarations, so you can use "using namespace", but I haven't played with that at all either
19:07 bluescreen left #parrot
19:07 bluescreen joined #parrot
19:09 bubaflub whiteknight: ok.  since my Winxed code is generated, i've just got a bunch of 'using ...' statements
19:11 mj41 left #parrot
19:13 mj41 joined #parrot
19:14 hercynium left #parrot
19:37 contingencyplan joined #parrot
19:38 dmalcolm_ joined #parrot
19:42 dmalcolm__ joined #parrot
19:43 dmalcolm left #parrot
19:46 dmalcolm_ left #parrot
20:10 mj41 left #parrot
20:14 jevin left #parrot
20:27 perlite_ joined #parrot
20:30 whiteknight left #parrot
20:31 perlite left #parrot
20:31 perlite_ is now known as perlite
20:49 dodathome left #parrot
21:33 fperrad left #parrot
21:42 PurityControl joined #parrot
21:46 Patterner left #parrot
21:46 PurityControl is now known as Patterner
21:47 ambs left #parrot
22:03 dalek parrot-gmp: 29123cb | bubaflub++ | t/integer/div/ (3 files):
22:03 dalek parrot-gmp: add coverage for the 27 division functions mpz_cdiv*, mpz_fdiv*, mpz_tdiv*:
22:03 dalek parrot-gmp:
22:03 dalek parrot-gmp: mpz_cdiv_q, mpz_cdiv_r, mpz_cdiv_qr, mpz_cdiv_q_ui, mpz_cdiv_r_ui, mpz_cdiv_qr_ui, mpz_cdiv_ui, mpz_cdiv_q_2exp, mpz_cdiv_r_2exp, mpz_fdiv_q, mpz_fdiv_r, mpz_fdiv_qr, mpz_fdiv_q_ui, mpz_fdiv_r_ui, mpz_fdiv_qr_ui, mpz_fdiv_ui, mpz_fdiv_q_2exp, mpz_fdiv_r_2exp, mpz_tdiv_q, mpz_tdiv_r, mpz_tdiv_qr, mpz_tdiv_q_ui, mpz_tdiv_r_ui, mpz_tdiv_qr_ui, mpz_tdiv_ui, mpz_tdiv_q_2exp, mpz_tdiv_r_2exp
22:03 dalek parrot-gmp: review: https://github.com/bubaflub/​parrot-gmp/commit/29123cb79e
22:11 bluescreen left #parrot
22:15 soh_cah_toa joined #parrot
22:15 soh_cah_toa ~~
22:16 bubaflub evening soh_cah_toa
22:16 soh_cah_toa bubaflub: hey
22:17 bubaflub how goes the debugger?
22:17 dukeleto bubaflub: nice tests
22:17 bubaflub dukeleto: thanks
22:18 soh_cah_toa bubaflub: i'm on the verge of a breakthrough. i'm very close to command recognition. working on parsing input
22:18 bubaflub soh_cah_toa: that's excellent.
22:18 soh_cah_toa yup
22:19 soh_cah_toa then i have to look at some test examples for ideas. i need to test that feature but i can't figure how to fake input since it's an interactive program
22:19 bubaflub soh_cah_toa: one way to do it is if you have a separate function that parses the input, test only that
22:20 soh_cah_toa bubaflub: yeah, i thought of that but it's a static function
22:20 bubaflub soh_cah_toa: let's say you've got a function like (psuedocode): string parse_input(string input);
22:21 bubaflub soh_cah_toa: is there source i can look at?  i may be able to help
22:21 soh_cah_toa sure, let me look quick. i think i have to push
22:23 dalek parrot/soh-cah-toa/hbdb: 0b4c473 | soh_cah_toa++ | src/hbdb.c:
22:23 dalek parrot/soh-cah-toa/hbdb: Beginnings of parse_command(). Not yet complete
22:23 dalek parrot/soh-cah-toa/hbdb: review: https://github.com/parrot/parrot/commit/0b4c4736b5
22:23 cotto_work soh_cah_toa: you should be able to fake input and output to the debugger by messing with stdin, stdout and stderr from the Perl testing code.
22:24 cotto_work write a function to start the debugger with a given set of arguments and another to run a single command and check that it returns the right output
22:25 soh_cah_toa bubaflub: https://github.com/parrot/parrot/blob/0b4c473​6b52b190b4f38d0f4b7424f860ddc9988/src/hbdb.c it's the parse_command() function around line 410 (it's not finished yet)
22:25 * soh_cah_toa thinks about this
22:25 cotto_work testing the output of a static function won't be fun
22:25 soh_cah_toa wonderful
22:27 bubaflub soh_cah_toa: here's what i'd do - i'd break out the parsing of the input from the commands into a separate function
22:27 cotto_work I highly recommend an alternate approach.
22:27 soh_cah_toa the thing that i'm struggling to figure out is how do i actually "reach" that function? how can i call a static function in a c source file from a completely unrelated perl script?
22:27 soh_cah_toa cotto_work: approach to what?
22:27 bubaflub soh_cah_toa: the perl script can compile a simple C program that #include's your file
22:28 cotto_work testing C functions directly as opposed to testing them by having the test suite running the debugger
22:28 bubaflub soh_cah_toa: it ain't pretty but it's possible
22:28 soh_cah_toa hmm...ok
22:29 soh_cah_toa so i could pass a command on the command-line. like w/ `` or system()
22:29 soh_cah_toa but my program doesn't do that
22:29 alester left #parrot
22:30 soh_cah_toa wouldn't it make sense to test the program exactly how it would be used by the user rather than defining some special condition in my program for testing? b/c then it's testing a different behavior
22:31 cotto_work soh_cah_toa: that's exactly what I'm recommending
22:31 soh_cah_toa alright
22:32 soh_cah_toa but then there's still the matter of automating a pretend interactive session
22:33 soh_cah_toa hmm...i wonder if i could do it w/ pipes like |
22:33 cotto_work You'd have to keep the handles around, but I think it'd be doable.
22:34 soh_cah_toa for instance: open FOO, "echo 'command' | hbdb"
22:34 soh_cah_toa yeah, i don't see why that wouldn't work
22:35 cotto_work make sure to write up a minimal proof of concept so you understand what you need to do
22:36 soh_cah_toa i'm not sure i follow :/
22:37 cotto_work http://search.cpan.org/~jesse/perl-5​.14.1/ext/IPC-Open3/lib/IPC/Open3.pm looks like what you'd want
22:37 preflex left #parrot
22:39 soh_cah_toa it looks like that may help. however, then i'm adding another dependency
22:39 cotto_work dukeleto may be able to suggest a better alternative
22:41 preflex joined #parrot
22:42 dukeleto cotto_work: better alternative for what?
22:44 cotto_work dukeleto: is IPC::Open3 the best option for testing a debugger by writing to stdin and reading from stdout and stderr on the same process?
22:45 sorear I recomment IO::Pty::HalfDuplex personally
22:46 soh_cah_toa i think i'm headed in the right direction. however, when i execute "echo 'foobar' | ./hbdb hello.pbc", i get "ERROR: Null PMC access in get_string()"
22:46 sorear soh_cah_toa: readline probably returns NULLPMC for EOF
22:47 soh_cah_toa oh, i see
22:48 soh_cah_toa i guess that method won't work then. IPC::Open3 does seem like it's what i'm looking for but i'm still worried about dependencies
22:48 sorear no, you need to fix hbdb
22:49 sorear user pressing ^D at the prompt shouldn't cause a crash!!
22:49 darbelo_ left #parrot
22:49 soh_cah_toa i didn't though
22:49 sorear echo '
22:50 sorear echo 'foobar' is exactly the same as typing foobar, enter, control-D
22:50 soh_cah_toa oh, ok
22:50 cotto_work dukeleto: is IPC::Open3 in core?
22:50 sorear has been since 5.0
22:51 sorear IO::Pty::HalfDuplex isn't in core yet though :(
22:52 soh_cah_toa well that's great. except now i need to figure out why ^D causes it to crash ;)
22:52 darbelo joined #parrot
22:52 sorear check your input loop
22:53 sorear are you doing "isnull" after readline?
22:53 soh_cah_toa no
22:54 sorear oh
22:54 sorear readline returns '' if EOF
22:54 sorear but also sets eof
22:54 sorear well, check the backtrace
22:56 dmalcolm__ left #parrot
22:57 soh_cah_toa so if i have "Parrot_pcc_invoke_method_from_c_args(interp, stdinput, readline, "S->S", prompt, &input)" i need to check "input" for null?
22:58 sorear only if you think the method might return null!
22:59 soh_cah_toa you said it did
23:01 sorear no
23:01 sorear 15:54 <@sorear> readline returns '' if EOF
23:02 soh_cah_toa aren't empty strings equal to null?
23:02 sorear not at all
23:04 soh_cah_toa wait, so then what does isnull have to do w/ it then? by which i thought you meant PMC_IS_NULL
23:11 dukeleto https://github.com/tanoku/spym : MIPS R2000 Virtual Machine written entirely in Python
23:23 mtk left #parrot
23:25 cotto_work dukeleto: interesting
23:36 TiMBuS now to port python to mips r2000
23:42 lucian_ joined #parrot
23:44 darbelo left #parrot
23:44 lucian left #parrot
23:49 whiteknight joined #parrot
23:53 whiteknight good evening, #parrot
23:53 * cotto_work goes home
23:54 Kulag left #parrot
23:54 soh_cah_toa whiteknight: hey
23:55 Kulag joined #parrot
23:57 whiteknight hello soh_cah_toa
23:58 Kulag left #parrot
23:58 Drossel joined #parrot
23:59 soh_cah_toa whiteknight: your mouse still acting up? ;)

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

Parrot | source cross referenced