Perl 6 - the future is here, just unevenly distributed

IRC log for #plparrot, 2010-07-28

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

All times shown according to UTC.

Time Nick Message
20:41 _ilbot2 joined #plparrot
20:41 Topic for #plparrotis now PL/Parrot! || http://github.com/leto/plparrot || Group: http://groups.google.com/group/plparrot || Ask dukeleto if you want a commit bit on the git repo || Paste http://plparrot.privatepaste.com/
20:41 davidfetter i forget how i give you access to do that
20:41 davidfetter what do you need done?
20:41 dukeleto davidfetter:  /mode +o dukeleto
20:42 davidfetter i meant more-or-less permanently
20:42 dukeleto http://irclog.perlgeek.de/plparrot/today
20:42 moritz_ joined #plparrot
20:43 moritz_ hi
20:43 moritz_ by request from dukeleto, this channel is now publicly logged at http://irclog.perlgeek.de/plparrot/today
20:43 davidfetter thanks, moritz_ :)
20:43 moritz_ if you have any wishes, suggestions etc, just /msg me, or find me at #perl6
20:43 moritz_ left #plparrot
20:43 cxreg i was wondering a bit about %_TD and %_SHARED
20:44 cxreg not sure what the parrot-friendly or perl6-idiomatic way of doing that type of thing would be
20:44 Topic for #plparrotis now PL/Parrot! || http://github.com/leto/plparrot || Group: http://groups.google.com/group/plparrot || IRC Channel log http://irclog.perlgeek.de/plparrot/today || Ask dukeleto if you want a commit bit on the git repo || Paste http://plparrot.privatepaste.com/
20:44 dukeleto davidfetter++
20:44 dukeleto cxreg: what were you wondering?
20:45 davidfetter i'd see %_TD as giving more capability
20:45 davidfetter ...says the guy who built an entire giant app atop %_SHARED ;)
20:46 cxreg heh
20:46 davidfetter i don't like to wear ops
20:46 dukeleto davidfetter: fine with me
20:46 dukeleto as long as somebody can change the /topic occasionally, i don't care
20:46 davidfetter oh. well, i own the channel
20:47 dukeleto cxreg: i am wondering what the simplest possible test for your spi branch would look like
20:47 davidfetter can you see if /msg chanserv op #plparrot dukeleto works when you're not already an op?
20:47 dukeleto davidfetter: does that require registered nicks?
20:47 cxreg dukeleto: well, if you dont care if your query worked, and just that the function worked and that postgres didn't segfault, you could SPI_execute('select 1') and return
20:47 davidfetter i believe so
20:48 dukeleto ChanServ(ChanServ@services.)- You are not authorized to perform this operation.
20:48 cxreg i nopasted a function like that earlier
20:48 dukeleto cxreg: i think i missed that nopaste
20:48 cxreg http://plparrot.privatepaste.com/0cbce83407
20:48 davidfetter one sec. lemme try something
20:49 cxreg dukeleto: elog() works too
20:49 dukeleto cxreg: yes, the simplest tests give you a lot of bang for the buck in the beginning. i think it is a worthwhile test
20:49 cxreg ok
20:49 dukeleto cxreg: scary!
20:49 cxreg heh
20:49 cxreg that's a straight NCI call in pir
20:49 davidfetter blast
20:50 davidfetter ChanServ*No templates set on channel #plparrot.
20:50 cxreg http://www.postgresql.org/docs/8.4/static/spi-spi-execute.html
20:50 * dukeleto begs for ops again
20:50 davidfetter how do i set it so others can op themselves?
20:50 * dukeleto eats happiness pie
20:50 davidfetter dukeleto, i'm delighted to let you do it permanently. i just don't know what chanserv needs to be told here on fleanode
20:51 dukeleto maybe i should register my nick one of these days. it always seemed annoying
20:51 dukeleto cxreg: very cool!
20:52 dukeleto cxreg: what do you think about pulling in various things with get_root_global in the setup of PL/PIR, so end-users don't have to do that?
20:52 davidfetter dukeleto, re: registering it, it's not *that* much of a PITA
20:53 dukeleto cxreg: we would prefix everything with spi_ or plparrot_spi_ or something
20:53 dukeleto davidfetter: yep, mostly laziness on my part
20:53 davidfetter dukeleto, i suspect that fleanode will require that you be identified in order for me to be able to give you ops
20:53 davidfetter well, for me to let you give them to yourself
20:55 * dukeleto will try to do it, but will probably go for a run first
20:59 dukeleto davidfetter: have a good link for how to register a nick? i just spent a few mins wading through chanserv docs and didn't find it
20:59 davidfetter /msg nickserv register dukeleto yourpassword
21:02 dukeleto it is actually /msg nickserv register username email, but i just did it
21:02 dukeleto davidfetter++
21:02 dukeleto i was searching for chanserv docs instead of nickserv
21:03 davidfetter yeah, there are several services, of which i'm familiar with those two
21:03 ChanServ joined #plparrot
21:09 dukeleto davidfetter: i registered my nick
21:09 dukeleto and yet, the world still turns
21:10 dukeleto davidfetter: so now you can do that thing you wanted to do
21:12 * davidfetter tries it
21:19 davidfetter dukeleto, see if /msg chanserv op #plparrot dukeleto
21:19 davidfetter works :)
21:26 cxreg dukeleto: right, that's my goal
21:26 cxreg dukeleto: the SPI_ native functions are useless to us
21:26 cxreg so i figured i'd just emulate the plperl api
21:26 cxreg that's what the second commit in the branch is starting
21:27 cxreg look down under "Public interface" on http://github.com/leto/plparrot/blob/spi/plparrot_spi.pir
21:28 cxreg (i shouldnt say useless, but it's nearly impossible to do anything useful with /just/ the SPI_ stuff)
21:33 cxreg dukeleto: the commit message in http://github.com/leto/plparrot/commit/464298f8df3 shows you how to implement a pir function using the higher order interface
21:33 cxreg which is still not that pretty
21:33 cxreg there might be a way for us to OO-ify it
21:34 cxreg i'm not sure what pl/pir does, i havent looked
22:03 davidfetter cxreg, so about SETOF...
22:04 dukeleto yay
22:04 davidfetter cool
22:05 cxreg davidfetter: heh :)
22:05 davidfetter i figure if you can always get ops, there's no need to wear them
22:05 davidfetter cxreg, i was hoping to come up with some impressive one-liner that, for example, returns the first n fibonacci numbers
22:06 cxreg that's easy
22:06 cxreg [\+] 1,1,*+*..$n
22:06 davidfetter cxreg, yes, but it doesn't work yet...or does it? :)
22:07 cxreg in rakudo, or plperl6?
22:07 davidfetter plperl6
22:07 cxreg ah
22:07 cxreg right, no not yet
22:07 cxreg but the oneliner part is easy :-)
22:07 davidfetter heh
22:07 davidfetter i think it'd be [\+] 1, 1, *+* ... @_.shift
22:08 cxreg wait, that's not right
22:08 cxreg the triangle op isnt needed
22:08 cxreg due to the series
22:08 cxreg it's just 1, 1, *+* ... @_.shift
22:09 cxreg man, perl6 lets you do wayyy too much on one line
22:09 cxreg seriously.
22:09 davidfetter heh
22:09 davidfetter i think APL still has it beat
22:10 cxreg yeah true
22:10 cxreg but not by a lot
22:11 * davidfetter hopes the perl6 community has the wisdom not to engage in wankery like perl6 golf
22:11 davidfetter or japh
22:13 davidfetter so i got to thinking. words like my (perl*) and friend (c++) already have meaning
22:13 davidfetter so with just a little imagination, and maybe some grammar whackery, one could say, perl -e 'say "Hello" to my little friend'
22:14 davidfetter and have it do something strange and wonderful
22:14 davidfetter perl6 of course :)
22:18 cxreg davidfetter: http://paste.scsys.co.uk/46723
22:18 cxreg oh crap, it expired
22:18 cxreg sigh
22:18 dukeleto sadface
22:19 dukeleto [+] 1,1,*+* ... $n works in PL/Perl6 now, it is part of the test suite
22:19 dukeleto there is not need to backslash the + in [+]
22:19 cxreg um
22:19 cxreg 2 things
22:19 dukeleto where did y'all see that?
22:19 cxreg first, what you just wrote is a reduction and it will sum the series into a single value
22:19 dukeleto cxreg: yes, that is what I meant to do
22:19 cxreg second, the backslash is significant the way i wrote it, it means "triangle"
22:20 dukeleto cxreg: i am not familiar with the "triangle"
22:20 cxreg it means make a new list out of each calculation
22:20 cxreg er
22:20 dukeleto cxreg: is that described in the synopses?
22:21 cxreg $ perl6 -e '([\+] 1,1,1,1,1).join(", ").say'
22:21 cxreg 1, 2, 3, 4, 5
22:21 cxreg yeah
22:21 cxreg $ perl6 -e '([\+] 1,1,5,1,1).join(", ").say'
22:21 cxreg 1, 2, 7, 8, 9
22:22 cxreg (no truth to the rumors that the perl6 triangle is like the bermuda triangle)
22:23 dukeleto cxreg: i think i get it now
22:24 dukeleto but sometimes i lie to myself to make myself feel better
22:24 cxreg so "each time you apply the operator, add the result to the returned array"
22:24 cxreg basically
22:24 cxreg s/add/push/
22:24 cxreg i'm probably abusing terms badly
22:25 dukeleto cxreg: that makes sense
22:26 dukeleto davidfetter: just about anything is possible with some grammar wankery
22:30 cxreg dukeleto: the rules might change, but you can still golf
22:34 davidfetter dukeleto, true

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