»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
lue Added pragmas to that gist. 00:00
lue plans a blog post surrounding that gist some time. 00:00
jnthn FROGGS: Bug exists in socketops.c too 00:01
FROGGS ahh, good that you checked that 00:02
jnthn Searching for u.handle->data shows 'em up.
TimToady: Well, we don't know that this is *the* bug, but since it extends the lifetime of standard handles, it correlates well. 00:03
FROGGS it is at least the thing that made me crazy for two or three days now 00:06
jnthn FROGGS: OK. Do you plan to work on it at some point? 00:10
Or should I put it on my todo list?
FROGGS jnthn: ahh, I thought you are fixing it atm...
jnthn Ah, no... :) 00:11
I already gave up writing code for the day. :)
FROGGS I can do that I think... just need to figure out what to do :o)
jnthn Well, the "easy" fix is to just hold the body structure a level of indirection off...
Then just point to it from the movable thing.
FROGGS and the "proper" fix? 00:12
jnthn Might be to look at exactly why the code is stashing the pointer into the body, and see if there's a better design.
FROGGS k, I'll do that first 00:13
jnthn May turn out that the extra level of indirection is still the best way anyway.
I can't tell without diving deeper into it
FROGGS ahh, it is used to access the body in a callback 00:13
tty_on_read
jnthn I guessed that much. It's more whey it needs it :) 00:15
jnthn ...I curd have typed that better... 00:15
TimToady well, that's just tuffet 00:16
[Coke] lue: "numeral values" -> "numeric values" ? 00:19
lue [Coke]: got it. 00:20
FROGGS jnthn: if that is our bug, then should commenting out the offending lines change its behaviour, no? 00:30
jnthn FROGGS: Depends which offenders you mean... 00:31
FROGGS all six occurrences of body->u.handle->data = body
jnthn But then anything that relies on it being set will crash I guess... 00:32
FROGGS that is what I had expected, but: 00:33
--vmlibs=dynext/libperl6_ops_moar.so=Rakudo_ops_init src/gen/m-BOOTSTRAP.nqp
Heap corruption detected: pointer 0x2aeba49ae650 to past fromspace
FROGGS and I reconfigured and built nqp and rakudo 00:34
jnthn hm 00:34
ingy jnthn: I got a new eye today 00:35
jnthn ingy: A...new eye? 00:36
jnthn needs sleep... 00:37
'night
TimToady o/
lue ingy: look at you, you made jnthn think he's crazy! :) 00:38
ingy cataract surgery
jnthn: ^
AND… I just switched to weechat 00:39
big day
lue
.oO(It is surprisingly and unbelievably difficult to find a website that'll print the current NTP time on its page.)
00:46
diakopter FROGGS: I'm curious how much overhead that heap corruption check creates... ;) 00:48
(hopefully we can remove it someday)
TimToady obviously not yet :) 00:49
lue: if they did that, you'd see how much they're cheating with caching :) 00:51
FROGGS ohh, that is interesting
the exploding object is a MVMStaticFrame
TimToady well, obviously you need to make it dynamic then :P 00:52
FROGGS dynamite, even
lue TimToady: you'd think at least one page would think to display it or something. It's generally hard to see if your ntp stuff is actually running. 00:57
lue Looking at heredocs, "A null terminating delimiter..." Example of a null-terminating delimiter please? 01:05
TimToady a blank line, basically
lue so q:to//; ? 01:06
TimToady r: say q:to//␤foo␤␤
camelia rakudo-parrot 874e35, rakudo-jvm 874e35: OUTPUT«foo␤␤»
lue r: say q:to//␤foo␤ 01:08
camelia rakudo-jvm 874e35: OUTPUT«===SORRY!=== Error while compiling /tmp/7_WvuwQ8cZ␤Ending delimiter not found␤at /tmp/7_WvuwQ8cZ:3␤------> <BOL>⏏<EOL>␤ expecting any of:␤ whitespace␤ vertical whitespace␤»
..rakudo-parrot 874e35: OUTPUT«===SORRY!=== Error while compiling /tmp/YJYlPqo7ti␤Ending delimiter not found␤at /tmp/YJYlPqo7ti:3␤------> <BOL>⏏<EOL>␤ expecting any of:␤ whitespace␤ vertical whitespace␤»
FROGGS gnight 01:10
timotimo jnthn: it wold have been great if you had mentioned that java code can call back into perl6 code as well 01:11
i should really get one of these wordpress accounts so i can read all the drafts in the future 01:12
raiph lue: added a comment to your s15 gist 02:01
s/lue/lue++/
rjbs Somebody please msg me diakopter's email? 02:17
got it, thanks 02:20
japhb__ raydiak: Is your Pray code available anywhere? I don't see it from your github page .... 02:55
And given that I've got a barely contained addiction to optimizing graphics code, I'd love to have a look at what you have so far. ;-) 02:56
raydiak japhb__: I'm working furiously to make it ready for the public ASAP. I don't want people to start forking and committing until I have it a little more settled (and I don't want to make a fool out of myself because I'm still learning). :) 02:57
did you see the image I put up today w/rudimentary shadows implemented? 03:00
lue raiph: my definition of ord and chr (and ords and chrs) is based on what Perl 6 already does, that's not my fault :) . 03:09
r: say "many letters".ord
camelia rakudo-parrot 874e35, rakudo-jvm 874e35: OUTPUT«109␤»
japhb__ raydiak: No, I haven't seen today's image. Link? 03:12
raydiak japhb__: as far as optimization goes, I haven't done any to speak of so far, it's pretty much just a transliteration of the math into classes and methods with little thought towards performance yet...so there ought to be plenty of fun to be had in that area
japhb__: cyberuniverses.com/pray/#pray-image-6 03:13
japhb__ :-)
nice
raydiak thanks :) the awesome feedback from people is a lot of what has kept the momentum so high on this project 03:14
japhb__ raydiak: BTW, if you haven't already read it, I recommend the book Physically Based Rendering (www.pbrt.org/). I only have the first edition, but I really enjoyed it. 03:15
-Ofun is a really strong part of our culture here. 03:16
lue raiph: could you point me to the part of Unicode that guarantees not clashing with 32-bit signed integers? I'm not aware of it off-hand.
(negative signed integers that is)
japhb__ Oh, and PBRT is the largest and most well written piece of literate programming I've had the joy of reading. 03:17
raydiak japhb__: I noticed the -Ofun...it's quite refreshing (nobody asked me WTF I was doing writing it in the first place). thanks for the pointer to the book, it sounds right up my alley! I've been reading about more advanced stuff like that lately (radiosity, lightmapping, volumetric lighting, etc etc) 03:19
oops, just saw the time! gotta run! 03:20
segomos thank you guys for not writing a spec like scala's language spec 04:26
dylanwh you're a pal and a confidant 04:34
japhb__ segomos: What do you mean? 04:45
TimToady I think that means "Thank you for not writing a spec." :)
we just make suggestions to the people writing the test suite...
raydiak japhb__: apologies for my sudden departure; was almost late to pick my g/f up after work...I try not to make her wait in December at night alone in the back parking lot of the mall :P 04:49
segomos i mean thank you for the language spec that doesn't read like some comp sci professor wrote it to show new CS students how smart he/she is 04:51
scala's language spec is painful to read
segomos perl6's ever changing spec is, at the very least, concise 04:52
lue segomos: I could change S05 to talk about terminals, non-terminals, semi-terminals, hyper-terminals, junctionary terminals, and whatever made up fluff I can come up with if you want, for starters :) 04:56
lue , needless to say, looks for the scala spec
segomos www.google.com/url?sa=t&rct=j&...5469,d.cGU
sorry - that is a long link 04:57
TimToady usually better to follow the link and then copy it from the location bar
lue or don't use Google :)
segomos yea i noticed :)
lue (yeesh, apparently gtk's document view (evince was it?) updated since I last used it, now it looks *awful*) 04:58
geekosaur this is the evolution of gtk/gnome in a nutshell.... 05:00
lue geekosaur: I don't mind the UI, it just happens to look like crap in places with Greybird. Luckily I use KDE most of time :) 05:01
[although whatever update I did apparently broke some settings reading thing. Hopefully a restart that I rarely do will fix it.]
raydiak wow, I just jumped to a random page in the middle, and the first thing I read is: ""Assume a selection of the form e.x where the type of e conforms to scala.Dynamic. Further assuming the selection is not followed by any function arguments, such an expression can be rewitten under the conditions given in §6.26"
lue should get around to telling GTK to make firefox open pdfs in Okular sometime... 05:02
"3.2.10 Existential Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26" Oh no. :)
raydiak hides
lue wonders what Scala means by not being able to support Unicode codepoints > 0xFFFF 05:04
TimToady it means it uses Java strings
lue Hang on, I need to restart my computer. That settings bug is being unreasonable ☹ 05:06
lue hello again o/ 05:10
TimToady sucks to program in Java if you speak Ugaritic... 05:12
lue TimToady: there's no way to generate a unique and static number for every possible non-precomposed grapheme, is there? (i.e. the number of possible graphemes is ∞) 05:15
(unless there's some sort of "5 diacritics per character" limit in Unicode I'm unaware of...) 05:17
TimToady well, Int is arbitrarily big, but we're not trying to encode them in an Int, since that wouldn't fit into a native int 05:18
and string ops have to be fast most of the time, so native is a necessity
but if our Int arrays turn out to be super fast, we could reconsider 05:20
that's a mighty big "if" though
lue yeah, I was assuming int32 (or int64 if we, say, felt like inventing UTF-64 or something ☺) 05:21
TimToady that would really chew up memory fast
32 is bad enough that way
lue Oh? I see no problems with U+00000047 :) 05:22
TimToady that would be a G-string 05:23
lue But there's no way to generate a negative number based on the grapheme without eventually running into either a break in the algorithm ("Numbers get too large after 10 combining chars") or just too many possibilities.
At least I don't think.
TimToady right, that's why we're not doing that 05:24
lue So it's essentially just (0x80000000..0xFFFFFFFF).pick per-process then, right?
TimToady well, I think we're going with per-string tables to avoid DOS attacks 05:25
though we could have some shared tables in some implementations 05:26
lue oh? So "a􏿽xCC􏿽x88" and "a􏿽xCC􏿽x88b" would have different numbers for a􏿽xCC􏿽x88 (assume a􏿽xCC􏿽x88 is a generic uncomposable grapheme) then? 05:27
TimToady if we're dealing with a language that has few precomposed graphemes, for instance
yes, if you get negatives, you have to do the indirection to compare the actual graphemes, unless you happen to be sharing tables
lue (That throws a wrench in NFG-level chr() and ord(), though those arguably become needless at the NFG level anyway)
TimToady yah 05:28
lue
.oO( say chr(ord("☃")); # OUTPUT: ☄ (maybe) )
TimToady we probably just have to force people down to the Uni level for chr/ord processing 05:29
lue The easiest thing to do in that case would be to force codepoints for chr/ord. ...which you just said. 05:29
TimToady or emulate it when used on NFG
though again we wouldn't know whether they want NFC or NFD semantics unless they say 05:30
lue Force codepoints within sub chr/ord() { } is what I meant.
TimToady: if it helps, my provisional idea of an S15 says Perl 6 prefers NFC (step down from NFG) whenever NFG doesn't work: gist.github.com/lue/7761244
TimToady but NFC and NFD produce different lists of codepoints, so we either have to assume, or force them to be specific
TimToady is biased towards NFC too 05:31
lue (that part is there to take care of say "NFG string" and similar, though)
TimToady but we might end up with a .nfdords or so 05:32
of course, if NFD is a Buf[Uint32] that already can behave as a list of ords 05:33
r: "abc".encode('utf8')[1].say 05:34
camelia rakudo-parrot 874e35, rakudo-jvm 874e35: OUTPUT«98␤»
TimToady much like that
lue I wouldn't be surprised if we just turn ords and chrs into shorthand to-buf converters or something.
(and from-buf, for chrs)
TimToady well, I'm not sure a buf will flatten like we want in list context 05:35
lue True.
TimToady but we'll have to feel our way into it as NFG comes online
lue (I would prefer .ords(:nfd) to .nfdords by the way. Feels righter. Or perhaps .nfd.ords even) 05:36
TimToady
.oO(dfnords)
lue feels just a bit proud of himself for the NF pragma's spelling, by the way :) 05:37
TimToady should read it when his crosses aren't eyeing
lue Fair enough. 05:39
lue
.oO(There's a weird intersection between the NF* / buf division of viewpoints and the graphs/codes/units/bytes division of viewpoints, from what I've noticed.)
05:42
w0rm_x Hello. 06:47
timotimo o/ 07:50
felher Ui, already three advents post. Hip Hip Array! moritz++ masak++ jnthn++ 08:10
FROGGS TimToady: are you going to write something for the calender? 08:13
moritz \o morning 08:29
FROGGS morning moritz 08:30
Woodi morning :)
timotimo earthings, fellow greetlings! 08:31
FROGGS hi Woodi :o)
Woodi I have long awaiting request for a post or documentation: a pictures of Perl6/nqp/moar internals (usually ractangles :) 08:32
FROGGS Woodi: moritz updated an svg a few months ago
moritz Woodi: you mean like docs/architecture.svg in the rakudo repo?
nwc10 +--------------+
| Clever stuff |
+--------------+
timotimo there's pictures in jnthns slides about moarvm and friends
nwc10 there, done. 08:33
actually,
FROGGS Woodi: raw.github.com/rakudo/rakudo/nom/d...ecture.svg
nwc10++
moritz but, bringing that to an advent calendar post wouldn't hurt 08:34
nwc10 actually, I have a better one:
+-------------------------------------------+
| Just code (mostly Perl 6, so take a look) |
+-------------------------------------------+
tadzik it may be helpful to have a kind of data flow diagram, showing how code text goes in and program output gets out 08:35
how it goes to HLL::Compiler, then Grammar, Actions, backend, and execution in setting's context, or so
FROGGS tadzik++ # go ahead! 08:38
I'd like to have that too
moritz well, with the exception of HLL::Compiler, that's what architecture.svg shows 08:39
Woodi I was not aware of this, checking
ee, my browser shows <?xml version="1.0" encoding="UTF-8" standalone="no"?> .......... :) 08:40
raydiak Woodi: save it and view it locally
Woodi I know :) 08:41
raydiak sorry, of course. it's late, I'm not thinking clearly. 08:42
moritz raydiak: don't apologize for helping
raydiak I find "helping" and "condescending" to be a blurry line, wanted to make sure I don't come off on the wrong side of it :) 08:45
moritz raydiak: that's a good attitude, right 08:46
Woodi I just thinked firefox know about svg format...
tadzik github probably doesn't send proper content-type for that 08:47
moritz raydiak: speaking of good, have you decided on a day to write for the advent calendar? :-)
raydiak Woodi: github does it on purpose in the HTTP headers so people don't use it to host web content and such
moritz and, very importantly, so that browsers don't act on active content while having the github cookie set 08:48
Woodi they do not want to expand to new teritories ? creating social portal or something ? in 2013 ?? ;)
moritz that's what the github.io domain is for 08:49
raydiak moritz: indeed, I'm down for day 8...looking forward to researching and writing it; thanks for encouraging me to do it! 08:54
FROGGS raydiak++ # \o/ 08:54
tadzik nice! 08:55
Woodi got Inscape portable. btw. I wondered about Rakudo-windows-portable but later I stop thinking it is good idea. Just share...
FROGGS errm 08:56
tadzik: you forgot to pick your days :o)
moritz raydiak: ah great, I hadn't seen your commit
moritz raydiak: are you also writing about your ray tracer? that would be really, really cool 08:57
tadzik FROGGS: yeah, I couldn't figure out what to write about
I was embarassingly inactive this last year
FROGGS Woodi: IIRC parrot is not very portable... but hopefully we get the jvm/moar backends to be portable so we can release a usb-stick version
hmmm
raydiak moritz: Hah! Never even occurred to me! 08:58
moritz making nqp-j and rakudo-j relocatable shouldn't be too hard
raydiak: we're always happy to hear/read about Perl 6 being actually used :-)
Woodi architecture.svg is general view. I thinked about something more detailed what can help new developers to dig into code...
tadzik Woodi: do you have a particular need here, like "I'd like to dig into this part, but I don't know how or where?" 08:59
raydiak moritz: that was one of my big goals for Pray, a real working p6 app, today...and a flashy one at that, I hope by the time I'm done 09:01
FROGGS moritz: and once we have S11 module repositories these are movable too
hoelzro morning #perl6 09:15
FROGGS hi hoelzro
arnsholt It should be possible to bundle NQP/Rakudo as a single runnable JAR 09:16
That'd be pretty cool, actually
tadzik aww yiss 09:19
FROGGS r: say 4 x "." ~ "{" 09:28
camelia rakudo-parrot 874e35: OUTPUT«===SORRY!=== Error while compiling /tmp/F9iG2RVvd8␤Unable to parse expression in double quotes; couldn't find final '"' ␤at /tmp/F9iG2RVvd8:1␤------> say 4 x "." ~ "{"⏏<EOL>␤ expecting any of:␤ s…» 09:29
..rakudo-jvm 874e35: OUTPUT«===SORRY!=== Error while compiling /tmp/p76cFcf9qQ␤Unable to parse expression in double quotes; couldn't find final '"' ␤at /tmp/p76cFcf9qQ:1␤------> say 4 x "." ~ "{"⏏<EOL>␤ expecting any of:␤ stat…»
FROGGS r: say 4 x "." ~ '{'
camelia rakudo-jvm 874e35: OUTPUT«Cannot convert string to number: radix point must be followed by one or more valid digits in '.⏏' (indicated by ⏏)␤ in sub infix:<x> at gen/jvm/CORE.setting:1395␤ in block at /tmp/NWhf5IlxyO:1␤ in any eval at gen/jvm/stage2/NQPHLL.nqp:1086␤ …»
..rakudo-parrot 874e35: OUTPUT«Cannot convert string to number: radix point must be followed by one or more valid digits in '.⏏' (indicated by ⏏)␤ in method Int at gen/parrot/CORE.setting:12012␤ in method Int at gen/parrot/CORE.setting:5447␤ in sub infix:<x> at gen/parrot…»
FROGGS r: say "." x 4 ~ '{'
camelia rakudo-parrot 874e35, rakudo-jvm 874e35: OUTPUT«....{␤»
FROGGS k
raydiak moritz: how's this for an idea? if all goes smoothly and there is still an opening in the schedule when the code is ready, I'll write another advent post, about Pray, which will also be the release announcement 09:31
raydiak I hesitate to advertise it too much before it is "real" in the sense that programmers expect there to be...you know...a program :) 09:32
arnsholt Actually, a single runnable JAR should maybe be our build product on JVM anyways
moritz raydiak: sounds good 09:34
diakopter whoa; who has access to my email that they can forward it to rjbs??!?! 09:44
moritz diakopter: I have access to your email address, but not to your email account :-) 09:46
diakopter: but I'm not quite sure what you actually want to know
diakopter runs away screaming
sry; being silly. will desist. 09:47
timotimo hoelzro: +1 on persisting on perl6 support on github >_> 09:48
tadzik diakopter: how was lpw? 09:51
hoelzro it's silly how long it's taken 09:53
timotimo yes.
it's like ... hey please click this button for us. 09:54
yeah we'd all appreciate it!
hey, how about clicking that button?
you know, the one that does everything for us? it would be a great help!
hoelzro I've even done the work for them!
timotimo hey, look, we made the continuous integration happy!
tadzik clickthatbutton.js
timotimo obviously we have to find a way to h3x0r github.com into merging that pull request 09:55
social engineering didn't work so far
tadzik we can contact the rails exploiter guy ;)
hoelzro hehe
diakopter yeah but just think if theyadded every language with >40 users... the list would be way too long 09:56
moritz there are 136 members in the 'perl6' team of the 'perl6' organization 09:57
tadzik well, the list is way long anyway 09:58
tadzik I don't know what Augeas, BlitzMax or Bro are, and I didn't even scroll very far 09:58
moritz Bro is for brogrammers, no? :-) 09:59
timotimo .o( bilbro swaggins )
tadzik also, they have 3 different languages related to Parrot
Parrot, PASM, PIR
whatever "Parrot" is 10:00
timotimo anything with the name /usr/bin/parrot
diakopter parrot parrots your parrot 10:03
timotimo it's just parroting for the fjords 10:04
(starring Parrotson Fjord) 10:05
FROGGS >.< 10:06
timotimo (also starring AwardBIOS-winning actress Demi Moar) 10:13
FROGGS /o\ 10:15
tadzik bazinga!
FROGGS hint: neeeeeeeeonggg 10:22
tadzik I wish I could asciify the inhale-laugh 10:23
FROGGS seen that episode yesterday evening :o) 10:24
tadzik www.youtube.com/watch?v=O12ZNxm7EUs#t=15
it's like dog sniffing sound
timotimo hm 10:28
jnthn ohhai o/ 10:33
FROGGS jnthn: o/
masak ohhai \o 10:35
FROGGS jnthn: I've pasted three interesting lines to #moarvm yesterday evening 10:36
masak FROGGS: a choo-choo train?
FROGGS a what?
what have I done wrong now? 10:37
masak <FROGGS> hint: neeeeeeeeonggg
FROGGS ahh, hehe
masak++
masak :)
nwc10 good UGT, jnthn 10:38
tadzik I like trains 10:38
masak tadzik: in Soviet Russia, trains like you!
tadzik neeeong 10:39
masak w0rm_x: hello! welcome! 10:41
mathw good $whenever-it-is 10:46
masak antenoon!
mathw whatever
masak good *, mathw 10:47
mathw Oh wait I do care, because if it's the afternoon that means it's approaching time for a musical evening of fun
hi masak 10:48
masak I find the "musical evening of fun" to be a much more successful concept than either "musical evening of pain" or "musical evening of duck sauce" 10:49
mathw my local .pm group's going to start having tech talks
masak ooh
mathw the organiser was worried about interest. So far it looks like almost everyone's volunteered to give one
masak yay
mathw not sure if anybody wants to *listen*
but we all like to talk, apparently :)
masak was gonna say :)
at least there'll be a speaker :)
mathw and yes, a musical evening of fun is better than a musical evening of pain 10:50
I had a non-musical evening of pain last night
masak that's like, the worst combination.
pain *and* no music!
mathw well, it was aikido 10:51
masak oh. 10:51
mathw so this is sort of expected when you check the week's schedule and it says "Monday: ikkajo and self defence"
it's the latter part that hurts
but I was the only person last night to defeat the chief instructor's "you can't do katate mochi ikkajo osae ichi" game :) 10:53
masak can't even say "karate mochi ikkajo osae ichi" :) 10:54
mathw katate
w0rm_x masak, I recently started to take a look at perl 6 (I never used perl before so I dont know perl 5), specially the syntax. The surprise was that it has couple of things that I wish it existed in a language. But from what I have been reading it isn't ready yet.
mathw karate is different :)
masak mathw: see? my point exactly.
mathw: I can't even say it.
:P
w0rm_x: it's not ready for everything, no.
w0rm_x: we're working on it. 10:55
mathw Actually I'm hoping somebody has some wisdom about generating documents for print
mathw w0rm_x: it might be ready, depending on exactly what you want to do with it. There's a lot it can do, but it might not be able to do it quickly enough for you, for example. 10:56
masak w0rm_x: the short story is: it's slow, sometimes unstable, and the documentation story is so-so.
mathw Or there might not be libraries you need, and you can't write them yourself for whatever reason
masak w0rm_x: but we like the language, the community is great, there are many examples, and people are really willing to help.
compared to Perl 5's CPAN, we're not very far along on modules. 10:57
those that exist can be seen at modules.perl6.org
w0rm_x masak, slow & unstable; for all the implementations? There are few of them from what I read. 10:58
masak w0rm_x: there is one in the lead: Rakudo.
masak w0rm_x: Rakudo currently targets Parrot and the JVM. 10:59
w0rm_x masak, does that mean Rakudo has to be re-written in some way to improve speed? 11:00
masak w0rm_x: yes and no. there are no big refactors on the horizon. 11:02
jnthn Rakudo is in decent shape architecturally, but it needs to be optimized, and to learn how to better optimize Perl 6 code.
masak w0rm_x: but there is work to be done on optimizing.
what jnthn said.
mathw It's been more about making things work than making things fast, so far.
w0rm_x Ah ok.
masak w0rm_x: the one in second place, Niecza, is no longer in active development. but it has a fair amount of features, and it's decently fast. 11:03
Niecza runs on the CLR.
w0rm_x Fair enough. Thanks for the clarifying things. 11:06
mathw starts wondering about calling Clojure libraries from Rakudo-JVM 11:08
probably need some sort of adapter interface to make them look less weird
and macros might be a problem
('might', hah)
arnsholt Well, we'd be limited to whatever's callable from ordinary Java code 11:09
Somehow, I doubt macros are part of that =) 11:10
mathw Generally Clojure programmers jump through a few hoops to make anything callable from Java at all 11:16
Or at least, anything callable without the Java programmers going mad
I'll have to look into it when I've got time. It's not like Rakudo has an entirely happy story about calling Java libraries yet anyway. 11:17
timotimo w0rm_x, ooc what language(s) did you come from? 11:40
i went straight from python to p6 :)
maybe today i will look into the java calling thing 11:42
w0rm_x timotimo, some of Lisp dialects, Haskell, C/C++. I tried Python before, nothing serious though.
timotimo i may be able to make methods that have unique arity callable without the wursy^Ht 11:43
wurst
as a haskeller, can you tell me if the ADT module i built is okay? 11:48
jnthn timotimo: Saussage? :) 11:49
timotimo yup 12:03
the java method identifier string sausage
jnthn: except when i first looked at the code i didn't see an obvious method to create the dispatchers or to do a dispatching 12:06
timotimo i guess computeInterop does that 12:10
and the for loop that iterates over the names.entrySet bails out if it finds duplicates, otherwise creates a short-named method 12:11
now all i have to figure out, i guess, is how to make proto/multi methods while inside java code :\ 12:12
jnthn Yeah, github.com/perl6/nqp/blob/master/s....java#L266 is the line that spots the dupe and makes sure we don't get shortname methods...
I don't think you want to do it that way.
timotimo fair enough. alternatives?
should i create a method that takes a capture and manually dispatches for the arity? 12:13
jnthn I was "just" going to generate a method that does something like that, yeah.
I mean, you just do it with the normal args processing things available in Ops
Trouble is that it's createAdaptor that probably needs to be updated... 12:14
As that's where you have chance to generate stuff.
So I guess it needs detecting in there...
timotimo mhm
arnsholt And Java dispatches methods statically rather than at run-time. There may be some dragons lying in wait for users there as well 12:15
timotimo what do i have to search for to find a specification for the name format they use? 12:17
arnsholt I can't remember. I found it at some point
It might have been somewhere in the JVM spec
(Not the Java spec, mind, but the JVM one) 12:18
timotimo mhm
dalek p/indy-args: a7f2425 | jnthn++ | src/vm/jvm/ (4 files):
Special-case one object arg case of invocation.

