Camelia, the Perl 6 bug

IRC log for #parrot, 2012-09-06

Parrot | source cross referenced

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

All times shown according to UTC.

Time Nick Message
02:07 MikeFair Heya Parrot!
02:10 rurban_mobile joined #parrot
02:13 sorear hello MikeFair.
02:15 * MikeFair continues on his quest for compilation and execution of his language using the new nqp. :)
02:16 MikeFair It seems like "make" instead of parrot setup.pir is the tool of choice... in the two projects I've looked at (perl6 and Partcl-nqp)
02:17 benabik The general choices seem to be Makefile or setup.winxed
02:19 MikeFair benabik: unfortuantely I started with mk_language_shell.pl
02:19 benabik mk_language_shell needs some love.
02:19 benabik There's nothing _wrong_ with a setup.pir
02:19 benabik Other than hand-writing PIR.
02:20 MikeFair Well my problem seems to be that I need to call NQP's version of Compiler.new() and friends, but I can't seem to find a good hokk that works into making that happen
02:20 MikeFair err hook
02:20 MikeFair I'm sure this is just my ignorance I'm struggling with
02:21 MikeFair I like the parrot setup.pir just fine for my purposes, I just can't seem to get a working build out of it. :)
02:22 MikeFair I was told that my problem, based on the error of not being able to find a parse function, was that the compiler didn't get registered
02:26 MikeFair So what I'm not sure about is how to go about getting the right things in the right places to make it all work
02:29 MikeFair I'm not married to NQP either, it just seemed more supported than winxed for my purposes
02:37 MikeFair I think I see the problem...
02:38 MikeFair .local pmc hllns, parrotns, imports
02:38 MikeFair hllns = get_hll_namespace
02:38 MikeFair parrotns = get_root_namespace ['parrot']
02:38 MikeFair imports = split ' ', 'PAST PCT HLL Regex Hash'
02:38 MikeFair parrotns.'export_to'(hllns, imports)
02:38 benabik ...  Can anyone write a calm response to zhuomingliang on gh818?  I keep coming to "let's not have this argument _again_"
02:38 MikeFair in all the .pm files I had to add  use NQPHLL;
02:39 benabik MikeFair: Are you trying to use parrot-nqp or new nqp?
02:39 MikeFair nqp
02:40 MikeFair parrot-nqp seems to have some challenges in certain areas that I thought should work but are causing problems.
02:41 benabik mk_language_shell is based on parrot-nqp, and I would expect many subtle issues trying to just s/parrot-nqp/nqp/ in the result.
02:41 MikeFair I was having a hard time telling the difference between my ignorance/misunderstanding/mistakes and the limitations of parrot-nqp
02:41 MikeFair benabik: I used a symlink
02:41 benabik Symlinked nqp to parrot-nqp?!?
02:42 benabik Even vice-versa seems like quite a bad idea.
02:42 MikeFair other way around, but yeah, moved parrot-nqp to parrot-nqp.orig
02:42 benabik `ln -s nqp parrot-nqp`?
02:42 MikeFair Well I watched parrot setup.pirs execution, and the command line is the right command line
02:42 MikeFair benabik: Yes
02:42 MikeFair It builds
02:42 benabik That's...  not a good idea.  There are differences between the two and I would expect many subtle issues.
02:43 MikeFair benabik: I had to rebuild parrot and nqp to make sure they were aligned
02:43 benabik Simply replacing parrot-nqp with the new nqp is not the solution.
02:44 MikeFair benabik: I don't exactly see why not?
02:44 MikeFair benabik: the nqp excutables take the .pms and output them to .pir
02:44 MikeFair parrot doesn't see or even care what's in those .pms
02:45 benabik nqp takes .pm and outputs .pir that requires 6model.
02:45 benabik I suppose the things we have written in nqp-rx are already compiled by that point...
02:46 MikeFair 6model are is a language or pbc's that parrot can load?
02:46 benabik It just feels wrong.
02:46 benabik parrot-nqp is not nqp.  parrot-nqp is nqp-rx
02:46 benabik Which is a generation behind.
02:47 MikeFair Yes, I do need to change my source code
02:47 MikeFair Which I've been doing
02:47 benabik Doing language development in nqp is fine, but I would suggest that making things that expect parrot-nqp run in nqp is error-prone.
02:47 MikeFair benabik: I'm doing a full textual replacement of my source in straight nqp
02:48 MikeFair benabik: I have like ten meaningful lines of code
02:48 MikeFair I'm just working with the language shell atm
02:48 MikeFair and even with that I'm primarily focused on the Grammar.pm parser part more than anything else
02:48 MikeFair :)
02:49 MikeFair benabik: I agree it feels wrong :)
02:49 MikeFair benabik: My other option was to drop parrot entirely and just do the whole thing straight in rakudo
02:49 MikeFair But I'd like to get to the point where I'm working on parrot's internasl
02:53 MikeFair I'd like to try my hand eventually and trying out using a message queue model internal to Parrot (where rather than pirops being sequential in memory, the ParrotVM would be treated like a service consuming the pirops from the queued pipeline.  Eventaully this is part of an end game I have to make a sane execution model for running parrot on GPU architectures).
02:54 MikeFair (Namespaces, classes, and such would all have their own queues and a reference to an execution context would get passed around through the queues)
03:13 benabik Sounds interesting.
03:13 MikeFair benabik: So what do you think?  Can this be done?  I only did a symlink because I didn't know how to get parrot setup.pir to execute the nqp command instead. :)
03:14 * benabik comments on gh818 and hopes that he kept most of his frustration out of it.
03:14 MikeFair benabik: I totally see what you're saying now if I was trying to build other langauges that expected nqp-rx then I just broke every one of those language compilations . :)
03:14 MikeFair benabik++
03:15 benabik Getting setup.pir to run nqp would require mucking around with distutils.
03:15 benabik I seem to remember adding a new phase wasn't too difficult...
03:15 MikeFair benabik: Wisdom for us all that we may acquire his patience
03:16 MikeFair benabik: Actually, yeah, I remember seeing that distutils was straight in the middle of it
03:16 benabik Adding winded to distutils: https://github.com/Whiteknight/Rosella/​blob/master/src/winxed/Distutils.winxed
03:18 MikeFair benabik: What do I do with that?
03:18 MikeFair replace the distutils.pir in my library?
03:18 MikeFair or add it somewhere and rebuild parrot
03:18 benabik MikeFair: No.  That calls distutils functions to extend it.
03:19 benabik You (or someone else) could use it as the basis of something similar for nqp.  (rather than nqp-rx)
03:19 MikeFair So download it, compile it and run it?
03:20 benabik MikeFair: This is how I used it in PACT: https://github.com/parrot/PACT​/blob/master/setup.winxed#L69
03:20 benabik That assumes Rosella is installed in the system.
03:21 MikeFair Which it is not atm :)
03:21 benabik It's probably not directly useful to you as-is, but it might point the way towards getting distutils to use nqp.
03:21 MikeFair Coke has managed to get Partcl to build with NQP and so I was trying to replicate the work he did
03:22 sorear Was there not at one point a distutils that used setup.nqp ?
03:22 sorear opbots trust MikeFair
03:22 slavorg Ok
03:22 MikeFair sorear: The distutils library says I can use a setup.nqp but I couldn't make it work
03:23 benabik I recall setup.nqp using distutls, but not really vice-versa.
03:23 MikeFair Wow, thanks :)
03:26 MikeFair any idea what this is?
03:26 MikeFair https://github.com/ekiru/tree-op​timization/blob/master/setup.nqp
03:27 sorear ekiru = tcurtis = tylercurtis, one of our past GSoC students
03:27 benabik That is an NQP script calling distutils.
03:27 sorear tree-optimization was an attempt to create a generic optimization framework for PAST
03:27 MikeFair benabik: Right, so that won't really help me because what I need is the distutils using nqp part
03:27 sorear like so many things we've built, it never really got used :(
03:28 * MikeFair thinks he'll just type it out by hand and put it in a shell script to compile everything
03:29 MikeFair It's 6 files and they take like 1/2 a second to build and I only want it for testing purposes
03:29 MikeFair I'll absorb more about the build processes as I go along
04:35 MikeFair ok
04:35 MikeFair so  think I'm really close now
04:35 MikeFair here's what I'm getting
04:35 MikeFair "load_bytecode" couldn't find file 'NQPHLL.pbc'
04:36 MikeFair That file is in ~/local/lib/parrot/4.7.0-devel/languages/nqp/lib
04:36 MikeFair but that lib directory does not seem to be in the load path
04:38 MikeFair any suggestions?
04:50 MikeFair Woohoo it built!
04:50 MikeFair But it can it "say" anything?
04:50 MikeFair nope:Method 'pasttype' not found for invocant of class 'QAST::Op'
04:51 benabik I've only found "It compiles" to have any relation to "does it work" in very strongly typed languages like Haskell.
04:51 benabik And even then it's not very strongly correlated.
05:00 MikeFair benabik: hehe
05:01 MikeFair benabik: yeah, it seems that I'm now back to my early days of assembly when compilation and build meant almost nothng
05:01 benabik For dynamic languages, "it compiles" just means you didn't screw up the syntax too badly.  The compiler doesn't care if you're trying to do something non-sensical.
05:02 benabik The runtime OTOH
05:02 MikeFair yep
05:03 MikeFair It seems that I've done something that registers say and print as viable parseable statements that are supposed to call "something" but that either go into some recursive loop or otherwise just disapear into and infinite blocking state when called
05:11 MikeFair Yep, maximum recursion depth exceeded :)
05:24 MikeFair Wel, it seems to be parsing, but I'm still getting a strange error
05:25 MikeFair I put simply <integer> in TOP
05:25 MikeFair and now get: Syntax error at line 2, near "\n"
05:25 MikeFair anytime I type an integer
05:25 MikeFair If I type something "not an integer" then I get a parse error! :)
05:26 MikeFair It's progress!!
07:02 eternaleye joined #parrot
07:11 brrt joined #parrot
07:48 lucian joined #parrot
08:25 Psyche^ joined #parrot
09:52 alvis joined #parrot
11:47 brrt hi #parrot, i need your help once more
11:48 moritz I can try :-)
11:52 brrt oh, moritz, i need your help for another thing entirely
11:52 brrt but my first and foremost problem
11:52 brrt is that, when specifying parrot applications to run via the psgi handler
11:52 brrt the actual script that should be run is Not Well Defined
11:53 brrt case in point, i use an uri to specify the script
11:54 brrt with the following structure: <compiler>://<script>/<class, optional, slashes are namespaces>#<routine, optional>
11:54 brrt thus, if  I have a script called foo.p6, which has a class called MyPsgiHanlder, and a routine called accept
11:55 brrt it would be perl6://foo.p6/MyApp/MyPsgiHandler#accept
11:55 brrt similarly for an error handler
11:55 brrt perl6:://foo.p6/MyApp/MyPsgiHandler#onerror
11:56 brrt but, where is foo.p6?
11:56 brrt if you say 'server document root local', then fine, but it means i cannot put files anywhere but in the document root
11:57 brrt which means $documentroot/somedirectory/foo.p6 would never work
11:57 brrt wait.... this is a resolvable problem
11:57 brrt i add yet another option
11:57 brrt called ParrotApplicationDirectory
11:57 brrt hmm no that is still not ideal
11:58 brrt anyway, summarising
11:59 brrt i use an uri scheme for specifying the langauge, script, class and routine
12:00 brrt but using the hostname for the script component is Not Ideal
12:00 moritz yet another option sounds quite sensible to me
12:00 moritz and have it default to the document root
12:00 brrt (virtual) server document root?
12:01 moritz erm, what other document roots are there?
12:01 brrt hmm.. not many
12:01 moritz but yes, I think that's what I mean
12:05 brrt its just, i had put it in <directory> statements earlier... hmnmmmm
12:06 brrt bascially if it is in 'server' context, use document root
12:06 brrt if in <directory> context, use directory specified
12:35 brrt oh, and moritz, i get the 'raw parrot cannot load rakudo' problem
12:36 brrt likely scenaroi, i must link something before i can load rakudo with load_language
12:42 moritz brrt: I can look into it, but I'm not sure I'll know how to fix it
12:44 brrt well, yeah, it would be nice to know in general :-) otherwise, i have to inspect the rakudo build process by hand
12:44 brrt which i can, but don't in general
12:44 brrt and haven't, and i was hoping you'd know
12:46 * Coke yawns.
12:47 moritz brrt: a load_language 'perl6' just succeeded for me
12:48 moritz brrt: after having rakudo installed, that is
12:48 moritz brrt: what else do you need?
12:48 brrt ... lets see if i can make that work
12:48 moritz as in, it didn't throw any exception :-)
12:48 brrt i recall that being broken
12:48 brrt no you 'should' have seen a segfault :-)
12:49 moritz yes, I recall that too
12:49 moritz but now it works, by magic :-)
12:49 brrt sometimes magic is good
12:50 brrt darn, i appear not to have perl6 on this box
12:50 brrt wait, i'll get back to that
12:53 moritz ah
12:53 moritz $P0 = compreg 'perl6'
12:53 moritz $P0.'eval'('say 42')
12:53 brrt wait wait!
12:53 moritz Null PMC access in find_method('eval')
12:54 brrt you /should/ call load_language('perl6') first
12:54 moritz yes, I did
12:54 moritz what's the way to register a compiler with parrot so that compreg will find it?
12:55 brrt .....
12:55 brrt hmm
12:55 brrt load_language :-p
12:55 brrt no, really, its compreg($S0, $P0)
12:55 brrt but
12:55 brrt thats what load_language is /supposed/ to do
12:56 moritz wait, how?
12:56 PacoAir joined #parrot
12:56 moritz load_language looks for a file named language.pbc
12:56 brrt well, i can't claim to know that
12:56 brrt probably in its init function?
12:56 brrt or load
12:57 moritz so the init function has to call compreg(S, P), so that compreg(P, S) will find it?
12:57 brrt as far as i know, yes
12:57 brrt will have to check the documentaiton
12:59 moritz yes, that's how it should work
13:00 brrt it is somewhat of a lack in my understanding
13:00 brrt whiteknight not here?
13:00 Coke moritz: yes, that's true.
13:01 Coke in nqp, you get this by...
13:01 brrt nqp doesn't play nice with that at all
13:01 Coke https://github.com/partcl/partcl-​nqp/blob/nqp2/src/Partcl.pm#L100
13:02 brrt (it can do it, but doesn't, no idea why)
13:02 PacoAir joined #parrot
13:03 moritz Coke: thanks, I'll try that in rakudo
13:09 Coke Oh, I thought rakudo already had all this figured out and that that was where this was cribbed from. ;)
13:11 moritz Coke: it probably was, in pre-nom days
13:12 moritz .oO( nom ate it! )
13:12 moritz but it doesn't work
13:12 moritz compreg still returns NULL
13:13 moritz and no compreg in the generated .pir code
13:14 moritz oh, and I know why
13:14 moritz because it calls compreg at the time that you call $compiler.language($name)
13:14 moritz but it doesn't generate code that calls compreg
13:18 bluescreen joined #parrot
13:19 dalek partcl-nqp/nqp2: c5fc935 | coke++ | src/Partcl/commands/string.pm:
13:19 dalek partcl-nqp/nqp2: partially fixup [string]
13:19 dalek partcl-nqp/nqp2:
13:19 dalek partcl-nqp/nqp2: commented out autovived hashes.
13:19 dalek partcl-nqp/nqp2: review: https://github.com/partcl/p​artcl-nqp/commit/c5fc935b13
13:30 nnunley joined #parrot
13:52 benabik joined #parrot
16:16 nopaste "Allison" at 112.68.48.67 pasted "Could I have an application form? <a href=" http://wheretoordernexiumro.devhub.com/ ">Where To Order Nexium </a> 059 * Invalid Profession Code 25 M/I Prescribe" (6 lines) at http://nopaste.snit.ch/163812
16:30 pmichaud joined #parrot
17:26 tuxit joined #parrot
17:41 Coke whee, nopaste bots.
17:41 Coke time to shut that down and just use github.
17:54 rurban_mobile joined #parrot
18:03 contingencyplan joined #parrot
18:20 p6eval joined #parrot
19:24 benabik joined #parrot
19:40 rurban_mobile joined #parrot
21:22 sivoais joined #parrot
23:36 kid51 joined #parrot
23:45 whiteknight joined #parrot
23:52 whiteknight good evening, #parrot

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

Parrot | source cross referenced