»ö« 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.
timotimo tries a new configureJVM.pl 00:02
i was wrong. it builds, but the execution raises an "representation cannot unbox to native int" where no int should be required 00:06
rakudo-jvm: class Foo { has num $.a }; my Foo $f .= new(:a(0e0)); 00:10
camelia rakudo-jvm 1f77c4: OUTPUT«java.lang.RuntimeException: Cannot access a native attribute as a reference attribute␤ in block at src/gen/CORE.setting:829␤ in method bless at src/gen/CORE.setting:797␤ in method dispatch:<.=> at src/gen/CORE.setting:1118␤␤»
timotimo now the question is: is that an improvement? i don't think so.
well, maybe tomorrow i'll get some help to fix this up for realsies
00:13 Psyche^_ joined 00:14 pecastro joined 00:16 Psyche^ left
grondilu .tell [Coke] changed my mind. If not too late, please use grondilu instead of my real name 00:16
yoleaux grondilu: I'll pass your message to [Coke].
00:17 ajr_ left 00:18 pecastro left
BenGoldberg n: class Foo { has num $.a }; my Foo $f .= new(:a(0.0)); 00:26
camelia niecza v24-98-g473bd20: OUTPUT«===SORRY!===␤␤Malformed has at /tmp/lBWIpZJawr line 1:␤------> class Foo { has⏏ num $.a }; my Foo $f .= new(:a(0.0));␤␤Parse failed␤␤»
Mouq n: my num $a # this works, right?
camelia niecza v24-98-g473bd20: OUTPUT«===SORRY!===␤␤Malformed my at /tmp/6csn3unNi8 line 1:␤------> my⏏ num $a # this works, right?␤␤Parse failed␤␤»
BenGoldberg Peculiar 00:27
Mouq n: my int32 $a # this works, right? 00:28
camelia niecza v24-98-g473bd20: OUTPUT«===SORRY!===␤␤Malformed my at /tmp/UP1Kz5mVGp line 1:␤------> my⏏ int32 $a # this works, right?␤␤Parse failed␤␤»
00:36 jeffreykegler joined 00:37 grondilu left 00:38 jeffreykegler left 00:49 zjmarlow left 00:52 autark left 01:01 xinming_ left 01:02 xinming joined
dalek ecs: c251a84 | larry++ | S02-bits.pod:
Some cleanups from hexcoder++
01:07
01:13 pdurbin joined 01:16 berekuk left 01:18 c1sung left, c1sung joined 01:35 mtj joined 01:37 silug joined 01:42 woosley joined 01:43 jnap left 01:45 _ilbot left 01:46 _ilbot joined 02:01 cognominal left, cognominal joined 02:04 LWA left
japhb__ masak, re: irclog.perlgeek.de/perl6/2013-10-17#i_7724545, man I like that syntax. :-) 02:20
02:24 benabik joined
japhb__ .tell timotimo re: slow dir (irclog.perlgeek.de/perl6/2013-10-17#i_7727089), see the discussion starting at irclog.perlgeek.de/perl6/2013-10-16#i_7719713 . Go far enough down in a slow path/filesystem operation, and you'll probably end up at canonpath, which is very slow. 02:28
yoleaux japhb__: I'll pass your message to timotimo.
japhb__ I think making it fast would be a big win for lots of path/filesystem operations. Making the underlying substitution operations fast would be a win for all sorts of use cases. 02:29
02:38 jnap joined, xinming left, jnap left 02:40 xinming joined 02:46 xinming left, xinming joined 03:09 aindilis joined 03:43 preflex_ joined, ChanServ sets mode: +v preflex_, preflex left 03:44 preflex_ is now known as preflex
moritz \o 04:02
04:10 xinming left 04:12 xinming joined 04:14 woosley left 04:19 [Sno] left 04:41 BenGoldberg left 04:49 FROGGS left 04:54 SamuraiJack joined 05:08 woosley joined 05:26 [Sno] joined 05:28 silug left 05:30 pecastro joined 05:34 pecastro left 05:35 btyler left 05:36 FROGGS joined 05:38 FROGGS left 05:39 silug joined
dalek p/unified-build: c6175b8 | moritz++ | tools/build/Makefile-Parrot.in:
[Parrot] missing cleanup
05:40
05:57 denis_boyun joined
dalek kudo/nom: 150bdb3 | coke++ | docs/announce/2013.10.md:
grondilu++
06:01
[Coke] grondilu++ 06:04
yoleaux 00:16Z <grondilu> [Coke]: changed my mind. If not too late, please use grondilu instead of my real name
06:18 woosley left 06:20 woosley joined 06:22 bloonix left 06:23 bloonix joined
dalek kudo/nom: bba54af | coke++ | docs/ (2 files):
copy big ticket items to changelog.

Fix grammer-o; japhb++
06:41
06:42 ssutch left
jnthn Cool! The first freezing weather of the autumn for me :) 06:47
dalek kudo/nom: 853e255 | coke++ | tools/build/NQP_REVISION:
[2013.10] bump NQP revision
06:48
kudo/nom: 39f4919 | coke++ | VERSION:
[2013.10] bump revision
[Coke] jnthn: crap, are you awake already? 06:50
jnthn [Coke]: Yeah. Gotta teach today... 06:52
Otherwise I'd not be ;)
teaching & 06:55
masak morning, #p6 06:58
07:02 bloonix left 07:03 bloonix joined, PacoAir left 07:04 __sri left, FROGGS joined 07:05 bonsaikitten joined, DrEeevil left 07:06 _sri joined
masak hah, and jnthn is happy about the cold in the backlog... probably means I should stay inside all morning :P 07:11
nwc10 I hope your house isn't in UGT, else you'll be trapped. 07:17
07:20 darutoko joined
FROGGS .tell [Coke] that the release announcements states it is the september release in the first line... 07:21
yoleaux FROGGS: I'll pass your message to [Coke].
[Coke] ah, crap stress test is failing.
yoleaux 07:21Z <FROGGS> [Coke]: that the release announcements states it is the september release in the first line...
FROGGS [Coke]: what exactly?
I would expect main-usage and another one to fail 07:22
masak nwc10: I thought if I leave IRC, it'd be UGT night... :) 07:23
FROGGS [Coke]: is it okay if I agg more to docs/ChangeLog? 07:27
add*
07:28 rindolf joined
[Coke] FROGGS: it's a little last minute, but sure. 07:28
dalek kudo/nom: d506b8d | (Tobias Leich)++ | docs/ChangeLog:
added some more items
07:30
FROGGS [Coke]: done, thank you
[Coke] FROGGS++ 07:32
JEZU it takes forever to cut a release. 07:33
FROGGS yeah, it does :(
nwc10 can more of it be scripted/automated/pushed back earlier in the month? 07:34
or is it now a mature project, like Perl 5? :-)
[Coke] nwc10: "run the full test suite". "cut a release. build it and run the full test suite"
07:34 dansamo joined
nwc10 aha. those seem sensible steps 07:34
masak [Coke]: fwiw, I usually run the full test suite in parallel with a lot of the other steps. 07:35
[Coke]: only going back if the test suite brings up problems.
[Coke] ... guess what I'm doing. :P 07:36
rerunning the test suite. :(
07:37 sqirrel joined
masak :/ 07:37
[Coke] bah. it's 3:40 AM here. I may have to pass the torch 07:38
I did not plan this well.
moritz [Coke]: do you want to do it tomorrow, or should I take over? 07:39
I have O(3h) of free time on my hand
[Coke] eh. "nearly" done. I'll soldier on. 07:40
moritz [Coke]++
07:41 denis_boyun left
masak [Coke]: in the interests of release manager management, what went wrong in planning, and what can we do about it next time? 07:45
remind a few days earlier?
masak , release meta-manager 07:46
[Coke] just need to remember that this isn't a quick thing. doesn't take a lot of eyeball time, but a LOT of clock time. 07:47
masak so it does.
I usually think of it as a ~4h thing.
bonsaikitten at this point someone suggests a CI infrastructure ;)
dalek kudo/nom: 455467b | coke++ | docs/announce/2013.10.md:
Fix month. FROGGS++
07:51
masak bonsaikitten: well, it *would* be an interesting thought experiment/hackathon to figure out how much of it could be reduced to just the push of a button. 07:57
I for one consider the announcement writing to be a bit too error-prone and not automated enough.
today's mini-challenge: make a script that produces a Rakudo announcement for the current month! 07:58
preferably it should just run without interactivity and place a file in the right subdirectory in the rakudo directory.
it may need to insert "[TODO]" markers for things like the current release name. 07:59
moritz r: say nqp::readall(nqp::open('/home/p6eval/nom/docs/announce/2013.09', 'r'))
camelia rakudo 39f491: OUTPUT«===SORRY!===␤Error while compiling block (source text: "say nqp::readall(nqp::open('/home/p6eval/nom/docs/announce/2013.09', 'r'))"): Error while compiling op call: Error while compiling block : Error while compiling op call (source text: "say nqp::readall(n…»
moritz r: say(nqp::readall(nqp::open('/home/p6eval/nom/docs/announce/2013.09', 'r')))
camelia rakudo 39f491: OUTPUT«===SORRY!===␤Error while compiling block (source text: "say(nqp::readall(nqp::open('/home/p6eval/nom/docs/announce/2013.09', 'r')))"): Error while compiling op call: Error while compiling block : Error while compiling op call (source text: "say(nqp::readall(…»
bonsaikitten masak: I've been automating quite a bit, maybe I can take care of this "problem" too 08:00
cronjobs are infinite power ;)
masak ++bonsaikitten 08:01
also, why don't we have a Perl 6 script in the Rakudo repo that computes future Rakudo release dates? 08:02
like "give me all the release dates in the interval 2013-01-01..2013-12-31"
or "when's the October release?"
bonsaikitten that sounds like a nice idea
masak and then provide it as a bot on the channel, too ;)
moritz masak: iirc we have such a script 08:03
tools/release-dates.pl
masak oh! oh! also, "who's the October release manager?"
moritz: oh, cool.
masak-- # didn't know :) 08:04
moritz r: say Date.today - Date.new('2013-02-03') 08:05
camelia rakudo 39f491: OUTPUT«257␤»
JimmyZ r: say Date.today - '2013-02-03'.toDate 08:09
camelia rakudo 455467: OUTPUT«No such method 'toDate' for invocant of type 'Str'␤ in block at /tmp/XeVDbKh32t:1␤␤»
JimmyZ r: sub ToDate($date) { Date.new($date); }; say Date.today - '2013-02-03'.&toDate 08:11
camelia rakudo 455467: OUTPUT«===SORRY!=== Error while compiling /tmp/tLNmAC_PF5␤Undeclared name:␤ &toDate used at line 1␤␤»
moritz it helps to use the same case for both declaration and use
JimmyZ r: sub ToDate($date) { Date.new($date); }; say Date.today - '2013-02-03'.&ToDate
camelia rakudo 455467: OUTPUT«257␤»
JimmyZ I thought there was "Do you mean ..." 08:12
moritz seems not to be used in all contexts
08:13 donaldh joined 08:17 woolfy left 08:19 donaldh left
masak moritz++ # Date 08:21
dates are much more tractable than datetimes. 08:22
lizmat [Coke]: fwiw, spectest is green on parakudo for me 08:29
[Coke] lizmat++
lizmat decommute continues with final leg: Ghent to Echt :-)
[Coke] it rang green with jobs=2 instead of 3 for me. at S14 on the stresstest via the tarball.
lizmat Files=764, Tests=29694, 453 wallclock secs ( 9.72 usr 2.95 sys + 3049.92 cusr 336.60 csys = 3399.19 CPU) 08:30
08:30 denysonique left 08:31 gfldex left 08:32 pernatiy joined
masak the release guide still doesn't say "run the spectests on Rakudo Parrot *and* Rakudo JVM", does it? 08:33
08:34 gfldex joined 08:39 lizmat left
[Coke] no, thank the great maker. 08:39
masak .oO( the great Makefile ) 08:41
08:42 mush joined
mush hello 08:42
where can i find some info on the current development status / change log for perl 6 ? 08:43
hoelzro mush: hi! 08:44
rakudo.org has a bit of that information
although rakudo is just one of the implementations
FROGGS if `git checkout HEAD^` let me step back one step into the past, how do I get into the future?
hoelzro perl6.org/compilers/features is also handy
FROGGS: you don't =(
mush nice, ty
FROGGS meh
masak mush: planetsix.perl.org/ is nice.
hoelzro you can checkout master or branch
or you can use the reflog 08:45
FROGGS: you're not by chance an Hg user normally, are you?
FROGGS no
mush i've actually got an university coursework to do which involves using perl
masak hopes frettled is OK, planetsix.perl.org/ says his pipe "has been deleted" :/ 08:46
mush does netbeans know how to work with perl ?
masak no idea.
I know there is a Perl dev plugin for Eclipse.
[Coke] done.
FROGGS [Coke]++
masak \o/
[Coke] email sent, files uploaded, wikipedia edited.
masak [Coke]++
[Coke] welcome to "Roederbergweg" (closest to frankfurt that was unused) 08:47
I will celebrate i about 3 hours with a gallon of coffee.
Adios.
masak o/ 08:48
mathw o/
[Coke] \o
FROGGS [Coke]: gulp well o/
mathw o/ \o
\o/
masak good UGT night, [Coke], hero of taken-by-relative-surprise release managers!
mathw I like how "wikipedia edited" is on the list now :)
the central repository of all human knowledge, or something 08:49
masak mathw: the cool thing is, "an encyclopedia" was among the suggested projects of TimBL's original vision for the Web.
mathw It's kind of an obvious application of the web
or rather, a hypertext system
masak troo. 08:50
mush the mighty hypertext!
mathw he might not have anticipated it being a wiki though...
masak I've always considered TimBL's Web to be slightly cooler, though. I want to be able to PUT to web pages, darnit!
mathw :)
mush as in.. be able to edit them lively ?
mathw yeah PUT kind of fell by the wayside until REST came along 08:51
masak that would basically have made the wiki, a hack from the very start, unnecessary.
mathw well you could write a wiki that accepts PUTs
you'd need to write a web browser that could send them, but...
masak right.
browsers are the bottleneck.
Amaya does it. 08:52
(and it's awesome)
mush noes it's the format
mathw Amaya is the only one that's ever likely to 08:53
it's the model web browser everyone else ignores
masak Amaya is the Plan 9 of browsers.
mathw ah Plan 9
my boss at my first job after university is a Plan 9 fan 08:54
he used to run it in a VM on his work machine
masak "Look, *this* is how you should impl... guys? Guys?"
mathw sometimes he'd write code in its environment, just because it was more fun
I, with more modest tastes, stuck to vim
08:55 pernatiy left
mathw attempts to convince his brain that he's on $dayjob, so he should really be thinking in C# not Haskell 08:55
frettled masak: Hum. Maybe Yahoo! Pipes is defunct.
I think my feed was based on that. 08:56
masak frettled: I was mostly concerned about your well-being. I had no idea what a destroyed pipe might imply. :P
masak .oO( Magritte: Ceci n'est pas une destroyed pipe ) 08:57
08:57 pecastro joined
masak .oO( well, it *is* a pipe, Magritte dear, if you're inside of the Art monad ) 08:58
moritz wouldn't that bee destroyée? :-)
*be
masak .oO( wouldn't that spelling bee destroyée? ) 08:59
08:59 dayangkun_ left
masak moritz: yes, and most likely postfixed to "pipe". 08:59
moritz www.perlmonks.org/?node_id=1058723 # another partially p6 reply to a p5 question
moritz simply can't resist
08:59 dayangkun joined
masak oh, "détruite", in fact. 08:59
09:00 mush left, donaldh joined
moritz but that's actual French, not English made to look like French :-) 09:00
so, fail :-)
frettled masak: well, thanks for your concern :) I'm quite fine, thank you! … and judging from your activity, I'd guess that you're doing okay, too. Are you? :) 09:01
masak ah non, le fail! quel dishoneur. :P
frettled nous avons le fail grande
(important to use the wrong gender suffix for that)
masak frettled: thank you, yes, very okay. I keep wishing I had more Perl 6 and #perl6 time... but apart from that, everything is a-OK.
frettled: "des failes grandes" -- remember to pluralize :P 09:02
JimmyZ You Will
frettled I'm almost constantly trashing around in context switches, so I don't have the energy for much extra-curricular work.
But I _have_ noticed that Perl 6 seems to be stabilizing nicely, and might possibly be production ready for several use cases we have at work. 09:03
masak meanwhile, all the actually French people on the channel are going "oh non, my yeux, they sont bleeding!"
frettled :D
masak frettled: yeah, the torch is being carried on.
moritz masak++ # Frenglish punning
hoelzro loves interlingual puns 09:05
JimmyZ 我的妈呀
masak more like smashing the languages l'un into l'autre, in this case. :)
JimmyZ: :) 09:06
JimmyZ: 你的妈呀 ;)
moritz .u 呀
yoleaux No characters found
moritz how fitting :-)
masak haha
yoleaux is without character.
bonsaikitten dat is niet leuk!
moritz it should answer with "你的妈呀" to unknown characters though 09:07
JimmyZ it's 'My god' in english 09:08
masak
moritz: re www.perlmonks.org/?node_id=1058723 -- as cool as junctions are sometimes, I would *greatly* lean towards the hash variant in most scenarios. 09:14
moritz: for maintainability.
moritz masak: me too
which is why I put it first :-)
masak nodnod 09:15
moritz (actually a more 6ish approach would use given/when with junctions in the when clauses, and I'd *still* prefer the hashes)
[Coke]++ # Rakudo release
masak it seems without realizing it, in the past few years when I program I always take the stance "how will I make this code easy to read/understand/change in the future?" 09:16
mathw moritz: Junctions are indeed awesome
masak and chained `if` statements lose to hashes most of the time.
mathw for that problem, hashes are probably superior, but sometimes it's so nice to just say "if $thing == 1 | 2"
it's the little things, not just the big things 09:18
moritz mathw: in fact I only use Junctions for the little things 09:20
whenever somebody uses them for the big things, I find it's an abuse of junctions, and quickly runs into their limitations
good that we now have sets, bags, keybags and all those other fancy thingies 09:21
Ulti *HashBags ;P 09:22
moritz HashTags
Ulti I know it changed in my bones because I had to regex my code :]
masak someone should blog about "all the nice things we have in Perl 6 that you thought you should use junctions for" :) 09:23
Ulti wait are nested junctions meaningless 09:25
masak Ulti: no, but they flatten into two levels. 09:27
09:27 berekuk joined
masak disjunctions (any/one) on the outside and conjunctions (all/none) on the inside. 09:27
this is in line with (most) natural language: "did you wash your clothes and have a nap OR go to the movies and inadvertently cause the apocalypse" 09:29
things naturally group into "(clothes && nap) || (movies && apocalypse)"
Ulti might play with that later, certainly the most useful meaning not sure its obvious that's what would happen though 09:30
I'd have expected it to just flatten completely into all or 09:31
masak Ulti: as a rule, I play it safe and use junctions with as small a footprint as possible. 09:33
if *I'm* uncertain of how a junction interacts with a negation... then I rephrase the expression.
Ulti I've only used them in 'where' in multi methods so far 09:34
which I think is really really powerful
masak rn: my $x = 5; if $x != any(1, 2, 3) { say "it's not one of those, that's for sure" }
camelia rakudo 455467, niecza v24-98-g473bd20: OUTPUT«it's not one of those, that's for sure␤»
masak rn: my $x = 5; if not $x == any(1, 2, 3) { say "it's not one of those, that's for sure" }
camelia rakudo 455467, niecza v24-98-g473bd20: OUTPUT«it's not one of those, that's for sure␤»
masak rn: my $x = 5; if $x == none(1, 2, 3) { say "it's not one of those, that's for sure" }
camelia rakudo 455467, niecza v24-98-g473bd20: OUTPUT«it's not one of those, that's for sure␤»
Timbus you cant have junctions as hash keys?
that would be neat :< 09:35
masak rn: my %h; %h{3 | 4 | 5} = "OH HAI"; say %h.perl
camelia niecza v24-98-g473bd20: OUTPUT«Unhandled exception: Writing to readonly scalar␤ at /tmp/L0xcYQISXu line 1 (mainline @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4583 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4584 (module-CORE @ 576) ␤ at /home/p6ev…»
..rakudo 455467: OUTPUT«No such method 'STORE' for invocant of type 'Any'␤ in sub AUTOTHREAD_METHOD at src/gen/CORE.setting:3189␤ in any at src/gen/Metamodel.nqp:2675␤ in block at /tmp/uzaV4j0IrO:1␤␤»
Ulti Timbus: what happens when two junctions contain the same values
masak Timbus: no, because hash keys are something like Str(Any).
rn: say Junction ~~ Any
camelia rakudo 455467, niecza v24-98-g473bd20: OUTPUT«False␤» 09:36
masak what Ulti said.
That Way Lies Madness.
Timbus awesomeness, madness, eh
masak Timbus: I s'pose you could init your own hash to be Str(Mu), and then it'd take Junction, too.
but if I'm on your Perl 6 team and you do that, I'll report you to the (inherently junction-wary) middle manager :P 09:37
Timbus would i get praised and punished for doing it 09:38
09:38 daxim joined
masak one(praised, punished) # :P 09:38
Timbus also if it matches two junctions it should return both values. junctioned. "easy" 09:39
09:39 fhelmberger joined
masak .oO( You have a problem, and you go "I know, I'll store junctions in a hash!" Now you h... Null PMC Access ) 09:40
Ulti :D
mathw now you have one problem, or one problem, or one problem 09:41
Timbus beat me to it
mathw but you don't know which one
Timbus i got 99 problems but i dont know which one 09:42
mathw I've got a lot of problems, but I know one of them's my cat so that's a start
masak .oO( Schrödinger's cat had any(0, 1) problems ) 09:43
mathw no, he definitely had a problem
because some crazy guy in a thought experiment locked him in a box
or she 09:44
might have been a girl cat
one of my other problems is that nobody knows how to write good software yet
masak mathw: at least it wasn't Einstein's cat. Einstein's thought experiment was to blow up the cat with gunpowder, rather than poison it. 09:45
mathw another one of my problems is that some people know how to write not-quite-so-bad software but loads of other people who're writing software don't seem to be interested in learning
maybe einstein didn't like cats?
masak I think he just confused Schrödinger's original description with a thought experiment of his own. 09:46
both the cat and the powder keg were about translating uncollapsed quantum phenomena to the macroscopic world. 09:47
and both (of course) were all about demonstrating the paradox that this is not how it actually happens in the macroscopic world.
mathw indeed
masak so there is some unknown factor that collapses the wavefunction on the way.
mathw physics is weird :)
masak seems to me, by what little I know about QM, that wavefunctions are really very unstable, and it's not so much about a conscious observer collapsing it, but almost *anything*. 09:48
mathw I don't really know about that at all 09:50
I leave that to the physicists. Let them make my computer work, I'll write incomprehensible software for it
masak no no, the physicists are clearly having too much fun with their models and their understanding of the world. I want in. 09:51
mathw fine, go retrain as a physicist :) 09:56
get a job at CERN
make sure you figure out that everyone's been wrong about exceeding the speed of light though
either that or a clean, cheap energy source
moritz or come up with a *simple* model of what's actually going on :-) 09:59
mathw that'd be grand, but I don't think that's possible
it might be elegant, but it's not going to be simple 10:00
moritz ok, come up with model that's as simple as possible (no artifical complexity added)
masak currently struggling with this tension for writing a course: wanting to teach the theory, independent of any framework, but also the practice, in which case a choice of tools has to be made. 10:02
the topic is "web applications", and the niche in question is in great flux. there are *lots* of solutions, all slightly different.
10:13 berekuk left
moritz re collapsing wave functions: the interesting part is that QM people says that wave functions collapse when a system is measured, and the measurement, by very definition, is coupling with a classical (non-QM) system 10:13
so QM needs non-QM systems to work :-)
10:15 woosley left
moritz which of course bothers the theory folks to no end 10:17
10:24 denis_boyun joined 10:25 berekuk joined
masak it's a bit like how category theory claims to be more fundamental than set theory, and yet it uses sets all over the place :) 10:27
mathw well as I understand it there arne't any non-QM systems - classical mechanics is an emergent property of a lot of quantum stuff going on underneath. Somehow.
category theory is more general than set theory 10:28
so it's got all of set theory in it
moritz automatically red-flags any sentence that contains "emergent"
mathw plus some new headaches
lots of new headaches
mathw doesn't get category theory
I really started to tune out of it when I had to remember what a surjective functor is
moritz it's on my list of things I'd really like to understand, but have been too scared/bored to really study it 10:29
felher Is this supposed to work? :
sub say-first(Str @array) { say @array[0]; }; say-first(<a b>);
r: sub say-first(Str @array) { say @array[0]; }; say-first(<a b>);
camelia rakudo 455467: OUTPUT«Nominal type check failed for parameter '@array'; expected Positional[Str] but got Parcel instead␤ in sub say-first at /tmp/8zQ9BMoHFI:1␤ in block at /tmp/8zQ9BMoHFI:1␤␤»
moritz also on that list: Haskell, Quantum Field Theory
felher Or do I have to do something like:
moritz felher: no, it's not supposed to work, because <a b> isn't declared as Array[Str]
felher r: sub say-first(Str @array) { say @array[0]; }; my Str @a = <a b>; say-first(@a);
camelia rakudo 455467: OUTPUT«a␤»
10:29 denysonique joined
mathw moritz: Haskell worth learning, definitely. Just to twist your brain into a new shape and show you stuff that's interesting. 10:29
moritz felher: or simply remove the type constraint from @array :-) 10:30
seriously, typed arrays aren't well done enough yet to be worth the trouble
10:32 denis_boyun left
felher moritz: okay. But they are supposed to be well done enough someday? Beause for me, one of the great things of Perl6 ist gradual typing. I do not use Types everwhere, but in the signatures of public-api functions/methods, I find them to be quite useful. 10:32
10:33 denisboyun joined
moritz felher: so far there's no spec that says passing <a b> to Str @ should ever work 10:33
felher It's embarrassing how often I write 'ist' instead of 'is'. ;)
moritz felher: so I'm not sure if that's a future extension just waiting to come up, or if it won't work 10:34
felher moritz: okay, thanks :)
r: sub say-first(Str @array) { say @array[0]; }; say-first(Array[Str].new(<a b>)); 10:51
camelia rakudo 455467: OUTPUT«a␤»
felher I'll go with that for now. :) Seems concise enough :) 10:52
10:53 risou_awy is now known as risou
FROGGS moritz: using valgrind might be a better approach than bisecting it: gist.github.com/FROGGS/247efea9968...-bash-L689 10:58
moritz: updated, now: gist.github.com/FROGGS/247efea9968...-bash-L592 11:05
seems to a parrot internal bug/problem
11:10 pdurbin left 11:14 xdbr joined
moritz FROGGS: did you manage to reproduce it with a single process? 11:15
11:22 LWA joined 11:27 denisboyun left
timotimo felher: at least that error message is now non-unhelpful, thanks to me \o/ 11:30
yoleaux 02:28Z <japhb__> timotimo: re: slow dir (irclog.perlgeek.de/perl6/2013-10-17#i_7727089), see the discussion starting at irclog.perlgeek.de/perl6/2013-10-16#i_7719713 . Go far enough down in a slow path/filesystem operation, and you'll probably end up at canonpath, which is very slow.
felher timotimo++ then :) 11:31
timotimo :D
it used to not output the [Str] part in Positional[Str] 11:32
so people got "expected Positional, but got Parcel/Array instead"
and then they'd come here and write:
r: say Array ~~ Positional
camelia rakudo 455467: OUTPUT«True␤»
timotimo and they'd be extra-confused
r: for ^1000 { my $str = 'a||b'; $str ~~ s { '||' } = '|' }; say now - BEGIN now; 11:33
camelia rakudo 455467: OUTPUT«5.06187182␤»
timotimo r: for ^1000 { my $str = 'a||b'; $str.=subst('||', '|'); } say now - BEGIN now;
camelia rakudo 455467: OUTPUT«===SORRY!=== Error while compiling /tmp/T4Xo6ABTbj␤Confused␤at /tmp/T4Xo6ABTbj:1␤------> str = 'a||b'; $str.=subst('||', '|'); } ⏏say now - BEGIN now;␤ expecting any of:␤ postfix␤ statement end…»
11:33 LWA left
timotimo r: for ^1000 { my $str = 'a||b'; $str.=subst('||', '|'); }; say now - BEGIN now; 11:33
camelia rakudo 455467: OUTPUT«4.9991899␤» 11:34
11:34 LWA joined
timotimo wow. 11:34
r: for ^1000 { my $str = 'a||b'; $str.=subst(rx/'||'/, '|'); }; say now - BEGIN now;
camelia rakudo 455467: OUTPUT«5.582004␤»
11:38 grondilu joined
timotimo maybe a pattern that identifies already-canonical paths could be put in the first line to do a quick return in "most" cases? 11:39
FROGGS moritz: not yet 11:43
12:01 pernatiy joined 12:05 benabik left 12:06 benabik joined 12:07 benabik left
timotimo i'm not sure what :parent is supposed to do in canonpath 12:10
FROGGS moritz: the single test passes, even in valgrind 12:13
timotimo my pattern for finding already-canonical paths didn't help performance at all :(
now i'll see if it perhaps calls canonpath on the same path multiple times 12:14
the pattern was apparently never matched? weird. 12:22
ah, great 12:28
even with debug output it's now 2x faster in the dir(...) case
3.2s down to 1.2s for dir('/etc'), which has almost 100 entries 12:33
12:39 PacoAir joined 12:46 ajr joined 12:47 ajr is now known as Guest51652, Guest51652 is now known as ajr_ 12:50 timotimo joined 12:56 pernatiy_ joined
masak rn: say <foo bar>[0] ~~ Str 12:56
camelia rakudo 455467, niecza v24-98-g473bd20: OUTPUT«True␤»
masak rn: my Str @strings = <foo bar>; say "alive"
camelia rakudo 455467: OUTPUT«alive␤»
..niecza v24-98-g473bd20: OUTPUT«Potential difficulties:␤ @strings is declared but not used at /tmp/vtrdWuV4jL line 1:␤------> my Str ⏏@strings = <foo bar>; say "alive"␤␤alive␤»
12:56 xenoterracide left
masak rn: sub foo(Str @values) { say @values.perl }; foo(<a b c>) 12:57
camelia niecza v24-98-g473bd20: OUTPUT«("a", "b", "c")␤»
..rakudo 455467: OUTPUT«Nominal type check failed for parameter '@values'; expected Positional[Str] but got Parcel instead␤ in sub foo at /tmp/1RCpdnBpv0:1␤ in block at /tmp/1RCpdnBpv0:1␤␤»
masak I think a very strong argument could be made for this to work.
r: say Parcel ~~ Positional 12:58
camelia rakudo 455467: OUTPUT«True␤»
masak why shouldn't qw literals be typed with the type of their components?
timotimo you mean for <> to create a Str @? 12:59
masak yeah.
timotimo yeah. that should also be easy to implement.
masak and possibly an IntStr one, if all the components are Int-y.
etc.
12:59 pernatiy left
timotimo that is not as easy :) 12:59
masak it all takes place at compile time, so it's not a runtime cost.
well, one step at a time :) 13:00
timotimo bbl
masak Str @ is fine for a start :)
dalek rlito: 52bf49a | (Flavio S. Glock)++ | / (4 files):
Perlito5 - js - fix call with ampersand
13:01 berekuk left
mathw masak: it seemed to me that it should probably work 13:08
13:09 berekuk joined
masak yeah. for literals, I don't think there should be any hesitation. 13:12
literals should always be as narrowly typed as possible, up to and including generic types.
13:13 benabik joined
masak mathw: re category theory; the amazing thing isn't that it's more general than set theory and (trivially) contains it. the amazing thing is that it manages to do so and also (arguably) pose itself as more fundamental than set theory. 13:13
mathw I tend to look at it as that it's a more general theory, therefore it's more fundamental because it describes mroe stuff 13:15
admittedly I have no idea what that other stuff actually is
I know you can use it to model types in programming languages, but I never really figured out how. I was a useless PhD student (which is why I haven't got one) 13:16
masak in a sense, it's a "second system" compared to set theory.
mathw aaaaaaaaaargh run away! Second system syndrome!
masak set theory goes "it's all about the objects that are inside".
mathw actually it's the language you write set theory's metaclass in :P
13:17 denis_boyun joined
masak category theory goes "that's all very well, but we keep talking about transformations between objects all the time. so why not model those, too?" 13:17
and then, just like set theory, it does the trick of bootstrapping itself in itself.
13:17 berekuk_ joined 13:19 berekuk left 13:20 prevost joined 13:21 SamuraiJack left 13:31 bluescreen10 joined
mathw and then my head explodes 13:32
masak mine melts, but YMMV. 13:35
13:40 zakharyas joined
masak fun fact: tab completion creates temporary files, so when you've filled a partition, tab completion fails. 13:40
FROGGS good to know :o) 13:41
grondilu well, when you've filled a partition, lots of things fail 13:44
grondilu knows that since he's using an USB key as main partition, and it is often full 13:45
13:47 jnap joined 13:52 jnap left 13:53 jnap joined
mathw tab completion creates temporary files???? 13:54
mathw filled /var a few times, that was interesting 13:55
13:55 rindolf left 13:56 bluescreen10 left 13:58 bluescreen10 joined 14:02 jnap left 14:03 jnap joined 14:09 btyler joined 14:10 jnap left, jnap joined 14:14 jnap left 14:20 jnap joined 14:22 skids joined 14:23 kaare_ joined 14:24 jnap left 14:25 jnap joined
masak mathw: actually, topos theory appears to be the language you write set theory's metaclass in. 14:31
14:31 FROGGS left, jnap1 joined
masak topos theory seems like great fun. it looks like "The Atrocity Archives" for various approaches to logic from the 20th century. 14:31
as in, "and in this universe, intuitonistic logic is true..." 14:32
14:32 jnap left
mathw umm 14:35
masak intuitionistic* 14:36
TimToady *expialidocious 14:37
14:39 zakharyas left, jnap1 left
frettled In this universe, all absolutist statements are false. 14:39
14:39 jnap joined
frettled loves the word "absolutist" :) 14:40
TimToady Not on that, but in this universe we're all cretans.
mathw In this universe, I'm still waiting for the vet to call
14:41 benabik left
frettled TimToady: not cretaceans? 14:41
TimToady that's where the Elder Gods live 14:42
I think I'd prefer to live in the world where we're all cetaceans. 14:43
masak .oO( "pizza delivery to one Cth... Cthl..." )
TimToady: [cetacean needed]
japhb__ .ask timotimo Was your performance boost just from doing the "Is it already canonical?" check at the top of canonpath? 14:44
yoleaux japhb__: I'll pass your message to timotimo.
TimToady masak: I'll go ask Ahab for one.
mathw cetaceans are cool 14:45
14:45 benabik joined
japhb__ FWIW, I think something is seriously awry in whatever underlies subst/s{}= because nearly 50ms to make a single substitution in a 4 char string is crazy. 14:46
14:47 jnap left
japhb__ thinks ruefully of the hundreds of millions of CPU ops spent doing that and gets all >.< 14:48
14:49 jnap joined
TimToady especially when you consider how fast Perl 5 can do that 14:49
japhb__ yeah
TimToady but then, Perl 5 has mutable strings
14:49 ajr_ left
masak japhb__: and the same deal with .trans -- seems we need someone who will ruthlessly optimize those things to a polish. while not destroying the nice architecture in the process. 14:49
TimToady Perl 5 goes to great pains to do a substitution in-place if it can 14:50
or with at most one copy 14:51
frettled masak: «Hello, this is Microsoft support calling, may I speak to Mr. Nyahrlo, eh, Nyalal, you about a virus on your computer?»
japhb__ I would volunteer, but A) it would be an enormous yak-shave for me, and B) I'm not sure I can string together a long enough block of hours to fully understand the necessary bits and implement the change correctly anyway.
TimToady and it'll all probably change when we get NFG anyway... 14:52
and I doubt we have any mechanism yet for knowing whether a variable is the sole owner of an immutable string such that it could temporarily cheat and treat it as mutable 14:54
mathw you wouldn't want to get that wrong... 14:56
14:56 araujo left 14:57 araujo joined
japhb__
.oO( leaky broken abstraction )
14:57
14:57 jnap left
japhb__ goes back to trying to fix panda on networked filesystems 14:58
masak TimToady: re "any mechanism yet for knowing whether a variable is the sole owner of [...]" -- I think that's a *really* deep problem, like a research problem, of which iceberg escape analysis is but a tip. 14:59
TimToady yes, we realized that when we moved from ref counting to normal gc 15:00
I'd probably be pretty happy if we could get it down to a single copy 15:01
rurban You'd need to add single-byte refcounts just for lock-free threading 15:02
TimToady when you know the size of your original string, and the sizes of the old and new bits are fixed, you can calculate how much space you'll need
rurban but not like p5p did it at the end of the string. it needs to be checked atomically
masak TimToady: the state of the art of reference immutability that I've read is irclog.perlgeek.de/perl6/2013-09-26#i_7635049 -- but (a) such an explicit solution is not for mainline Perl 6, and (b) this solution, enticing as it is, doesn't seem "done" to me. notably, the need to forbid globals seems like a design smell. 15:04
15:04 ajr joined, ajr is now known as ajr_ 15:05 dmol left
benabik Immutable strings basically inevitably leads to poor performance of string manipulation. That's why most languages with them have a mutable version (i.e. Java StringBuilder). 15:05
rurban If they are big use bytebuffers instead. if you need to share parts use tries (as clojure does) 15:06
benabik If we have library methods that do a lot of string mania, we might want to convert it to some mutable format, do the manipulation, and then convert back. 15:08
TimToady well, Buf[Grapheme] is not such a stretch for us
benabik s/mania/manip/ 15:09
TimToady since buffers are mutable lists of integers, and NFG is a list of integers too
diakopter string mania, too 15:10
masak Perl 5 has string mania :) 15:11
benabik Do Bufs work with things like s{}= ? 15:12
15:24 [Sno] left
masak not at present, no. 15:24
I think S05 mumbles something about being able to do pattern matching on byte streams. 15:25
but it's never been quite clear to me how.
benabik We'll need Buf[Grapheme] to do so if we want to use it as a mutable string.
masak or assume (or provide) an encoding, I guess. 15:27
TimToady one can do pattern matching over any API that allows you to pull out characters at positions, even if the positions are fake, as they are in P5
pattern matching in particular is mostly relative positioning, and UTF-8 isn't bad at relative movement 15:28
15:28 jnap joined
benabik Are there byte-string literals? 15:28
(well, buf8 literals, I guess) 15:29
TimToady blob8
if you want immutable
benabik Good point. Literals should be immutable.
(Otherwise things get funny in loops.)
diakopter
.oO( "we're not in canada anymore.." )
15:30
TimToady eh? 15:31
15:32 jnap left
TimToady r: say Date.today - '2013-02-03'.Date 15:33
camelia rakudo 455467: OUTPUT«No such method 'Date' for invocant of type 'Str'␤ in block at /tmp/XoXSf7mThp:1␤␤»
TimToady r: say Date.today - Date('2013-02-03')
camelia rakudo 455467: OUTPUT«No such method 'Date' for invocant of type 'Str'␤ in block at /tmp/N1jUAi612R:1␤␤»
TimToady seems like a good place for a coercion 15:34
function names that begin "To" are smelly to me
to-ness is precisely what coercions are for
masak +1 15:35
15:35 pmurias joined
masak I've never satisfactorily figured out where coercion logic "should" be: on the source type, on the target type, or somewhere global, maybe mediated by something adapter-y. 15:36
TimToady in this case the coercion should be defined in Date and the .Date form should delegate to the .() form
benabik .Foo automagically redirects to Foo() ? 15:37
Generally, or just lots of such methods on Cool?
TimToady it should if Foo is a type
masak TimToady: ah, so explicitly on the target type, and implicitly (unless overridden) on the source type? that sounds sane. 15:38
benabik How do you define .() on a type? method postcircumfix:<()> (Foo:T : ) ? 15:39
TimToady one could go as far as to say that .Foo is really just a postfix, and you'd have to say .'Foo'() to get to a method of that name; my vaguely recalls that the specs had it that way at one point, but it could be a false memory
benabik So you don't get the automagic behavior on lowercase types? 15:40
TimToady not saying we should do it that way necessarily, since each type would add postfixes, which blows up the grammar
a failover might be saner
also, a failover allows the source type to define it simply as a method 15:41
benabik Failover is probably saner. Also allows types to define more specific conversions.
15:41 ssutch joined
TimToady also, if Foo occurs nowhere as method name, you can optimize away the method dispatch entirely 15:42
benabik wonders if many Type.() would include a $arg.^can('Type') as a first try.
15:42 denis_boyun left
TimToady it may already be this way: note how Date() and .Date produce identical messages 15:43
except that Date.() seems to be delegating to .Date, and arguably the common case should go the other direction 15:44
masak +1
the target type is more likely to know how to convert to the target type :)
benabik can't find where Date.() is defined. 15:45
15:45 denisboyun joined
masak r: class A { method B { say "OH HAI" } }; class B {}; B(A.new) 15:45
camelia rakudo 455467: OUTPUT«OH HAI␤»
masak yep -- .() delegates to .Target() 15:46
TimToady: if you change the spec, I'll submit a rakudobug ;)
TimToady S13:171
synopsebot Link: perlcabal.org/syn/S13.html#line_171
15:47 FROGGS joined
TimToady well, we really need to delegate in both directions, but catch infinite regress 15:47
masak yes, please. 15:48
r: say "yes, please" while True
yogan Wasn't there a way to extend core classes with new methods? Something like: class Int { method foo() { 42 } } gives me "Representation must be composed before it can be allocated" when I try to call 1.foo() (with rakudo).
camelia rakudo 455467: OUTPUT«(timeout)yes, please␤yes, please␤yes, please␤yes, please␤yes, please␤yes, please␤yes, please␤yes, please␤yes, please␤yes, please␤yes, please␤yes, please␤yes, please␤yes, please␤yes, please␤yes, please␤yes, please␤yes, please␤…»
masak yogan: `use MONKEY_TYPING`; augment class Int { ... }` 15:49
benabik Type(foo) == foo.Type == foo.^can('Type') ?? foo.Type !! Type.(foo) #?
yogan masak: Ah, that's it. Thanks!
TimToady benabik: Type() tries the function first, .Type tries the method first 15:50
S13:202
synopsebot Link: perlcabal.org/syn/S13.html#line_202
masak yogan: the `use MONKEY_TYPING` is upper-case because the act itself is anti-social and fairly incompatible with playing nicely in a module ecosystem.
benabik TimToady: You're essentially expressing a preference, but the compiler should fall back to the other version? 15:51
yogan masak: I see. What would be the cleaner way? Deriving from the class?
masak yogan: I've always been partial to subroutines.
r: sub foo(Int $x) { say "Look, it's a $x!" }; foo(42) 15:52
camelia rakudo 455467: OUTPUT«Look, it's a 42!␤»
masak yogan: beyond that, there's a "pretend that this subroutine is a method" option.
benabik r: sub foo(Int $x) { say "Look, it's a $x!" }; 42.&foo()
camelia rakudo 455467: OUTPUT«Look, it's a 42!␤»
yogan masak: That was just the way I had it before. :-)
masak ...like that.
some languages call that "static methods" or something. 15:53
yogan Ah, with the .&foo syntax. Didn't know that one.
masak fun thing: it was *discovered*, not added to the language.
TimToady yes, we add .$foo and .&foo came along for the ride :) 15:54
*added
yogan I'm pretty sure I don't want to know how that happened... ;-) (probably wouldn't even understand it)
masak it happened like TimToady++ said. :) 15:55
yogan What does .$foo do? Sorry, I'm really pretty new with Perl 6.
TimToady it was simply a matter of writing code in a habitually generic style; used <sigil> to match the $, and & also happens to be a sigil :)
masak r: 42.&foo() # does this give a compile-time error?
camelia rakudo 455467: OUTPUT«===SORRY!=== Error while compiling /tmp/iDB9G1caLq␤Undeclared name:␤ &foo used at line 1␤␤»
masak \o/
r: sub foo($a, $b, $c) {}; 42.&foo() # how about this? 15:56
camelia rakudo 455467: OUTPUT«Not enough positional parameters passed; got 1 but expected 3␤ in sub foo at /tmp/8iCNaeLq_D:1␤ in block at /tmp/8iCNaeLq_D:1␤␤»
TimToady .$foo requires a hard reference to a routine that will serve as a "method"
masak \o/
TimToady just so happens that &foo also gives a hard ref to something Callable
yogan So foo(42) and 42.&foo() are basically just different syntax for the same thing? 15:57
TimToady pretty much 15:58
masak I can't really think of a difference, semantically. 15:59
yogan Alright, thanks.
16:00 dansamo left, denisboyun left 16:01 daxim left, woolfy joined 16:04 benabik left
timotimo japhb__: yes, the performance boost was only by adding a fast-succeed-path to canonpath. 16:05
yoleaux 14:44Z <japhb__> timotimo: Was your performance boost just from doing the "Is it already canonical?" check at the top of canonpath?
16:05 benabik joined
moritz where's the patch? 16:15
16:19 bluescreen100 joined
timotimo not on the 'net yet. want it? 16:20
moritz sure
16:22 pmurias left
timotimo github.com/timo/rakudo/tree/fastpa...aha_get_it 16:23
git wouldn't let me put a ? in the branch name
16:24 bluescreen10 left
masak gets it, after a few seconds 16:24
timotimo :D
moritz timotimo: just commit 76759b7, right? 16:25
timotimo yes, that's all
i haven't spectested it yet
moritz I will, after the current run finishes 16:26
timotimo thank you
i haven't really analyzed that regex thoroughly, but i think it should fail quickly without backtracking much 16:27
16:28 lizmat joined
timotimo so it shouldn't add too much time to every run of canonpath, but if it's already canonical, it should be really quick 16:30
16:31 mattp_ left 16:33 mattp_ joined 16:35 fhelmberger left
moritz my @before = 1.1775159, 1.20721209, 1.15056118, 1.1735369, 1.18734222; say @before R/ [+] @before 16:36
r: my @before = 1.1775159, 1.20721209, 1.15056118, 1.1735369, 1.18734222; say @before R/ [+] @before
camelia rakudo 455467: OUTPUT«1.179233658␤»
moritz that's the time for a sink dir() in the source repo 16:37
timotimo in the source repo? there aren't many files there, are there?
16:37 ajr_ left, denis_boyun joined
moritz 43 16:37
timotimo should still be a high enough n ...
moritz (though there are a few processes running in paralle
l
16:39 [Sno] joined
timotimo ufo and panda should profit from the speedup of dir() 16:39
moritz r: my @after = 1.32715440, 1.34506589, 1.24679486, 1.2795049, 1.309171; say @after R/ [+] @after 16:44
camelia rakudo 455467: OUTPUT«1.30153821␤»
moritz that's actually slower than before :(
masak moritz++ # publishing the original data 16:46
timotimo huh. 16:47
that surprises me. i had speed improvements locally. let me re-measure 16:48
moritz re-measures without running other processes in parallel 16:49
timotimo actually ... if my fast-path succeeds, none of the other substitutions should even do anything 16:50
TimToady it's the mystery R/[+] operator
moritz r: my @after = 0.70397300, 0.70647127, 0.7048678, 0.7070485, 0.7202731; say @after R/ [+] @after
camelia rakudo 455467: OUTPUT«0.708526734␤»
moritz *recompile*
timotimo that's more in line with my findings
moritz well, I haven't done the comparison measurement without parallel processes yet 16:51
masak TimToady: with all the math-y junk we already have in the setting, I'm kinda surprized we don't have avg() and stddev() yet :) 16:53
TimToady that's not math, that's just statistics :P
masak fair point.
moritz my @before = 0.73889503, 0.7367437, 0.7434040, 0.7421254, 0.7314602 ; say @before R/ [+] @before; 16:54
r: my @before = 0.73889503, 0.7367437, 0.7434040, 0.7421254, 0.7314602 ; say @before R/ [+] @before;
camelia rakudo 455467: OUTPUT«0.738525666␤»
timotimo *huh*
moritz r: say (0.738525666 - 0.708526734) / 0.738525666 * 100
camelia rakudo 455467: OUTPUT«4.0620026332␤»
timotimo that's not nearly as slow as my local stuff.
moritz: do the paths you create actually take my fast path? 16:56
or do they have a . in them or something like that?
say dir("/etc/") takes 3.2s here, but dir("/etc") takes only 0.9s 16:57
TimToady sure that's not caching? 16:58
timotimo i suppose the /etc/ version appends ./ at the end and that causes canonpath to run
i re-ran it.
the difference is true.
TimToady maybe we should use a faster langauge for canonicalizing :) 16:59
timotimo probably should strip / from the end of paths before running them through dir. running canonpath on it should do the trick
masak wow, JavaScript ES6 and template strings: www.nczonline.net/blog/2012/08/01/a...-literals/ 17:03
17:05 vk joined
masak I must say I like using the `` syntax for template strings. 17:06
PerlJam even in Perl? 17:07
masak well, "" already do most of the things in that article, whether you mean Perl 5 or Perl 6. 17:08
PerlJam "template strings" sounds very much like simple macros, which is why I asked :)
masak for Perl 6, I think the party line is to leave `` easily grabbable for eager slangers. 17:09
PerlJam: AFAICS, it's simply qq strings + heredocs + filtering :)
17:09 pernatiy_ left
benabik r: say `echo hello` 17:09
camelia rakudo 455467: OUTPUT«===SORRY!=== Error while compiling /tmp/4EmlqBoUvo␤Two terms in a row␤at /tmp/4EmlqBoUvo:1␤------> say ⏏`echo hello`␤ expecting any of:␤ argument list␤ prefix or term␤ prefix or meta-p…»
benabik std: say `echo hello`
camelia std a0bcfb1: OUTPUT«===SORRY!===␤Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument at /tmp/00UJWerwM_ line 1:␤------> say⏏ `echo hello`␤Confused at /tmp/00UJWerwM_ line 1:␤…»
17:10 vk is now known as vky
timotimo r: say ‘hello’ 17:10
camelia rakudo 455467: OUTPUT«===SORRY!=== Error while compiling /tmp/z2kj5utQnb␤Two terms in a row␤at /tmp/z2kj5utQnb:1␤------> say ⏏‘hello’␤ expecting any of:␤ argument list␤ prefix or term␤ prefix or meta-pr…»
timotimo r: say q‘hello’
camelia rakudo 455467: OUTPUT«hello␤»
timotimo r: say q`hello` 17:11
camelia rakudo 455467: OUTPUT«hello␤»
benabik I somewhat expected an error telling me to use qx (or whatever quote that is.)
timotimo no, qx is execute quoting 17:12
benabik Right. That's what `` used to be, no?
timotimo oh, really?
benabik In p5 anyway. 17:13
timotimo may very well be
in python `foo` meant repr(foo), which is basically our .perl
benabik p5eval: print `echo hello`
p5eval benabik: ERROR: Insecure $ENV{PATH} while running with -T switch at (eval 7) line 1.
benabik Okay, yes, allowing arbitrary commands is somewhat insecure.
Yeah, Python's `` confused me after years of perl and shell. 17:17
17:20 benabik left 17:24 Rotwang joined 17:27 vky left
masak in python `foo` is discouraged these days. py3 removes it and looks meaningfully towards repr(foo) 17:27
I guess two ways of doing it can't both be obvious :)
timotimo yes
17:28 vky joined 17:32 benabik joined
timotimo so, what's the proper way to make the performance good? just remove trailing /es from the path in the dir sub? 17:34
but only on unix? 17:40
(but that's only because i have no idea how it behaves on windows and other platforms) 17:43
or maybe .child should know about trailing /es?
17:47 ggoebel7 left 17:49 ggoebel joined, prevost left
timotimo maybe catfile could be taught not to create //es? 17:50
if it's so expensive to remove them again
17:52 SamuraiJack joined 17:56 ggoebel7 joined 17:58 stevan_ left 17:59 stevan_ joined 18:01 ajr joined 18:02 ajr is now known as Guest78383, fhelmberger joined, Guest78383 is now known as ajr_ 18:04 ggoebel7 left 18:09 ggoebel7 joined 18:18 bloonix left 18:21 stevan_ left 18:22 fhelmberger left 18:29 cognominal left, cognominal joined 18:36 Sqirrel_ joined 18:46 stevan_ joined 18:47 stevan__ joined 18:51 stevan_ left 18:52 Sqirrel_ left 18:55 xenoterracide joined 18:56 ggoebel7 left 18:57 darutoko left
moritz p5eval: $ENV{PATH} = '/bin:/usr/bin'; `echo hello` 19:00
p5eval moritz: interrupting, taking more than 5 second(s)
moritz: No output
19:14 dmol joined
moritz ok, two weird ideas for regex optimizations 19:15
first, do we use the cursor's Bool method? If yes, we might speed up regexes matches with a custom boolification protocol
second: we could turn scan(literal) and scan(concat(literal, ...)) into something that uses index() to finds possible starting positions 19:16
19:17 benabik left
PerlJam that second one isn't so weird. 19:19
moritz looks at QAST::Copmiler and is scared
PerlJam: probably not
TimToady p5 goes as far as to recognize that /...foo/ can index for 'foo' and then back off 3 chars 19:20
moritz nqp: say(nqp::index('ababc', 'ab', 0)
camelia nqp: OUTPUT«Confused at line 2, near "say(nqp::i"␤current instr.: 'panic' pc 14748 (src/stage2/gen/NQPHLL.pir:5229) (src/stage2/gen/NQPHLL.nqp:279)␤»
moritz nqp: say(nqp::index('ababc', 'ab', 0))
camelia nqp: OUTPUT«0␤»
moritz nqp: say(nqp::index('ababc', 'ab', 1))
camelia nqp: OUTPUT«2␤»
TimToady (iirc) 19:21
moritz TimToady: I know, but for that we'd have to track min and max length, and that would be a much more intrusive patch
frettled TimToady: well, that's pretty nice. And perhaps even an obvious optimization for what Perl 5 is :)
moritz (especially considering that it mostly won't help with parsing at all, just with traditional regex matches)
19:22 cognominal left, cognominal joined
frettled not that there's anything wrong with traditional regexp matches :) 19:23
I suppose it would be a pretty complicating factor to treat these things separately, too.
moritz there isn't, but I don't want to slow down parse times of the rakudo setting
TimToady I think a big optimization will be finding more ways to make use of what the DFA matched to figure out how to avoid rematching in the procedural bits 19:24
frettled waits for someone to step in from a side wing and fling the traditional insult of "get someone who knows compilers". *snort* *grumble* 19:25
TimToady "we would have descended through these recursive nodes, so just wrap this in these bits of AST, which is what those nodes would have done if we'd called them"
frettled sees no fault in that part of P6 developer competence.
TimToady well, we understand why bottom-up parsers are faster, and also why they're stupider 19:26
frettled and quite a lot more :L)
TimToady LALR! 19:27
frettled Heeey, I'd repressed that. 19:28
TimToady one possible optimization is recognizing when we have a large chunk of language that is not being mutated, and write a little LALR parser for it; if it gets into syntactic trouble, we just back up and retry with recursive descent to diagnose the problem better
19:29 Rotwang left
frettled That should be pretty quick. 19:31
I'm thinking of whether there is a way to program this that would take advantage of the extra registers in current x86 architecture, which seems rather dominant, as well as state-of-the-art ARM architecture. 19:32
That is a few layers removed, but perhaps, perhaps. …
19:33 berekuk_ left 19:36 denis_boyun left
lue platform-specific advantage taking is in the domain of Parrot, the JVM, and MoarVM methinks 19:36
jnthn evening, #perl6 19:39
moritz \o jnthn
frettled Well, this is not just platform-specific, but about programming so that it's easy for the VM to understand that hey, these things here, they fit these registers that I have rather many of here.
TimToady g'day
frettled jnthn: yay! o/
colomon \o
jnthn 's trip home from Oslo was thankfully less stressful than his trip to Oslo :)
19:40 berekuk joined, benabik joined
frettled jnthn: was it nice? 19:40
TimToady fewer terrorists? 19:41
19:41 bluescreen100 left
moritz ok, I have the detection in place for when we can do an nqp::index scan 19:41
now I "just" need to make the codegen work
jnthn frettled: The time in Oslo was nice, though quite tiring as I was teaching :) 19:42
TimToady moritz: have you tested index to see if it's actually faster than regex? :D
jnthn The trip there was stressful 'cus I had to discover whether you can make it to your flight if you arrive at Copenhagen airport ~25 mins before it leaves :)
moritz TimToady: I haven't, but I'm pretty sure it is :-)
19:43 ggoebel7 joined
moritz nqp: say(nqp::index("foo", "bar")) 19:44
camelia nqp: OUTPUT«-1␤»
19:44 Rotwang joined, itz_ left 19:45 itz joined
frettled jnthn: well, knowing you, your pupils had a good time :) 19:45
19:47 risou is now known as risou_awy
moritz has a 16-line patch that could conceivably work 19:50
frettled worth testing?
moritz worth compiling :-)
moritz wants a convenient way to run qregex tests with stage 1 19:51
jnthn wonders what moritz's 16 line patch does :)
moritz: prove --exec "...the stage 1 invocation" t/qregex
But maybe that's not convenient enough ;)
moritz jnthn: it tries to implement rxtype<scan> with nqp::index scan
jnthn But could always at it as a make stage1test :)
moritz: ooh! :D
moritz t/qregex/01-qregex.t .. ok 19:52
All tests successful.
jnthn Yes, that's worth it
moritz after: 0.000600814819335938 19:55
moritz recompiles to check the "before" time
gist.github.com/moritz/7047280 # benchmark, totally artifical 19:56
frettled :)
run 7 times, purge outliers, mean and distribution? :) 19:57
moritz before: 0.00112199783325195
ok, I need to do statistics to actually find something out 19:58
gah, first check correctness, then check timings 20:08
I found that the timings are the same before and after 20:09
then I looked at the generated pir: no changes :(
so, the codegen didn't work the way I wanted it to
20:11 lue joined
timotimo that's why i always leave debug says in there until the very end, sometimes too long :P 20:11
moritz ok, found at least one obvious bug by eyeballing 20:12
timotimo: committing debug code to production? happens to me all the time :/ 20:13
20:17 sqirrel left 20:18 sqirrel joined
moritz ok, now the codegen actually does stuff differently 20:22
20:23 LWA left, LWA joined
TimToady hopes it fails constructively, where success is construed as one form of constructive failure... 20:24
moritz ok, significant faster now, but fails some qregex tests :/ 20:27
though maybe that's due to the debug output
it's not :( 20:29
20:29 sqirrel left
timotimo significantly? maybe it just fails faster now :P 20:30
moritz oh, because ignorecase
timotimo oooooh 20:31
along the same lines, did you make sure to handle zerowidth and such?
TimToady nqp: say(nqp::index("", "bar")) 20:32
camelia nqp: OUTPUT«-1␤»
TimToady nqp: say(nqp::index("", ""))
camelia nqp: OUTPUT«-1␤»
TimToady nqp: say(nqp::index("foo", ""))
camelia nqp: OUTPUT«-1␤»
TimToady ooh, I'd say there's a bug
timotimo finding nothing should always give you 0? 20:33
because nothing can be found in every string?
TimToady p5eval: say index("","")
p5eval TimToady: 01
TimToady p5eval: say index("","something")
p5eval TimToady: -11
TimToady p5eval: say index("something","")
p5eval TimToady: 01
TimToady yes, that's the correct degenerate case 20:34
nrp: say index('','')
camelia rakudo 455467, niecza v24-98-g473bd20, pugs: OUTPUT«0␤»
TimToady looks like just an nqp bug 20:35
or maybe a parrot bug?
is correct on jvm 20:36
nqp-jvm: say(nqp::index("", "")) 20:37
camelia nqp-jvm: OUTPUT«0␤»
TimToady nqp-moar: say(nqp::index("", "")) 20:38
nqp-m: say(nqp::index("", ""))
camelia nqp-moarvm: OUTPUT«0␤»
TimToady how come we have nqp-jvm but nqp-m?
oh, it's nqp-moarvm 20:39
you can see how much I've already internalized that its name is "moar", not "moarvm"
jnthn Well, its executable name is at least :P 20:45
moritz jnthn: in a case insensitive match, is $*REG<tgt> already lower-cased? 20:46
jnthn No
Actually it's only literal rxtype that has ignorecase handling.
We handle :i in charclasses in the action method
And pass it along to a couple of the itnerpolaters 20:47
moritz well, for making scan index()-based, I also need to handle that :/
jnthn hmmm 20:48
Or just don't do it for the :i case for now?
moritz that's possible, yes
20:48 kaare_ left
TimToady in any case, lc() is unicodically incorrect, and you should be using fc() 20:49
jnthn fc that!
But yeah, Moar has supprot for fc :)
Made sure of that :)
20:49 donaldh_ joined
jnthn So we can at least get it right there 20:50
moritz Ceterum censeo Unicode esse delendam
TimToady nqp-m: say(nqp::fc("Moar"))
camelia nqp-moarvm: OUTPUT«No registered operation handler for 'fc'␤compile_op␤»
TimToady nqp-m: say(fc("Moar"))
camelia nqp-moarvm: OUTPUT«(signal SEGV)No lexical found with name '&fc'␤frame_name_0␤»
TimToady nqp-m: say(("Moar").fc) 20:51
camelia nqp-moarvm: OUTPUT«Missing method cache; late-bound dispatch NYI␤frame_name_0␤»
jnthn SEGV?!
moritz oooh, a segfault
TimToady "supprot" indeed
jnthn Oh, it's only as a VM-level op iirc
oh, hmm 20:52
moritz t/qregex/01-qregex.t .. ok
\o/
jnthn moritz++ 20:53
moritz and here are the benchmarks 20:55
nqp::x('abc', 500) ~ 'def' ~~ /def/ 20:56
before: 647 +- 28 us, after 161 +- 18 us 20:57
and with s/500/5000/:
jnthn \o/
moritz before: 5009 +- 275 us, after 486 +- 350 us 20:58
jnthn Woo
moritz 19 lines of patch 20:59
TimToady do it again!
japhb__ Oooh, that ought to be visible in all sorts of places. 21:00
moritz++
timotimo holy crap, that could have happened earlier! :))
21:01 stevan__ left 21:02 SamuraiJack left, stevan_ joined 21:03 ggoebel7 left
moritz ok, running a final test after a small cleanup 21:03
21:03 colomon left
moritz don't get too excited; it's a case that doesn't happen at all in grammar matches 21:04
timotimo of course
but it might still speed up bits and pieces here and there?
jnthn It's a dramatic win for anything that would have to have scanned strings before 21:05
moritz: Is that timing on the JVM or Parrot, ooc? 21:06
moritz jnthn: parrot only
needs implementing in the JVM codegen too, I suppose
dalek p: 71c142a | moritz++ | src/ (2 files):
regexes: speed up scanning for literal matches

if an unanchored regex (not ignoring case) starts with a literal, we now use the "index" opcode (at least on parrot) to search for the start position. Speeds up the fairly artifical benchmark nqp::x(abc, 500) ~ def ~~ /def/ by a factor of 4
21:07
moritz and JVM too
21:07 ggoebel7 joined
jnthn May be smaller win on JVM as it doesn't substr to compare. Similar for MoarVM 21:07
moritz I factored it so that backends not doing the optimization shouldn't regress on it
Mouq moritz++ 21:08
moritz though a good substring search can still be a lot faster than comparing position by position
21:09 colomon joined, benabik left
moritz huh, I can't build nqp on the JVM :( 21:10
jar cf0 nqp-runtime.jar -C bin/ .
java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libnio.so: /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libnio.so: failed to map segment from shared object: Cannot allocate memory
21:10 skids left
moritz ok, going to bed now 21:11
timotimo you may need to ... wait what
jnthn wat
timotimo i'll look if i can figure out how to make the same codegen changes on jvm or something 21:12
moritz if anybody wants to follow up on that optimization: 1) the code from P6Regex/Actions.nqp needs porting to P5Rgex/Actions.nqp too (should be straight forward)
2) JVM 3) MoarVM
++timotimo
21:13 donaldh_ left
moritz sleep& 21:13
21:13 donaldh_ joined 21:14 btyler left 21:16 ggoebel7 left, donaldh_ left
timotimo oh, the jvm codegen is ... completely different 21:18
21:18 ggoebel7 joined
timotimo i should have known 21:18
oh, i was just looking at the completely wrong file :D
yeah, i don't even know what i'm looking at here %) 21:23
21:25 donaldh_ joined, donaldh_ left 21:27 ggoebel7 left 21:31 ggoebel7 joined 21:47 stevan_ left 21:55 Rotwang left 21:58 vky left 22:04 vky joined 22:18 deorritke joined 22:26 stevan_ joined, deorritke left
dalek rl6-roast-data: cb8e1e5 | coke++ | / (3 files):
today (automated commit)
22:26
22:27 stevan_ left, stevan_ joined
timotimo how did niecza reach 00.00%? 22:29
ah, it did not build? 22:30
[Coke] yes. seems fine today. 22:31
22:32 BenGoldberg joined
timotimo today? 22:33
the today i'm looking at at the moment claims not so.
[Coke] yes, that today was yesterday
"Coke authored a day ago" 22:34
timotimo aah
22:34 xenoterracide left
jnthn bah, I read the headline "Swiss seize a million fake tablets" and thought it was, like, fake iPads or something... 22:39
You know you read too much tech news when... :) 22:40
Well, I have latest builds of stuff, and hopefully tomorrow will have some tuits to hack on stuff )
timotimo looking for wardto it!
jnthn Gotta go travel again on Sunday, though... 22:42
22:47 grondilu left 22:48 xenoterracide joined 22:49 pecastro left 22:59 vky left 23:01 ajr_ left 23:20 vky joined 23:26 vky left 23:29 xenoterracide left 23:41 Mouq left 23:50 xenoterracide joined 23:51 pecastro joined 23:57 Mouq joined
dalek rl6-roast-data: 1d8fa71 | coke++ | / (2 files):
today (automated commit)
23:59
23:59 dmol left