Camelia, the Perl 6 bug

IRC log for #parrot, 2012-07-05

Parrot | source cross referenced

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

All times shown according to UTC.

Time Nick Message
00:05 whiteknight joined #parrot
00:15 UncleFester6 joined #parrot
00:20 UncleFester6 Anyone happen to know if parrot release tar balls happen to be made under win32 or anything else special or unusual?
00:21 whiteknight good evening, #parrot
00:21 whiteknight UncleFester6: the tarballs are made under linux
00:21 whiteknight There's a separate packaging project for win32. I have to look it up
00:22 UncleFester6 whitenight: the ordering of some files looked off for linux but I am interested in your answer ...
00:22 whiteknight msg benabik Congratulations! Hope all is going well. Do your best to get any sleep you can get, and don't worry about parrot at all for a few days
00:22 aloha OK. I'll deliver the message.
00:23 UncleFester6 whiteknight: oh sorry - I don't need the packaging project for win32  - thanks anyway
00:23 whiteknight http://sourceforge.net/projects/parrotwin32/
00:23 whiteknight There it is anyway
00:26 UncleFester6 pmichaud: the parrot tarball builds ok on cygwin and doesn't have the missing phony.exe problem.  If they put it together under linux - wondering what they do right ...
00:53 kid51 joined #parrot
01:29 UncleFester6 left #parrot
03:07 bacek_at_work joined #parrot
03:08 bacek_at_work ~~
03:36 fperrad joined #parrot
03:58 pmichaud I'm looking at updating the release guides for Rakudo, Rakudo Star, and NQP, and have a question about Parrot releases:
03:58 pmichaud Is Parrot still doing the "supported" versus "developer" release policy in any real way? (more)
03:59 pmichaud More directly, if a Rakudo release has a choice between a supported and developer release for its "minimum version", should it always choose the supported release, the earlier release, or the later one?
04:01 pmichaud As a more concrete example, the 2012.06 release of Rakudo could build on either Parrot 4.4.0 or 4.5.0.  Our traditional release policy has been to always bump our minimum release to the latest released Parrot (either supported or developer); I'm wondering if we should bump only if we really need a later version of Parrot.
04:01 pmichaud suggestions and opinions welcomed.
07:04 brrt joined #parrot
07:56 lucian joined #parrot
10:19 Psyche^ joined #parrot
11:30 lucian joined #parrot
12:47 whiteknight joined #parrot
12:54 PacoAir joined #parrot
13:08 brrt oh, hey, andrew is awake
13:08 brrt i'm so very near to fixing everything
13:08 brrt please help me out :-)
13:09 moritz ooo, world peace in 10 minutes! :-)
13:09 brrt i need to wrap a Parrot_Hash into an appropriate Parrot_PMC
13:09 brrt well, my own localized version if anyway
13:09 brrt s/if/of it/
13:10 brrt and i need it to /not/ use the Parrot_api_* functions
13:10 whiteknight good mornign, #parrot
13:10 whiteknight hello brrt
13:10 brrt hello
13:11 whiteknight There is a Hash PMC which already wraps a HASH*
13:11 brrt ... yes
13:11 brrt so
13:11 whiteknight or, Hash*, or whatever it's called
13:11 brrt how to make such a thing
13:12 whiteknight in winxed? var hash = {};
13:12 brrt yes
13:12 whiteknight or var hash = new 'Hash'
13:12 brrt but, in C
13:12 brrt w/o using parrot_api functions
13:12 brrt as they are evil and clear my jumpbuf
13:12 whiteknight PMC * hash = Parrot_pmc_new(interp, enum_class_Hash);
13:12 brrt oh, that is so obvious
13:12 brrt thanks
13:12 brrt i suppose
13:12 whiteknight src/pmc.c contains functions for allocating them
13:13 whiteknight the enum_class_* constants are generated and hard to find, but they follow a clear naming convention
13:13 moritz brrt: so you're using the embedding API by now?
13:13 whiteknight if you just want a Hash*, you can use Parrot_hash_new() or something like that from src/hash.c
13:13 brrt moritz: basically, i'm using the 'new' embedding api as far as i can
13:14 brrt basically, i call an nci function which is supposed to return a PMC which contains a hash
13:14 whiteknight you use the embedding API in the embedding situation (Apache module calling into Parrot). Once you're in parrot, you use the normal internal subsystem apis
13:14 brrt right, what whiteknight++ said
13:14 moritz ok, then I think I've mixed up the two
13:15 moritz I'm just familiar witth the internal subsystem apis (which nqp's and rakudo's C code uses)
13:15 whiteknight brrt: using NCI to call Parrot_pmc_new() to get a Hash is exactly the same (but a little slower) than just using var x = {};
13:15 whiteknight moritz: yes, that's the "internal" API
13:15 brrt right, but it also has access to request_rec and apr_table_t and all that
13:15 brrt w/o me mucking about
13:16 brrt with a thousand NCI calls and structviews
13:16 whiteknight or, you're writing a C wrapper to do all that stuff?
13:16 brrt ehm, i think we're going babylonic here a bit
13:16 brrt what I am doing:
13:17 moritz better babylonic than barbaric :-)
13:17 brrt * startup my handler
13:17 brrt * create a parrot
13:17 brrt * load my 'loader'
13:17 brrt * wrap my request_rec as a pointer
13:17 brrt * pass it
13:17 brrt GO
13:17 brrt so the point is to get all possible data from this request_rec structure
13:17 brrt as far as IO is concerend
13:18 brrt this works absolutely wonderfully
13:18 brrt https://github.com/bdw/mod_parrot​/blob/master/loader/apache.winxed is how that works
13:18 brrt however, i also need to get the request parameters
13:19 brrt what i used to do is pre-make these into a Parrot-hash structure
13:19 brrt ehm, Parrot_PMC with class hash
13:19 brrt which gets fairly clunky pretty quickl
13:19 brrt y
13:19 brrt so, i wrapped those
13:20 brrt these 'request parameter hashes' are constructed on demand
13:20 brrt i.e., you call apache.input.headers() and it calls NCI to get down to my module and make that hash
13:21 brrt however, what happens is that it used the Parrot_api_* functions, and as whiteknight explained, these functions are not reentrant
13:21 brrt and moreover clear the api_jmp_buf value upon return
13:21 brrt now, this last value is needed for the parrot embedding api to return correctly when an error occurs
13:22 moritz so now you segfault on error? :/
13:22 brrt nope
13:22 brrt that would have been somewhat better because in that case, I'd get a stack trace much more easily
13:22 brrt it just exits with an error code (1)
13:23 brrt however, if i avoid the 'external' api (and use the internal api) my api_jmp_buf is never cleared
13:24 brrt my errors return to where they come from
13:24 brrt and i can safely argue about world peace again
13:24 whiteknight the internal API is much richer and more full-featured anyway
13:24 brrt it is actually pretty nice
13:24 moritz aye; use it whenever you can
13:24 brrt just, large
13:24 whiteknight yes
13:24 whiteknight that's why the embedding API can only ever be just a subset
13:24 brrt which is ok and i get that point
13:25 brrt its really important in fact to keep it small
13:26 whiteknight basically, you're just after a way to read parameters from apache into a Parrot hash lazily
13:27 brrt yes
13:27 brrt because (in theory)
13:27 brrt not all requests need all of them
13:27 whiteknight right
13:28 brrt ... now that i do use the 'internal' api
13:28 whiteknight right
13:28 brrt interating over hashes becomes plausible too
13:28 brrt (within C)
13:28 brrt pandora's box is open so to speak
13:29 whiteknight right
13:30 whiteknight what's the apache API function for extracting out one of those parameters?
13:34 bluescreen joined #parrot
13:35 brrt well, request_rec is a struct
13:35 brrt but most of its values are structs
13:35 brrt a 'Hash' in apr speak is an apr_table_t
13:36 whiteknight okay, so how do you read a value out of that?
13:36 brrt you get its values as an apr_array_header_t of apr_table_entry_t via apr_table_elts
13:37 whiteknight ok
13:37 brrt doing that all via NCI is possible - ish
13:37 whiteknight but it sounds like a huge waste of time
13:37 brrt yet
13:37 brrt yes
13:37 brrt especially as compared with the current solution
13:38 brrt https://github.com/bdw/mod_parrot/bl​ob/master/module/mod_parrot_io.c#L20 and
13:38 brrt https://github.com/bdw/mod_parrot/bl​ob/master/module/mod_parrot_io.c#L57
13:38 brrt are both relatively simple
13:40 whiteknight NCI has a certain amount of overhead itself, so doing things lazily through NCI might not save you anything in terms of performance
13:40 whiteknight I'm not saying it can't, but it's worth benchmarking if you really want to squeeze out performance
13:41 * Coke wonders if the evil exiting parrot has an exception handler for dealing with the thrown exceptions.
13:45 whiteknight it exits when it has no handlers. That's the absolute last resort of the exceptions system
13:45 whiteknight it looks for handlers. If none, it tries to jump back out to the API. If not, it exits
13:46 whiteknight Assuming you're using the API correctly, it should never ever ever get to that third option
13:55 brrt yes, point it out
13:55 brrt i'm not  really looking for performance gains
13:56 brrt what are a few 100 cycles w/o disk lookup to a modern processor
13:56 brrt basically, of all the web servers of the world, fewer than .001% are cpubound
13:57 brrt ... thart might not be true considering how many servers google has
13:57 brrt but for the internet outside of google
13:57 brrt i think it holds
13:58 whiteknight yes
14:01 brrt so, in short
14:01 brrt code easiness is much more important to me :-)
14:03 whiteknight it is a motivation I agree with
14:04 moritz ... until it becomes a hot path :-)
14:04 moritz but yes, simplify first, optimize later
14:04 whiteknight well, sure. But having a good design helps refactoring later
14:04 moritz brrt: are your questions answers?
14:04 moritz *answerd
14:04 whiteknight and having a good interface prevents those refactors from reaching out into other places
14:04 moritz *answered
14:05 brrt yes, answered
14:05 brrt well, almost
14:06 brrt but i need to experiment a bit for my next questions, if any at all
14:18 lucian allison: ping
14:25 dmalcolm joined #parrot
15:48 alester joined #parrot
16:03 brrt left #parrot
16:26 jashwanth joined #parrot
17:12 dalek rakudo/nom: 58d9852 | pmichaud++ | src/core/IO.pm:
17:12 dalek rakudo/nom: Update IO.s to return file size.
17:12 davidfetter joined #parrot
17:12 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/58d9852d0d
17:34 lucian joined #parrot
17:43 contingencyplan joined #parrot
17:49 wagle_ joined #parrot
17:49 cotto ~~
17:56 dalek rakudo/nom: 6ec88fa | duff++ | src/core/Main.pm:
17:56 dalek rakudo/nom: Set $PROCESS::ARGFILES after command line processing
17:56 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/6ec88fad2b
18:10 allison lucian: pong
18:12 lucian allison: hi. i need some references for a job. would you be willing to be one of my referrers?
18:13 allison lucian: absolutely!
18:13 lucian allison: thanks :) i've been made an offer and accepted, but apparently it's conditioned on satisfactory references. i don't know if that's common practice or not
18:13 allison lucian: let me know if you need any extra info
18:14 allison lucian: yeah, I've had that a few times
18:14 allison lucian: (I guess it's less trouble than checking the references on all the applicants)
18:14 lucian yeah, probably
18:15 lucian allison: i'll just tell them your name, email and wikipedia page :)
18:15 lucian allison: if they want more, i'll let you know. thanks!
18:48 nopaste joined #parrot
18:49 TonyC joined #parrot
19:29 Hunger joined #parrot
19:56 fperrad joined #parrot
20:02 brrt joined #parrot
20:09 brrt apparently
20:09 brrt it works :-D
20:10 brrt (where it means, making hashes with the internal api)
20:16 whiteknight nice!
20:16 whiteknight brrt++
20:16 whiteknight commit, push, and go grab a drink
20:17 brrt drink has been grabbed
20:19 dalek mod_bart: 58c40f8 | (Bart Wiegmans)++ | / (5 files):
20:19 dalek mod_bart: proof of concept for making hashes
20:19 dalek mod_bart: review: https://github.com/bdw/mod_bart/commit/58c40f8bc7
20:21 whiteknight and as soon as you're done the drink, move on to the next TODO item
20:21 whiteknight no rest for the weary!
20:25 lucian joined #parrot
20:35 brrt :-) i've already found that todo item
20:38 fperrad joined #parrot
20:41 brrt is there a guide to writing correct c function type definitions?
20:42 brrt oh, nm, google found it
21:19 brrt .. you know what
21:19 brrt iterating over hashes
21:20 brrt is for suckers
21:26 * brrt leaves &
21:26 brrt left #parrot
23:34 whiteknight joined #parrot
23:47 whiteknight good evening, #parrot

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

Parrot | source cross referenced