Many method invocations where no extra parameters look like this, such as almost all grammar rule invocations.
p/indy-args: 343fb95 | jnthn++ | src/vm/jvm/QAST/Compiler.nqp:
Unbust Rakudo after indy arg handling work.
timotimo i think i see it 12:19
jnthn: ooooh, rakudo compiles again with the branch?
jnthn Yeah
timotimo cool! 12:20
i'll measure stage compile timings :)
er, stage parse
since the action methods should be invoked much faster now?
jnthn No, not actions yet; those are obj,obj
I may special-case that path next.
But I've not really wired up all the goodness yet...
timotimo oh
hm, ok :( 12:21
jnthn Almost all the grammar rule invocations are improved in this regard, though
So it should help a bit on that front.
timotimo so stuff I need to parse looks like '(' [ '['* <[BCDFIJSZ]> | 'L' .*? ';' ] 12:23
er, with a * at the end
what mechanism should i be using for that in java-space? seems like a very simple finite automaton that feeds a counter would suffice 12:24
jnthn Well, I think you can do it off the normal reflection objects rather than parsing?
timotimo oh, well that would certainly be nice :) 12:25
timotimo i can't find documentation for ClassContext 12:28
oh
of course not
masak of course not? 12:38
timotimo yeah, it's declared in the same file :) 12:41
it's not something java offers
jnthn: should i worry about var-args methods?
jnthn Eventually perhaps... 12:44
timotimo for now i'll just poison a method name if there's a method with var args with that name i guess
arnsholt Java varargs are equivalent to a single last argument which is Something[], aren't they? 12:45
timotimo maybe 12:45
dalek p/indy-args: 7e17160 | jnthn++ | src/vm/jvm/ (3 files):
Also special-case (obj,obj); also very common.
jnthn arnsholt: yes
timotimo i think i found the right datastructure for the arity stuff 12:54
masak .oO( an ar-ray ) :P 12:55
timotimo aharr!
nope, in this case a hashmap of hashmaps
though the inner one is a hash from integer to string, so it could just as well be a list. 12:56
masak but I guess it would be sparse?
timotimo yes
timotimo but also: i need to differentiate between "i haven't seen a method with this arity yet" and "i have seen more than one method of this arity" 12:56
timotimo the former is a missing key, the latter is a key that has "null" as its value at the moment 12:57
jnthn timotimo: Keep in mind that we want to also do this by type later on too...
hoelzro anyone going to FOSDEM 2014?
hoelzro trying to decide whether or not to go 12:57
jnthn hoelzro: I'm planning to go 12:58
timotimo: So good to pick something that'll let us keep the things of different arities around for the future...
timotimo hm, aye
hoelzro cool, I can pick your brain ;) 13:02
lizmat_ hoelzro: on the Sat we'll have a Perl devroom with probably a lot of Perl 6 talks :-) 13:03
hoelzro \o/
lizmat_ on both days, we will have a Perl booth also
timotimo i suppose a List<String> instead of String will already do the trick 13:07
timotimo does java have the [] syntax for hashmaps? 13:10
jnthn No 13:11
timotimo hm
i suppose the answer to all questions of the kind "does java have $SYNTAX for $THING" is "no"
timotimo oof. 13:17
if a HashMap has a .size of 1, how do i get the only value out of it without a thousand lines of code?
i guess .values.toArray(new *magical type here*)[0] would work 13:18
jnthn Isn't there a way to get the list of values? .values() or so? 13:22
arnsholt .values().get(0) innit? 13:23
timotimo oh
Collection doesn't have .get 13:24
arnsholt Huh. Indeed it doesn't
toArray()[0] is probably it, in that case 13:25
timotimo oh well.
arnsholt If you know the type of the collection toArray(new TheThingCollected[0]) gets you a typed array 13:26
timotimo i have to [0] that? 13:27
arnsholt Yeah 13:28
timotimo OK, thanks!
arnsholt It'll just get you an object of the right type, rather than just an Object
timotimo i'll have a prototype that prints out diagnosis text if it thinks it can generate an arity-unambiguous dispatcher
if there's like 5 arities for a method and only one of them has ambiguous calling possibilities, should i generate a dispatcher for the other 4, or no dispatcher at all? 13:29
tangentstorm any chance we could get camelia to join #learnprogramming? 13:30
timotimo you're teaching perl6 in #learnprogramming? :)
tangentstorm well, there's a guy studying perl... don't know which version. :) 13:31
moritz tangentstorm: is that on freenode too?
timotimo glomp him at once! ;)
tangentstorm moritz: yeah... it's the irc channel for reddit.com/r/learnprogramming/
we have a j bot and used to have a haskell bot. 13:32
dalek albot/host07: 2b7d4c6 | moritz++ | freenode.org.conf:
join #learnprogramming (for tangentstorm++)
13:33
moritz EWRONGBRANCH
dalek rl6-roast-data: 3a8cbed | coke++ | p (2 files):
today (automated commit)
13:34
albot: aa7a8c9 | moritz++ | freenode.org.conf:
join #learnprogramming (for tangentstorm++)
jnthn timotimo: I'd generate it for the other 4...seems more useful :) 13:35
timotimo: And maybe even throw on the ambig cases saying "use X or Y to be clear which you mean" so people can even copy-paste the descriptors :) 13:36
tangentstorm moritz: thank you! :) 13:40
moritz tangentstorm: you're welcome
timotimo jnthn: that would be fantastic 13:43
timotimo jnthn: i'll have to generate jvm bytecode for a bunch of ifs and then invokedynamic/invokestatic? 13:45
jnthn Sounds about right...I guess invokestatic or invokevirtual as you want to end up in the generated adaptor... 13:47
timotimo oh, yes 13:50
timotimo src/vm/jvm/runtime/org/perl6/nqp/runtime/BootJavaInterop.java:269: error: generic array creation List<String> matching_descriptors = descriptors_by_arity.values().toArray(new List<String>[0])[0]; 13:54
hum
lizmat looking at lue's S15 proposal 13:57
I can't help but wonder whether we wouldn't need a "pragma" statement in the family of package/class/module 13:58
and then only allow "yes" and "no" to call pragma's
in order to avoid confusion between pragma's and "real" modules
so, for "no warnings" there wouldn't be a diff 13:59
and instead of "use warnings", one would say "yes warnings"
thereby separating the loading code functionality from tweaking compile time settings 14:00
and run time settings
core pragma's wouldn\'t need to be loaded, user defined pragmas would need a 'use' statement once in the outer scope where they're used 14:01
TimToady: would that make sense ? 14:02
lizmat initially, I thought "ok" instead of "yes", but that would wreak havoc on the test-suites 14:03
so: "ok warniings" if you want warnings enabled, "no warnings" if you don't
timotimo huh, isn't this supposed to be fixed? Unhandled exception: java.lang.NoSuchMethodError: org.perl6.nqp.runtime.Ops.printfh(Lorg/perl6/nqp/sixmodel/SixModelObject;Ljava/lang/String;Lorg/perl6/nqp/runtime/ThreadContext;)Ljava/lang/String; 14:05
FROGGS timotimo: now I've seen that twice in 24 hours on this channel... 14:06
lizmat commuting to Amsterdam.PM meeting& 14:08
moritz timotimo: I've send you an invitation to the calendar 14:08
timotimo an invitation?
jnthn timotimo: stage0 is still using it I guess... 14:09
moritz timotimo: an email with a link where you can get an account as editor
timotimo oh cool!
moritz timotimo: so that you can preview and write posts :-)
anybody else want/need one?
timotimo thanks
oh, i already seem to have an account! 14:10
moritz with the same email address? 14:12
timotimo no, but it doesn't matter :) 14:14
timotimo so... how do i fix my jvmnqp? 14:21
jnthn I don't think you should be doing this in nqp at all really...
I'd been planning to put it into the Rakudo JVM interop class 14:22
Maybe by overriding something existing, or maybe by adding a method to add this stuff that can be overridden as part of the Rakudo JVM interop subclass. 14:23
timotimo OK, but that still leaves me with the problem that i don't have an nqp-jvm that i can use :) 14:24
jnthn huh? 14:25
timotimo nqp-jvm doesn't build. it complains about the lack of printfh in the ops
jnthn Without any changes of yorus?
That probably means it's trying to report an error.
timotimo that must be it :\ 14:26
oh, yes, i had some dirt in my working copy!
timotimo that was it indeed. 14:33
lizmat moritz: could you please also send me an invitation for the calendar? 14:36
it appears colomon++ already did Sets and Bags in the past though 14:37
colomon a lot has changed since then
lizmat (and yes, I'm not driving myself)
colomon lizmat++
moritz lizmat: sent. 14:40
lizmat thanks!
jnap thanks for the advent calender stuff, it does help 14:44
moritz \o/ and you're welcome 14:45
jnap I look forward to the day when I know Perl6 well enough to Port Catalyst ;) 14:46
timotimo what's the magic incantation to only rebuild the runtime jar thingie? 14:48
moritz make nqp-runtime.jar # ?
timotimo i'll try 14:49
timotimo gist.github.com/timo/cbdfdeab27c3af40c0a0 :) 15:02
jnthn nice :) 15:05
timotimo but it's all inside nqp for the moment
why exactly do you not want it to be in nqp?
because nqp doesn't have multiple dispatch for methods? 15:06
FROGGS it has
otherwise as_mast would not work
timotimo er
of course :)
FROGGS :o)
timotimo but ... only with fixed arity, no?
FROGGS dunno
moritz no 15:07
timotimo hm, ok
FROGGS the dispatcher is implemented in nqp, no?
so, there is nothing special in rakudo
timotimo well, i'll implement the code gen for the arity based dispatch now and after i get it to work, i'll move it over to rakudo if i can
moritz nqp: class A { proto method a(*@a) {*}; multi method a() { say 42 }; multi method a($x) { say 5 } }; A.a()
camelia nqp-parrot: OUTPUT«Unable to parse expression in blockoid; couldn't find final '}' at line 2, near "say 42 }; "␤current instr.: 'panic' pc 16262 (gen/parrot/stage2/NQPHLL.pir:6020) (gen/parrot/stage2/NQPHLL.nqp:426)␤» 15:08
..nqp-jvm: OUTPUT«Unable to parse expression in blockoid; couldn't find final '}' at line 2, near "say 42 }; "␤ in panic (gen/jvm/stage2/NQPHLL.nqp:379)␤ in FAILGOAL (gen/jvm/stage2/NQPHLL.nqp:386)␤ in blockoid (gen/jvm/stage2/NQP.nqp:983)␤ in method_def (gen/jvm/stage2/N…»
..nqp-moarvm: OUTPUT«Unable to parse expression in blockoid; couldn't find final '}' at line 2, near "say 42 }; "␤panic␤»
moritz nqp: class A { proto method a(*@a) {*}; multi method a() { say(42) }; multi method a($x) { say(5) } }; A.a()
camelia nqp-moarvm, nqp-jvm, nqp-parrot: OUTPUT«42␤»
moritz nqp: class A { proto method a(*@a) {*}; multi method a() { say(42) }; multi method a($x) { say(5) } }; A.a(6)
camelia nqp-moarvm, nqp-jvm, nqp-parrot: OUTPUT«5␤»
timotimo mhm mhm
brrr, it's cold in here
i shouldn't have taken that lemonade from the fridge
FROGGS I have warm tea :o) 15:09
timotimo that's probably warmer than cold lemonade
FROGGS earl grey, hot 15:11
timotimo :)
jnthn: what must the type signature be for the java-level method i generate? 15:12
jnthn timotimo: Same as the other generated ones I guess... 15:13
timotimo yeah, okay, but where do i find them? :P
jnthn createAdaptorMethod should give some hints 15:15
timotimo OK
jnthn ah, it's in startCallout 15:15
timotimo ah, the void, CU, TC, CR, CSD, AOBJ part? 15:16
jnthn yeah
timotimo should i chop off the first part of startCallout into a separate method and re-use that? 15:17
lizmat is lacking inspiration for an advent post
tadzik same here
timotimo lizmat: have you looked at the topic suggestions yet?
lizmat Sets/Bags have been done
ah, good point
moritz lizmat: you could look at your commits this year, and ask yourself "is this worth telling about"? 15:18
like the deprecation trait. People can use that in their own programs, right? 15:19
jnthn lizmat: One on the :k/:kv/:pairs etc might work
lizmat adverbs on slices
hmmmm
lizmat I was also thinking "is default" and other variable traits 15:20
moritz +1
FROGGS or programming design patterns / perl6 best practices 15:21
like skimming through rosettacode and explain how a how a problem might be solved in perl6
lizmat moritz: yes, you can *only* use "is DEPRECATED" in user programs, not in core 15:22
in core, you have to fake it
FROGGS I'd like to read something from masak or jnthn about general programming topics fwiw
lizmat maybe a post about changes in the past year in the spec, combined with "is DEPRECATED" ? 15:23
moritz +1
FROGGS +1
dalek : 7dacd1a | (Elizabeth Mattijsen)++ | misc/perl6advent-2013/schedule:
Claim day 5: Spec changes and operational fallout
15:25
lizmat driver switch, will be back later& 15:29
timotimo jnthn: i'm not sure what op to use to find out more about the capture i got passed. nqp::takecapture or something? 15:29
oh, actually just captureposelems should be enough! 15:30
jnthn timotimo: Well, do the same arity check op sequence but use the rnage of allowable arities.
timotimo: And then that csd thing (a CallSiteDescriptor) has a numPositionals or so
masak lizmat: I for one would love to see a post about adverbs on slices.
jnthn Which should tell you just what you want.
timotimo great, that's what i needed to know 15:32
so i'll ALOAD the csd and visitFieldInsn(Opcodes.GETFIELD, TYPE_CSD.getInternalName, "S;") 15:34
no, just "S"
er, Ljava.lang.String;
also, "numPositionals" 15:35
er, why was i thinking of a string?
I is correct, of course
i'll have to i2l, then dup2 and then use lcmp and then compare the comparison result to lconst_0 using ifeq? 15:41
jnthn timotimo: Well, you don't have to l2i, you can also use an integer constant to compare it to...
uh, i2l I mean
timotimo oh. i guess. 15:42
and then i can use if_icmpeq?
jnthn iirc, yes
timotimo can i just pass a label there and it'll do the branchbyte thing for me?
jnthn Yeah, asm does the offset computation 15:44
timotimo excellent. i should be able to continue hacking for a bit now 15:45
at the end i'll have to figure out how to actually make the method i generated available to nqp; do i just have to pass the full name into some magic function that turns it into a CodeRef?
jnthn timotimo: No, it's done through the CodeRefAnnotation 15:46
timotimo oh, so after the visitAnnotation for that, the av.visit("name", ...) creates the coderef for me and i'll just have to look it up somewhere? 15:47
jnthn nqp: sub foo(&bar) { bar() }; foo({ say(1) }) 15:48
camelia nqp-moarvm, nqp-jvm, nqp-parrot: OUTPUT«1␤»
jnthn timotimo: No, it says that when the compilation unit is loaded the coderef should be created... 15:49
timotimo now i'm confused :) 15:50
jnthn timotimo: The code that did the existing shortname stuff is what takes the built code-refs and puts them into the methods table.
We don't create code-refs by hand any more. We just annotate that they should be created.
timotimo oh 15:51
so, er, what do i have to put into HashMap<String, CodeRef> names for my custom method to be invoked?
jnthn I think you've got the overall process mixed up 15:52
jnthn createAdaptor produces a Java class that subclasses CompilationUnit, with things in annotated with CodeRefAnnotation 15:52
That is then loaded, and it's the compilation unit loading that produces the CodeRefs for you 15:53
The building of the map comes after that, up in $indy_meth
oops
Up in computeInterop
timotimo oh, interesting 15:54
so at that point the coderefs have been created
er, that's bad, though. i've been writing the code to create the dispatcher methods into the computeInterop method 15:55
jnthn adaptorUnit.initializeCompilationUnit(tc); // this is the line that triggers it, iirc
Oh...but I said earlier they needed to go on adaptorUnit? :(
timotimo sorry, i guess it was too much new stuff at once :(
jnthn k
But yeah, they really have to go there. 15:56
timotimo i think i can move it easily
jnthn It makes sense...once you work out what the heck it's doing :)
jnthn didn't write this lot so also had to figure it out in the past :)
timotimo hehe
you meant it has to go into createAdaptor? 15:57
jnthn yeah 15:58
for (Method m : target.getMethods()) createAdaptorMethod(cc, m);
That's the thing that makes all the long-name adaptor methods
timotimo mhm, yeah
jnthn I think you need to in that loop build your hash of things by short name/arity
timotimo i'll add createShorthandDispatchers beside it
that's where i do it, yes
jnthn And then use it for the decidign which things to crate
Yeah, in a createShorthandDispatchers or so. 15:59
Or make another pass over target.getMethods() if you want to keep things more isolated
timotimo that's my current approach 16:00
i'm still confused. how can i re-use the long-named method if i don't have to create a dispatcher? 16:03
maybe the logic for the no-dispatcher-needed stuff should stay where it has been before
jnthn Yeah, you do now have to distinguish shortname generated things from just installing one thing under a short name 16:05
But you know that a generated short-name thing will never have a / in it
May be a better way to factor it... 16:06
timotimo: Does NQP::Optimizer actually do anything? 16:07
timotimo it descends into regexes ;)
let me have a quick look.
i think it annotates ops that it knows to return integers with that
diakopter I played Descent 16:08
timotimo descent 1?
good choice.
jnthn Well, the thing that worries me is...it never walks QAST::Stmts and QAST::Stmt nodes...
oh, wait, it does...d'oh :)
mis-read :)
timotimo did i put an optimizer into the ... ah
jnthn yeah :) 16:10
Though, given 1 + 1 doesn't seem to trigger...
Do we ever actually build it? 16:11
ah, yes :)
But 1 + 1 remains an add_n... 16:12
timotimo that may explain why the winings were not so extreme :) 16:13
jnthn: i'm not sure i understand the "generated short-name thing will never have a / in it" piece 16:15
jnthn oh duh, it is working... 16:17
timotimo and what is the name supposed to be, ooc?
ah, were you using --target=ast? :)) 16:18
jnthn yes :P
timotimo :D
i'm glad i'm not the only one who makes that mistake
cc.target.getName is the name of the class, aye?
and then it has a space and the descriptor that holds the parameter list? 16:19
i guess the descriptor actually starts with the name of the method
jnthn nqp: foo() 16:36
camelia nqp-moarvm: OUTPUT«No lexical found with name '&foo'␤frame_name_0␤»
..nqp-jvm: OUTPUT«java.lang.NullPointerException␤ in (/tmp/EAaWB6qvC0:1)␤ in (gen/jvm/stage2/NQPHLL.nqp:1100)␤ in eval (gen/jvm/stage2/NQPHLL.nqp:1086)␤ in evalfiles (gen/jvm/stage2/NQPHLL.nqp:1292)␤ in command_eval (gen/jvm/stage2/NQPHLL.nqp:1196)␤ in command_line…»
..nqp-parrot: OUTPUT«Could not find sub &foo␤current instr.: '' pc 45 ((file unknown):36899495) (/tmp/dxnVhdrWTz:1)␤»
timotimo oh. now i don't have access to the right method object when i'm at this point :\ 16:39
is there something like Tuple? 16:40
google says no :) 16:41
TimToady well, $(1,2,3) is close
or are we asking about Java? 16:42
timotimo java, yes
TimToady
.oO("I am too soon oldt and too late schmart.")
16:43
FROGGS .oO( #perl6 - where nothing is off topic unless we don't like you! ) 16:44
timotimo i'm asking about java to make perl6 better :)
also, you like me
TimToady is getting sleepy
FROGGS true true :o)
TimToady: well, then hibernate like sheldon does :o) 16:45
timotimo what kind of error should i throw if an ambiguous call is attempted? 16:51
TimToady "Was that a duck call?"
timotimo %) 16:52
timotimo does some heavy, heavy cargo culting 16:54
the NullPointerException is the result 16:55
i wish invoking jdb wasn't so had >_> 17:00
well, there's a jdb server ... 17:01
TimToady does the Java wurst not provide enough information to simply generate a set of multis? 17:02
timotimo jnthn advised against going the multi route 17:03
TimToady "argument by authority is the weakest form of argument" --wp 17:04
timotimo :)
timotimo it says Source file not found: BootJavaInterop.java even though i gave it ten different "use" lines 17:10
timotimo i can't kill the java process any more >_< 17:15
TimToady because it's already dead?
timotimo nope. 17:16
kill -9 helped, though
TimToady speaking of which, I tried to write a signal handler using sun.misc.Signal and sun.misc.SignalHandler, but couldn't figure out what to pass to the second argument of .handle 17:18
timotimo yay, i can has code 17:20
diakopter TimToady: cool. what is .handle 17:22
TimToady a method in sun.misc.Signal to set a signal handler 17:23
timotimo Step completed: "thread=main", 63E3D8F0624DF5900C1DCFCE51700D18B761D257.qb_4851(), line=16,803 bci=649 ....... >_> 17:24
diakopter TimToady: docs.oracle.com/javase/7/docs/platf...jvmti.html
timotimo that's where the NPE seems to fly
diakopter TimToady: rotfl especially at the utf8 section 17:25
timotimo not helpful :( 17:26
jnthn: can i drop my code onto you and ask you where the NPE comes from? >_<
TimToady yes, Java still heavily believes in null-terminated strings and 16-bit Unicode
TimToady well, their UTF-8 does, anyway 17:29
timotimo lue: how long until we can preview your advent blog post for tomorrow?
timotimo yay, i have running code! 17:39
... what do i test it with? :\ 17:40
kbenson An interesting article on java substrings and memory, which may be of interest to people who write interpreters: twistedoakstudios.com/blog/Post8147...ing-memory
jnthn timotimo: Find soemthing in the Java class library that just overloads by arity 17:41
timotimo i'm sprinkling stuff into the jakudo core setting now 17:42
dalek p/indy-args: d869316 | jnthn++ | src/vm/jvm/runtime/org/perl6/nqp/runtime/IndyBootstrap.java:
Various indy refactors/cleanups.
17:43
p/indy-args: f3d8cf8 | jnthn++ | src/vm/jvm/ (2 files):
Preparations for callstatic support.

Used when we know a code object lookup is not going to change its target beneath us. For now, just useful info for JVM.
p/indy-args: 917927a | jnthn++ | src/NQP/Optimizer.nqp:
Tidy up NQP optimizer; do some call => callstatic.
p/indy-args: 3151ce1 | jnthn++ | src/NQP/ (2 files):
Fix call => callstatic optimization.
p/indy-args: daeee99 | jnthn++ | src/vm/jvm/runtime/org/perl6/nqp/runtime/IndyBootstrap.java:
Further indy optimizations for sub calls.
timotimo i'll do a spectest while i go out to eat 17:46
btyler jnthn++ #nice advent post! learned a few things I hadn't picked up lurking here 17:48
moritz jnthn++ indeed; nice post, nice work 18:07
DarkWolf84 hello 18:09
moritz hi DarkWolf84 18:10
DarkWolf84 hello 18:11
moritz has a deja-vu 18:12
DarkWolf84 I'm sorry bug in the client 18:13
PerlJam wonders if the bug is that the client keeps joining #perl6 or keeps leaving #perl6 18:14
DarkWolf84 much better 18:15
timotimo this food is not a minute too early 18:16
DarkWolf84 I'm not sure this is the right place to ask but who owns rosettacode 18:19
because I was inspired from saying from TimToady about dining philosophers problem 18:22
and wrote some in perl5, Coro and AnyEvent 18:23
dalek p/indy-args: a620659 | jnthn++ | src/vm/jvm/runtime/org/perl6/nqp/runtime/IndyBootstrap.java:
Further indy optimization of method calls.

Previous attempts to do this used the guardWithTest approach. However, this made performance worse, not better. Now we go for a simpler approach that assumes that despite method calls being polymorphic, in reality the majority are monomorphic. So it optimizes for that case. Thanks to other improvements, there's no loss if we're wrong and fall back to the normal dynamic lookup.
18:24
jnthn DarkWolf84: Not sure about who owns it, but iirc it's wiki-like, so if you have a solution to a problem for a language you can add it.
DarkWolf84 should I ask some permision? 18:25
PerlJam DarkWolf84: no. forgiveness >>> permission :)
DarkWolf84 ok 18:26
PerlJam IIRC, mikemol "owns" rosettacode. You could ask him if you need some "authority"
rurban kbenson: I answered to the java substring problem at twistedoakstudios.com/blog/Post8147...ing-memory 18:34
timotimo jnthn, good speed improvements?
masak DarkWolf84! \o/ 18:41
DarkWolf84 hi, masak
kbenson rurban: interesting. In truth, I didn't look super close at the article. I see stuff that looks interesting to VMs and think "hmm, I know some people working on that..." 18:45
masak * FROGGS .oO( #perl6 - where nothing is off topic unless we don't like you! ) 18:50
to which the obvious retort is "FROGGS, please stay on topic"
:P
FROGGS :P 18:51
I won't move!
jnthn timotimo: In some micro-benchmarks for NQP, there's certainly some. I seem to have regressed some spectests. 19:07
timotimo 'some microbenchmarks' :/ 19:13
sounds just likevthe stuff i keep doing :) 19:14
DarkWolf84 rosettacode.org/wiki/Dining_philoso...d_AnyEvent 19:17
I posted it 19:18
ajr_ DarkWolf84: Just don't abuse the abos. (When anybody's looking.)
DarkWolf84 sorry 19:20
masak ajr_: the... aborigines? o.O 19:30
ajr_ I think I have the quote correct.
jnthn Phew, looks like all my spectest regressions were down to a single thinko.
masak ajr_: I have no idea what quote that might be. 19:36
ajr_ The "Three Bruces".
dalek p/indy-args: 7805299 | jnthn++ | src/vm/jvm/runtime/org/perl6/nqp/runtime/IndyBootstrap.java:
Fix excessive decontainerization bug.

