Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2007-01-08

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:02 neonse left perl6
00:05 ozo joined perl6
01:04 bucky joined perl6
01:06 jontec joined perl6
01:07 jontec what does array[num1][num2] do?
01:12 johnjra joined perl6
01:21 johnjra array[num1][num2] acceses the element at that position
01:21 johnjra jontec:
01:21 jontec so, this is a multi dimentsional array?
01:22 jontec dimensional*
01:22 jontec johnjra: sorry, forgot to point the message to you
01:23 finchely jontec: how would you declare an array with 2 dimensions?
01:23 johnjra jontec: reformulate your question
01:23 jontec finchely: is it an array with an array inside it?
01:23 jontec johnjra: that's directed at you as well
01:23 johnjra jontec , to understand easier
01:24 finchely jontec: well yes an array of arrays
01:24 johnjra johnjra: array[num1][num2] has num1 x num2 elemnts right ?
01:26 johnjra johnjra: array[num1][num2] is a continous memory space with sizeof(type_chosen_for_array) x num1 x num2   <--this is the size of teh memory it occupies
01:26 jontec johnjra: that's the thing... I can't tell when it gets the second array? Let me pastebin the part I am talking about
01:27 johnjra jontec no no no
01:27 ozo left perl6
01:27 Limbic_Region this is #perl6 right
01:27 Limbic_Region ?
01:27 johnjra jontec: so the memorry for that is continous,now arra[num1][num2] is just a way of saying access the   (sizeoftypechosen x num1)  +num2
01:28 johnjra jontec: you understand ?
01:29 jontec johnjra: I am seriously not getting this at all. T_T I'm a ruby programmer and not familiar with memory at all...
01:29 jontec johnjra: nope
01:30 jontec johnjra: do you know of anything I could read?
01:31 johnjra jontec: yes
01:31 johnjra joined perl6
01:34 johnjra jontec: u there ?
01:34 jontec johnjra: yeah
01:36 jontec johnjra: I just saw something... is this what it is http://perldoc.perl.org/perllol.html or is it something totally different
01:42 mjk joined perl6
01:42 johnjra jontec
01:42 johnjra let us start with the case dimension 1
01:42 johnjra array[n];
01:42 johnjra how do you access cell n ?
01:42 johnjra well in C its relevant to see how
01:44 johnjra *(array+sizeof(cell)*j )
01:50 johnjra jontec: u wit me ?
01:51 johnjra jontec: for dimension 2
01:52 johnjra you have * ((array+sizeof(cell)*j )+j1)
01:55 jontec no, not really, I didn't see that you had posted again
01:55 jontec that syntax makes no sense to me
01:56 johnjra jontec: dude
01:56 johnjra jontec: if you have array[n][m] how much elements does it have ? how much does it weigh ?
01:57 jontec johnjra: I guess it has to be at least n wide and m long?
01:57 johnjra jontec: so how much eleemnts does it have ?
01:57 johnjra jontec: n * m  , yes?
01:57 jontec n x m
01:57 jontec yeah
01:58 johnjra jontec: but if it is array[n][m][p] ?
01:58 jontec n * m * p...
01:59 jontec I'm seeing a cube now, is this wrong? should I be seeing a 3 x 3 square?
01:59 johnjra yes you are seeing a cube
02:00 jontec okay
02:00 johnjra but that cube can be seen as a line with length n*m*p
02:00 TimToady joined perl6
02:00 johnjra do you agree ?
02:00 jontec yeah
02:01 johnjra so jontec if you have array[n][m][p] and array2[n*m*p]  they weigh the same ?
02:01 jontec yeah
02:02 johnjra jontec: it remains to make a correspondence between them
02:02 johnjra jontec: how would you do that ?
02:02 jontec what do you mean?
02:03 johnjra jontec: make a one-to-one correspondence(function that associates an element from one side to an element on the other side)
02:05 jontec array[1][1][1] = array[n][m][p]? I only remember one-to-one functions (algebra) as being inverses. O_o
02:05 jontec n, m, and p there are the last elements
02:05 jontec I don't know how far they extend?
02:06 johnjra suppose n=2;m=3;p=4;
02:06 johnjra a[2][3][5] -> a2[30]
02:06 johnjra so we can associate a[1][1][1]->a2[1]
02:07 johnjra a[1][1][2]->a2[2]
02:07 johnjra so forth to a[1][1][5]->a2[5]
02:07 johnjra now a[1][2][1]->a2[6]
02:07 jontec but isn't that ambiguous? a[1][2][1] -> a2[2]?
02:08 jontec woah... wait... I didn't understand that last one... let me read again.
02:08 johnjra jontec: it was a[1][1][2]->a2[2]
02:08 johnjra ok read again
02:09 jontec johnjra: yeah I see that, but wouldn't the one I wrote also associate to a2[2] (1*1*2) = (1*2*1) ?
02:09 johnjra jontec: no
02:10 jontec why?
02:10 johnjra jontec: if it were so,2 elements would be associated to one element and that would lead to 30 distinct elements in the left side and 29 distinct elements in the right side wich is wrong
02:10 johnjra distinct=unique
02:10 johnjra jontec: you understand ?
02:11 jontec okay, yeah... but in your last example... 1*2*1 != 6?
02:11 jontec how does it reference to that
02:11 jontec ?
02:11 johnjra jontec: we shall get to that later
02:12 johnjra jontec: a[1][2][2]->a2[7]
02:12 johnjra a[1][2][3]->a2[8]
02:12 johnjra and so forth
02:13 johnjra a[1][2][5]->a2[9]
02:13 johnjra a[1][3][1]->a2[10]
02:13 johnjra ok ?
02:13 johnjra now you can see a pattern
02:13 jontec but I'm not going to get any of the other ones.... how is 1*2*3 = 8 and 1*2*3 = 9?
02:14 jontec I can't... see one.
02:15 johnjra well   a[i][j][k]->a2[  (i-1) * ((j*3) +k)  ]
02:15 johnjra oh...sorry i have made a mistake
02:15 johnjra just a little to correct it
02:17 johnjra a[i][j][k]->a2[         ( (i-1)i*3+j )*3+k    ]
02:17 johnjra >a[i][j][k]->a2[ ( (i-1)*3+j )*3+k ]
02:17 johnjra ok the last one is good
02:17 johnjra its ok now
02:17 johnjra you can check for i=1 ; j=3;k=1
02:18 johnjra it is a[1][3][1] -> a2[10]
02:18 johnjra wich is as we have typed above
02:18 jontec okay... gimme a sec... I have made a cube...
02:18 jontec I need to tape it together
02:18 jontec lol
02:18 johnjra now this formula lets you make a correspondence between a cube and a line with cells
02:19 johnjra lol ?
02:21 jontec okay, I'm done... I see the math... I can do the math...
02:21 jontec but where is it derived... why?
02:21 jontec by why I mean why would you want to make associations like this?
02:22 stevan jontec: if you program in C, it makes sense (for some definition of "sense")
02:22 jontec I mean it's way easier to look at the first.
02:22 jontec nope.
02:22 jontec I've only done VB
02:22 johnjra jontec: what we have proven is that a a[i1][i2][i3][i4]...[in] -> a[i1*i2*i3*...*in]
02:22 johnjra wich simplifies things allot
02:23 stevan jontec: that assumes that arrays are layed out in memory contiguiously
02:23 allbery_b you just have to remember thatin C, a multidimensional array is syntactic sugar for a unidirectional array
02:23 allbery_b er, unidimensional
02:23 stevan in ruby/perl/any modern language ... the array is usually a series of pointers to the heap
02:24 jontec stevan: so, there is always a a2[1.. 30]
02:24 allbery_b a behavor which is held over from early C which was little more than structured assembly language :)
02:24 stevan jontec: I dont knwo what you mean
02:25 jontec stevan: lol... forget it
02:25 jontec :D
02:25 stevan jontec: :)
02:25 johnjra jontec: yes,the answer is yes
02:25 stevan if you are not writing assembler/C, stuff like this is basically useless trivia IMO
02:25 stevan a good compiler means you never need worry about memory layout
02:26 jontec stevan: but why is this important to understanding what array[num1][num2] is? if I know that it references something like a.... what is the thing...
02:26 jontec I can't remember...
02:26 jontec okay, I saw what you said.
02:28 jontec okay, johnjra: thanks for the help understanding the whole memory arrangement (I think that's what we were discussing?). :D
02:28 johnjra yeah , your welcome :)
02:32 jontec I'm trying to figure out where the second dimension in my array came from for the guy who wrote this to reference it with two subscripts
02:32 stevan jontec: pasting the code would help
02:33 jontec stevan: oh, I was going to ask a question about push first :D
02:33 jontec lol... umm push merely appends the data in the second array to the first? in the same dimension?
02:34 jontec a1[a, b, c] (however I do push) a2[c, d, e] >> a1[a, b, c, d, e]?
02:34 stevan yes
02:36 jontec okay... I'll let you guys have a go...
02:42 jontec trying to find someplace to paste... my two normal ones aren't working O_o
02:43 jontec http://pastebin.com/853975
02:43 buubot The paste 853975 has been copied to http://erxz.com/pb/847
02:45 allbery_b pastebin.ca?  sial.org/pbot?
02:46 polettix joined perl6
02:48 b00t joined perl6
02:53 jontec I've gotta go.. see ya... if you can tell me how that array magically gains a dimension, im me at Ez8Gundam4
02:56 allbery_b @tell jontec array indices in perl5 are 0 .. $#array-1
02:56 allbery_b hm, right, they're messing with LB
02:57 allbery_b in any case, does this mean we;'re back to being #perl6?
02:57 allbery_b :/
03:03 leed joined perl6
03:11 thepler joined perl6
03:57 dduncan joined perl6
04:04 xpika joined perl6
04:37 mako132_ joined perl6
05:08 miyagawa audreyt: ping
05:11 meppl gute nacht
05:29 b00t joined perl6
05:44 Lunchy joined perl6
05:45 allbery_b ...and I'm here too :)
05:45 allbery_b OSX intel or ppc?
05:45 Lunchy intell
05:45 Lunchy 10.4
05:45 Lunchy please excuse my horrendous spelling/typing :)
05:46 allbery_b hm.  no intel here, audreyt has definitiely built pugs for 10.4 intel though
05:46 * allbery_b has built it on ppc
05:46 Lunchy ah
05:46 allbery_b *definitely
05:46 Lunchy I've got macports installed, along with ghc and the latest parrot
05:46 Lunchy but pugs fails to build
05:47 allbery_b what version of ghc?
05:47 Lunchy 6.6
05:47 allbery_b ok.  where is it failing?
05:48 Lunchy when it tries to build UTF8
05:48 allbery_b there was recent discussion here (which I've lost due to having to reboot) about leftover files from old builds tripping over changes in parrot
05:48 Lunchy Build failed: 256 at util/build_pugs.pl line 360.
05:49 Lunchy I checked out that line and didn't find an obvious answer
05:49 allbery_b that's almost useless, it's the lines before it that have real information.  send them to sial.org/pbot or pastebin.ca?
05:50 Lunchy ah, yea, thought it mighta looked familar :)
05:50 allbery_b hm.  al.so I never built parrot support into pugs here, I distrusted my prrot build to much (about 4 month ago, haven't updated)
05:50 allbery_b basiclaly any build failure will end with essentially that message :)
05:51 Lunchy http://pastebin.ca/309963
05:51 buubot The paste 309963 has been copied to http://erxz.com/pb/848
05:51 Lunchy gotcha :)
05:52 allbery_b hm.  is this the pugs source tarball or are you using svn.pugscode.org?
05:53 Lunchy tarball
05:53 Lunchy suggest svn?
05:53 allbery_b I think the last tarball is too out of date
05:53 Lunchy heh, okay
05:53 allbery_b yes, get the latest from svn.  possibly the tarball doesn't even support macintel (in fact likely, from that error message right at the start)
05:54 allbery_b that looks like an early attempt at intel support that went awry
05:54 Lunchy ah
05:55 Lunchy I'll give that a shot, thank you!
05:55 Lunchy it's probably better that it doesn't work as it'll just distract me from haskell :)
05:56 allbery_b audrey was justr starting to play with an intell OSX box when I started with pugs, and the tarballwas already a little old
05:57 Lunchy oh, yea, that's from October!
05:58 allbery_b (actually I think only a week or so old, but (a) pugs development moves pretty fast outside the holiday season, and (b) still too arly for audrey to have fixed the intel build)
05:58 allbery_b *early
05:59 Lunchy well, I got the tarball off cpan and it says the date is from october
05:59 allbery_b yeh
05:59 Lunchy os x doesn't come with svn does it?
05:59 allbery_b no, but it's in macports
06:00 Lunchy schweet
06:01 Lunchy I've got so many ports installed it makes me feel like I'm on my gentoo box ;)
06:01 allbery_b then svn co http://svn.pugscode.org/pugs/ and go for it
06:01 dduncan if things go according to what I anticipate, I should be getting my own intel OSX box within a month ... the anticipate being that a refresh of the portables is announced this tuesday
06:02 dduncan then when I go to conferences I can bring my own portable rather than a borrowed one
06:02 Lunchy thanks allbery_b, it's been a while since I've used svn
06:03 allbery_b and eventually someobne here will offer you a commit bit :)
06:03 allbery_b 115 ports installed on mine.  my freebsd box has more ;)
06:03 Lunchy danger will robinson!
06:03 allbery_b *everyone* gets a commit bit around here
06:03 Lunchy heh, I'd be too timid to ever use it, so feel free to give me one :)
06:04 Lunchy I'd just got my macbook a about a month ago, I'm a new apple convert
06:06 sunnavy joined perl6
06:15 BooK_ joined perl6
06:17 Lunchy dang, svn gave teh same error
06:18 allbery_b hrm
06:18 Lunchy oh well, I suppose I can just ssh to my linux box and use it from there
06:18 allbery_b hm, wait.  what version of xcode do you have installed?
06:19 Lunchy I think 4.1...whatever the latest is
06:19 allbery_b what does gcc_select say?
06:19 Lunchy 4.0.1
06:20 allbery_b hrm.  think you'll need to wait for audreyt to show up, or someone else with macintel experience
06:20 allbery_b that error message suggests to me that either gcc or ghc is confused abotu what platform it's building for
06:20 Lunchy okay, no problem, it's not a big deal to me, but if anyone wants to work through this with me in the interest of progress, I'm all for it :)
06:21 Lunchy ah
06:21 allbery_b (multiple -arch flags shouldn't happen.  my gguess is that somehow it thinks it's supposed to be doing ppc and intel compiles at the same time)
06:22 Lunchy yea, that sounds possible
06:26 nipra joined perl6
06:32 Lunchy sure enough, -arch ppc and -arch i386 are in all of the makefiles
06:32 Lunchy for the LD(D)FLAGS
06:34 allbery_b there may be some bit that needs to be tweaked somewhere in xcode to convinvce it to not do "fat" builds.  I don't recall having to do anything but it may well be different on PPC
06:40 Lunchy looking through the settings, nothings jumping out at me
06:40 Lunchy oh well, will play more tomorrow, it's bedtime for me :)  thanks again for your assistence
06:48 bwk joined perl6
07:31 buetow joined perl6
07:33 Aankh|Clone joined perl6
07:41 drbean joined perl6
07:45 marmic joined perl6
07:59 bucky_ joined perl6
08:14 drbean left perl6
08:16 f0rth_ joined perl6
08:29 Odin- joined perl6
08:30 iblechbot joined perl6
08:32 f0rth joined perl6
08:35 buetow joined perl6
08:40 elmex joined perl6
08:41 luqui joined perl6
09:19 drrho joined perl6
09:24 johnjra joined perl6
09:46 drbean joined perl6
09:46 TimToady I believe smartmatching is now close to sane.
09:47 TimToady but then, I've believed that before... :)
10:13 Alias__ joined perl6
10:20 cdfh joined perl6
10:42 ruoso joined perl6
10:51 fglock joined perl6
10:53 dduncan my, you're up late
11:01 fglock I'm trying to find a way to implement BEGIN blocks in pure perl6
11:02 fglock is there an API for pads?
11:05 fglock if I wrote an interpreter for the generated code, I could have enough program state info - but compiled code is harder
11:08 jferrero joined perl6
11:28 fglock in a sense, BEGIN blocks need to be "executed" into a script, that could be replayed at run-time
11:29 kanru joined perl6
11:35 dduncan Might macros do what you want? ...
11:36 dduncan or Perl 6 has actual BEGIN blocks ...
11:37 dduncan see Synopsis 4, under "Closure traits" ...
11:37 dduncan about 60% of the way down in http://dev.perl.org/perl6/doc/design/syn/S04.html
11:38 dduncan fglock
11:38 dduncan or are you trying to implement that Perl 6 spec rather than just use it?
11:39 fglock dduncan: yes - this is p6-on-p6
11:39 dduncan I C
11:39 dduncan can't say then
11:39 fglock I need to create the environment into which a BEGIN block will execute
11:40 fglock and then recreate the side-effects at run-time
11:40 dduncan I assume that this is being written on a mini-Perl 6 then, and not a full Perl 6?
11:40 fglock I need something like 'is inner' sub trait
11:40 dduncan I don't yet know enough about that, sorry
11:41 fglock that't the mp6 -> kp6 transition
11:41 fglock kp6 provides the lang to write 6-on-6
11:46 dduncan left perl6
11:53 fglock storing pads as p6 data would make them easier to manage - I wonder if it's a bad idea, since native pads are much faster
12:09 fglock there is an idea of a "Pad class" here: http://www.mail-archive.com/perl6​-language@perl.org/msg25373.html
12:11 chris2 joined perl6
12:14 luqui perhaps this isn't the time to worry about speed
12:14 luqui we can always optimize later, after bootstrapping, no?
12:17 elmex_ joined perl6
12:19 fglock luqui: yes, but I worry about the compiler speed
12:19 fglock it can easily go from a few seconds to several minutes
12:24 luqui yeah, I guess that wouldn't be good for development
12:24 luqui (like when pugs took 45 minutes to compile)
12:41 fglock kp6 will end up desugaring almost to vm level - it could almost implement continuations
12:54 integral joined perl6
12:58 finchely left perl6
13:20 nipra joined perl6
13:22 iblechbot joined perl6
13:36 sonorous joined perl6
13:40 sunnavy joined perl6
13:50 svnbot6 r15010 | fglock++ | kp6 - added notes on BEGIN, pads, oo
13:51 sunnavy joined perl6
13:52 TimToady joined perl6
13:55 gnuvince joined perl6
14:13 mdiep joined perl6
14:18 [particle] left perl6
14:36 [particle] joined perl6
14:48 fglock joined perl6
14:56 fglock hmm - desugaring kp6 into mp6 buys some interesting simplifications
15:04 fglock following this line of thought, multi-dispatch could also be resolved at mp6 level
15:04 fglock this is for bootstrapping - the calls can be replaced by native code later
15:15 sunnavy joined perl6
15:18 fglock what is the scope of this declaration? multi infix:<+> {...}
15:20 avar same as multi sub .. ?
15:20 fglock with 'is export' it is valid in the modules that 'use' it, and with '*infix:<+>' it is valid everywhere?
15:29 thepler joined perl6
15:35 wolverian http://err.no/src/contentless_ping.pl # heh
15:47 araujo joined perl6
15:51 vel joined perl6
15:55 Limbic_Region joined perl6
15:56 araujo joined perl6
15:57 mako132 joined perl6
16:09 araujo joined perl6
16:14 araujo joined perl6
16:20 araujo joined perl6
16:32 sunnavy joined perl6
16:33 chris2 joined perl6
16:38 hexmode joined perl6
16:46 sunnavy joined perl6
16:47 sonorous joined perl6
16:48 weinig is now known as weinig|bbl
16:58 ozo joined perl6
16:59 TimToady fglock: infix:<+> is just a strange name for a sub or multi, and under that name works exactly like a normal sub or multi.  As an infix:, however, it also adds to the parsers infix table when in scope, and that scoping works like macros.
17:00 TimToady macros work only from the point of declaration or importation to the end of the scope.
17:00 TimToady so the semantics of *infix:<+> depend on when it was logically exported to *
17:01 luqui joined perl6
17:01 TimToady or rather, when it was logically imported by *
17:01 fglock TimToady: thanks
17:01 TimToady if before the user's compilation unit is compiled, then the user's code sees your infix:<*>
17:02 TimToady but if exported at user's run time, then it would not be visible as a macro.
17:03 TimToady *however*, since there is already an infix:<+> defined
17:03 TimToady and since infix:<+> is presumably dispatched by MMD, it would actually find it anyway if defined as a multi
17:03 Nouk joined perl6
17:03 TimToady since that is late binding
17:05 fglock I'm now considering a state-machine built using mp6, as kp6's runtime
17:05 fglock this would add support for continuations
17:05 Nouk left perl6
17:07 fglock hmm - too many options
17:07 mj41 joined perl6
17:14 fglock the key for kp6 success is to find the right level of abstraction in the low-end
17:14 weinig|bbl is now known as weinig
17:14 luqui fglock, \calc + cps ?
17:15 luqui what are kp6's goals?
17:15 fglock what't \calc ?
17:15 luqui lambda calculus
17:15 fglock luqui: it's being specified
17:15 luqui what does it stand for?
17:16 fglock KindaPerl6 - it's a compiler built upon MiniPerl6
17:16 fglock should have better support for p6 features
17:16 luqui ohk
17:16 luqui so it's like (mp6 + p6)/2 in a way
17:16 luqui ?
17:16 fglock like: containers, BEGIN, an object model
17:17 fglock yes
17:17 fglock it's a level of indirection
17:17 luqui hmm
17:18 fglock the main problem is performance x ease-of-implementation, I think
17:19 fglock I'm trying to find the tradeoff
17:19 [particle] i'd go for ease of implementation, and refactor for performance
17:20 [particle] working trumps good
17:23 sunnavy_ joined perl6
17:30 fglock [particle]: there is also the v6.pm's way - "move all problems into the backend"
17:31 fglock in other words, just extend mp6 into full-p6
17:32 masak [particle]: of course it does, the latter is a subset of the former
17:32 [particle] well, parrot certainly has continuations
17:32 [particle] but not every back end will
17:33 [particle] so implementing them at a higher level makes sense (as long as they can still be optimized easily to a  vm-ative continuation)
17:33 [particle] *vm-native
17:33 ludan joined perl6
17:34 [particle] masak: 'good' is probably better written as 'well-designed'
17:34 [particle] or, 'optimized'
17:35 fglock brb
17:47 fglock I think it boils down to backend-specific AST transformations
17:48 [particle] ah, well if it's just a matter of semantics, it's no big deal to xform ast
17:49 fglock is there a spec for p6-parrot high level ast?
17:50 fglock I'd like to reuse if possible
17:50 kanru joined perl6
17:50 [particle] pmichaud is working on past now as he implements p6
17:51 [particle] he'll be working on binding shortly, then 'for'
17:51 [particle] and lastly, begin/end
17:52 [particle] then we'll be running Test.pm
17:52 [particle] it'd be great if you found past useful enough to reuse outside of parrot
17:52 [particle] it would make ast transformation so easy for us :)
17:53 fglock it would be nice to have some examples
17:54 [particle] of what, parse tree -> ast
17:54 fglock source code -> ast would be nice
17:54 [particle] ok, well, p6 source goes through pge using a p6 grammar
17:55 [particle] actually, you can do live examples from languages/perl6
17:56 [particle] pastebot?
17:56 fglock [particle]: http://svn.pugscode.org/pugs/v6/v6-Mini​Perl6/lib/MiniPerl6/Grammar/Control.pm - mp6-style grammar
17:57 pasteling "[particle]" at 144.81.84.207 pasted "example of 'say 1;' converted to parrot ast" (51 lines, 1.2K) at http://sial.org/pbot/22203
17:58 fglock thanks - I can work out from that
17:59 [particle] let me know if you need more examples
18:00 fglock what is 'ctype'?
18:00 [particle] that needs renaming
18:00 [particle] along with vtype
18:01 [particle] i'll point you to a discussion
18:01 fglock "concrete type"?
18:01 [particle] constant type
18:02 [particle] meaning, it can be stored in an i,s,or n register in parrot
18:02 [particle] rather than as pmc
18:02 [particle] so, it's an integer constant
18:03 [particle] and vtype is value type
18:03 [particle] ctype is optional, btw
18:04 amnesiac joined perl6
18:05 [particle] http://groups.google.com/group/perl.perl6.int​ernals/tree/browse_frm/thread/9ea7288dbf2ccf6​f/1f82b5d4c00129b5?rnum=1&amp;q=initial+feedb​ack&amp;_done=%2Fgroup%2Fperl.perl6.internals​%2Fbrowse_frm%2Fthread%2F9ea7288dbf2ccf6f%2F1​f82b5d4c00129b5%3Flnk%3Dgst%26q%3Dinitial+fee​dback%26rnum%3D1%26#doc_60019dbc53dcb3cb
18:05 [particle] i guess you have to request shorten here
18:08 fglock got it
18:09 _bernhard joined perl6
18:09 fglock [particle]: I wonder if we could gen Past, out of the existing mp6 impl
18:09 [particle] what does mp6 gen now?
18:09 fglock it generated parrot source
18:09 fglock generates
18:09 [particle] ah, right, it does.
18:09 fglock (or perl5 source)
18:10 [particle] it'd be nice to move that up to the ast level, generate past
18:10 justatheory joined perl6
18:10 [particle] then mp6 doesn't need to worry about changes to parrot vm-level languages
18:11 fglock I wonder if you could work with me for an hour or so, and see what we get
18:11 [particle] can do
18:11 [particle] i'm updating pugs for the first time in a month
18:12 fglock this is the current parrot emitter: http://svn.pugscode.org/pugs/v6/v6-Min​iPerl6/lib/MiniPerl6/Parrot/Emitter.pm
18:14 [particle] so, should we create Parrot/PAST/Emitter.pm?
18:15 fglock maybe just PAST/Emitter for short
18:15 [particle] that works
18:16 fglock it needs a workflow script - it can be copied from mp6-parrot.pl -> mp6-past.pl
18:17 fglock and s/MiniPerl6::Parrot::Emitte​r/MiniPerl6::PAST::Emitter/
18:17 [particle] ok, i'l start on it now
18:18 fglock just run 'sh hello-parrot.sh' to check if it's working
18:18 [particle] not on windows
18:19 fglock echo 'class Main { say "hello, World" }' | perl -Ilib5 mp6-parrot.pl | parrot -
18:19 fglock s/'/"/
18:21 [particle] my variable $s masks earlier declaration...
18:22 [particle] oh, don't worry about that
18:22 fglock ?
18:22 [particle] but mp6-parrot.pl gets me "Can't call method "emit" without a package or object reference"
18:22 [particle] mp6-parrot.pl line 33
18:23 fglock hmm - let me try on another computer
18:25 fglock it works in feather too
18:27 [particle] maybe i need to build/install some modules?
18:27 fglock do you have Scalar::Util installed? it's the only dependency
18:27 [particle] i had to change -Ilib5 to -Ilib
18:27 fglock that should not work - lib is a p6 directory
18:28 [particle] ok, i'll try again. i'm getting latest Scalar::Util, laso
18:31 fglock would you try copying the program to a file and perl -Ilib5 mp6-parrot.pl < filename
18:31 fglock it may be a windows command line problem
18:31 [particle] sure. as soon as my Scalar::Util install finishes
18:32 fglock I got a windows machine - will try...
18:33 cdfh_ joined perl6
18:33 [particle] crap, Scalar::Util fails a taint test on win32, gotta force install
18:36 [particle] same problem
18:37 fglock waiting for svn up to finish...
18:38 fglock hmm - no problems in windows either - with vanilla perl 5.8.8
18:39 [particle] if i uncomment line 31, i get ''
18:39 [particle] empty single quotes (line 32, that is)
18:40 [particle] i'll try another machine, too
18:43 pasteling "fglock" at 200.17.89.88 pasted "mp6-parrot snippet" (19 lines, 384B) at http://sial.org/pbot/22204
18:44 rafl_ joined perl6
18:48 [particle] that style works
18:50 pdcawley joined perl6
18:53 fglock 'PAST::Val' seems like a good place to start
18:53 pdcawley joined perl6
18:54 fglock it can be generated by class Val::Int, Val::Num ...
18:56 cdfh joined perl6
18:57 fglock hmm - mp6 nodes are discarding 'pos' and 'source', but that's fixable
18:59 fglock [particle]: in windows:  echo class Main { say "hi" } | perl mp6-parrot.pl
19:00 fglock the 'emit' problem is caused by '' around the echo string
19:03 [particle] gotcha
19:04 [particle] how do i compile PAST::Emitter to p5?
19:04 [particle] (get it from lib to lib5)
19:05 fglock perl mp6-perl5-boot.pl  < lib/...  > lib5/...
19:05 fglock first: mkdir lib5/MiniPerl6/PAST
19:06 fglock mp6-perl5-boot is the perl5-bootstrapped compiler
19:06 [particle] got it
19:07 fglock these commands can be added to util/build-perl5.sh, for a full-rebuild
19:13 buetow joined perl6
19:14 fglock did it work? it should not take more than half a minute to compile
19:15 [particle] yes, it compiled
19:15 [particle] i'm now modifying, but as you said, i can't us esource or pos
19:16 [particle] so i'll just work around that for now
19:18 kolibrie fglock: I'm stuck trying to get data out of an array deep within a match
19:18 pasteling "kolibrie" at 66.239.158.2 pasted "how can I get to the data in this array?" (88 lines, 2.1K) at http://sial.org/pbot/22206
19:18 fglock kolibrie: looking
19:18 pbuetow joined perl6
19:19 * kolibrie has been looking for hours, and hopes someone else can find an answer with less effort
19:20 fglock [particle]: I can give you 'from' and 'to' - 'source' is a bit tricky because it may end up creating multiple copies of the string and eating ram
19:20 justatheory joined perl6
19:22 [particle] <pos> is 'from', so i'll take that
19:23 [particle] i don't need source right now
19:28 autark joined perl6
19:37 prism joined perl6
19:37 kolibrie fglock: are you as baffled as me?
19:40 fglock kolibrie: add an extra $ at: $$block<names>
19:40 fglock $block<names> returns a Match, the return-object is an array
19:41 kolibrie ahh,
19:41 fglock maybe because 'token block' doesn't have a return-block
19:41 kolibrie name: is still ARRAY(...), but this?: and hmm: have data now
19:42 kolibrie that's good
19:42 kolibrie now, can I apply this back into my real grammar?
19:42 fglock 'name' does not interpolate by default - that looks correct
19:43 kolibrie fglock: good, thank you so much!
19:43 fglock np
19:44 larsen_ joined perl6
19:46 fglock I need to run
19:46 fglock [particle]: thanks for the help
19:47 nipra joined perl6
19:48 fglock &
19:48 kolibrie see you
19:48 fglock g'night
19:48 fglock left perl6
19:51 larsen__ joined perl6
20:06 Lorn joined perl6
20:09 gaal http://feeds.feedburner.com/~r/typepad/Cut​eOverload/~3/72484276/back_on_the_moo.html
20:20 Lorn_ joined perl6
20:23 Vex joined perl6
20:27 rindolf joined perl6
20:27 rindolf Hi all.
20:28 rindolf Hmmm... #perl has reached its limit and no more people can join.
20:31 Tene rindolf: that's exactly what perl6 is being made for!
20:34 wolverian heh
20:34 wolverian there were just 521 people on #perl
20:34 * wolverian shrugs at irc
20:47 jferrero joined perl6
20:57 awwaiid joined perl6
21:06 weinig joined perl6
21:06 weinig is now known as weinig|away
21:10 johnjra joined perl6
21:12 koye joined perl6
21:14 ludan joined perl6
21:18 justatheory joined perl6
21:19 TreyHarris TimToady: in re your last S03 mod--is "exists" gone?
21:27 [M]erk joined perl6
21:30 buetow joined perl6
21:30 TimToady I suspect it's gone.
21:31 TimToady though I'm still not entirely happy with contains...
21:33 TimToady contains %foo: $key doesn't read well, is one problem.
21:34 [particle] %foo.contains( $key ) reads okay, though
21:34 TimToady but exists is no better on that score.
21:34 TimToady %foo.exists($key) is worse on that.
21:34 [particle] yep
21:34 TimToady and I still wish there was a way to combine the predicate with subscript notation nicely.
21:35 TimToady but the P5 macro approach for exists and delete doesn't nicely keep the keyword near the actually part that you're testing
21:35 TimToady *actual
21:36 TimToady unless we made .exists and .delete postfix macros that require a subscript on the left.
21:36 TimToady but then we've made something look dispatchable that isn't.
21:37 TimToady it's more like %hash{$key}:delete or %hash{$key}:exists
21:37 TimToady they tell the subscript to do something other than just return the values
21:38 TimToady it's the subscript that has to do it, though, or you lose the original object you're subscripting by the time the values are returned.
21:39 TimToady and I'm not sure we really want to have the ordinary subscript code having to decide continually at runtime whether there was an adverb.
21:39 TimToady subscripting tends to be on the critical path in the tightest loops
21:40 TimToady so I'd rather have a macro that is known at compile time to modify the subscript to a different operator
21:41 TimToady in which case, it might even be punctuational.  .?{$key} for exists, for instance.
21:42 TimToady but contains reads better than that...
21:43 TimToady hmm
21:44 TimToady %hash.:delete{$key} has possibilities.
21:45 TimToady or swipe a bit of grammatical category namespace...  %hash.delete:<foo>
21:45 svnbot6 r15011 | particle++ | [v6]: beginnings of a PAST emitter for mp6
21:45 svnbot6 r15011 | particle++ | ~ created control script based on mp6-parrot.pl
21:45 svnbot6 r15011 | particle++ | ~ created emitter based on Parrot::Emitter.pm
21:45 svnbot6 r15011 | particle++ |   - all Val:: nodes emit
21:45 svnbot6 r15011 | particle++ |   - PAST::Block (top level) emits
21:45 svnbot6 r15011 | particle++ | ~ TODO:
21:45 svnbot6 r15011 | particle++ |   - node numbering is a prerequisite to proper generation
21:45 svnbot6 r15011 | particle++ |   - add Stmts and Stmt nodes
21:45 svnbot6 r15011 | particle++ |   - refactor as needed
21:47 theorbtwo joined perl6
21:47 pasteling "evalbot_r15010" at 194.145.200.126 pasted "Pugs build failure" (429 lines, 24.1K) at http://sial.org/pbot/22210
21:52 TimToady or maybe .delete and .contains are normal methods that return a proxy that responds to normal subscripting differently.
21:53 TimToady I would worry about those proxies persisting though if you *don't* subscript it...
21:53 TimToady You could create hashenbergs that delete their entries when you look at them...
21:58 TimToady $keyexists = contains %hash;  if $keyexists<foo> { ... }
22:00 wolverian %hash.keys.contains($foo)
22:01 TimToady that's what S03 currently says, except you can leave out the .keys because .contains is subset, and %hash assumes that set context means keys.
22:02 wolverian ah, right. sorry :)
22:02 TimToady I'm so deeply offended... :)
22:04 wolverian %hash contains $foo?
22:04 TimToady I suppose if .delete and .contains don't have an argument list supplied, they can just autocurry themselves to proxy objects that do autodeletion or subset testing
22:04 TimToady would have to have a unary form that defaults to $_
22:04 TimToady when contains
22:05 TimToady and generally we've been shying away from completely hiding $_ defaulting
22:05 TimToady in favor of .method forms
22:05 TimToady I suppose it's not really hidden in this case, since it's pretty obvious
22:05 TimToady to the compiler at least whether contains is where a term or an infix is expected
22:06 TimToady but then you get into precedence issues
22:07 TimToady and whether a standalone {...} will be interpreted as a subscript or closure
22:08 TimToady and I want subscript notation somehow
22:08 TimToady so that you can delete from a multidim hash:  %hash.delete:{$a;$b;$c}
22:08 TimToady %hash delete {$a;$b;$c} would turn those into statements.
22:09 wolverian do we want first-class subscripts that you can hand to a method then?
22:10 TimToady %hash.delete(\{$a;$b;$c})
22:10 * wolverian opens the specs to find Subscript
22:10 wolverian right. :)
22:11 polettix joined perl6
22:11 TimToady reducable perhaps to %hash.delete\{$a;$b;$c}
22:12 wolverian somehow I like it if it's a regular method. probably just shying from specialness due to how perl5 treated it
22:12 TimToady but it has to do something either macroish or proxyish
22:12 TimToady or we need first class subscripts
22:13 TimToady which are arguably a kind of Capture
22:13 wolverian right. it's not obvious to me that the latter would be the worse solution
22:15 TimToady I rather suspect people would just a soon write %hash.delete{...}
22:16 wolverian I know I would.
22:16 wolverian I just want to first-class everything :)
22:17 TimToady so let's just make .exists and .delete macros if followed by { [ or <
22:17 TimToady .contains rather
22:19 TimToady then we can always switch to the proxy approach if the macro starts getting in the way
22:21 TimToady the proxy approach feels slightly cleaner in that we could somehow have any .mumble<foo bar> grab control of its subscript at runtime without the connivance of the compiler.
22:22 wolverian I like it too.
22:24 TimToady maybe there's some way to make method dispatch decide whether to dispatch as two cascaded methods or as a single method with a subscript argument depending on the way the signatures look somehow.
22:30 weinig|away is now known as weinig
22:30 mdiep where is the source for evalbot?
22:31 integral try http://svn.pugscode.org/pug​s/examples/network/evalbot/
22:32 Aankhen`` joined perl6
22:32 mdiep thanks!
22:32 integral np
22:40 TimToady on the gripping hand, I don't think the proxy object helps much, because it's the original container that actually has to delete the item, which the current .delete(...) form calls.  What we really are looking for is syntactic relief so we specify the identity of the contents the same way as with subscripting.
22:45 johnjra anyone here used vim with svn ?
22:47 johnjra i need to know if theres any possibility of getting vim integrated with svn,by that i mean,if i press a button in vim , it should svn commit stuff
22:48 TimToady hmm, write a macro that calls !svn ci maybe?
22:48 TimToady you'd probably want to autowrite first though.
22:49 TimToady I always autowrite on ^Z, so it's one stroke (more or less) to get to a prompt
22:50 TimToady but that's on Linux
22:50 TimToady my reflexes don't work at all well on Windows... :/
22:53 nperez joined perl6
22:58 wolverian johnjra, it even comes with a svn integration script, I think.
22:58 wolverian scratch that, it doesn't. well, check vim.org
23:00 ingy TimToady: can I msg you?
23:02 frankg joined perl6
23:03 ingy TimToady: in other words, are you identified to freenode's NickServ?
23:10 Juerd You can always receive messages
23:10 johnjra wolverian: did u make it work for yourself ?
23:10 Juerd Sending them does require identification
23:11 wolverian johnjra, I vaguely remember using it with svk with success.
23:12 johnjra svk ?
23:15 Psyche^ joined perl6
23:15 wolverian johnjra, http://en.wikipedia.org/wiki/Svk
23:15 bucky joined perl6
23:29 arguile joined perl6
23:32 Psyche^ is now known as Patterner
23:33 dduncan joined perl6
23:36 weinig is now known as weinig|food
23:36 ingy Juerd: msging someone typically involves a dialogue :P
23:37 Juerd Really?
23:37 Juerd Now I know what has been wrong all this time :)
23:38 ingy but thanks for the technical update
23:39 TimToady ingy: yes, I'm ID'd
23:40 lisppaste3 joined perl6
23:40 ingy TimToady: are you seeing my msgs?
23:40 TimToady yes
23:40 ingy I'm not seeing yours
23:41 TimToady hmm
23:41 ingy see why I started down this road? :)
23:41 ingy I think I've msged you several times and just thought you hated me
23:42 ingy Which is of course impossible
23:42 TimToady what, that I hate you, or that you think it? :)
23:42 ingy :P
23:43 ingy how could you not love me?
23:43 TimToady you got me there...
23:44 ingy well I was wondering if you still had access to the server that Dan Kogai set us up on
23:44 TimToady dunno, haven't looked in most of a year...
23:45 ingy do you even remember its address?
23:45 TimToady erm
23:56 sonorous is now known as sono

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

Perl 6 | Reference Documentation | Rakudo