»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend! | Rakudo Star Released!
Set by diakopter on 6 September 2010.
dalek odel: de688fe | jnthn++ | dotnet/compiler/PAST2DNSTCompiler.pm:
[dotnet] Fix code-gen bug that caused problems with && and || and probably other things that cared about what a failed if/unless evaluated to.
00:01
odel: f7efbd5 | jnthn++ | t/nqp/25-class.t:
[t] We now pass 25-class.t.
00:01 dalek left 00:03 dalek joined, ChanServ sets mode: +v dalek 00:08 patspam left 00:09 xinming joined
dalek odel: ea111e5 | jnthn++ | common/NQP/NQPSetting.pm:
[common] Implement .isa in NQPClassHOW.
00:09
odel: 8471528 | jnthn++ | t/nqp/28-subclass.t:
[t] We now pass 28-subclass.t.
tadzik ## Czechy :D 00:12
jnthn
.oO( If you put enough puns in the code, people will review it for you. )
00:14
tadzik how far in the nqp-rx testsuite are you, jnthn? 00:15
jnthn tadzik: In the non-regex bits, fairly far.
tadzik: Significant missing things include for loops and exception handling. 00:16
sorear jnthn: Have you noticed dalek is back?
jnthn sorear: Yes. :-)
sorear: It feels normal here again. :-)
sorear: Thanks for sorting it out.
sorear: It missed some of my commits earlier.
sorear: And then dupe-reported some others. 00:17
Hopefully that was a mid-fix glitch though.
00:17 Raynes left
jnthn sorear: What broke, ooc? 00:18
tadzik jnthn: will you be writing your own regex engine, or using the existing one? 00:19
00:19 Guest57296 joined
jnthn tadzik: The aim is to implement a PAST::Regex compiler and then bootstrap NQP's Regex grammar and actions on top of .Net. 00:20
dalek odel: 0f23784 | jnthn++ | dotnet/compiler/ROADMAP.txt:
[dotnet] ROADMAP updates.
jnthn tadzik: The overall goal being a self-hosting NQP.
Well, the overall goal being Rakudo running there, but... :-)
sorear jnthn: it was a combination of github switching to SSL and diakopter's VPS not having SSL libs 00:21
jnthn sorear: Ah, that'd do it. :)
00:26 patspam joined 00:27 Guest57296 is now known as Raynes, Raynes left, Raynes joined
sorear jnthn: that last dup was me testing a new version of the aggregator 00:28
I just split dalek into two programe 00:29
git://github.com/sorear/dalek-poller.git handles all the getting of data and writes a queue file
dalek is now a tail -f bot
nothing more
00:30 mjk joined 00:32 xabbu42 joined
masonkramer I'd like to overload prefix:<+> for a class, without touching + for other operand types. 00:33
tadzik g'night
masonkramer S13 leads me to believe that multi sub prefix:<+> (Bag $bag) is export { $bag.elems }
ought to work
00:34 mjk left
masonkramer but other types are not falling back to the builtin prefix:<+>, or anyway something is going awry. After that line, something like +8 doesn't work anymore 00:34
rakudo: say +8, class Bag { ... }; multi sub prefix:<+> (Bag $bag) is export { $bag.elems }; say +8; 00:35
p6eval rakudo 142d22: OUTPUT«error:imcc:syntax error, unexpected ')' (')')␤ in file 'EVAL_10' line 67808177␤===SORRY!===␤syntax error ... somewhere␤»
masonkramer say +8; class Bag { ... }; multi sub prefix:<+> (Bag $bag) is export { $bag.elems }; say +8; 00:36
rakudo: say +8; class Bag { ... }; multi sub prefix:<+> (Bag $bag) is export { $bag.elems }; say +8;
p6eval rakudo 142d22: OUTPUT«1␤1␤»
masonkramer that's interesting
on rakudo* interpreter, before the multi sub declaration, +8 is 8 00:37
*on mine
sorear masonkramer: you need to use our multi sub (rakudo bug)
however, the standard prefix:<+> just delegates the the Numeric method 00:38
jnthn Aye, that's probably it.
sorear so define that
jnthn That also. :)
sleep & 00:39
masonkramer Sorry, I have to define another multi sub prefix:<+>?
sorear No 00:40
Just define method Numeric() { YOUR CODE HERE }
In the class
masonkramer that's easy for prefix:<+> 00:41
but I also need to export multi sub infix<=> (Hash, Bag)
so this problem doesn't go away
sorear no 00:42
= isn't a multi sub 00:43
you can't add candidates
masonkramer ahh
that's why it's not in the docs for overloading
sorear in Rakudo, = delegates to the !STORE method on the left hand object 00:44
masonkramer Alright, so if I want to implement that part of Bag, I'll have to work on Hash.!STORE 00:46
Hmm, nope, looks like I just have to declare Bag is EnumMap, neato 00:54
01:05 kjeldahl left 01:06 Chillance left
masonkramer is there an easy way to make a Hash read only? 01:08
01:16 cotto left 01:17 cotto joined 01:24 dnl- joined 01:28 c1sung_ joined, dnl left, snarkyboojum_ joined 01:29 sorear_ joined, ashleyde1 joined, tadzik1 joined, snarkyboojum left, tadzik left, boggytwo left, c1sung left, sorear left, jasonmay left, f00li5h left, ashleydev left, jhuni left, jasonmay_ joined 01:30 f00li5h joined, boggytwo joined, jhuni joined
masonkramer mostly working Bag github.com/masonk/rakudo/commit/6f...c76e7de1d0 01:36
dalek osystem: 04aca36 | Util++ | projects.list:
Add Perl6-Math-Quaternion
01:49
01:55 xabbu42 left 01:59 jferrero left 02:04 jasonmay_ is now known as jasonmay 02:07 patspam left 02:13 whiteknight joined, Axius left 02:20 jhuni left, [Sec] left
masonkramer pir is a lot like perl... 02:23
02:25 patspam joined 02:30 Plastic_Chicken joined 02:38 ggoebel left 02:39 jhuni joined 02:42 jhuni left 02:57 risou joined 03:10 sorear_ is now known as sorear 03:17 whiteknight left
dalek ecza: 8f40628 | sorear++ | / (3 files):
Add testsuite for C# JSON
03:22
03:28 lidden left 03:40 chitragupt joined 04:13 am0c joined 04:29 patspam left
masonkramer can I mutate a class at runtime? 04:48
sorry, let me rephrase that
sorear yes 04:49
masonkramer I have a Hash, %h. I want %h to become a subclass that I define after I've done some stuff with %h
basically, I'm trying to freeze %h so that assignments to its elements dies
something like %h is Hash but { at_key { die } } 04:50
sorear well, at_key is also used for reading elements 04:51
so that's a leetle tricky
masonkramer alright 04:52
Guess I need to go learn PIR enough to understand what at_key is doing 04:53
that's the final thing to implement on Bag 04:54
sorear rakudo: my %h = :a(1), :b(2); role ReadOnlyHash { method at_key($k) { my $r ::= callsame; $r } }; %h does ReadOnlyHash; say %h<a>; %h<a>++; 04:55
p6eval rakudo 142d22: OUTPUT«1␤Cannot modify readonly value␤ in '&infix:<=>' at line 1␤ in main program body at line 7294:CORE.setting␤» 04:56
sorear \o/
masonkramer heh 04:58
cool, but now I've got some different questions
what the heck is ::= ?
05:00 skangas left
TimToady bind and make readonly 05:01
masonkramer Ahh, well, that's concise 05:03
This Bag passes all the tests, plus a few more that I wrote for it 05:08
github.com/masonk/rakudo/commit/26...684a20c520
Though I'm not sure about any&all&none 05:12
they probably should've been delegated to keys, not counts 05:13
TimToady one has to look at the count, of course 05:20
one() that is
05:24 nymacro joined 05:47 JackyJ joined 06:06 REPLeffect left, REPLeffect joined 06:11 justatheory left 06:13 risou_ joined 06:15 risou left 06:21 topeak joined 06:33 am0c left 06:51 justatheory joined, justatheory left 06:53 quietfanatic left 07:16 _twitch joined 07:21 satyavvd joined 07:26 Guest22875 left 07:38 topeak left 07:44 meppl joined 07:48 satyavvd left 07:51 REPLeffect left 07:52 REPLeffect joined 08:09 mberends left 08:11 tri joined 08:20 _kaare joined 08:29 nymacro left 08:35 REPLeffect left 08:36 REPLeffect joined
ingy sorear++ # JSYNC::XS 08:47
08:50 tri left
sorear ingy: What should I call a combined effort to support JSON, JSYNC, and (eventually) YAML? 09:01
ingy sorear: Acmeist ;) 09:03
sorear: in what sense?
sorear One library, one event stream, three presentation layers 09:04
lib/$foo/YamlReader.cs
ingy DataGraph 09:06
?
cxreg WhateverConfig 09:07
ingy Cereal 09:08
cxreg DataBran 09:10
ingy MultiFibreDataBranCerealizer 09:11
sorear Cereal? 09:12
sorear is looking for something shortish and implying I/O in some way... DataGraph fails on both 09:13
09:13 mberends joined
sorear WhateverConfig fails on the first only 09:13
I don't folow the Bran reference
ehllo mberends
_sri AnyData
09:16 risou_ left
_sri Omnivore 09:17
09:27 risou joined 09:34 mavrc joined 09:36 orafu left
mberends ehlo sorear ;) 09:41
09:43 JackyJ left 09:49 mberends left 09:56 xabbu42 joined 09:57 tadzik1 is now known as tadzik 10:05 mberends joined 10:10 kjeldahl joined 10:11 mberends left, mberends joined 10:13 nymacro joined 10:16 FlamingRed joined 10:27 whiteknight joined 10:28 masonkramer left, masonkramer joined 10:33 mberends left, mberends joined
moritz_ oh hai 10:37
10:45 rgrau` joined 10:47 REPLeffect left 10:48 REPLeffect joined
tadzik oh hai 10:50
10:51 mberends left
moritz_ tadzik: yes, I meant "important" 10:53
11:01 nymacro left 11:02 cognominal left 11:03 cognominal joined
moritz_ (backlogging) re page hits for advent posts: these numbers are severly skewed by the slashdotting, which linked to two posts directly 11:06
or three
11:21 dual left, arthur-_ joined
arthur-_ perl6: use MongoDB; 11:23
p6eval pugs: OUTPUT«pugs: *** Unsafe function 'use' called under safe mode␤ at /tmp/JTeh2M5oWo line 1, column 1␤»
..rakudo 142d22: OUTPUT«===SORRY!===␤Unable to find module 'MongoDB' in the @*INC directories.␤(@*INC contains:␤ lib␤ /home/p6eval/.perl6/lib␤ /home/p6eval//p1/lib/parrot/2.9.1-devel/languages/perl6/lib␤ .)␤»
arthur-_ :(
11:26 dual joined
moritz_ arthur-_: even if it existed, it wouldn't be installed on the server that p6eval uses 11:26
arthur-_ oh ok 11:27
perl6: use MongoDB:from<perl5>;
p6eval pugs: OUTPUT«pugs: *** No such subroutine: "&require_MongoDB"␤ at /tmp/KnA9EiglmE line 1, column 1␤»
..rakudo 142d22: OUTPUT«===SORRY!===␤"load_language" couldn't find a compiler module for the language 'perl5'␤»
arthur-_ so not that either
moritz_ there's no reason the perl5 module should be installed on the server either 11:28
arthur-_ any doc somewhere on how to write something like that ( a module for a C lib )
moritz_ arthur-_: github.com/jnthn/zavolaj is a module you can use to wrap C libs 11:29
it comes with a README and some examples
arthur-_ moritz_: thanks
moritz_ arthur-_: and ttjjss.wordpress.com/2010/08/09/so-...-6-module/ about writing Perl 6 modules in general 11:30
tadzik arthur-_: well volunteered! :)
11:32 dual_ joined 11:34 dual left 11:42 MayDaniel joined 11:45 wamba joined 11:46 wamba left, wamba joined 11:48 x3nU joined, spinclad left
arthur-_ tadzik: make on zavolaj fails, I can't go further, so that's not a very usefull volunteering :) 11:52
tadzik arthur-_: care to provide more details? 11:53
arthur-_ tadzik: pastebin.com/wp5k6Um3 11:54
tadzik arthur-_: compiles fine for me (installed via neutro)
arthur-_: what rakudo version are you using?
arthur-_ tadzik: lastest ubuntu's 11:55
-v gives only This is Rakudo Perl 6.
tadzik oh, ubuntu ships Rakudo?
arthur-_ tadzik: or I compiled it and don't remember it ^^ 11:56
tadzik arthur-_: the last rakudo that printed only 'This is Rakudo Perl 6.' is, as far as I remember, _quite_ old
hmm, how to check
arthur-_ ok, so I update it
tadzik that'd be good
iirc one of my fellow Mongers has some PPA with Rakudo 11:57
there's 2010.09 in his repo 11:58
arthur-_ installing from git, I'll see if it works better 11:59
tadzik zavolaj works flawlessly on my gitrakudo
gist.github.com/666090 -- anyone to apply? 12:02
12:04 jlaire left, jlaire joined
moritz_ tadzik: Applying: Simplified Range.pick a bit 12:09
error: patch failed: src/core/Range.pm:75
error: src/core/Range.pm: patch does not apply
tadzik: is that against latest origin/master ?
jnthn o/ 12:11
tadzik :F
moritz_: yeah, it was format-patch master. Lemee check
jnthn: o. 12:12
moritz_ tadzik: even the system patch(1) utility doesn't apply it (and it's usually more tolerant than git's) 12:14
tadzik moritz_: applies flawlessly here wklej.org/id/414259/ (I think)
moritz_ oh, copy&paste killed some whitespace it seems :( 12:16
tadzik ah, probably
moritz_ ("smart" software)-- 12:17
arthur-_ sudo make install installs it to the /tmp/ im in ... :( 12:18
option ?
tadzik did you pass any --prefix to Configure.pl?
or just maintain it in your ~
arthur-_ perl Configure.pl --gen-parrot 12:19
no --prefix
tadzik yeah, then it defaults to the current dir
arthur-_ how do I install it to the whole system ?
--prefix=/ ?
tadzik probably, yes
or --prefix=/usr?
12:20 rvrgs joined
tadzik dunno, when I use git I install it in my /home, when I manage it for CRUX I use Parrot and Rakudo separately 12:20
arthur-_ trying /usr
12:22 rvrgs left
arthur-_ did not work :( 12:29
anyone knows how to install rakudo to / ?
12:36 simon__ joined 12:37 simon__ left 12:38 M_o_C joined 12:40 satyavvd joined
arthur-_ --prefix=/ did not work again 12:43
ok so sudo cp perl6 /usr/bin/perl6, we'll see if that works ... 12:47
make works now !
moritz_ arthur-_: for a proper installation /usr/ you need to configure parrot with the /usr prefix 12:48
to do that, you can run rakudo's Configure.pl with --gen-parrot --gen-parrot-prefix=/usr
arthur-_ doing that now, thanks 12:49
tadzik moritz_: ming applying the patch? :) 12:51
arthur-_ tadzik: mysql-client example working ! 12:54
tadzik: thanks !
12:57 orafu joined
tadzik arthur-_: you're welcome :) 12:59
arthur-_: hacking on something?
arthur-_ tadzik: well I'd like to make a mongodb driver for perl6, and then an ORM from that, but the first part I'm pretty sure is way too hard for me 13:04
looking into it anyway
13:06 bobkare left 13:09 orafu left, orafu joined
arthur-_ arthur@aquarelle /t/zavolaj> perl6 examples/mongodb.p6 13:10
===SORRY!===
The native library 'libmongo' required for 'mongo_connect' could not be located
13:13 PerlJam left 13:14 masak joined
masak hello, #perl6. 13:14
jnthn o/ masak 13:15
arthur-_: Do you actually have a libmongo in your path?
masak jnthn: I just realized that the kind of sleep-hour dislocation I have currently is perfect for a visit at your place. so I don't have much of a reason to fix it in the upcoming week. :) 13:16
arthur-_! \o/
arthur-_ jnthn: I don't even know how to know that ...
jnthn masak: lol :)
arthur-_ I'm not even sure it's named that way
all I have is that : www.mongodb.org/display/DOCS/C+Tutorial 13:17
jnthn arthur-_: Well, if you don't know what it's called, Zavolaj sure don't. :)
arthur-_ and mongodb-dev installed
masak: !!
jnthn oh ouch 13:18
masak arthur-_: long time no see!
jnthn The build line on that page is...not encouraging.
arthur-_ masak: yep, no time for perl6 lately
any work done on web.pm since then ? 13:19
masak arthur-_: stuck at week 19 :/
arthur-_: but I plan to, sometime this month.
13:22 kjeldahl_ joined 13:23 Patterner left 13:25 PerlJam joined
masak looking at Instant in src/core/Temporal.pm yesterday, I realized that at some point, someone will release a module that auto-declares all the operators for some user-defined type that does Real. 13:25
wow, masonkramer++ wrote a Bag! 13:27
13:28 dju left
tadzik what's a Bag? 13:28
masak it's like a Set, but allows multiple copies of elements.
or you could think of it as an unordered Array. 13:29
tadzik mhm
masak or a Hash that maps stuff to Int :)
general question: how to I map/grep on only the values of a hash? that is, I want to keep the keys of the hash intact, but transform or filter its values. 13:30
tadzik %hash.values.grep()? 13:32
colomon are you suggesting you might want to transform (say) "blue" => 42 to just "blue"?
(otherwise I don't understand what filtering values but leaving keys intact means) 13:33
masak ok, I'll give you a concrete example.
13:34 Psyche^ joined, Psyche^ is now known as Patterner
masonkramer oh, masak, I know what you're talking about 13:34
masak I want to go from { Jan => 0, Feb => 1, Mar => 2 } to { Jan => 1, Feb => 2, Mar => 3 }. here, the transformation is (* + 1)
masonkramer I want to do this a lot in perl5
moritz_ %months.values>>++ # maybe? 13:35
colomon at least in theory moritz_'s suggestion should work, I think.
jnthn %months>>++ # doesn't hypers operate ove the values by default in a hash? 13:36
moritz_ jnthn: they probably do
masak I don't want to do it in-place.
colomon jnthn++
moritz_ rakudo: my %month = (Jan => 0, Feb => 1); %month>>++; say %month.perl 13:37
p6eval rakudo 142d22: OUTPUT«{"Jan" => 1, "Feb" => 2}␤»
jnthn masak: oh
moritz_ masak: then copy first :-)
masak also, I chose a simple transformation, but I might want to do something more complicated.
jnthn Then why not %h.pairs.map({ .key => .value + 1 }).hash or so?
colomon %months.kv.map({.key => .value + 1}).hash
damnit, jnthn just slightly faster than me.
masak I believe .pairs is reduntant there. 13:38
moritz_ rakudo: our postfix:<inc>($x) { $x.succ }; say ({Jan => 1, Feb => 2}>>inc).perl
p6eval rakudo 142d22: OUTPUT«===SORRY!===␤Malformed our at line 22, near "postfix:<i"␤»
moritz_ rakudo: our sub postfix:<inc>($x) { $x.succ }; say ({Jan => 1, Feb => 2}>>inc).perl
p6eval rakudo 142d22: OUTPUT«{"Jan" => 2, "Feb" => 3}␤»
moritz_ \o/
masak moritz_++
moritz_ rakudo: say { a => 0, b => 1}>>.succ.perl 13:39
p6eval rakudo 142d22: OUTPUT«Method 'succ' not found for invocant of class 'Pair'␤ in main program body at line 22:/tmp/IUhYo8b9MK␤»
moritz_ EDIFFERENTMAGIC
dalek kudo: 690e370 | tadzik++ | src/core/Range.pm:
Simplified Range.pick a bit

Signed-off-by: Moritz Lenz [email@hidden.address]
colomon rakudo: say { a => 0, b => 1}.hash>>.succ.perl 13:41
p6eval rakudo 142d22: OUTPUT«Method 'hash' not found for invocant of class ''␤ in main program body at line 22:/tmp/bm_0BvSLf8␤»
colomon rakudo: my %a = a => 0, b => 1; say %a>>.succ.perl
p6eval rakudo 142d22: OUTPUT«Method 'succ' not found for invocant of class 'Pair'␤ in main program body at line 22:/tmp/lmtwd3Lw0Y␤» 13:42
moritz_ there's a certain asymmetry
%has>>op is the same as %hash.value>>op
colomon rakudo: my %a = a => 0, b => 1; say (%a >>+>> 1).perl
p6eval rakudo 142d22: OUTPUT«{"a" => 1, "b" => 2}␤»
moritz_ but %hash>>.method is the saem as %hash.pairs>>.method
tadzik moritz_++
colomon I think that's a bug. 13:43
moritz_ hm
colomon tadzik++
moritz_ I kinda think it's current spec
masak me too.
but I agree that it's somewhat skewed.
doesn't really fit together.
moritz_ becuase >>.method is really not a hyper operator, but a method call with some hyper-y semantics
which defaults to .list on its invocant
colomon are you sure that's spec?
tadzik I should get a civilized gravatar 13:44
colomon If I'd been able to figure it out, I'd have changed >>.method to match >>op
moritz_ let's see what TimToady has to say 13:45
colomon (of course, it's possible I was wrong to think that should be done!)
moritz_ a certain symmetry wouldn't be bad
colomon I'm not seeing anything obvious to me in the hyperop specs that separate out >>.method as behaving differently from >>op 13:47
masonkramer philosophical question about pull requests - what level of polish are you considering for rakudo right now? 13:48
E.G., I have a Bag that passes the tests, but it does not have the .WHICH property of immutable objects such that $x.WHICH eqv $y.WHICH when all keys and counts are identical
13:48 vdrab left
colomon sounds like a good start to check in to me. 13:49
masak rakudo: my %h = Jan => 0, Feb => 1, Mar => 2; sub vmap(&c, %h) { hash(%h.keys Z=> map { .&c }, %h.values) }; say (vmap { $_ + 1 }, %h).perl 13:50
p6eval rakudo 142d22: OUTPUT«{"Jan" => 1, "Feb" => 2, "Mar" => 3}␤»
masak this is what I wanted.
moritz_ masonkramer: are bags supposed to be value types? 13:51
masak I was wondering if that was built in. seems not.
moritz_: they're listed under "Immutable types" in S02.
colomon rakudo: my %a = a => 0, b => 1; say (%a >>+>> 1).perl; say %a.perl 13:52
p6eval rakudo 142d22: OUTPUT«{"a" => 1, "b" => 2}␤{"a" => 0, "b" => 1}␤»
masonkramer moritz_: what masak said, "Objects with these types behave like values, i.e. $x === $y is true if and only if their types and contents are identical (that is, if $x.WHICH eqv $y.WHICH)."
I'm going to solve this *particular* problem before I issue a pull request, because I know about it, and how to fix it
however, as a philosophical point, when is it good enough? 13:53
when it has no known bugs?
colomon masonkramer: by that standard probably 50% of the commits in Rakudo wouldn't be made 13:54
moritz_ masonkramer: "no known bugs" is not a requirement
colomon if you're implementing new functionality and it mostly works, that's great.
if you're worried about known bugs, make sure tests for them are in the spectest
moritz_ masonkramer: it shouldn't have bugs that you expect to be heavily relied on, thus misleading the user 13:55
13:57 wamba left, wamba joined, satyavvd left
moritz_ masonkramer: most features first get implemented in a buggy, incomplete way. Then masak++ files ten bug reports about it, and it gradually improves :-) 13:58
masak word.
masonkramer: release early, release often. 13:59
masonkramer: if it's not in Rakudo, I can't bash at it.
masonkramer ok, sounds great 14:00
I'm on board with that plan
14:02 icwiener joined
arthur-_ tadzik: too complicated for me, I give up 14:05
tadzik arthur-_: what's up?
arthur-_ tadzik: too difficult, I can't even get it to load the library 14:06
tadzik arthur-_: show some code with errors
jnthn arthur-_: Are you sure thre even *is* a library?
arthur-_ no, that's why it is that difficult
jnthn arthur-_: The page you linked to showed a C example where they compiled the entire set of C source files for the binding into the example executable.
Zavolaj can't help you if there's no library to load.
Then 14:07
I'm not sure what can... :)
14:07 M_o_C left
jnthn Short of re-implementing the binding from the ground up, or working out how to make a shared library. 14:07
Latter should be possible.
I'm just surprised they didn't already provide one. :S 14:08
arthur-_ again, too complicated for me
I was ready to try if it did not involve any C-stuff
jnthn I'm afraid it's probably going to if there's no library handy already. :(
arthur-_ ok 14:09
tadzik awaits the new NCI branch so he could (maybe) get Loudmouth working
jnthn GET WHAT WORKING?
arthur-_ it says "library" on the c++ page : www.mongodb.org/pages/viewpage.acti...eId=133415
tadzik :)
then I could rewrite my xmpp client in Perl 6, which would be insanely awesome 14:10
(and insanely slow)
arthur-_ jnthn: " You can also specify --sharedclient to build a shared library instead of a statically linked library. " ... do I want this ? 14:14
jnthn arthur-_: That sounds the right kind of thing yes
arthur-_ ok, trying 14:15
14:16 risou left 14:19 risou joined
masonkramer What method does for use on an object to obtain the iterator? 14:24
jnthn for is actually just map 14:25
masak I just got "Can't exponentiate a Duration" in real-world code. could someone explain to me why we have Durations? 14:26
masonkramer jnthn: in that case, what method does map use?
masak: time notation is hard and incredibly common. I think the success and ubiquity of the DateTime project in perl5 proves that there should be one comprehensive, standard way of notating time 14:28
masak I mean, what would we lose from getting rid of the Duration type, and just dealing with Num seconds?
I must confess that's what I thought I had until I got the error message. 14:29
and if I do .x, that's what I'll have.
my point is, I'd prefer not to have to do .x
when I look in src/core/Duration.pm, all I see is a lot of delegation methods, and some methods saying what you can't do. 14:30
that doesn't benefit me as a user in *any* way.
(as far as I can see) 14:31
14:31 bonelifer joined, nymacro joined 14:33 patspam joined
masonkramer If it's anything, it's that it usually doesn't make sense to do most numeric operations on two Durations. E.G., from a physical point of view, 5 seconds * 5 seconds usually doesn't make sense 14:35
masak I don't care. when I did it, it made perfect sense. no offense, but what you just said is so short-sighted it sounds like it came from a Python person. 14:36
I was calculating the standard deviation of a bunch of Durations. that calculation contains an exponantiation.
I know what I'm doing. Rakudo thought it knew better, it didn't.
masak throws the tantrum a bit more 14:37
masonkramer I'm not actually advocating Durations, mind you, I'm just reading the spec and trying to give it a fair shake 14:38
masak *nod*
I just hate when things that could be simple are complicated, and obstruct a simple solution.
I don't currently see what Duration buys us.
masonkramer It makes the program more self-documenting, for one thing. Having a Duration object gives me more info about that object that an equivalent Rat. 14:40
*than an 14:41
masak that is true.
I wasn't declaring Duration objects in my code, though. I was just implicitly (and unwittingly) using one.
14:42 spinclad joined
masonkramer The way you fmt a Duration might be different from the way you fmt a Rat? 14:43
masak not that I'm aware. 14:44
masonkramer But it *could* be
And/or you can conceive of another pretty printer for Durations
something configurable 14:45
something _localizable_
masak meh. 14:46
all this abstraction, and we don't even know exactly what we want it for. colour me unconvinced.
masonkramer I'm not even sure that your failure was to spec 14:47
masak I'm pretty sure it isn't.
masonkramer "Durations allow additive operations with other durations, _and allow any numeric operation with a number as the other argument_"
masak submits rakudobug 14:48
masonkramer So it wouldn't have been an issue for you if it had been to spec
masak masonkramer: thank you.
masonkramer welcome! 14:49
and I'm definitely going to monkey patch Duration.Stringy one day
14:50 satyavvd joined, dual_ left
masak I did 10 Str.trans calls on a 5k piece of text. 14:52
here are the times it took, in seconds: 17.83 18.25 17.64 18.09 18.16 19.69 18.83 21.02 20.10 24.01
notice anything odd?
oh, and avg time 19.36, stddev 3.88 14:53
moritz_ it gets worse over time
masak bingo.
moritz_ memory leak?
which puts additional strain on the GC
masak aye. 14:54
jnthn: hurry up with that .Net thing, will you? :/
jnthn masak: Well, you can have it faster if I totally drop Rakudo-on-Parrot. :/ 14:55
arthur-_ it works !!!!!!
trying to get a mongodb database connection now
jnthn arthur-_++! \o/ 14:56
masak arthur-_++
arthur-_ something like Data::Dumper in perl6 ?
jnthn .perl method :)
arthur-_ Method 'perl' not found for invocant of class 'UnManagedStruct'
jnthn Oh
er, you're not going to be able to dump that :)
arthur-_ oh ok 14:57
jnthn It's just a thingummy holding a pointer to a chunk of memory.
Which it knows nothing about really.
arthur-_ I guess that's my client object
jnthn *nod* 14:58
You can I guess treat it as just opauqe.
You can with the mysql one anyways.
masonkramer how does .map iterate through an object? 15:07
bonelifer moritz_, quick /msg about ilbot? 15:11
15:13 nymacro left
jnthn masonkramer: See List.pm's map method, but it calls an .iterator() method on the iteratee. 15:17
15:17 risou left
jnthn masonkramer: Generally you can implement such a meethod using gather/take. I think that's how Hash does it. 15:17
*method 15:18
tssk...this connection is so laggy today :|
15:19 risou joined, Chillance joined
masonkramer thanks jnthn! 15:20
jnthn takes a walk, bbl
15:24 _twitch left
moritz_ bonelifer: sure 15:25
arthur-_ is there a tool to find all of a shared c++ library's functions ? 15:28
documentation in mongodb is not for humans
tadzik you could examine the .h file 15:30
15:32 nexusone joined 15:38 bonelifer left
masak I made a modification to .trans 15:43
here are the new runtimes: 2.26 2.15 2.82 3.12 2.88 3.21 3.30 2.44 2.03 2.76
avg: 2.70
stddev: 0.45
all the old spectests pass.
moritz_ \o/ 15:44
masonkramer masak++
masak preparing patch. 15:45
I wonder how many other src/core methods could benefit from this kind of scrutiny. 15:47
moritz_ most.
masak the algorithm that .trans employed was really embarassingly slow. the one I substituted was the first I thought of.
arthur-_ pastebin.com/wia2uYWU : connect always returns -1 15:48
I don't get how I'm supposed to use the functions in the .h files
there are several connect()
15:49 colomon left
arthur-_ dbclient.h has 4 connect() functions :( 15:50
api.mongodb.org/cplusplus/1.7.0-pre...ource.html 15:51
15:51 mavrc left
arthur-_ needs to learn more c++ 15:52
masonkramer rakudo: say <a b c>.flat.WHAT; say <a b c>.flat.iterator.WHAT; 15:53
p6eval rakudo 690e37: OUTPUT«List()␤»
15:53 mavrc joined 15:54 mavrc left
masonkramer rakudo: say List.new(<a b c>).iterator.WHAT 15:54
p6eval rakudo 690e37: ( no output )
masonkramer that's interesting. On my r*, the third statement prints ListIter() 15:55
moritz_ which R*?
masonkramer so does the second, actually
15:55 mavrc joined
masonkramer 09 15:56
moritz_ star: say List.new(<a b c>).iterator.WHAT
p6eval star 2010.09: ( no output )
masonkramer I swear it does
Oh. 15:57
No, it doesn't. It null PMC's. Without the say, the return value is a ListIter. With say, null PMC
star: my $s = <a b c>.flat.iterator.WHAT; say $s; say $s.WHAT 16:00
p6eval star 2010.09: ( no output )
16:03 mberends joined
masak mberends! \o/ 16:04
16:05 timbunce joined
masak timbunce! \o/ 16:06
16:06 xinming left 16:07 lidden joined
jnthn masak: yay for the speedup :) 16:07
16:07 mberends left 16:08 mberends joined
arnsholt arthur-_: You need to find a reference to the C bindings for MongoDB (there should be some) 16:08
The reason is that C++ function names are mangled, because function names need to be unique in the library (see en.wikipedia.org/wiki/Name_mangling...in_C.2B.2B for more) 16:09
arthur-_ arnsholt: so I need to work with C function names, not C++ ?
the only library I could find that compiles as a shared library is the C++ one 16:10
masonkramer I see .Stringy in S13, but nothing has it defined - perlcabal.org/syn/S13.html#Fallbacks
arthur-_ you say I need a C library that compiles as a shared library arnsholt ?
they don't seem to have that
just .h files you are supposed to use in your C code, I think 16:11
arthur-_ understands less that 20% of what he says
arnsholt Well, if there are C header files, there should be a C library somewhere as well
masonkramer arthur-_: I sympathize
rakudo: say (List.new(<a>).iterator.WHAT~""); 16:12
p6eval rakudo 690e37: OUTPUT«ListIter()␤»
masonkramer rakudo: say (List.new(<a>).iterator.WHAT);
p6eval rakudo 690e37: ( no output )
arthur-_ arnsholt: the C++ library is : /usr/local/lib64/libmongoclient.so , does that give you any clue what the C library is ? 16:13
arnsholt Maybe. I'm digging around a bit in the docs
arthur-_ thanks a lot
16:13 mberends left
masonkramer type objects can't stringify? is that right? 16:14
moritz_ rakudo: class A { }; say A
p6eval rakudo 690e37: OUTPUT«A()␤»
masonkramer well, is what I just posted correct?
moritz_ masonkramer: there's a known bug that in some situations they can't stringify
16:15 satyavvd left
arthur-_ arnsholt: the doc I have on C is : www.mongodb.org/display/DOCS/C+Language+Center 16:15
arnsholt Yeah, I just found that
arthur-_ arnsholt: "$ scons # this will produce libbson.a and libmongoc.a" , this is what I need no ?
16:16 cls_bsd left
moritz_ looks like a static lib to me 16:16
arthur-_ oh
arnsholt Yeah
moritz_ .a is static, .so dynamic
arthur-_ ok
masonkramer moritz_: thanks, I was going a bit crazy there. I'm still not sure which bugs are BCAK and which aren't 16:17
arnsholt There's a recent commit message that mentions support for shared libs, but I don't know how well it would work
They say it's alpha, so it might be a bit fiddly
arthur-_ arnsholt: they say how to make the .so file ? 16:18
arnsholt But if you got that built and installed as a shared lib, it whould be pretty straightforward
See github.com/mongodb/mongo-c-driver
The commit messages on .gitignore and SConstruct say that the changes were for adding support for shared lib, but that's all I know
arthur-_ gcc -o libmongoc.so -shared src/md5.os src/mongo.os src/bson.os src/numbers.os -L/opt/local/lib
arnsholt Not that simple, AFAIK 16:19
arthur-_ ok I have a libmongoc.so , let's try it 16:20
that is cool, I understand C way better 16:21
arnsholt C is a lot easier to understand =)
masonkramer Why does C<for> call .pairs on an object? Shouldn't it be .iterator? 16:25
arthur-_ arthur@aquarelle /t/zavolaj> perl6 examples/mongodb.p6
3
fish: Tâche 1, 'perl6 examples/mongodb.p6 ' terminée par le signal SIGSEGV (Erreur de frontière d'adresse)
masonkramer oh, I see
arthur-_ never been so happy to see SIGSEGV : something is happening !
masonkramer It's EnumMap calling .pairs.iterator 16:26
16:28 kanishka joined 16:30 molaf joined
masak oh. a real run of the spectests reveals that I mucked up the longest-token property. I think I can fix that easily. 16:32
16:35 xinming joined
arthur-_ wooo ! 17:34:36 connection accepted from 127.0.0.1:51556 #3 16:35
connection !
16:39 fhelmberger joined, kanishka left
arthur-_ jnthn, arnsholt, tadzik , know how I make and pass a struct-thing to a function defined with NativeCall ? 16:41
if I pass an empty object it does not connect, If I pass a pir::null__P(), it connects ( woot ! ) but then fails with a Null PMC access in isa_pmc() error 16:42
function I'm trying to interface : github.com/mongodb/mongo-c-driver/...rc/mongo.c line 140 16:43
16:43 kanishka joined
arthur-_ said otherwise : I need to convert this C : mongo_connection_options opts[1]; into a Perl6+NativeCall 16:49
then feed it to mongo_connect
16:50 kanishka left
arthur-_ but all NativeCall code I can find only passes to functions OpaquePointers returned by function calls, or simple things like strings 16:50
moritz_ you'll need OpaquePointers for that too 16:51
16:52 REPLeffect left, REPLeffect joined
arthur-_ moritz_: yes that's what I want to do, create an OpaquePointer, set some things in it ( hostname, port ) , then feed it to connect, but I don't find in the examples how to do that 16:54
masonkramer do we want C<for $bag -> $i { ... } > to iterate over its keys? If not - how do we want to unroll Bags?
arthur-_ all the source says is : class OpaquePointer { } 16:55
16:55 kanishka joined
arthur-_ not much 16:55
16:57 REPLeffect left
jnthn arthur-_: That's the point 16:58
It's opaque
You're meant to obtain one from somewhere
If you need to create and fill a struct "from scratch" rather than getting one back from a C function, there's not a way to do that yet in Zavolaj. :( 16:59
arthur-_ oh
jnthn The MySQL API gets awya wiht needing this though. It has something that makes and returns the connection object 17:00
But I don't see anything in the API here that does that. :S
17:00 REPLeffect joined 17:01 toebu joined
masak rakudo: my %h; say %h.min: *.value 17:01
p6eval rakudo 690e37: OUTPUT«Inf␤»
arthur-_ jnthn: ok, so I need to add a function to the lib
masak this just bit me. I expected to get a Pair out, because I didn't consider the case where the hash is empty.
not sure it's a bug, though.
just something to watch out for.
arthur-_ jnthn: for now I could get away with the default options, but for that I need to pass something that will make option false in if ( options ){ ( github.com/mongodb/mongo-c-driver/...rc/mongo.c line 146 ) 17:02
jnthn: but I don't find how
17:03 toebu left
arthur-_ passing an empty OpaquePointer makes it not connect 17:03
jnthn arthur-_: Try passing a pir::null__P()
arthur-_ jnthn: gives me an error
( 1sec )
moritz_ write another C function that returns such a struct from primitive C type
arthur-_ Null PMC access in isa_pmc() 17:04
in '&infix:<=>' at line 1
in main program body at line 11:examples/mongodb.p6
jnthn Hm. 17:05
17:05 jferrero joined
arthur-_ moritz_: that is what I will do eventually, but just to be able to go further today without writing C, I want to try having it using it's default options 17:05
( and passing pir::null__P() like in the mysql driver gives an error ) 17:06
jnthn Yeah, I was gonna say, I'm sure it works in the mysql one...
17:08 M_o_C joined 17:09 icwiener left
arthur-_ jnthn: pastebin.com/2GGLcZeY , I'm doing it like in the mysql one 17:10
17:15 fhelmberger left, risou_ joined
arthur-_ jnthn: I see the connection in the mongodb logs, so the C-part seems to work ... the problem is probably after the call to the C lib, but the NativeCall.pm6 file makes no sense to me 17:16
17:16 risou left
arthur-_ ( maybe ) the error occurs at line 1106 in NativeCall.pir : $P384 = "&infix:<=>"($P377, $P383) 17:20
does not make any sense to me
or line 2689 17:21
17:24 REPLeffect left 17:25 timbunce left 17:26 REPLeffect joined 17:27 FlamingRed left
masonkramer after making head rakudo, when I run perl6: Incompatible versions of `perl6_ops' oplib. Found 2.8.0 but loaded 2.9.1 17:27
17:28 wamba left, ggoebel joined
masonkramer nevermind 17:28
17:31 REPLeffect left, kanishka left 17:32 timbunce joined
arthur-_ this: pastebin.com/K71cZGtf produces a "Type check failed for assignment" error, I'm guessing it is because I don't return a pointer or something, how do I get a pointer for something in C ? 17:34
moritz_ but wouldn't you get an "type check failed in return" if it were the return line? 17:38
and don't return pointers to local variables in subroutines, they are on stack and get re-used when the function exits 17:39
arthur-_ I get a Type check failed for assignment for this line : my OpaquePointer $options = make_mongo_connection_options('localhost', 27017);
so it does not return a OpaquePointer
but I just noticed compiling the lib gives warnings :
src/mongo.c: In function ‘make_mongo_connection_options’:
src/mongo.c:36: warning: return from incompatible pointer type
src/mongo.c:36: warning: function returns address of local variable
moritz_ right, that's what I meant 17:40
arthur-_ moritz_: so if I don't return a pointer to a local variable, how do I do in C a function that returns a pointer to a mongo_connection_options struct ?
moritz_ arthur-_: you use malloc() to allocate a new struct 17:41
arthur-_ urk !
this is getting more and more complicated
moritz_: how would you do it ? ^^ 17:42
moritz_ yes, urk!. It's C, of course it's irksome
I'd do it with malloc
arthur-_ can you help a little by showing how you would rewrite pastebin.com/K71cZGtf ?
( if it's not too much code ) 17:43
arthur-_ goes searching doc on malloc
arthur-_ fears he will have to worry about free() 17:44
moritz_ mongo_connection_options *opts = (*mongo_connection_options) malloc(sizeof mongo_connection_options);
rest should remain the same 17:45
arthur-_ ok I try it, thanks
moritz_ and after you stop using it, you need to free() the option (but not in the function, but in its caller)
arthur-_ ok
moritz_ though my C is a bit rusty at the moment
17:46 REPLeffect joined
arthur-_ moritz_: src/mongo.c:33: error: expected expression before ‘mongo_connection_options’ 17:48
tadzik duh, I thought there is silence on the channel, and it was my ssh session which was frozen
moritz_ uhm, did I confuse the casting syntax with C++ again? 17:49
arthur-_ sizeof feeds (), that's all I was able to see and correct 17:50
the rest I don't know
17:50 justatheory joined
arthur-_ s/feeds/needs/ 17:50
17:52 kanishka joined, REPLeffect left
arthur-_ mongo_connection_options * make_mongo_connection_options( char host[255], int port ){ 17:54
mongo_connection_options *opts = malloc(sizeof(mongo_connection_options));
strcpy( opts->host , host );
opts->port = port;
return opts;
no compilation error, but perl6 typecheck error
17:54 timbunce left
moritz_ so what's the exact error message? 17:55
17:55 toebu joined, toebu left
arthur-_ arthur@aquarelle /t/zavolaj> perl6 examples/mongodb.p6 17:56
Type check failed for assignment
in '&infix:<=>' at line 1
in main program body at line 14:examples/mongodb.p6
line 14 is : my OpaquePointer $options = make_mongo_connection_options('localhost', 27017);
tadzik arthur-_: the new NCI may land in a few days, that'd probably open a way to create/introspect structs, and stuff 17:57
moritz_ arthur-_: if you remove the type constraint from the variable, and in the line after say $options.WHAT; what's the result? 17:58
arthur-_ moritz_: I look 17:59
tadzik: nice !
tadzik arthur-_: actually, it's only not merge because no one wants to fight with svn merge while git is so close 18:00
arthur-_ Method 'WHAT' not found for invocant of class 'UnManagedStruct'
tadzik heh
moritz_ there you go, you get an UnManagedStruct and not an OpaquePointer
arthur-_ oh
tadzik "answer 4 not available for 2 + 2" 18:01
arthur-_ oh so I just type it to UnManagedStruct
trying
In "my" declaration, typename UnManagedStruct must be predeclared (or marked as declarative with :: prefix) at line 14, near " $options " 18:02
moritz_ just omit the type constraint for now
arthur-_ moritz_: yes, worked !
thanks !
oh no it does not connect 18:04
maybe because I pass $options to mongo_connect, and mongo_connect wants Opaque : sub mongo_connect( OpaquePointer $client, OpaquePointer $options)
not good 18:05
but sub make_mongo_connection_options( Str $host, Int $port ) returns OpaquePointer 18:07
so why does it give me a UnManagedStruct
18:07 REPLeffect joined
moritz_ no idea 18:08
arthur-_ maybe I won't have a perl6 mongodb driver today after all ... 18:09
18:09 meppl left
arthur-_ tadzik: you thing the new NCI will fix this ? 18:10
18:10 Chillance left
arthur-_ ( or help me understand what I do wrong ) 18:11
18:11 mberends joined
tadzik arthur-_: the new NCI would enable you to peek inside structs, modify them, and stuff (iirc) 18:12
oh wait, I'm wrong
forget I said anything
arthur-_ ouch
forgot
tadzik so the only way to introspect structs is probably to write a C library for it, Zavolaj-friendly 18:14
with getters and setters
18:15 risou_ left
moritz_ or write a function that pack into / unpack from structs 18:15
jnthn Zavolaj needs to be extended at some point to support structs.
It's on the todo list once the new NCI lands.
It's also non-trivial to write. :)
tadzik jnthn: does this rely on the new NCI? 18:16
arthur-_ jnthn: do it now ^^ 18:18
18:18 meraxes left
tadzik jnthn: what skills does that require? 18:18
yay, I can compile Rakudo on feather \o/ 18:19
that opens a way to smoketesting again
plobsing what about different representational polymorphism? wasn't that supposed to be the 6-ish way of handling structs?
s/different// 18:20
moritz_ plobsing: jnthn is working on it (though not primarily for NCI purposes), but it's going to take some time
18:21 REPLeffect left
dalek kudo: 2c66f9a | masak++ | src/core/Cool-str.pm:
[src/core/Cool-str.pm] 500% speedup of .trans

Keep a hash with the next index of each substring to be substituted, and then pick the smallest one through each iteration. (Or, more informally, "skip the boring parts".) This makes the number of iterations through the main loop proportional to the number of substitutions actually made.
18:22
arthur-_ so nobody knows why it returns a UnManagedStruct instead of a OpaquePointer ?
18:22 REPLeffect joined
jnthn tadzik: Mostly, understanding meta-model bits enough to be able to pull data out of objects and construct Parrot unmanagedstructs and map back again later 18:23
tadzik: It's more fiddly than anything, and I suspect hard to debug when you hit problems.
tadzik: Feel free to have a try. :-)
arthur-_: Nothing ever returns OpaquePointer, fwiw. It's just a place-holder name.
tadzik hmm, I'd have to hit deeper into Parrot, and I still have no opportunity 18:24
arthur-_ jnthn: my brain exploded
seems writing a mongodb driver is too hard for me 18:25
tadzik maybe the NCI stuff is a good topic for Advent Calendar then? 18:27
moritz_ or maybe not :/
arthur-_ wants lots of doc on NCI 18:28
masak blog post! strangelyconsistent.org/blog/novemb...ck-at-this
18:28 REPLeffect left 18:29 toebu joined 18:30 meraxes joined 18:31 REPLeffect joined
arthur-_ ok I give me 2 more hours to get this working 18:31
jnthn: the code if you have time to help : pastebin.com/Z4vZ2qtw 18:34
18:39 meppl joined
arthur-_ is there a perl6-help mailing list or something ? 18:45
moritz_ there's [email@hidden.address]
arthur-_ ok
writing there, maybe I can get some help 18:46
masak yes! use it! it sees way too little traffic these days.
tadzik++ moritz_++ # using it the other day
jnthn dinner & 18:49
masak ooh! good idea!
tadzik on 8 PM? 18:50
masak is that unusual? 18:51
18:51 toebu left
tadzik I'm usually too hungry before 8 PM to resist with dinner so long 18:51
masak hey! Haskell 2010 (formerly known as Haskell Prime) has been released!? www.haskell.org/onlinereport/haskell2010/
tadzik: me too. but I got up late today.
tadzik masak: I got up at like 1 PM 18:53
masak :)
tadzik is it something like R* for Haskellers?
moritz_ tadzik: it's a document, not a distribution 18:54
masak tadzik: Haskell Prime has been a long time coming.
it's had issues similar to Perl 6, in that it tries to improve on something already successful. 18:55
18:55 toebu joined
moritz_ how much of it does GHC implement? 18:55
masak no idea.
18:55 kjeldahl_ left 19:01 toebu left
masak some people on this channel might enjoy MJD's talk about git: perl.plover.com/yak/git/ 19:07
19:08 kanishka left
masak om nom nom & 19:08
19:08 masak left 19:13 patspam left 19:14 MayDaniel left 19:16 REPLeffect left 19:19 REPLeffect joined 19:21 kjeldahl left 19:25 REPLeffect left 19:31 kanishka joined 19:34 tri joined 19:36 zorgnax joined 19:38 REPLeffect joined 19:46 REPLeffect left 19:47 REPLeffect joined, kjeldahl joined 19:55 zorgnax left
masonkramer did my Bag / Set ideas letter make it to the mailing list? 20:01
diakopter I think so 20:09
arthur-_ and my Problem with NativeCall one ? 20:16
diakopter to which list was that one sent 20:20
arthur-_ perl6-users 20:22
found it ! ( at least the first part, the problem with isa_pmc() ) , well at least fixed it by removing returns OpaquePointer
araujo pastie.org/1276960 20:28
20:32 REPLeffect left 20:33 REPLeffect joined
arthur-_ jnthn: any Idea what could give me this error ? No NCI thunk available for signature 'iptt' 20:39
while doing something like that : sub mongo_count( OpaquePointer $client, Str $db, Str $ns, Str $a ) returns Int is native('libmongoc') { ... }
20:41 timbunce joined, timbunce left 20:45 nexusone left 20:50 Onepamopa joined 20:52 Onepamopa left 20:58 patspam joined, patspam left 21:08 nexusone joined
arthur-_ plobsing: how do I use parrot-libjit-fb in Perl6 ? ( if I can ) 21:16
moritz_ araujo: what is 'no'? 21:17
21:23 lichtkind joined
plobsing arthur-_: all you have to do is load the library. then it takes over the NCI using the same interface. 21:25
so it should work transparently from under zavolaj 21:26
arthur-_ use NativeCall; ?
21:27 rgrau` left
plobsing you'll need to also loadlib it. probably "pir::loadlib__s('libjit_fb')" or something like that 21:27
arthur-_ I try 21:28
===SORRY!===
rtype not set
plobsing rtype?
arthur-_ plobsing: don't know .... 21:29
moritz_ arthur-_: it means that you tried to assign something which is read-only
arthur-_ moritz_: oh ok
not sure where, I just added the loadlib thing 21:30
plobsing: code is here : pastebin.com/FTXfDtWV
sorear (Out of curiousity, why aren't you using Perl 5?) 21:33
21:33 wallberg joined
arthur-_ sorear: ? 21:33
plobsing arthur-_: submitted update to code that I think should work 21:36
arthur-_ plobsing: update ? 21:37
plobsing to your pastebin 21:38
basically s/__s/__ps/
arthur-_ plobsing: I'm not sure where I can see it ... I try s/__s/__ps/ 21:39
plobsing: no bug, but same problem as without libjit-fb :
No NCI thunk available for signature 'ipttp'
araujo moritz_, false 21:40
arthur-_ ( I think I understood that libjit-fb was supposed to avoid creating that problem, but I'm not sure )
moritz_ perlgeek.de/article/discovering-met...t-protocol # any feedback? 21:41
plobsing arthur-_: that is precicely the problem libjit-fb as well as gsoc_nci are trying to address
arthur-_ plobsing: so why do I still have the problem, I do something wrong ? 21:42
plobsing I think somehow it is trying to build a thunk *before* the dynamic framebuilder is loaded 21:43
I'm setting up the required infrastructure (mongo install, r* install) to be able to test further
arthur-_ thanks a lot
21:46 masak joined
mkramer moritz_: just the title is exciting to me! Awesome topic. Reading it now 21:46
masak o/
arthur-_ ( for mongodb I try to use the C lib : github.com/mongodb/mongo-c-driver ) 21:47
moritz_ \o masak
masak: I just pasted perlgeek.de/article/discovering-met...t-protocol in the backlog, and would welcome your feedback
diakopter moritz_++ 21:48
masak ah, so that's the exciting title :)
masak reads
21:49 tri left
lue happy end of daylight savings! (in the US at least) 21:49
diakopter in the US *except* Hawaii :) 21:50
(and other exceptions in the USA)
mkramer I hope you will disect the final code snippet piece by piece. Why is the method .^add_method named with a ^ in front? what is ^compose? Where can I learn more about ClassHOW? 21:51
moritz_ mkramer: thanks; I meant to explain ^, but forgot it 21:52
lue Would the [% %] I read about in the Web.pm README be the way to embed P6 in webpages like you can in PHP? 21:54
flussence s/in PHP/in Template Toolkit/ 21:55
;)
lue So it's not like how you embed PHP in .php files? 21:56
masak moritz_: nice post.
moritz_: I have no comments on content, except that I found the semicolon at the end of method greet misplaced.
moritz_ revmoes
flussence I'll admit I haven't actually *looked* at Web.pm yet, but the difference between PHP and TT is that TT has its own template code unless you explicitly ask for perl via a [%PERL%] block. 21:59
at this stage of development, Web.pm probably does the PHP thing, yeah :/ 22:00
22:00 wallberg left
flussence (or not, considering how easy it is to write a template language in p6 :) 22:01
moritz_ mkramer, masak: incorporated your feedback, thanks
mkramer: I don't actually know where to read more about ClassHOW, because we don't have a proper API spec 22:02
22:02 toebu joined
lue Because I would like to start experimenting with using P6 on the web so that I can build a site when I can host it somewhere. 22:02
mkramer Anyway, nifty post, thanks 22:03
22:05 wallberg joined, wallberg left
lue maak: I just can't get test 29..46 of compiler.t compiling, so I think its somewhat safe to say what I add doesn't break those tests 22:08
sorry, masak (stupid keyboard) 22:09
toebu a little problem :-) a program about mice: start with one female mouse ... after 10 weeks it bears 6 kids ... 3 female, 3 male ... after that it bears a new set every six weeks ... all females are fertile ... mice do not die ... how many mice do you have after x weeks ... find a cool way two program this in perl6 ... 22:10
Tene toebu: how many weeks before females are fertile, or are they fertile at birth? 22:13
moritz_ toebu: 1) find a solution 2) make it cool (while keeping it correct)
flussence looks like a straightforward algebra thing to me... 22:14
moritz_ flussence: the 10 weeks vs. 6 weeks thing makes it a bit harder than fibonacci
22:15 nexusone left
moritz_ if that wasn't teh case, female poluation would be 1, { 3 * $_ + 1 } ... * 22:15
masak masonkramer++ # p6l email
moritz_ and @male := @female.map: 2 * * - 1 22:16
masak masonkramer: I may not agree with all of your suggestions, but I agree very much with the need to explore that spec space.
moritz_ -> sleep
masak lue: did you get those tests to pass on a fresh checkout of Yapsi?
lue checkout on the whole thing? 22:17
masak yes.
because if they fail on an unmodified Yapsi, then we have a problem.
but I don't believe they do, since they work here.
22:18 Raynes left
toebu Tene: females get fertile after 4 weeks ... and have their first kids after another 6 ... hence 10 weeks for the first generation 22:19
moritz_ got the correct solution already ... (I need 11 integers for it ...) but I wonder how others would solve this 22:20
lue git stash ; git checkout [commands] # right?
22:20 Guest22875 joined
masak lue: `git stash` should give you a clean index. 22:21
and if you haven't made any local commits, that's the same as getting a clean checkout. 22:22
but... make sure you don't have old .pir files anywhere.
lue WIP on master: cce1b5a [doc/announce/2010.11] small fix
toebu after 52 weeks there are 4423 mice
lue is that what my stash should look like? 22:23
arthur-_ plobsing: any progress ?
masak lue: yes, that's the latest commit on github.
masak bumps the SIC version 22:24
lue where would these old .pir files be? 22:25
masak in lib/ or blib/
plobsing arthur-_: mongodb build giving me grief
22:25 risou joined
lue The only thing is Yapsi.pir in blib/lib 22:25
22:25 kjeldahl left
arthur-_ plobsing: oh ok, tell me if I can help 22:26
masak lue: nuke it. 22:27
dalek psi: 74884bf | masak++ | lib/Yapsi.pm:
[Yapsi] bumped SIC version

Between releases, the SIC version is always the version number of the upcoming release.
22:28
22:28 masonkramer left, masonkramer joined
lue initiating missile... 22:28
plobsing arthur-_: problem is likely on my end. I was trying to run multiple builds simultaneously. retrying unloaded. 22:30
lue aah! Should I proceed to nuking the entire repo? [then re-clone it of course] 22:31
masak lue: no, why? 22:32
lue: do the tests pass now?
lue no :( 22:33
22:33 kensanata joined
masak then yes, maybe nuke the repo and do a clean check-out. 22:33
22:33 Plastic_Chicken left
masak now would be the time to rescue your changes, though. 22:33
lue I just looked at t/compiler.t 22:34
...
29-46 are meant to say "will not compile", aren't they? [hand approaches forehead...]
masak lue, a test passes if it says "ok". are we agreed on this? 22:35
lue yes. [sorry for wasting time]
masak I take your reply as meaning that we are agreed, but that you learned it very recently. :) 22:36
does that mean that your patch actually passes all the test? that's good news, then.
lue I ignored the ok's by mistake, and when I saw "not"s, I immediately went into "O NOES WONT PASS!" mode 22:38
22:38 mavrc left
lue
.oO(Please wait while at least a couple new tests are written for the patch.)
22:39
masak I don't meet a lot of people in my trade who are unfamiliar with TAP. had I not assumed you were familiar with it, I might have realized sooner what was amiss.
sorear good * #perl6 22:40
masak sorear: \o
lue Just so you know, I'm eligible to apply for Google Code-In :) 22:41
22:46 M_o_C left 22:49 _kaare left
masak -> zzz 22:50
22:50 masak left 22:59 rgrau_ joined 23:04 arnsholt left 23:08 toebu left 23:15 Grrrr left
lue phenny: tell masak Here's your Yapsi patch: gist.github.com/667105 23:17
phenny lue: I'll pass that on when masak is around.
23:19 meppl left 23:20 Grrrr joined 23:29 awwaiid_ joined
awwaiid_ p6eval: "README" ~~ :e 23:29
er
rakudo: "README" ~~ :e 23:30
p6eval rakudo 2c66f9: OUTPUT«Method 'e' not found for invocant of class 'Str'␤ in 'Enum::ACCEPTS' at line 5246:CORE.setting␤ in main program body at line 10:/tmp/_rex9Endx9␤»
awwaiid_ so, does ~~ :e not work because it isn't done, or because that's not how it works anymore? :)
As an excercise, I'm building me a wiki, you see, and am sticking pages into their own files. So I wanna see if a page exists. 23:31
sorear rakudo: "README".IO ~~ :e 23:32
p6eval rakudo 2c66f9: ( no output )
sorear rakudo: say "README".IO ~~ :e
p6eval rakudo 2c66f9: OUTPUT«Bool::True␤»
sorear there's no current spec for this stuff
23:33 toebu joined
awwaiid_ ok, thanks 23:33
arthur-_ plobsing: going to .zZzZ , please tell me if you find something, good luck ! 23:34
plobsing will do
sorear TimToady: ping 23:35
awwaiid_ sorear: I've added a small note to the wiki tablet at www.perlfoundation.org/perl6/index....letest_ops 23:36
sorear TimToady: I'd like some clarification on how S05:1225 is supposed to work 23:38
if you have something like token foo($str) { $str }; / [ foo | <foo("foo" ~ "bar")> ] /, does the LTM engine evaluate the expression? 23:39
23:41 toebu left
sorear awwaiid_: $file.:x is wrong in any event 23:41
syntactically, even 23:42
awwaiid_ unrelatedly, %*ENV doesn't like me much -- I can get individual values out, but %*ENV.perl or %*ENV.keys gets mad. 23:44
perl6: say %*ENV.keys.perl
p6eval rakudo 2c66f9: OUTPUT«Method 'key' not found for invocant of class 'String'␤ in <anon> at line 5017:CORE.setting␤ in 'Any::join' at line 1␤ in 'List::perl' at line 2675:CORE.setting␤ in main program body at line 22:/tmp/bvykKgjKAI␤»
..pugs: OUTPUT«*** Can't modify constant item: VUndef␤ at /tmp/zRa6Cu1c9Q line 1, column 5 - line 2, column 1␤ /tmp/zRa6Cu1c9Q line 1, column 5 - line 2, column 1␤»
sorear %*ENV in Rakudo is not a real hash 23:47
it's a ugly half-implemented wrapper over the Parrot unique EnvHash object
23:51 toebu[s9] joined 23:56 PacoLinux left