Fixes Rakudo spectest regressions resulting from indy work.
19:38
masak oh, ok.
jnthn A while back we discussed a bug involving some split/join thing taking gigabytes, but I can't find it now. :( 19:45
lizmat: Dunno if you remember ^^?
lizmat yes, I do vividly! 19:46
moritz iirc it was split that was very slow, not join
jnthn Well, I'm more looking at the insane memory use...does anybody have the code that triggered it? 19:49
lizmat (^10000).join(' ').split(' ') ?? 19:49
lue hello world o/ 19:51
moritz jnthn: say (^20_000).join(',').split(',')[*-1];
java.lang.OutOfMemoryError: Java heap space
lue lizmat: fwiw I've always wondered why pragmas were done with module calling syntax too. 19:53
timotimo: shouldn't be long now :)
dalek kudo/nom: b227e62 | jnthn++ | src/core/ListIter.pm:
Allocate more sensibly in ListIter.
20:01
jnthn moritz, lizmat: Now it completes :) 20:01
lue Is there supposed to be an error trying q:to/ END/ ? 20:02
moritz lue: I don't know if there's supposed to be an error, but it sounds like a dangerous thing to do 20:03
lue agreed :) 20:03
Util r: my @a = [ 1, 2 ], [ 5, 8 ]; for @a -> [ $OLD, $NEW ] { say $NEW - $OLD } 20:13
camelia rakudo-parrot 874e35, rakudo-jvm 874e35: OUTPUT«1␤3␤»
Util r: my @a = {OLD=>1,NEW=>2},{OLD=>5,NEW=>8}; for @a -> { :$OLD, :$NEW } { say $NEW - $OLD }
camelia rakudo-jvm 874e35: OUTPUT«===SORRY!=== Error while compiling /tmp/OueXDh2A2V␤Variable '$OLD' is not declared␤at /tmp/OueXDh2A2V:1␤------> W=>2},{OLD=>5,NEW=>8}; for @a -> { :$OLD⏏, :$NEW } { say $NEW - $OLD }␤»
..rakudo-parrot 874e35: OUTPUT«===SORRY!=== Error while compiling /tmp/3ltssp8A1B␤Variable '$OLD' is not declared␤at /tmp/3ltssp8A1B:1␤------> W=>2},{OLD=>5,NEW=>8}; for @a -> { :$OLD⏏, :$NEW } { say $NEW - $OLD }␤»
timotimo watch out for flattening vs non-flattening
Util What syntax should I have used in the second attempt, to unpack hash values by keyname?
timotimo i think \(...)
jnthn Just parens
timotimo no, wait, that's wrong
yeah, just parens
masak yeah. 20:14
Util Doh!
masak curlies don't work, because they introduce the block. 20:15
Util Thanks, all!
timotimo jnthn: should i be creating a short-named method for the constructor? 20:17
dalek p/indy-args: 3d5a834 | jnthn++ | src/vm/ (2 files):
Make new callstatic op work on other backends.

Just compiles into the same thing as 'call' for the time being.
timotimo and if so, should it be .new or &.()?
jnthn timotimo: Those today are generated as something that shortens to new if there is just one of them... 20:18
timotimo because new might already be taken
oh!
neato :)
jnthn timotimo: So yeah, we can apply the same approach.
timotimo so i should be able to get that to work with ... yeah
jnthn I don't think you can write a method call new in Java.
*called
timotimo first i want to make sure my stuff isn't actually wrong :)
jnthn 'cus it's a keyword
moritz aye, the join + split example now completes, though still takes 14s on my not-too-slow machine 20:20
compared ot 0.088s on perl 5 :-) 20:21
r: say 19 / 0.088
camelia rakudo-parrot 874e35, rakudo-jvm 874e35: OUTPUT«215.909091␤»
jnthn Yes, at least now it doesn't take infinitely longer. :) 20:22
timotimo jnthn: i think i've been creating the same "name" for the CodeRefAnnotations of the same class 20:25
that's bad, right? why doesn't it asplode violently?
jnthn If it's the name just used for backtraces, etc then it needn't be unique... 20:28
timotimo oh, interesting 20:31
i'm not actually sure how it even finds the right method, tbh :)
timotimo what bytecodes do i need to emit to throw an adhoc exception with a nice string message? 20:34
or rather, where do i have to look?
jnthn Hmm...you could just get tc and a string constant on the stack, then make the static call to ExceptionHandling.dieInternal I guess. 20:35
That's probably easiest way.
Just 3 instructions :)
timotimo thanks :)
er, i think i may have done it in the wrong order 20:36
first the tc, then the string, aye?
oh, do i need to visitInsn(Opcodes.ATHROW) after that?
oh, i know what i'm doing wrong 20:37
also, i think i'm not installing the methods anywhere where they can be found by nqp 20:39
jnthn timotimo: No, dieInternal throws, iirc 20:40
timotimo strange. if i don't ATHROW there, i get an error during the bytecode validation step of ASM 20:41
if i do, i don't
excuse me for being stupid, but how exactly do i tell nqp "this method i'm building here ... please use it to supply the nqp-level method 'foobar'!"?
jnthn Oh...yeah...it returns an exception too
You could also pop 20:42
Doesn't that just need making sure it has an entry made in the hash computeInterop builds?
timotimo let me have a look 20:43
jnthn I'm pretty sure that's where it needs to go.
And then that hash gets used as the method cache or some such.
timotimo ah, startCallout used to do that 20:44
timotimo it pushes "desc" to that hash, but creates a CodeRef named "callout $classname desc" 20:45
timotimo i removed the line that adds the desc to the descriptors because i don't really have a desc equivalent 20:46
ah, desc is really only a somewhat human readable name 20:47
now i get it
jnthn description, I guess... 20:49
timotimo i thought it had to be a special format to please the jvm :) 20:54
lue the advent's publish-when clock runs on UTC I hope? 21:00
Here's the post to preview! perl6advent.wordpress.com/2013/12/0...9a653aee7c 21:02
lue timotimo: there it is ^^^ :) 21:03
timotimo cool, i'll grab my password and read
masak also 21:04
timotimo lue: on my browser and resolution, two of the code blocks scroll a tiny bit horizontally 21:05
the only thing you can see if you scroll right is whitespace, though
so it's just useless scrollbars 21:06
to be honest i prefer the look of the "code" blocks from the previous two posts
lue timotimo: yeah. I blame the code blocks being a pixel or two too short :)
timotimo where it doesn't have line numbers to the left
masak lue: s/thrid/third/ 21:07
lue got it :) 21:08
masak twice.
lue got two of 'em
masak lue++ # the post 21:09
lue masak: do you think I should change the [code] blocks to <pre> blocks, like timotimo? Cross-post consistency or some other reason?
nwc10 jnthn: origin/indy-args + Rakudo works on "my" machine
masak lue: I don't have a vested opinion either way.
lue: I'm tickled pink that you did bring up the BEGIN+heredoc thing. that's really nice.
lue I'll go in and make the change for output at least, that seems silly on second thought. 21:10
masak lue: you might want to spend a sentence or two on why it's not possible, though.
lue: (it's to do with one-pass parsing)
lue Yeah, I'll go and add a statement about one pass parsing and how BEGIN blocks mess that up for heredocs.
timotimo i'd appreciate a more thorough mention of "adverbs" 21:11
jnthn nwc10: NQP, or you build Rakudo too? 21:11
nwc10: Should both be working, though...
masak timotimo: oh, I had that thought too. no explanation of :c, for example. 21:12
nwc10 Rakudo passes all of its tests when built using NQP on origin/indy... 21:13
timotimo jnthn: so did you notice a speedup in the compilation or something? :)
lizmat suddenly realizes she has been responsible for the problem solved by github.com/rakudo/rakudo/commit/b227e6294b 21:14
lizmat again, it becomes clear, that premature optimization is evil 21:14
dalek kudo-star-daily: 900fa28 | coke++ | log/ (5 files):
today (automated commit)
21:16
timotimo having to tap up before return to get jdb to do another step is *very* tiring
jnthn timotimo: Didn't do a huge amount of comparison yet, but numbers seem to be falling a bit :)
nwc10 will try to time the setting compilation "without" and "with" tomorrow 21:17
if suitable bits of time present themselves
timotimo blergh! successive calls to "list" will not reveal more and more code 21:19
lue Is it supposed to fail if I do sub stuff { say q:to/END/ } \n <heredoc> ? (i.e. s/BEGIN/sub stuff/ for the broken example) 21:21
masak lue: no. 21:22
lue That's what I thought.
masak r: sub stuff { say q:to/END/ }␤OH HAI␤ WORLD␤END 21:23
jnthn Yeah, that *should* work...
camelia rakudo-jvm b227e6: OUTPUT«(timeout)»
..rakudo-parrot b227e6: OUTPUT«===SORRY!=== Error while compiling /tmp/i6PYMUYPnN␤Confused␤at /tmp/i6PYMUYPnN:4␤------> END⏏<EOL>␤ expecting any of:␤ postfix␤ statement end␤ statement modifier␤ state…»
jnthn It's BEGIN that won't...
masak hmmm
p: sub stuff { say q:to/END/ }␤OH HAI␤ WORLD␤END␤stuff
camelia rakudo-parrot b227e6: OUTPUT«===SORRY!=== Error while compiling /tmp/bSrjIFhoVF␤Confused␤at /tmp/bSrjIFhoVF:5␤------> <BOL>⏏stuff␤ expecting any of:␤ postfix␤ statement end␤ statement modifier␤ sta…»
masak bleh. 21:24
jnthn std: sub stuff { say q:to/END/ }␤OH HAI␤ WORLD␤END␤stuff
camelia std 3b262af: OUTPUT«ok 00:01 124m␤»
masak submits rakudobug
jnthn p: sub stuff { say q:to/END/ };␤OH HAI␤ WORLD␤END␤stuff
camelia rakudo-parrot b227e6: OUTPUT«OH HAI␤ WORLD␤␤»
jnthn Looks like some bad interaction between heredocs and the closing curly rule.
masak double bleh.
jnthn Well, not really. That golfs it to something smaller/more huntable. 21:25
lue will assume it works for the sake of argument in his post :) 21:26
lizmat decommutes& 21:27
masak p: sub x { say q:to/A/ }␤A␤x 21:28
camelia rakudo-parrot b227e6: OUTPUT«===SORRY!=== Error while compiling /tmp/skxXrbOobv␤Confused␤at /tmp/skxXrbOobv:3␤------> <BOL>⏏x␤ expecting any of:␤ postfix␤ statement end␤ statement modifier␤ stateme…»
masak p: sub x { say q:to/A/ };␤A␤x
camelia rakudo-parrot b227e6: OUTPUT«␤»
masak jnthn: indeed :)
lue Updated the post. Now mentions one-pass parsing and explains the :c adverb. 21:30
masak lue++
[Coke] still have one failur in Testing modules/perl6-lwp-simple...
lue (I don't think this post is the best place to explain adverbs in general though; I could be wrong however.)
masak lue: I like the distinction between code and output. 21:31
lue
.oO(Hmmm... maybe I could explain adverbs on another advent day? ☺)
lue masak: depending on how you write your Day 9 post, Day 10 might be the perfect place to explain adverbs. 21:34
masak interesting development with the t4 reviews: 21:35
I just constructed 6 "hard cases" to try the four submissions on. three fail at least two.
the fourth one passes them all.
lue: I'll keep that in mind :)
lue Should I reserve day 10 for adverbs then?
masak might as well.
though I suspect they might have been topic'd before. 21:36
lue I covered DateTime a couple years ago, didn't seem to stop moritz :) /me checks the past anyway
Huh, I don't see an adverb post in any of the schedule files (I did see a Hash post in 2011 though ☺) 21:39
timotimo i'm getting "No such method 'insert' for invocant of type 'BOOTJavaObject'", but i'm putting a coderef into the names list with "insert" as the name :\
ah, the duplication check removes them again %) 21:40
masak lue: I might be wrong :) 21:41
dalek : 135dd29 | lue++ | misc/perl6advent-2013/schedule:
[advent-2013] Claim Day 10 for adverbs

It'll flow nicely from Day 9 I suspect :) .
21:42
lue
.oO(I hope my working tile for Day 10 isn't too cryptic...)
21:44
masak lizmat++ moritz++ raydiak++ # filling The Gap since I last looked 21:47
I'll take slot 6 if no-one else does... but I'd prefer not to have to.
timotimo jnthn: my coderefs are turning up null :(
jnthn :( 21:51
timotimo would you like to look at my code? 21:52
it's not pretty :)
jnthn Well, given it's Java... :P
I cna glance at it and see if I spot anything.
timotimo well, it also needs a big refactoring before it can be merged 21:53
jnthn Sure; make it work, then make it nice.
dalek p/jvm_interop_dispatchers: a69295d | (Timo Paulssen)++ | src/vm/jvm/runtime/org/perl6/nqp/runtime/BootJavaInterop.java:
oh god the humanity!
lue masak: I'm thinking of a post exploring things more generic than class, which are oft-forgotten (package, module). I'm just not totally confident I'll learn everything I need to know in time for Day 6 for that.
lue must see timotimo's commit :) 21:54
timotimo my $interop := nqp::jvmbootinterop(); my \StrBuilder := $interop.typeForName('java.lang.StringBuilder'); my $b := StrBuilder.'constructor/new/()V'(); $b.insert(1, 2);
DarkWolf84 bbfn and happy hacking :) 21:55
masak lue: then please schedule it for a later slot ;) 21:56
timotimo what does bbfn mean?
lue Bye Bye For Now methinks
timotimo ah, that makes sense
masak lue: the question I'd like to see addressed is "why would anyone ever use the `package` keyword in Perl 6?" :P 21:57
lue me too :)
(In S11) Is =NAME, =AUTHOR, and =VERSION really how you're supposed to set the info in use Foo::bar:auth<foo>:ver<2> ? 21:58
dalek kudo/opts: afb0511 | jnthn++ | src/Perl6/Optimizer.nqp:
Start trying to use callstatic where possible.
22:07
kudo/opts: ceb7f13 | jnthn++ | src/Perl6/Optimizer.nqp:
Avoid double-walking trees in sink context.

Before, we'd walk the tree under the non-void and void branches of the QAST::Want. This prevents the double-work, cutting a good bit off the optimize phase.
timotimo good catch :) 22:10
huh, is that decision with 'soft' really right? 22:12
looks weird to me
jnthn Think so
If we start failing wrap tests we'll know :)
timotimo either the scopes is 0, or it's 1 and calling .soft gives 0?
well, what do i know :) 22:13
jnthn Well, gives something false-y.
timotimo right
are you looking at my branch?
jnthn a soft routine is too mutable to reduce the call to a static...
timotimo thinking wether or not to go to bed now :)
jnthn timotimo: I dont' immediatley see the problem... 22:19
How does it fail? 22:20
timotimo the error is No such method 'insert' for invocant of type 'BOOTJavaObject', the cause is that SixModelObject cr = adaptorUnit.lookupCodeRef(i) returns null
i pasted a bit of code you can run to get the same error above 22:22
jnthn Don't suppose you're missing a call to c.mv.visitEnd(); or something? 22:24
timotimo i have a visitEnd directly after the "name" thing
and i end the whole thing with endCallout 22:25
jnthn av.visitEnd(); ? 22:26
I meant one on the mv you crate
MethodVisitor mv = mc.mv = ...
Do you certainly visitEnd at some point?
On the mv? 22:27
timotimo i think so 22:28
i give mc to the stopCallout
timotimo er endCallout 22:29
endCallout does c.mv.visitEnd
jnthn ok
timotimo i guess i'll have to ... *shudder* jdb that 22:34
lue timotimo: you could always use gcj and then gdb :) 22:40
timotimo oh hell no 22:40
maybe i can attach an IDE to the jdb server, though
timotimo well, i'll see what i can do tomorrow. 22:45
jnthn Yes, sleeping on it may well help :) 22:46
Looks like quite a bit of progress, even if it's not quite working yet. 22:47
timotimo++
timotimo i only got the easy parts done ;)
mostly by stealing from other places :D
lue I can't help but feel this line in S10 is a bit redundant by the time you get to S10: "Since there are no barewords in Perl 6, package names must be predeclared." 22:51
lue gets the feeling it's been a while since someone looked at S10... 22:54
dalek kudo/opts: 4af34c8 | jnthn++ | src/Perl6/Optimizer.nqp:
On JVM, eliminate binder for zero-param code.

This in turn means it'll be elligible for the indy optimization that relates to such calls.
22:56
jnthn Teaching tomorrow, so I guess I'll have to stop there with hacking on stuff for today... 22:57
lue Is it just me, or does S10 go off on a tangent at one point that doesn't *really* fit with a spec about packages? Or is thinking S10 is about the C<package> keyword too narrow a view? 23:01
lue concludes that S10 is useless for learning about packages, due either to brevity or the... suboptimal way it's written. 23:12
I just realized: S10 not containing much useful information on how C<package> works is probably due to suffering from "If it's the same as Perl 5, don't mention it" syndrome. 23:15
jnthn 'night, #perl6 23:17
lue jnthn o/ 23:21