Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2011-11-02

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:07 molaf_ joined #perl6
00:18 whiteknight joined #perl6
00:25 replore_ joined #perl6
00:26 Ingis joined #perl6
00:35 thou joined #perl6
00:36 tyatpi_ joined #perl6
00:41 dalek 6model: 358cadd | diakopter++ | lua/ (17 files):
00:41 dalek 6model: oodles of fixes.  many many more to come.
00:41 dalek 6model: review: https://github.com/diakopte​r/6model/commit/358cadddd8
00:41 dalek 6model: 358cadd | diakopter++ | lua/ (17 files):
00:41 dalek 6model: oodles of fixes.  many many more to come.
00:41 dalek 6model: review: https://github.com/diakopte​r/6model/commit/358cadddd8
00:43 _jaldhar joined #perl6
01:23 cooper joined #perl6
01:24 dalek 6model: de55f49 | diakopter++ | lua/runtime/Metamodel/ (2 files):
01:24 dalek 6model: fix some off-by-one error
01:24 dalek 6model: review: https://github.com/diakopte​r/6model/commit/de55f49748
01:24 dalek 6model: de55f49 | diakopter++ | lua/runtime/Metamodel/ (2 files):
01:24 dalek 6model: fix some off-by-one error
01:24 dalek 6model: review: https://github.com/diakopte​r/6model/commit/de55f49748
01:26 alc joined #perl6
01:31 gfldex joined #perl6
01:43 hypolin joined #perl6
01:46 woosley joined #perl6
01:58 eT-eB joined #perl6
01:59 eT-eB Hi, are perl 6 executables smaller than perl 5?
02:06 wolfman2000 joined #perl6
02:06 diakopter executables?
02:12 eT-eB diakopter:  the kind of thing you get from perl2exe
02:12 dalek 6model: c7d3c7d | diakopter++ | lua/ (5 files):
02:12 dalek 6model: more fixes; Setting begins to compile.
02:12 dalek 6model: review: https://github.com/diakopte​r/6model/commit/c7d3c7d20d
02:12 dalek 6model: c7d3c7d | diakopter++ | lua/ (5 files):
02:12 dalek 6model: more fixes; Setting begins to compile.
02:12 dalek 6model: review: https://github.com/diakopte​r/6model/commit/c7d3c7d20d
02:15 eT-eB In Perl 5 i could use perl2exe to make executables and share them with people who might not "get" cpan. In perl6 is there anything like perl2exe and if so how big are the files?
02:16 diakopter there's nothing like that
02:16 diakopter there are several implementations of Perl 6, too.
02:16 packetknife joined #perl6
02:17 eT-eB really, they abandoned standalones in perl6 ??
02:17 diakopter that's not how I would put it. perl2exe is a commerical product; if someone wants to make a product to do that with one of the Perl 6 implementations, they could do that.
02:18 eT-eB besides perl2exe there was B
02:18 eT-eB and C
02:18 eT-eB C made C code out of perl
02:19 eT-eB so there were FOSS options
02:19 eT-eB i just used perl2exe to convey the idea of executable to you diakopter, because you asked "(10:05:12 PM) diakopter: executables?"
02:19 diakopter there is, of course, the PAR toolkit, which I would recommend over perl2exe
02:20 eT-eB PAR is in Perl6 too?
02:20 diakopter I wouldn't say "abandoned"; the Perl 6 community is hundreds of thousands of times smaller than the Perl 5 userbase; there is much less available resources to implement things.
02:20 daniel_ joined #perl6
02:21 diakopter no, there is no PAR for Perl 6
02:21 diakopter as I already said
02:21 diakopter "there's nothing like that"
02:21 eT-eB The problem i have with PAR is that even a simple "Hello, World" is a 4Mega standalone file.
02:25 diakopter afk&
02:29 LoRe joined #perl6
02:30 am0c joined #perl6
03:06 [Coke] eT-eB: more like "haven't gotten around to it yet" rather than "oh, we'd never do that."
03:06 [Coke] you can generate parrot bytecode with rakudo already and ship that. (I /think/ that works...)
03:10 benabik [Coke]: Kind of.  You'd have to ensure that Rakudo was installed because it needs to load the ops and library.
03:11 [Coke] yes, in general, you need to install rakudo.
03:14 eT-eB So it would not be stand alone, but it would be in a machine readable format.
03:15 envi_ joined #perl6
03:17 benabik eT-eB: Yes.
03:22 eT-eB Thanks benabik and [Coke]. I need to find another programming language for this task.
03:26 packetknife joined #perl6
03:28 djanatyn The day with the most birthdays was incidentally 10/30, with 6 birthdays occuring in one day. 226/365 days in the year have at least one or more birthdays according to my friends list on facebook. Interestingly enough, 146 people have unique birthdays. This means that for each day, there is a 61.9% chance that it is someone's birthday. If I bought everyone in my friend's list a $5 present, I would have to work at a minimum wage job ($7/25) at Mc
03:28 djanatyn now to mess with oop in perl6 to figure out which months had the highest concentrations of birthdays
03:29 djanatyn who knew that you could have so much fun with the "export birthdays" button on facebook? :)
03:30 djanatyn also what's up with github :(
03:30 djanatyn ah, just went back up
03:31 benabik When I want to know what's up with github, I read their blog.  It's informative. https://github.com/blog
03:32 PerlJam also ... there's bitbucket.org  :)
03:33 benabik Bitbucket speaks git?  I thought they were hg only.
03:33 PerlJam They used to be, but they realized the err of their ways  ;)
03:34 djanatyn benabik: bitbucket changed everything about themselves to be more like github
03:34 djanatyn they even *look* like github now
03:34 benabik djanatyn: Does look that way, yeah.
03:34 PerlJam indeed.  It's a little scary
03:35 djanatyn they are probably the best place for hg hosting though
03:37 sorear good * #perl6
03:37 djanatyn I've started work (read: written about three lines) of a really simple script to keep track of schoolwork and tasks in perl6
03:37 * sorear updates to the latest mono
03:37 djanatyn might be kinda fun, I did something similar with perl5
03:38 djanatyn I'll work on it tommorow
03:39 djanatyn I think the major advantage that bitbucket has over github right now is free private hosting
03:39 djanatyn but that's not really major at all
03:40 benabik Free unlimited edu accounts is nice.  :-d
03:40 benabik *:-D
03:42 molaf joined #perl6
04:18 sorear :| seems new mono's profiler wants a kernel upgrade, brb
04:23 colomon_ joined #perl6
04:26 kaleem joined #perl6
04:37 sorear survived
04:40 sorear eT-eB: if you want to ship _small_ standalone executables, Perl (all versions past or future) is right out
04:41 sorear eT-eB: you need to use a language with a very small runtime (some Forth or Lisp), or a language where the runtime ships with Windows (C, C++, VB)
04:41 sorear does the CLR ship with Windows these days?
04:43 Ingis yup
04:44 Ingis 3.5 at least
04:44 sorear if you're determined to use Perl, Niecza/CLR has a space overhead of 200k-700k bytes depending on whether you're willing to manually cull the setting
04:45 sorear how big is Rakudo's compiled setting these days?  pre-nom it was around 4 Mwords
04:46 sorear welcome, Ingis
04:46 Ingis hey :)
04:52 eT-eB thank you for the information sorear, im going to check out Niecza/CLR.
05:01 shinobicl_ joined #perl6
05:12 mls joined #perl6
05:12 LoRe joined #perl6
05:13 jfried joined #perl6
05:18 orafu joined #perl6
05:18 replore joined #perl6
05:19 renormalist joined #perl6
05:20 bonsaikitten joined #perl6
05:27 mkramer joined #perl6
05:40 lrnperl joined #perl6
06:00 alvis joined #perl6
06:02 moritz good morning
06:02 moritz sorear: 10MB
06:02 tadzik good morning moritz
06:03 moritz \o tadzik
06:03 moritz std: /<A::b>/
06:03 p6eval std be1f10e: OUTPUT«ok 00:01 120m␤»
06:15 sorear o/ moritz
06:15 eT-eB left #perl6
06:19 dual joined #perl6
06:28 koban joined #perl6
06:30 cognominal joined #perl6
06:38 felher Whats that repr-api mentioned in a few log messages?
06:45 moritz a low-level storage API
06:47 felher moritz: for storing perl6 objects?
06:48 moritz felher: yes
06:48 felher moritz: k, thnx :)
06:48 Woodi repr-api is used via parrot in Rakudo ?
06:50 kst joined #perl6
06:51 moritz it's currently defined at the NQP level
06:55 fsergot good morning. :-)
06:56 fsergot where can i find nqp and pir instructions?
06:56 moritz nqp: say(1); # that's an nqp instruction
06:56 p6eval nqp: OUTPUT«1␤»
06:57 moritz fsergot: what kind of introcutions are you looking for?
06:57 wtw joined #perl6
06:57 moritz *instruction
06:58 fsergot moritz, dont know. i want to be able to do some perl6 stuff, to help in developing. :-)
06:59 moritz fsergot: for PIR, see http://docs.parrot.org/parrot/latest/html/ scroll down to "PIR book"
06:59 moritz fsergot: there's not much direct docs for NQP. It's a subset of Perl 6, so knowing Perl 6 helps. Apart from that, you need to look at example code
07:00 moritz fsergot: but there are lots of things you can do for Perl 6 development that can be done in pure Perl 6
07:01 moritz for example in Rakudo, the .perl method in Parameter needs lots of love
07:01 fsergot moritz, right, but pir and nqp can help. Well, thanks You very much moritz++
07:01 moritz and Str.trans needs to be ported from the old branch
07:02 moritz and Str.indent
07:02 mkramer left #perl6
07:05 fsergot Are there any sites, where can i find some informations about "whats to do in p6"? Or i should just do what i thinks is good for perl6? :)
07:05 fsergot think*
07:06 im2ee joined #perl6
07:06 im2ee left #perl6
07:07 sorear mono statistical profiler thinks niecza spends 40% of its time in _IO_fflush
07:07 sorear I wonder if it's counting the time spent writing the profile data
07:08 sayu joined #perl6
07:21 xinming joined #perl6
07:25 Shozan joined #perl6
07:34 am0c joined #perl6
07:52 daniel-s joined #perl6
08:05 jonasbn joined #perl6
08:06 jonasbn left #perl6
08:10 wk_ joined #perl6
08:11 moritz fsergot: there's no general TODO page. Several projects have their own bug trackers, and people ask in here
08:11 moritz fsergot: a good start is writing modules. http://modules.perl6.org/ gives an overview of what's there, and how to get started
08:15 ethndbst joined #perl6
08:20 buubot_backup joined #perl6
08:21 * sorear sleep
08:25 fsergot Thanks moritz. :)
08:26 ethndbst Perl 6 looks nice.
08:27 moritz ethndbst: glad to hear that
08:27 * moritz agrees :-)
08:27 * fsergot agress too. :)
08:27 fsergot *agrees :D
08:28 simcop2387 joined #perl6
08:28 moritz fsergot, ethndbst: out of curiosity, how did you came across Perl 6?
08:28 ethndbst I came across Perl 6 when I was interested in Perl 5.
08:29 moritz so the Perl brand works :-)
08:30 ethndbst I guess...
08:30 ethndbst I'll probably be dead when there is an official Perl 6 interpreter
08:30 moritz yes, because we're just working on compilers these days, no interpreters :-)
08:30 ethndbst Really?
08:31 ethndbst Interesting.
08:31 ethndbst So why was it decided to kill the interpreter?
08:32 moritz which one? :-)
08:32 ethndbst For Perl
08:32 moritz waitwaitwait
08:32 moritz there's still the 'perl' executable for Perl 5
08:32 ethndbst Yes
08:32 fsergot moritz, i'm reading evalbot's code, but i have a question. Your bot makes file with code to execute, and then run it?
08:32 fsergot moritz, You wrote evalbot right? :)
08:33 moritz that's a hybrid interpreter/compiler, and it's not killed. It just doesn't run Perl 6
08:33 moritz fsergot: yes, I wrote it. Yes, it writes tempfiles and runs them
08:33 moritz rakudo: say callframe().file
08:33 p6eval rakudo cb6374: OUTPUT«/tmp/SJIZHGAOTG␤»
08:34 moritz temp files like these :-)
08:34 moritz and most approaches to implement Perl 6 simply took the compiler route
08:34 fsergot moritz, thanks. :)
08:35 moritz but for a language like Perl, the distinction is a bit artifical; it needs a fat runtime anyway, so you could argue it's a bit of an interperter anyway
08:35 moritz otoh it doesn't reparse the source code when you run a function twice, so it needs a compilation step too
08:42 fsergot nom: say callframe().file
08:42 p6eval nom cb6374: OUTPUT«/tmp/ZOS42SXWUl␤»
08:42 fsergot nom: say callframe()
08:42 p6eval nom cb6374: OUTPUT«CallFrame.new(level => Int, annotations => ("file" => "/tmp/0a94V4F7_L", "line" => 1).hash, my => EnumMap.new("\$=POD", Array.new(), "GLOBALish", GLOBAL, "EXPORT", EXPORT, "\$?PACKAGE", GLOBAL, "\$_", Any, "\$/", Any, "\$!", Any, ))␤»
08:45 snarkyboojum nom: say callframe().^methods
08:45 p6eval nom cb6374: OUTPUT«new line file callframe level annotations my eager elems end classify infinite flat hash list pick roll reverse sort values keys kv pairs Array grep first join map min max minmax postcircumfix:<[ ]> at_pos all any one none postcircumfix:<{ }> reduce ACCEPTS WHERE WHIC…
08:45 moritz nom: say callframe().^methods(:local)
08:45 p6eval nom cb6374: OUTPUT«new line file callframe level annotations my␤»
08:45 snarkyboojum nom: say callframe().my
08:45 p6eval nom cb6374: OUTPUT«EnumMap.new("\$=POD", Array.new(), "GLOBALish", GLOBAL, "EXPORT", EXPORT, "\$?PACKAGE", GLOBAL, "\$_", Any, "\$/", Any, "\$!", Any, )␤»
08:47 mj41 joined #perl6
08:59 [particle] joined #perl6
09:04 envi_ joined #perl6
09:09 mj41 joined #perl6
09:18 fsergot What did --setting=SAFE in nom?
09:18 fsergot What is the SAFE mode? :)
09:18 moritz nom: shell('echo pwnd')
09:18 p6eval nom cb6374: OUTPUT«shell is disallowed in safe mode␤  in sub restricted at src/SAFE.setting:2␤  in sub shell at src/SAFE.setting:7␤  in block <anon> at /tmp/g3neuNrSIN:1␤  in <anon> at /tmp/g3neuNrSIN:1␤»
09:19 fsergot does*
09:19 moritz fsergot: that's what it does :-)
09:19 fsergot And nothing with time limit etc.? :)
09:19 moritz nope
09:19 moritz that's done in EvalbotExecuter.pm
09:21 fsergot Thanks. :)
09:22 Vlavv` joined #perl6
09:23 satyavvd joined #perl6
09:27 moritz nqp: say(try { 1 })
09:27 p6eval nqp: OUTPUT«1␤»
09:33 daxim joined #perl6
09:42 moritz nom: say $Inf
09:42 p6eval nom cb6374: OUTPUT«Inf␤»
09:45 moritz meh
09:45 moritz the setting relies on variables that are used before they are declared :(
09:46 snarkyboojum nom: say $Inf - now
09:46 p6eval nom cb6374: OUTPUT«(timeout)»
09:46 snarkyboojum whoops
09:48 moritz nom: say now.WHAT
09:48 p6eval nom cb6374: OUTPUT«Instant()␤»
09:49 moritz nom: say now.Numeric
09:49 p6eval nom cb6374: OUTPUT«Instant:1320227422.46064␤»
09:49 moritz nom: say now.bridge
09:49 p6eval nom cb6374: OUTPUT«Method 'bridge' not found for invocant of class 'Instant'␤  in block <anon> at /tmp/o2P8UlYg_L:1␤  in <anon> at /tmp/o2P8UlYg_L:1␤»
09:52 moritz nom: say "%s\t%s"
09:52 p6eval nom cb6374: OUTPUT«%s   %s␤»
09:52 moritz nom: say "%s\t\%s"
09:52 p6eval nom cb6374: OUTPUT«%s   %s␤»
09:53 moritz oh.
09:54 * moritz has a 'WTF?' moment
09:55 [particle] joined #perl6
09:55 moritz for a bit of context, I'm trying to make rakudo complain about undeclared variables
09:55 moritz as in
09:55 moritz nom: $x; my $x;
09:55 p6eval nom cb6374:  ( no output )
09:55 snarkyboojum nom: printf("%s")
09:55 p6eval nom cb6374: OUTPUT«'' is not a valid sprintf format␤  in sub sprintf at src/gen/CORE.setting:1644␤  in sub printf at src/gen/CORE.setting:1649␤  in block <anon> at /tmp/vJnz9c47ZC:1␤  in <anon> at /tmp/vJnz9c47ZC:1␤»
09:56 snarkyboojum nom: say printf("%s")
09:56 p6eval nom cb6374: OUTPUT«Null PMC access in get_string()␤  in sub sprintf at src/gen/CORE.setting:1644␤  in sub printf at src/gen/CORE.setting:1649␤  in block <anon> at /tmp/4E03uib4ON:1␤  in <anon> at /tmp/4E03uib4ON:1␤»
09:56 moritz now when I make it complain about undeclared variables, it also complains about the %s in an interpolated string
09:57 moritz my theory is that it first parses the %s as a variable, triggers the action method (that can complain), and then decides whether to actually use it as a variable
09:59 snarkyboojum what change is required to make it complain about undeclared variables?
10:00 snarkyboojum nom: $x++; say my $x
10:00 p6eval nom cb6374: OUTPUT«1␤»
10:00 moritz when a variable is parsed, look it up in the current $*ST; complain if it doesn't exist
10:00 moritz but as I just outlined, that's overly simplified
10:01 snarkyboojum niecza: $x++; say my $x
10:01 p6eval niecza v11: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Variable $x is not predeclared at /tmp/o6qOV50twP line 1:â�¤------> [32m<BOL>[33mâ��[31m$x++; say my $x[0mâ�¤â�¤Potential difficulties:â�¤  $x is declared but not used at /tmp/o6qOV50twP line 1:â�¤------> [32m$x++; say my [33mâ��[31m$x[0mâ�¤â�¤â�¤U…
10:02 moritz niecza: say "@a"
10:02 p6eval niecza v11: OUTPUT«@a␤»
10:02 snarkyboojum yay niecza
10:02 snarkyboojum or not ;)
10:03 moritz it's correct
10:03 snarkyboojum is niecza right there?
10:03 snarkyboojum ok
10:03 moritz only $ variables are always interpolated
10:03 moritz all others only if the expression ends in a postcircumfix
10:03 snarkyboojum different to p5 then?
10:03 moritz so "@a[]" would interpolate, "@a" not
10:03 moritz yes
10:03 snarkyboojum okydoke
10:04 snarkyboojum b: say "@a"
10:04 p6eval b 1b7dd1: OUTPUT«@a␤»
10:05 snarkyboojum b: $x++; say my $x
10:05 p6eval b 1b7dd1: OUTPUT«1␤»
10:05 snarkyboojum awww
10:05 moritz one of our 15 oldest, known bugs
10:06 snarkyboojum saw the mail yeah.. not a bug in niecza tho :)
10:06 moritz if you discount TODO and spec tickets, it's our 5th oldest open bug
10:06 snarkyboojum a golden oldie eh
10:08 dalek rakudo/check-vars: 430c564 | moritz++ | src/Perl6/Actions.pm:
10:08 dalek rakudo/check-vars: align code vertically, no functional changes
10:08 dalek rakudo/check-vars: review: https://github.com/rakudo/rakudo/commit/430c564074
10:08 dalek rakudo/check-vars: c18c888 | moritz++ | src/Perl6/Actions.pm:
10:08 dalek rakudo/check-vars: complain about undeclared variables
10:08 dalek rakudo/check-vars:
10:08 dalek rakudo/check-vars: breaks the build
10:08 dalek rakudo/check-vars: review: https://github.com/rakudo/rakudo/commit/c18c888b2f
10:08 dalek rakudo/check-vars: 0381c3c | moritz++ | src/core/ (2 files):
10:08 dalek rakudo/check-vars: move declarations of $Inf and $NaN before its first usage
10:08 dalek rakudo/check-vars: review: https://github.com/rakudo/rakudo/commit/0381c3cebd
10:08 dalek rakudo/check-vars: 9464ea5 | moritz++ | src/core/Enum (2 files):
10:08 dalek rakudo/check-vars: work around variable interpolation issues in the setting; restores the build
10:08 dalek rakudo/check-vars: review: https://github.com/rakudo/rakudo/commit/9464ea5b2e
10:08 dalek rakudo/check-vars: 430c564 | moritz++ | src/Perl6/Actions.pm:
10:08 dalek rakudo/check-vars: align code vertically, no functional changes
10:08 dalek rakudo/check-vars: review: https://github.com/rakudo/rakudo/commit/430c564074
10:08 dalek rakudo/check-vars: c18c888 | moritz++ | src/Perl6/Actions.pm:
10:08 dalek rakudo/check-vars: complain about undeclared variables
10:08 dalek rakudo/check-vars:
10:08 dalek rakudo/check-vars: breaks the build
10:08 dalek rakudo/check-vars: review: https://github.com/rakudo/rakudo/commit/c18c888b2f
10:08 dalek rakudo/check-vars: 0381c3c | moritz++ | src/core/ (2 files):
10:08 dalek rakudo/check-vars: move declarations of $Inf and $NaN before its first usage
10:08 moritz snarkyboojum: that's the first step of fixing it
10:08 dalek rakudo/check-vars: review: https://github.com/rakudo/rakudo/commit/0381c3cebd
10:08 dalek rakudo/check-vars: 9464ea5 | moritz++ | src/core/Enum (2 files):
10:08 dalek rakudo/check-vars: work around variable interpolation issues in the setting; restores the build
10:08 dalek rakudo/check-vars: review: https://github.com/rakudo/rakudo/commit/9464ea5b2e
10:08 moritz dalek-- # double reports
10:13 mkramer joined #perl6
10:13 moritz niecza: "@a[]"; my @a
10:13 p6eval niecza v11: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Variable @a is not predeclared at /tmp/e3zdfvgj4b line 1:â�¤------> [32m"[33mâ��[31m@a[]"; my @a[0mâ�¤â�¤Potential difficulties:â�¤  @a is declared but not used at /tmp/e3zdfvgj4b line 1:â�¤------> [32m"@a[]"; my [33mâ��[31m@a[0mâ�¤â�¤â�¤Unhandled …
10:14 snarkyboojum bulletproof :D
10:14 moritz aye :-)
10:14 moritz sorear++ I guess :-)
10:15 moritz I currently see a workaround that makes  $x; my $x  complain and *not* complain about "@a" if @a is not predeclared
10:17 moritz but it will incorrectly fail to complain about "@a[]"; my @a
10:17 moritz but don't tell masak :-)
10:28 avar joined #perl6
10:31 moritz perl6: my %s; say "%s[0]"
10:31 p6eval rakudo cb6374: OUTPUT«().hash␤»
10:31 p6eval ..niecza v11: OUTPUT«Use of uninitialized value in string context␤  at /home/p6eval/niecza/lib/CORE.setting line 773 (warn @ 2) ␤  at /home/p6eval/niecza/lib/CORE.setting line 168 (Mu.Str @ 9) ␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /tmp/em3Gd2FK_p line 1 (mainline @ 1) ␤  at /home…
10:31 p6eval ..pugs b927740: OUTPUT«␤»
10:32 moritz huh, is uninitialized value fatal in niecza?
10:32 Gothmog_ joined #perl6
10:32 Vlavv` joined #perl6
10:32 xinming joined #perl6
10:32 benabik joined #perl6
10:32 __sri joined #perl6
10:32 felher joined #perl6
10:32 lestrrat joined #perl6
10:32 drbean joined #perl6
10:32 djanatyn joined #perl6
10:32 ruz joined #perl6
10:32 araujo joined #perl6
10:32 kfo joined #perl6
10:32 ponbiki joined #perl6
10:32 ponpon joined #perl6
10:32 Grrrr joined #perl6
10:32 Sarten-X joined #perl6
10:32 TiMBuS joined #perl6
10:32 pmichaud joined #perl6
10:32 HarryS joined #perl6
10:32 kent\n joined #perl6
10:32 lumi_ joined #perl6
10:32 hanekomu joined #perl6
10:32 ranguard joined #perl6
10:32 jerome_ joined #perl6
10:32 pjcj joined #perl6
10:32 domm joined #perl6
10:32 athomason_ joined #perl6
10:32 takesako joined #perl6
10:32 kshannon joined #perl6
10:32 jtpalmer joined #perl6
10:32 jasonmay joined #perl6
10:32 clkao joined #perl6
10:33 wooden joined #perl6
10:33 robins joined #perl6
10:33 daxim_ joined #perl6
10:33 kst joined #perl6
10:33 plobsing joined #perl6
10:33 jesk joined #perl6
10:33 masak joined #perl6
10:33 snarkyboojum joined #perl6
10:33 yves joined #perl6
10:33 mantovani joined #perl6
10:33 silug joined #perl6
10:33 awwaiid joined #perl6
10:33 zb joined #perl6
10:33 geekosaur joined #perl6
10:33 jql joined #perl6
10:33 ilogger2 joined #perl6
10:33 simcop2387 joined #perl6
10:33 satyavvd joined #perl6
10:33 flussence joined #perl6
10:33 mathw joined #perl6
10:33 \patch joined #perl6
10:33 Juerd joined #perl6
10:34 nine joined #perl6
10:34 sorear joined #perl6
10:34 Psyche^ joined #perl6
10:34 jnthn joined #perl6
10:34 kthakore joined #perl6
10:34 pnu joined #perl6
10:34 lucs joined #perl6
10:34 ruoso joined #perl6
10:34 alim joined #perl6
10:37 thowe joined #perl6
10:38 snarkyboojum my comment about the 'job seems to be done in method check_variable in STD.pm6 in Niecza and STD' didn't seem to survive the netsplit :)
10:39 hillu joined #perl6
10:47 moritz I skimmed the check_variable code in STD, and don't see how it deals with this issue in particular
10:47 charsbar__ joined #perl6
10:48 woosley joined #perl6
10:55 dalek rakudo/check-vars: c6bbbf8 | moritz++ | src/core/EnumMap.pm:
10:55 dalek rakudo/check-vars: fix typo in EnumMap.pm
10:55 dalek rakudo/check-vars: review: https://github.com/rakudo/rakudo/commit/c6bbbf82dc
10:55 dalek rakudo/check-vars: 5a22e59 | moritz++ | src/Perl6/Actions.pm:
10:55 dalek rakudo/check-vars: work around over-eager complaints about things that might turn out to be variables in double-quoted strings
10:55 dalek rakudo/check-vars: review: https://github.com/rakudo/rakudo/commit/5a22e5907d
10:55 dalek rakudo/check-vars: c6bbbf8 | moritz++ | src/core/EnumMap.pm:
10:55 dalek rakudo/check-vars: fix typo in EnumMap.pm
10:55 dalek rakudo/check-vars: review: https://github.com/rakudo/rakudo/commit/c6bbbf82dc
10:55 dalek rakudo/check-vars: 5a22e59 | moritz++ | src/Perl6/Actions.pm:
10:55 dalek rakudo/check-vars: work around over-eager complaints about things that might turn out to be variables in double-quoted strings
10:55 dalek rakudo/check-vars: review: https://github.com/rakudo/rakudo/commit/5a22e5907d
10:55 flussence for a few seconds there I though it'd fixed itself...
10:56 flussence (I wonder if something's changed on github that's causing these double messages...)
10:58 am0c joined #perl6
10:58 satyavvd joined #perl6
11:02 simcop2387 joined #perl6
11:03 flussence joined #perl6
11:04 cognominal_ joined #perl6
11:05 wk joined #perl6
11:05 Trashlord joined #perl6
11:13 Trashlord joined #perl6
11:13 [particle]1 joined #perl6
11:20 tadzik oh hai
11:23 ethndbst joined #perl6
11:24 ethndbst joined #perl6
11:38 Psyche^ joined #perl6
11:38 simcop2387_ joined #perl6
11:46 [particle]1 joined #perl6
11:47 ethndbst joined #perl6
11:52 pernatiy joined #perl6
12:01 woosley left #perl6
12:21 JimmyZ joined #perl6
12:23 pernatiy_ joined #perl6
12:34 alim joined #perl6
12:36 tyatpi_ joined #perl6
12:42 packetknife joined #perl6
12:44 masak oh hai, #perl6
12:44 moritz lol it's masak!
12:45 masak <moritz> but don't tell masak :-)
12:45 kaleem joined #perl6
12:45 masak tell me what? :P
12:46 masak as I said, it's been a while since we had one of those semicolon parsing bugs.
12:46 masak I remember being quite bothered by them back in 2009.
12:46 moritz masak: nope, something completely different
12:46 moritz http://irclog.perlgeek.de/​perl6/2011-11-02#i_4649873
12:46 masak oh, ok.
12:47 moritz that's the check-vars branch
12:47 mj41 joined #perl6
12:48 kaleem joined #perl6
12:48 moritz ... which introduces a parsing bug in t/spec/S04-declarations/my.rakudo which I completely fail to comprehend
12:49 masak ah.
12:55 jnthn moritz: ...well, that's quite a wtf.
12:57 wk joined #perl6
12:57 moritz ok, I've golfed it down, nopaste forthcoming
12:59 moritz jnthn: https://gist.github.com/1333561
12:59 moritz I wonder if maybe the error is bogusly thrown, and caught, and causes a parsefail somehow
13:00 moritz or... something
13:00 jnthn moritz: Or a contextaul ends up in an undesirable state somewhere
13:01 moritz well, my patch only ever reads contextuals, afaict
13:01 jnthn or some other such oddity
13:01 moritz *patches
13:02 moritz git pull; git diff origin/nom origin/check-vars
13:02 jnthn moritz: I can golf it further
13:02 jnthn try { eval '$b' }
13:02 jnthn eval('
13:02 jnthn my $d = 1;');
13:02 jnthn So it's nothing to do with Test.pm
13:03 moritz jnthn: you're on that branch too?
13:04 jnthn yes
13:05 * moritz wonders if a cursor gets messed up with $/.CURSOR.panic, and then is somehow reused to parse the insides of the eval
13:06 moritz ... which is probably a rather stupid idea
13:08 jnthn moritz: MARKED and MARKER are globals. I'm wondering if they're to blame.
13:09 moritz ah, a fun we've had before
13:18 jnthn moritz: it's that
13:18 jnthn https://gist.github.com/1333597
13:18 moritz so, what's the fix? making %markhash an attribute in HLL::Grammar, and creating an instance before parsing?
13:19 jnthn (not suggesting this for direct application, just as proof that it's a marking problem)
13:19 Sarten-X joined #perl6
13:19 jnthn Well, the problem with that is we'd need to copy it to every cursor
13:19 jnthn A contextual would work
13:20 moritz that would have been my next suggestion
13:20 moritz are they fast?
13:20 jnthn Slower than what we currently have
13:20 jnthn I'm wondering if we can maintain a stack of mark hashes reliably
13:23 jnthn STD uses @*MEMOS for these kinds of thing.
13:24 daniel-s joined #perl6
13:24 moritz jnthn: should I merge the branch anyway, and fudge the test for now? This is starting to get over my head :-)
13:24 jnthn moritz: Well, or apply it with the hack
13:24 jnthn So we don't have to regress on the test
13:24 jnthn Just clearly mark my patch as a hack.
13:25 moritz jnthn: ok
13:25 jnthn I'll try and work out the best way to fix this.
13:25 jnthn Or pmichaud may appear and give us an opinion ;)
13:26 jnthn Make sure my hack doesn't cause regressions too, btw
13:26 moritz sure, will spectest
13:26 moritz oh and btw it won't be a branch merge
13:26 jnthn I suspect you could get something weird with a BEGIN time eval.
13:26 moritz because I changed stuff back and forth
13:26 jnthn ah, ok
13:26 moritz and the overall diff is rather small
13:26 jnthn however you prefer it :)
13:27 y3llow joined #perl6
13:38 masak nom: sub foo { my $x; our sub bar { $x = 42 }; say $x }; our &bar; bar(); foo
13:38 p6eval nom cb6374: OUTPUT«Any()␤»
13:38 masak niecza: sub foo { my $x; our sub bar { $x = 42 }; say $x }; our &bar; bar(); foo
13:38 p6eval niecza v11: OUTPUT«Any()␤»
13:38 masak fair enuf :)
13:38 masak I guess bar is modifying a pad that is then thrown away...
13:38 jnthn yes
13:39 jnthn Or
13:39 jnthn Well, yes, it will be. But the real issue is that the call to foo makes a new one :)
13:43 envi_ joined #perl6
13:44 sftp joined #perl6
13:51 benabik joined #perl6
13:51 [Coke] http://thedailywtf.com/Articl​es/The-True-Alternative.aspx
13:52 thou joined #perl6
13:52 PZt joined #perl6
13:52 [Coke] nom: sub EmailList { return True CATCH { return False } } ; say EmailList()
13:52 p6eval nom cb6374: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 1␤»
13:52 [Coke] nom: sub EmailList { return True; CATCH { return False } } ; say EmailList()
13:52 p6eval nom cb6374: OUTPUT«Bool::True␤»
13:53 masak nom: sub foo { my $x; our sub bar { $x = 42 }; say $x }; foo; our &bar; bar(); foo
13:53 p6eval nom cb6374: OUTPUT«Any()␤Any()␤»
13:53 masak right.
13:53 moritz niecza: sub EmailList { return True; CONTROL  { return False } } ; say EmailList()
13:53 p6eval niecza v11: OUTPUT«Bool::True␤»
13:59 masak is that correct?
13:59 moritz erm, yes, because I'm stupid
14:00 moritz niecza: sub EmailList { return True; CONTROL  { default { return False } } } ; say EmailList()
14:00 p6eval niecza v11: OUTPUT«Bool::True␤»
14:00 moritz now *that* should come out as False, afacit
14:00 moritz *afaict
14:03 dalek rakudo/nom: 430c564 | moritz++ | src/Perl6/Actions.pm:
14:03 dalek rakudo/nom: align code vertically, no functional changes
14:03 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/430c564074
14:03 dalek rakudo/nom: d307831 | moritz++ | src/ (4 files):
14:03 dalek rakudo/nom: Catch variable use before declaration (RT #61838)
14:03 dalek rakudo/nom:
14:03 dalek rakudo/nom: Does not catch unused non-$ variables in double quoted strings.
14:03 dalek rakudo/nom:
14:03 dalek rakudo/nom: This also moves $Inf and $NaN to an earlier setting file, because
14:03 dalek rakudo/nom: they were used before the declaration.
14:03 dalek rakudo/nom:
14:03 dalek rakudo/nom: It also contains a very ugly workaound around a problem with the nqp
14:03 dalek rakudo/nom: %markhash being global, and reused for multiple evals. This bug
14:03 dalek rakudo/nom: was exposed by other parts of the patch.
14:03 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/d307831a71
14:03 moritz evalbot rebuild nom
14:03 p6eval OK (started asynchronously)
14:03 dalek rakudo/nom: 430c564 | moritz++ | src/Perl6/Actions.pm:
14:03 dalek rakudo/nom: align code vertically, no functional changes
14:03 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/430c564074
14:03 dalek rakudo/nom: d307831 | moritz++ | src/ (4 files):
14:03 dalek rakudo/nom: Catch variable use before declaration (RT #61838)
14:03 dalek rakudo/nom:
14:03 dalek rakudo/nom: Does not catch unused non-$ variables in double quoted strings.
14:03 dalek rakudo/nom:
14:03 dalek rakudo/nom: This also moves $Inf and $NaN to an earlier setting file, because
14:03 dalek rakudo/nom: they were used before the declaration.
14:03 dalek rakudo/nom:
14:03 dalek rakudo/nom: It also contains a very ugly workaound around a problem with the nqp
14:03 dalek rakudo/nom: %markhash being global, and reused for multiple evals. This bug
14:03 dalek rakudo/nom: was exposed by other parts of the patch.
14:03 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/d307831a71
14:05 koban left #perl6
14:05 masak "yo dawg, I know you like commit messages, so I doubled them"
14:16 dalek roast: 1947757 | moritz++ | S0 (2 files):
14:16 dalek roast: unfudge two passing tests for rakudo
14:16 dalek roast: review: https://github.com/perl6/roast/commit/19477571ee
14:16 dalek roast: 1947757 | moritz++ | S0 (2 files):
14:16 dalek roast: unfudge two passing tests for rakudo
14:16 dalek roast: review: https://github.com/perl6/roast/commit/19477571ee
14:17 * moritz closes https://rt.perl.org/rt3/Ti​cket/Display.html?id=61838
14:17 jnthn \o/
14:17 masak \o/
14:17 masak moritz++
14:19 moritz nom: $x; my $x
14:19 p6eval nom cb6374:  ( no output )
14:20 * [Coke] would chip in a few bucks to help fund a cert for rt.perl.org.
14:20 [Coke] moritz++
14:21 [Coke] moritz: there may be some near-dups that also closes. excellent.
14:22 moritz another that it fix is  sub f { $x; $^x }
14:24 masak [Coke]: I would chip in a few bucks for that too.
14:25 JimmyZ joined #perl6
14:25 jnthn Next challenge:
14:25 jnthn nom: my $x = 42; { say $x; my $x = 69 }
14:25 p6eval nom cb6374: OUTPUT«Any()␤»
14:25 jnthn std: my $x = 42; { say $x; my $x = 69 }
14:25 p6eval std be1f10e: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Lexical symbol '$x' is already bound to an outer symbol (see line 1);â�¤  the implicit outer binding at line 1 must be rewritten as OUTER::<$x>â�¤  before you can unambiguously declare a new '$x' in this scope at /tmp/llF9xD75w6 line 1:â�¤---…
14:25 jnthn :)
14:26 moritz jnthn: I guess the infrastructure for that one isn't quite as ready as for the last fix :-)
14:27 jnthn Hm :)
14:27 moritz (because we don't track usage of variables per scope in the $*ST
14:27 moritz only declarations)
14:28 jnthn Yes, though we could track usages too :)
14:29 moritz ... and burn even more memory. Sigh.
14:29 jnthn We already keep a per-block symbol table.
14:37 [Coke] masak: I pinged the admins.
14:39 tyatpi joined #perl6
14:40 masak [Coke]++
14:48 tokuhiro_ joined #perl6
14:50 moritz nom: $x; my $x
14:50 p6eval nom cb6374:  ( no output )
14:51 moritz the previous rebuild seems to have vm-panic'ed
14:55 am0c joined #perl6
14:59 fsergot What is the easiest way to write in p6 an old dump function. Like this one: https://gist.github.com/1333837
15:00 fsergot I wrote some code, but i think it's too complicated.
15:00 jnthn fsergot: You have a string of data and you want to see the bytes?
15:01 moritz nom: say Buf.new(123, 0, 128).gist
15:01 p6eval nom d30783: OUTPUT«Buf:0x<7b 00 80>␤»
15:01 moritz you can just look how Buf.gist does it :-)
15:01 jnthn nom: "abcd\nef".encode('utf-8').list.perl.say
15:01 p6eval nom d30783: OUTPUT«encoding 'utf-8' not found␤  in method encode at src/gen/CORE.setting:3444␤  in block <anon> at /tmp/h1IObLRjOR:1␤  in <anon> at /tmp/h1IObLRjOR:1␤»
15:01 jnthn er
15:01 jnthn nom: "abcd\nef".encode('utf8').list.perl.say
15:01 p6eval nom d30783: OUTPUT«Array.new(97, 98, 99, 100, 10, 101, 102)␤»
15:01 jnthn That gets you the bytes
15:02 moritz that's a bit of a f*ckup (that parrot thinks 'UTF-8' is 'UTF8')
15:02 jnthn m
15:02 fsergot I want to see hex hex hex | a b c :)
15:02 moritz utf8 exists within the Perl community as a relaxed version of UTF-8
15:03 moritz fsergot: just show the code you've got so far, we can make then suggestions on how to improve it
15:04 araujo joined #perl6
15:04 araujo joined #perl6
15:06 moritz nom: sub dump-line($s) { $s.comb>>.base(16) ~ ' | ' ~ $x.comb.map({ 31 < .ord < 127 ?? $_ !! '.'}) }; say dump-line("abc")
15:06 p6eval nom d30783: OUTPUT«===SORRY!===␤Variable $x is not predeclared at line 1, near ".comb.map("␤»
15:06 moritz nom: sub dump-line($s) { $s.comb>>.base(16) ~ ' | ' ~ $s.comb.map({ 31 < .ord < 127 ?? $_ !! '.'}) }; say dump-line("abc")
15:06 p6eval nom d30783: OUTPUT«Method 'base' not found for invocant of class 'Str'␤  in method reify at src/gen/CORE.setting:4051␤  in method reify at src/gen/CORE.setting:3958␤  in method reify at src/gen/CORE.setting:3958␤  in method gimme at src/gen/CORE.setting:4320␤  in method eager at src/gen…
15:06 fsergot moritz, my code is undone yet. It's to complicated too. :)
15:06 moritz nom: sub dump-line($s) { $s.comb>>.Int>>.base(16) ~ ' | ' ~ $s.comb.map({ 31 < .ord < 127 ?? $_ !! '.'}) }; say dump-line("abc")
15:06 p6eval nom d30783: OUTPUT«0 0 0 | a b c␤»
15:06 moritz nom: sub dump-line($s) { $s.comb>>.ord>>.base(16) ~ ' | ' ~ $s.comb.map({ 31 < .ord < 127 ?? $_ !! '.'}) }; say dump-line("abc")
15:06 p6eval nom d30783: OUTPUT«61 62 63 | a b c␤»
15:07 moritz fsergot: something like that? :-)
15:07 fsergot This is what i want! :)
15:07 pernatiy joined #perl6
15:07 moritz nom: $x; my $x
15:07 p6eval nom d30783: OUTPUT«===SORRY!===␤Variable $x is not predeclared at line 1, near "; my $x"␤»
15:07 fsergot Exactly!
15:07 moritz \o/ # finally
15:07 jnthn moritz++
15:08 moritz now there's just one case that doesn't work right yet
15:08 moritz nom: "@a[0]"; my @a
15:08 p6eval nom d30783:  ( no output )
15:08 moritz that's the one where I said "don't tell masak" :-)
15:08 fsergot moritz++ , can You explain your code? :)
15:09 moritz fsergot: which part of it?
15:09 fsergot All between { } :)
15:09 fsergot The subroutine :)
15:09 moritz $s.comb returns a list of characters in the string
15:10 moritz >>.something is a method call done on each item of the list
15:10 moritz .ord returns the Codepoint number
15:10 moritz are you with me so far?
15:12 fsergot hmmm
15:13 fsergot Don't understand the >>. :)
15:13 moritz nom: say ("a", "b").uc.WHAT
15:13 p6eval nom d30783: OUTPUT«Str()␤»
15:13 moritz if I call string method like this on a list, it first converts to string
15:14 moritz does its operation
15:14 moritz and then returns a string
15:14 moritz nom: say ("a", "b").uc.perl
15:14 p6eval nom d30783: OUTPUT«"A B"␤»
15:15 moritz but when I call it as >>.uc, the method is called on each list element, and a new list is constructed and returned
15:15 moritz nom: say ("a", "b")>>.uc.perl
15:15 p6eval nom d30783: OUTPUT«("A", "B")␤»
15:16 moritz fsergot: a bit clearer now?
15:16 fsergot It's clear now. :)
15:16 fsergot So, "does something on each element of a list"? :)
15:17 moritz yes
15:17 fsergot Great moritz++ :)
15:17 moritz nom: say "abc".comb.perl
15:17 p6eval nom d30783: OUTPUT«("a", "b", "c").list␤»
15:17 moritz nom: say "abc">>.ord.comb.perl
15:18 p6eval nom d30783: OUTPUT«("9", "7").list␤»
15:18 * moritz stupid
15:18 moritz nom: say "abc".comb>>.ord.perl
15:18 p6eval nom d30783: OUTPUT«(97, 98, 99)␤»
15:18 moritz nom: say "abc".comb>>.ord>>.base(16).perl
15:18 p6eval nom d30783: OUTPUT«("61", "62", "63")␤»
15:18 dukeleto joined #perl6
15:18 moritz so, .base(16) just converts the number to base 16
15:18 moritz ~ is concatenation
15:19 fsergot Great. :)
15:19 fsergot Ok, it's clear all now. :)
15:19 moritz \o/
15:19 bluescreen10 joined #perl6
15:20 fsergot ?? !! is the same as?  : in e.g. c, right?
15:20 moritz yes
15:20 fsergot Thank You very much. :)
15:21 fsergot I have another question, just for pure curiousity.
15:21 moritz sure, shoot
15:22 fsergot Where should i looking for if i want to add this function to standard functions on Str type, like e.g. "abc".perl?
15:22 moritz you shouldn't
15:23 fsergot Why?
15:23 moritz you can add methods to core classes from within your own programs, but it's very dangerous, because other users might add another method of the same class
15:24 moritz ruby people have experienced a lot of pain because it was cultural acceptable (and easy) to do in ruby
15:24 moritz so two different libraries added two different (and incompatible) .json methods to the core classes
15:24 moritz so you can't use both libraries at once
15:25 moritz that's why you just put such functions into a module, and import that module when you do need it
15:25 kaare_ joined #perl6
15:25 alester joined #perl6
15:26 moritz if you really want do perform the black magic, it goes like this:
15:26 moritz nom: use MONKEY_TYPING; augment class Str { method dump() { "generate dumped string here" } }; say 'abc'.dump
15:26 p6eval nom d30783: OUTPUT«generate dumped string here␤»
15:28 benabik nom: role Foo { method foo() { say "foo" } }; my $x = "bar" but Foo; $x.foo
15:28 p6eval nom d30783: OUTPUT«foo␤»
15:29 benabik How I'd do it ^^
15:29 fsergot Ok, clear. Thanks. But what if i would write it in rakudo files, to add it to standard method. You know, someone is downloading the rakudo and he can use this method at once. :)
15:29 moritz fsergot: then you'd just put the method in src/core/Str.pm
15:30 moritz though we'd need to agree that it's generally useful, and spec it
15:30 moritz and it'd need a less general name, maybe "hexdump" or so
15:30 moritz benabik: I'd still like a sub (or multi sub) better
15:30 fsergot So, it's quite simple.
15:31 fsergot Of course, community is community. :)
15:31 moritz fsergot: yes, it's simple
15:31 moritz benabik: with a sub, you can dump any string, not just those with the role mixed in. And you have to load the module in any case
15:31 benabik moritz: Well, yes.  But if I wanted to make it a method on a String, I'd do mixins not monkey around with core types.
15:32 fsergot Perl becomes better, and better. it makes me very happy, i love perl! :)
15:32 moritz benabik: ok, agreed on that part
15:33 benabik Might be useful to pass a String to some _other_ sub that expects a .foo method, for example.
15:33 fsergot What is the difference between role and class? When should i use a role and when a class?
15:34 Grrrr joined #perl6
15:36 moritz you use a class when you want to make objects from it directly
15:36 moritz and you use a role when you have a piece of code that you want to share between different classes or roles
15:37 moritz well, at least that's the basic rule of thumb :-)
15:37 benabik Or random objects with the power of but
15:37 moritz S12 and S14 have more on that matter
15:37 fsergot Thanks :)
15:37 molaf joined #perl6
15:38 JimmyZ nom: say "abc".>>.ord.comb.perl
15:38 p6eval nom d30783: OUTPUT«===SORRY!===␤Confused at line 1, near "say \"abc\"."␤»
15:44 fsergot nom: say <5/10>.perl
15:44 p6eval nom d30783: OUTPUT«"5/10"␤»
15:51 fsergot nom: say <55/5>.perl
15:51 p6eval nom d30783: OUTPUT«"55/5"␤»
15:51 moritz just a string
15:58 worr joined #perl6
16:02 masak very interesting PerlMonks thread: http://www.perlmonks.org/index.pl?node_id=233565
16:02 masak especially Abigail-II's answer close to the bottom.
16:04 jnthn and the ASCII-art screw
16:04 masak indeed, that was nice too.
16:15 cognominal___ joined #perl6
16:21 cognominal_ joined #perl6
16:21 flussence joined #perl6
16:27 phenny joined #perl6
16:46 kaleem joined #perl6
16:48 fsergot joined #perl6
16:49 kaleem joined #perl6
16:50 cognominal joined #perl6
16:51 masak oh my, there's a quantum version of the Monty Hall problem...
16:51 lateau_ joined #perl6
16:52 masak but the solution turns out to be the same as in the classical version, assuming the position has been correctly randomized. ;)
16:52 dual joined #perl6
16:59 sorear good * #perl6
16:59 phenny sorear: 01 Nov 06:48Z <japhb> tell sorear Perhaps one of the command-line capable JS engines.  Would be nice to see how well Niecza's design fits into that type of VM, and whether the way that JS VMs are tunes can work well with the kind of generated code Niecza would throw at it.
16:59 sorear o/ masak
16:59 sorear niecza: sub EmailList { return True; CONTROL  { default {  return False } } } ; say EmailList()
16:59 p6eval niecza v11: OUTPUT«Bool::True␤»
16:59 sorear niecza: sub EmailList { CORE::return True; CONTROL  { default {  return False } } } ; say EmailList()
16:59 p6eval niecza v11: OUTPUT«Bool::True␤»
16:59 sorear so much for that idea
16:59 moritz sorear: fwiw dalek reports every commit twice, any idea what could be wrong?
17:00 sorear moritz: github changed the API on us
17:00 icwiener joined #perl6
17:00 moritz :(
17:02 masak sorear: \o
17:04 pernatiy_ joined #perl6
17:06 * masak decommutes
17:08 dalek rakudo/nom: fde126b | jnthn++ | src/Perl6/Optimizer.pm:
17:08 dalek rakudo/nom: Make sure the optimizer knows about PAST::Want nodes; stub for PAST::Var consideration.
17:08 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/fde126bd36
17:20 MayDaniel joined #perl6
17:25 sorear #phasers in 5?
17:25 moritz yes
17:25 pernatiy joined #perl6
17:25 jnthn grrr, DST :/
17:41 pernatiy_ joined #perl6
17:52 fsergot Can You show me how to use gather and take?
17:53 cognominal_ joined #perl6
17:53 Chillance joined #perl6
17:53 Juerd my @foo = gather { ... }; Within the block, have one or more of  take $item;. @foo will end up containing the items taken.
17:54 fsergot Juerd++, tahnks. :)
17:54 fsergot thanks
17:54 Juerd e.g. my @foo = gather { while (...) { for (...) { if (...) { take $_ } } } } };
17:55 Juerd In p5 you'd write my @foo; and then use push instead of take.
17:55 fsergot Hm, right. :)
17:55 Juerd You can still do that :)
17:56 sorear the real advantage of gather/take is that it is _lazy_ and creates a _coroutine_
17:57 sorear niecza: my @infinite-list := gather { my $i = 0; loop { take $i++ } }; for @infinite-list -> $x { say $x; last if $x > 10 }
17:57 p6eval niecza v11: OUTPUT«[31m===[0mSORRY![31m===[0m��Confused at /tmp/OcMf20672L line 1:�------> [32m= gather { my $i = 0; loop { take $i++ }[33m�[31m }; for @infinite-list -> $x { say $x; l[0m��Parse failed��»
17:57 sorear niecza: my @infinite-list := gather { my $i = 0; loop { take $i++ }; }; for @infinite-list -> $x { say $x; last if $x > 10 }
17:57 p6eval niecza v11: OUTPUT«0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤»
17:58 sorear note the use of := there, which tells niecza to do an "aliasing" operation instead of a "copy" (which would fail for an infinite list)
17:58 Juerd - in identifiers still confuses me
18:00 PerlJam Juerd: why?
18:02 Juerd PerlJam: I don't really know. I read it as the minus operator.
18:03 Juerd Even though I always do write whitespace around the infix op, it appears that when reading I'm not as whitespace conscious... :)
18:05 fsergot sorear, only in niecza?
18:05 fsergot i think about :=
18:06 moritz in rakudo you should also use := there
18:07 tlocalhos joined #perl6
18:08 bluescreen10 joined #perl6
18:09 sorear I understand niecza's behavior and requirements very much better than I do rakudo's, so I tend to use it as an example, is all.
18:10 fsergot sub foo ( |$some ) { ... }
18:10 fsergot What means the | prefix?
18:11 fsergot I can't find it in S06
18:11 sorear $some is a Capture object
18:12 moritz and it holds all the arguments passed to &foo
18:12 moritz in a raw form
18:13 fsergot Clear, thanks! :)
18:13 frettled joined #perl6
18:13 Lothar joined #perl6
18:18 fsergot So, what means the * prefix? :)
18:19 jnthn *@foo # all the positionals
18:19 jnthn *%foo # all the nameds
18:19 jnthn er, all those we didn't yet bind.
18:20 fsergot Thanks jnthn :)
18:21 karamorf joined #perl6
18:21 fsergot And what about ** ? :)
18:21 moritz that's non-flattening List of List context
18:22 moritz if you write (1, 2), (3, 4)  that will bind as 4 list items to *@a, and as 2 list items to **@a
18:23 fsergot Great, thanks. :)
18:25 masak moritz++ jnthn++ # explainers
18:25 fsergot right
18:26 fsergot nom: multi sub foo { say "foo"; }; multi sub foo (Int $a) { say "$a foo"; }; foo(); foo(1);
18:26 p6eval nom fde126: OUTPUT«foo␤1 foo␤»
18:26 fsergot nom: multi sub foo (Int $a) { say $a; }; multi sub foo (Int $a) { say "$a foo"; }; foo(); foo(1);
18:26 p6eval nom fde126: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'foo' will never work with no arguments (line 1)␤    Expected any of:␤    :(Int $a)␤    :(Int $a)␤»
18:27 fsergot nom: multi sub foo (Int $a) { say $a; }; multi sub foo (Int $a) { say "$a foo"; }; foo(1); foo(2);
18:27 p6eval nom fde126: OUTPUT«Ambiguous dispatch to multi 'foo'. Ambiguous candidates had signatures:␤:(Int $a)␤:(Int $a)␤␤  in block <anon> at /tmp/C9VaquTaEB:1␤  in <anon> at /tmp/C9VaquTaEB:1␤»
18:36 fsergot nom: sub name ( 1||2 ){ say 1; } name(1);
18:36 p6eval nom fde126: OUTPUT«===SORRY!===␤Malformed block at line 1, near "( 1||2 ){ "␤»
18:36 fsergot nom: sub name ( 1||2 ) { say 1; }; name(1);
18:36 p6eval nom fde126: OUTPUT«===SORRY!===␤Malformed block at line 1, near "( 1||2 ) {"␤»
18:37 jnthn You can't quite do that
18:37 fsergot I have to write 2 subroutines?
18:37 jnthn nom: sub name($a where 1|2) { say $a }; name(1); name(2); name(3)
18:37 p6eval nom fde126: OUTPUT«1␤2␤Constraint type check failed for parameter '$a'␤  in sub name at /tmp/tWFhWdcmvp:1␤  in block <anon> at /tmp/tWFhWdcmvp:1␤  in <anon> at /tmp/tWFhWdcmvp:1␤»
18:38 jnthn Note | (junction), not || (logical and)
18:38 fsergot Thanks jnthn++ :)
18:41 cognominal___ joined #perl6
18:43 dalek rakudo/nom: 58c4721 | jnthn++ | src/Perl6/Actions.pm:
18:43 dalek rakudo/nom: Include and propagate a bit more type information.
18:43 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/58c4721af0
18:43 dalek rakudo/nom: 325ea3c | jnthn++ | src/Perl6/Actions.pm:
18:43 dalek rakudo/nom: Various improvements to handling of native types; get back to producing stuff the inliner can do well with.
18:43 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/325ea3c928
18:43 dalek rakudo/nom: 5b98ef4 | jnthn++ | src/core/Int.pm:
18:43 dalek rakudo/nom: Start to simplify various of the native ops thanks to native handling improvements; don't need the nqp::want rigmarole any more.
18:43 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/5b98ef4a4f
18:44 icovnik joined #perl6
18:44 dalek 6model: 630d886 | diakopter++ | lua/ (9 files):
18:44 dalek 6model: bunches more bugfixes.  still many to go I'm sure.
18:44 dalek 6model: review: https://github.com/diakopte​r/6model/commit/630d886809
18:45 jnthn moritz: If you're about and have tuits - feel free to continue the cleanup started in 5b98ef4. :)
18:45 * jnthn goes to sort out dinner
18:46 moritz jnthn: will take a look
18:47 fridim_ joined #perl6
18:50 moritz jnthn: how much do we benefit from 'returns int' and 'returns Int:D' annotations?
18:53 tyatpi joined #perl6
18:54 icovnik hello please can you point me to some docs about installing modules into rakudo?
18:54 icovnik i am trying to install panda
18:54 moritz ... and it fails
18:54 moritz because we've regressed on protoregexes
18:54 icovnik to install some other modules
18:54 icovnik ahhh
18:55 icovnik that would be it :)
18:55 moritz and it needs JSON to parse its state files
18:55 moritz so what I'm currently using as a hack is ufo
18:55 icovnik heh
18:55 moritz https://github.com/masak/ufo
18:55 moritz I clone the repos by hand, then do
18:55 moritz ufo && make install
18:56 icovnik and ufo is the replacement for panda?
18:56 moritz no
18:56 moritz it's a hack we use until panda works again
18:56 moritz sorry for the incovenience
18:56 icovnik :)
18:57 icovnik no problem
18:57 moritz (that's also the reason why we don't have a nom-based rakudo star release yet)
18:57 icovnik today i said to myself it is about the time to try to do something in rakudo
18:58 TimToady japhb: I see very little use case for 0X, 0B, etc. and I'd hate to be responsible for encouraging their use.
18:58 icovnik ok so no problem, there is another thing what i have a problem with
18:59 icovnik i wanted to install Digest::MD5
18:59 icovnik but don't know how
18:59 icovnik so i just wanted to try it
18:59 icovnik downloaded source
18:59 icovnik cd'd into it
19:00 icovnik but it somehow... doesn't work
19:00 icovnik so is there a way I can make it work?
19:00 * moritz takes a look
19:01 icovnik hm maybe quite a big task with my 1-hour experience with rakudo and parrot :)
19:01 icovnik i got an error "Cannot assign a non-Perl 6 value to a Perl 6 container" in method md5_hex at a.pl:13
19:02 * moritz sees why
19:03 jnthn moritz: Without the returns annotations, we can't inline, say, $a * $b + $c fully, even if we know that all are int. We need to know that int * int gives int.
19:03 moritz jnthn: ok, so they make sense to add where they are missing
19:03 moritz jnthn: working on the cleanup
19:04 fsergot Can i build something like C's structure in perl?
19:04 jnthn moritz: Yes, and returns Bool on the comparrisons too.
19:05 moritz icovnik: I probably have a fix, but I need to wait until my rakudo is compiled again :-)
19:06 icovnik moritz: no problem
19:06 icovnik moritz: i can recompile too if needed
19:06 moritz icovnik: probably not necessary
19:07 tinmrn joined #perl6
19:09 icovnik ok in the meantime, can you direct me to some http client library? LWP::Simple? HTTP::Client?
19:10 moritz LWP::Simple exists
19:10 moritz icovnik: https://github.com/moritz/perl6-digest-md5 branch nom
19:10 moritz https://github.com/cosimo/perl6-lwp-simple/
19:13 moritz jnthn: now that we have much more magic, should we simply return native things from all kinds of ops?
19:13 moritz like infix:<+>(Int:D $a, Int:D $b) { ... }
19:13 wk joined #perl6
19:13 moritz could return int just as well as Int
19:14 Trashlord joined #perl6
19:14 jnthn moritz: I'd rather not
19:14 jnthn moritz: Also, all the Int ops will change soon.
19:14 jnthn moritz: Because bigint.
19:15 moritz ok, and yes
19:16 TimToady sorear: would hash lookup overhead be distributed over your flat profile?  and how much hash lookup is it doing for all the Cursors these days?
19:16 dalek 6model: 5c50076 | diakopter++ | lua/ (3 files):
19:16 dalek 6model: more fixes
19:16 dalek 6model: review: https://github.com/diakopte​r/6model/commit/5c50076828
19:17 TimToady i.e. would a repr change help there?
19:17 icovnik moritz: yes, after few minutes wrestling with git it really works :) thank you
19:17 moritz \o/
19:19 sjn joined #perl6
19:22 icovnik moritz: ok another question, how to run test suite of the module Digest::MD5 please?
19:22 icovnik moritz: i tried prove t
19:23 moritz icovnik: PERL6LIB=lib prove -e perl6 -r t/
19:23 Chillance joined #perl6
19:23 moritz jnthn: problem, my native int/num patches make rakudo segfault :(
19:24 icovnik moritz: ...that answers another question of mine, how to include lib dir in module search path
19:24 moritz or if you use ufo
19:24 moritz ufo && make test
19:24 jnthn moritz: int eresting...
19:24 mkramer joined #perl6
19:25 jnthn moritz: Can you figure out if it's the int or num bit, and send me a diff/intructions to reproduce?
19:25 wolfman2000 joined #perl6
19:25 moritz oh, I've made a mistake somewhere
19:26 moritz I've accidentally returned a list from one of the ops
19:26 moritz that shouldn't make it segfault, but it shouldn't be done anyway
19:26 jnthn no, segfaults are bad.
19:26 * moritz recompiles and retests
19:26 jnthn I like to hunt those down if they're something that can happen without nqp::ops
19:27 benabik moritz: as in `return list;` inside a .ops file?
19:27 moritz benabik: no
19:27 jnthn (e.g. if it could happen in user space)
19:27 moritz 'Ii', nqp::cmp_i(...) or so
19:30 TimToady nom: say "abc".ords
19:30 p6eval nom 5b98ef: OUTPUT«97 98 99␤»
19:30 moritz oooh
19:30 moritz I completely forgot about .ords
19:30 moritz even though I implemented it :-)
19:31 diakopter :)
19:36 icovnik moritz: ufo works really well, but another problem, now with URI
19:37 icovnik moritz: while running make: Invalid hard reference syntax at line 10, near "%%02X\", $c"
19:39 [Coke] nom: say "aֻ".ords
19:39 p6eval nom 5b98ef: OUTPUT«97 1467␤»
19:41 moritz icovnik: how does the line 10 look like?
19:41 mkramer left #perl6
19:41 icovnik moritz: that line of URI/Escape.pm looks good i think
19:42 icovnik moritz: %escapes{ chr($c) } = sprintf "%%%02X", $c;
19:42 icovnik moritz: the problem is that part "%%%02X", $c
19:42 tadzik hello #perl6
19:42 colomon joined #perl6
19:43 icovnik moritz: i tried sprintf "%02X", $c and that works, i tried sprintf "%%" and that works too, i tried sprintf "%% %02X", $c and even that works, but "%%%02X" doesn't work
19:43 moritz nom: say sprintf "%%%02X", 123
19:43 p6eval nom 5b98ef: OUTPUT«===SORRY!===␤Invalid hard reference syntax at line 1, near "%%02X\", 12"␤»
19:43 moritz nom: say sprintf '%%%02X', 123
19:43 p6eval nom 5b98ef: OUTPUT«%7B␤»
19:44 moritz that's a possible fix
19:44 moritz though I guess it's a rakudobug
19:44 PerlJam that's a crazy error message
19:44 moritz std: my $x; %%$x
19:44 p6eval std be1f10e: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Invalid hard reference syntax at /tmp/efDntrSl4p line 1:â�¤------> [32mmy $x; %[33mâ��[31m%$x[0mâ�¤    expecting any of:â�¤      desigilnameâ�¤    twigilâ�¤Parse failedâ�¤FAILED 00:01 120mâ�¤Â»
19:46 dalek rakudo/native-ints: 41359ec | moritz++ | src/core/Int.pm:
19:46 dalek rakudo/native-ints: get rid of nqp::want in Int.pm
19:46 dalek rakudo/native-ints: review: https://github.com/rakudo/rakudo/commit/41359ec516
19:46 moritz jnthn: bnrach native-ints pushed to github. Segfaults t/spec/S03-operators/reduce-le1arg.rakudo for me
19:46 moritz on [+&]
19:49 moritz yes, bad branch name, I hope we can delete it soon
19:49 ICheer_No0M joined #perl6
19:49 ICheer_No0M left #perl6
19:50 icovnik moritz: another one, again file lib/URI/Escape.pm: Typed arrays/hashes/callables not yet implemented at line 46, near ", Bool :$n"
19:50 icovnik moritz: the problematic line: sub uri_unescape(Str *@to_unesc, Bool :$no_utf8 = False) is export {
19:51 moritz is that also in the URI module?
19:51 icovnik yes
19:54 ksi joined #perl6
19:55 hugme joined #perl6
19:55 moritz hugme: list projects
19:55 hugme moritz: I know about Math-Model, Math-RungeKutta, MiniDBI, bench-scripts, book, gge, hugme, ilbot, java2perl6, json, modules.perl6.org, november, nqp-rx, nqpbook, perl6, perl6-examples, perl6-wtop, proto, pugs, rakudo, star, svg-matchdumper, svg-plot, tardis, try.rakudo.org, tufte, ufo, web, yapsi
19:57 mj41 joined #perl6
19:58 moritz icovnik: seems that URI isn't easy to fix :/
20:00 icovnik moritz: hm hm hm  so it looks like i am going to try HTTP::Client, that states that URI is replaced with some regex-fu
20:01 icovnik moritz: thanks
20:05 icovnik moritz: heh sorry again, it seems i am not going to load web pages today :)
20:05 tadzik just use Star :)
20:05 tadzik Star is based on the old Rakudo branch and most of the modules work there
20:06 icovnik module HTTP::Client, file lib/HTTP/Client/Response.pm6, error: Undefined routine '&splice' called (lines 108, 130)
20:06 moritz right, splice in NYI in nom
20:06 icovnik tadzik: please can you explain that to total novice (= me)?
20:07 icovnik tadzik: hmm do you thing rakudo star?
20:08 * icovnik is really clever sometimes... ;)
20:08 tadzik icovnik: sure. You are now using the Compiler release, which is the best compiler ever known to man. Unfortunately, the old one still has advantages, one of them being that modules work on the old one only. While the new one is released, it's still quite experimental in some fields, I'd say
20:08 masak "Rakudo -- the best compiler ever known to man"
20:08 tadzik saw this one coming
20:08 tyatpi joined #perl6
20:09 masak the sun was setting, and it was not a humble day in #perl6... :)
20:09 tadzik :)
20:09 tadzik I may be talking silly, I've slept below 4 hours and spent 12 hours on the university today
20:09 masak know the feeling.
20:09 masak I slept too little and worked too much too.
20:09 tadzik but I got the highest grades from everything today :)
20:10 tadzik morale boost!
20:10 masak \o/
20:10 jnthn masak: You just get a way for a few days...take a break ;)
20:10 moritz tadzik++
20:10 masak jnthn: I could totally use a vacation now.
20:10 tadzik also managed to accidentally setup a password on a cisco router, which was quite entertaining
20:10 moritz tadzik: want to implement splice() in nom?
20:10 masak jnthn: good thing I don't have to prepare three talks or anything.
20:10 jnthn masak: eek!
20:10 tadzik moritz: sure thing, will just finish me pasta
20:11 masak more like one and two half talks, but still...
20:12 tadzik masak: yeah, and tomorrow is "only" 10 hours on the uni :)
20:12 tadzik good thing it's mostly "Battle for Wesnoth Day"
20:12 masak oh yeah. good thing.
20:12 masak er, what? :)
20:13 tadzik well, 7 hours of lectures after 3 hours of table tennis cannot possibly result in any productivity
20:13 * tadzik looks at splice
20:14 * masak attempts to mind-map what his missing talk will be about
20:18 tadzik augment's working, si?
20:19 masak nom: use MONKEY_TYPING; augment Str { method foo { say "si" } }; "OH HAI".foo
20:19 moritz oui
20:19 p6eval nom 5b98ef: OUTPUT«===SORRY!===␤In "augment" declaration, typename Str must be predeclared (or marked as declarative with :: prefix) at line 1, near " { method "␤»
20:19 masak nom: use MONKEY_TYPING; augment class Str { method foo { say "si" } }; "OH HAI".foo
20:19 p6eval nom 5b98ef: OUTPUT«si␤»
20:19 masak si.
20:19 tadzik si! \o/
20:21 GlitchMr joined #perl6
20:28 fsergot joined #perl6
20:35 masak perl6: my $a = "OH HAI"; say q"$a"'
20:35 p6eval pugs b927740: OUTPUT«*** ␤    Unexpected "'"␤    expecting term postfix, operator, ":" or ","␤    at /tmp/lzRQY9tHqn line 1, column 28␤»
20:35 p6eval ..niecza v11: OUTPUT«[31m===[0mSORRY![31m===[0m��Confused at /tmp/eC7u_yEZr2 line 1:�------> [32mmy $a = "OH HAI"; say q"$a"[33m�[31m'[0m��Parse failed��»
20:35 p6eval ..rakudo 5b98ef: OUTPUT«===SORRY!===␤Confused at line 1, near "say q\"$a\"'"␤»
20:35 masak perl6: my $a = "OH HAI"; say q"$a"
20:35 p6eval niecza v11: OUTPUT«Potential difficulties:â�¤  $a is declared but not used at /tmp/m4tIhUGL8r line 1:â�¤------> [32mmy [33mâ��[31m$a = "OH HAI"; say q"$a"[0mâ�¤â�¤$aâ�¤Â»
20:35 p6eval ..pugs b927740, rakudo 5b98ef: OUTPUT«$a␤»
20:35 masak \o/
20:36 fsergot :-)
20:38 masak perl6: say < :-) :-> :-P ;-) >.pick
20:39 p6eval niecza v11: OUTPUT«[31m===[0mSORRY![31m===[0m��Confused at /tmp/eHG8KelQCQ line 1:�------> [32msay < :-) :-> [33m�[31m:-P ;-) >.pick[0m��Parse failed��»
20:39 p6eval ..rakudo 5b98ef: OUTPUT«===SORRY!===␤Confused at line 1, near "say < :-) "␤»
20:39 p6eval ..pugs b927740: OUTPUT«*** ␤    Unexpected ")"␤    at /tmp/PMj3AwSY_v line 1, column 21␤»
20:39 masak oh, of course :/
20:39 masak perl6: say < :-) :-P ;-) >.pick
20:39 p6eval pugs b927740: OUTPUT«:-)␤»
20:39 p6eval ..niecza v11: OUTPUT«:-P␤»
20:39 p6eval ..rakudo 5b98ef: OUTPUT«;-)␤»
20:40 masak nom: say [+](1..9).grep({ $_ %% 2 })
20:40 p6eval nom 5b98ef: OUTPUT«20␤»
20:40 masak niecza: say [+](1..9).grep({ $_ %% 2 })
20:40 p6eval niecza v11: OUTPUT«␤»
20:41 masak niecza: say [+] (1..9).grep({ $_ %% 2 })
20:41 p6eval niecza v11: OUTPUT«20␤»
20:41 masak I think Niecza is right and nom is parsin' it rong.
20:41 masak I guess there's an RT ticket for it, too.
20:41 moritz I thikn so
20:42 * jnthn pulls moritz's branch
20:43 moritz tadzik: https://gist.github.com/1334853 I couldn't resist :-)
20:43 jnthn moritz: oh
20:43 jnthn moritz: It's 'cus you use pir:: instead of nqp:: :)
20:43 moritz oh.
20:43 jnthn moritz: I guess I should try and make it handle those...
20:44 jnthn moritz: Yeah, it relies on knowing the result register type of nqp::, which we always do.
20:44 moritz ... and we don't know that for pir:: ?
20:44 jnthn moritz: Only if it's explicitly written in the opcode...which it is in these cases.
20:45 moritz so, what's the problem then?
20:45 jnthn moritz: That I only bothered to implement the type handling for nqp::
20:45 moritz oh
20:46 jnthn :)
20:46 moritz I thought the two compiled down to the same thing anyway
20:46 jnthn moritz: Yes, but I handle attaching .type for them earlier.
20:46 jnthn (In the actions)
20:46 jnthn moritz: anyway, I can make it work for pir::foo_II etc too
20:46 jnthn moritz: Or we can add the missing nqp ops
20:47 moritz or we make nqp:: opcodes for it all
20:47 jnthn Well, that needs to happen anyway really :)
20:47 moritz how shall we name the binary ops?
20:47 jnthn Are bor_i, band_i etc bad?
20:48 moritz no
20:48 jnthn bitwiseor_i is a bit long :)
20:48 moritz maybe bitor, bitand
20:48 jnthn Yes, with _i
20:48 moritz sure
20:49 tadzik moritz: there's nqp::splice :) And I have something that mostly works
20:49 benabik Would there be non _i bitwise ops?
20:49 moritz benabik: yes, for strings
20:52 benabik moritz: Hm. That could be very useful for cryptography… Shame I don't have the time to make a AES dynop lib for parrot.
20:58 moritz benabik: nqp is about to adopt libtommath, which can be used to build crypto stuff... http://libtom.org/?page=features&​amp;newsitems=5&amp;whatfile=ltm
20:59 tadzik moritz: wanna implement item() in the meantime? my splice seems to work :)
20:59 tadzik besides occasional maximum recursion depth exceeded
21:00 moritz tadzik: I'm on the nqp:: opcode stuff right now, so probably not today
21:01 tadzik okay
21:01 tadzik nom: sub indirect_slurpy_context( *@got ) { @got }; my @a = 1, 2, 3; @a = indirect_slurpy_context(@a); # masak, your call :)
21:02 p6eval nom 5b98ef: OUTPUT«maximum recursion depth exceeded␤Method 'dispatch:<.?>' not found for invocant of class 'ResizablePMCArray'␤current instr.: 'is-hidden' pc 863722 (src/gen/CORE.setting.pir:239050) (src/gen/CORE.setting:6249)␤»
21:02 baest joined #perl6
21:02 benabik Line numbers from CORE.setting.pir scare me sometimes.
21:03 benabik (Assuming, of course, that IMCC isn't just lying about them.)
21:03 moritz nom: my @a = 1, 2, 3; @a = @a
21:03 p6eval nom 5b98ef: OUTPUT«maximum recursion depth exceeded␤  in method infinite at src/gen/CORE.setting:4310␤  in method infinite at src/gen/CORE.setting:4003␤  in method infinite at src/gen/CORE.setting:4320␤  in method infinite at src/gen/CORE.setting:4003␤  in method infinite at src/gen/COR…
21:03 jnthn benabik: It's 250000 lines or so...
21:03 moritz simpler :-)
21:03 moritz the ones from src/gen/CORE.setting seem to be accurate
21:03 tadzik eww, splice.t, you so silly
21:04 tadzik #?rakudo skip "splice is no longer spec'd as taking non-Int offset or size"
21:04 tadzik why is it in spectests then?
21:04 jnthn I love how we do infinite recursion...in a method called infinite
21:04 tadzik we should have the irony() method. It'd be so ironic
21:05 benabik Is infinite recursing infinitely really a bug?
21:05 tadzik any idea why https://github.com/perl6/roast/bl​ob/master/S32-array/splice.t#L136 wouldn't just be killed with fire?
21:06 tadzik these are supposed to be spec-tests, not "in-the-land-before-time-spec-tests"
21:06 moritz because fire hurts our hard discs
21:06 benabik Killed with magnets then?
21:06 moritz tadzik: most of the Cool stuff isn't really specced
21:07 tadzik I'm worried about the "no longer" part. Or is it planned to be put back in?
21:12 tadzik aw, whatever, I'll leave that to spec ninjas :)
21:12 fsergot o/ tadzik
21:13 sorear good * #perl6
21:13 tadzik hello fsergot
21:13 tadzik hello sorear
21:13 masak hello sorear
21:13 sorear o/ MASAK
21:14 sorear TimToady: hash lookup isn't that high
21:14 fsergot hello sorear
21:14 jnthn .oO( good guess though...hash and high do go together well... )
21:14 sorear TimToady: thinking I'll try to port tryfile/STD to niecza in their own right, to see how much of this is parser vs action methods
21:14 dalek nqp: d75deea | moritz++ | src/PAST/NQP.pir:
21:14 dalek nqp: more math nqp:: ops
21:14 dalek nqp: review: https://github.com/perl6/nqp/commit/d75deea76d
21:14 dalek nqp: 3400e44 | moritz++ | src/PAST/NQP.pir:
21:14 dalek nqp: more nqp:: math ops
21:14 dalek nqp: review: https://github.com/perl6/nqp/commit/3400e4420e
21:15 moritz jnthn: pir:: -> nqp:: qill probably have to wait until tomorrow
21:15 jnthn moritz: That's fine
21:15 jnthn moritz: Will a bit offline at times tomorrow
21:16 jnthn (Travel to Blava...)
21:16 jnthn Hotel should have wifi though :)
21:18 dalek rakudo/nom: aecd2fc | jnthn++ | src/Perl6/Optimizer.pm:
21:18 dalek rakudo/nom: Remove fossil analysis from optimizer.
21:18 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/aecd2fcb14
21:19 icovnik jnthn: (Blava ta uz caka ;) sorry didn't resist)
21:21 jnthn ;)
21:21 * jnthn suspects he's going to find his Slovak terribly rusty tomorrow :(
21:22 icovnik jnthn: heh no problem it's quite interresting if someone even tries to learn slovak :)
21:26 masak good night little cacti and cloudberries
21:26 * masak sleeps
21:26 jnthn icovnik: It's a beautiful, but tricky to learn language. :)
21:27 shachaf masak: Cloudberries!
21:27 shachaf That's lakka, right?
21:29 benabik_ joined #perl6
21:30 moritz aren't the berries callte målte or so?
21:30 moritz but yes, the liquor is called lakka
21:31 dalek roast: cbcca7c | tadzik++ | S32-array/splice.t:
21:31 dalek roast: Fudge splice.t for rakudo
21:31 dalek roast: review: https://github.com/perl6/roast/commit/cbcca7c14b
21:31 dalek nqp: 7e4bb20 | moritz++ | src/PAST/NQP.pir:
21:31 dalek nqp: forgot nqp::sinh_n
21:31 dalek nqp: review: https://github.com/perl6/nqp/commit/7e4bb20256
21:32 dalek rakudo/nom: b441203 | tadzik++ | / (2 files):
21:32 dalek rakudo/nom: Implement splice(); run S32-array/splice.t
21:32 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/b4412038eb
21:33 moritz tadzik++ # one step closer to running HTTP::Client on nom
21:33 * moritz -> sleep
21:33 jnthn 'night, moritz
21:33 tadzik 'night moritz
21:36 icovnik jnthn: for me it's only the tricky part... :( i really don't understand how can someone speak 3 languages heh
21:36 pmichaud I'm not sure that splice() should be eager, fwiw.
21:36 phenny pmichaud: 27 Oct 14:37Z <moritz> ask pmichaud to please review https://github.com/perl6/nqp/commit/fa​9f991cedc8620f9642cc641d27a220f76fe6d9 when he has a spare minute. My first regex built-in, so I'm not sure at all if that's the right approach
21:37 tadzik pmichaud: I stole that from ng
21:37 pmichaud ng had an eager splice?  hmmm
21:37 pmichaud well, I guess it makes sense for it to be eager.
21:37 pmichaud so, keep it that way :)
21:37 pmichaud we might want a lazy splice somewhere.
21:38 * jnthn suspects it has to be eager up to the elements it's replacing, at least.
21:38 pmichaud I'm thinking of the elements that are being spliced in.
21:38 jnthn pmichaud: You'll be happy to know that those nqp::want-s in the native ops are going away :)
21:38 jnthn pmichaud: oh...yeah, those are more arguable.
21:38 pmichaud jnthn: yes, I saw some of the patches  \o/
21:39 pmichaud I have been somewhat following along, even if my tuit shortage doesn't let me do much commit/review of my own :)
21:39 jnthn pmichaud: btw, optimizer stats:
21:39 jnthn my int $i = 0; while $i < 10000000 { $i = $i + 1; }; say $i
21:39 jnthn Without optimizer: 82.26s
21:39 jnthn With optimizer: 3.51s
21:39 pmichaud \o/
21:39 jnthn And we've improvements to come yet.
21:39 pmichaud yes, indeedy
21:40 jnthn Oh, there was one issue I was going to ask you about.
21:40 jnthn That while is in void context
21:40 sorear jnthn: What exactly does your optimizer do here?  Just replace + with add_i_i_ic?
21:40 jnthn However, PAST::Compiler seems to like making sure the while body always produces a result.
21:40 jnthn sorear: heh, "just" :)
21:41 * sorear is still dubious of the "statement level loops return values" rule
21:41 jnthn sorear: It does that, and the < too
21:41 jnthn pmichaud: The thing is it really wants that to be a PMC
21:41 jnthn So even if we don't emit code that leads to such a thing, we end up with a new ['Integer'] thingy getting emitted.
21:41 jnthn sorear: Also flattens the loop body into the outer scope.
21:42 pmichaud I think we could update PAST::Compiler so that while loops honor rtype
21:42 jnthn sorear: Note that it does the replacement by first doing a compile time multi-dispatch.
21:42 sorear I don't see why there should be a huge speed diffierence between $i++ while $i < 1000000; and $i++ while $i < 1000000; say $i
21:42 jnthn sorear: And then checking if the resulting candidate can be inlined.
21:42 dorlamm joined #perl6
21:42 jnthn sorear: That is, it's quite generalized.
21:43 jnthn pmichaud: Could be good :)
21:43 pmichaud jnthn: maybe add a ticket for me to look at it?
21:43 pmichaud can go in the RT queue for now
21:43 pmichaud (even though it's a change to nqp and/or parrot)
21:43 jnthn pmichaud: can do
21:43 pmichaud I probably won't be able to get to it until early next week, though
21:43 jnthn np
21:44 sorear jnthn: do you follow my specgripe?  ^^^
21:44 jnthn pmichaud: Note that I have things so it actually boxes anyway at the moment.
21:44 pmichaud sure thing
21:44 jnthn sorear: yeah, I see the issue
21:53 * sorear is annoyed by the new 2.10 mono profiler
21:56 colomon profiler not working, or results still too flat?
21:56 sorear results are pretty flat, and the profiler itself has Issues
21:57 sorear I run the profiler against a 50-60 second program run
21:57 sorear it takes 30-45 minutes and generates a 5.1 G output file
21:58 sorear when profiler overhead is 98% of the runtime, I don't put much faith in the ability of the profiler to subtract out the overhead
22:00 sorear http://gist.github.com/1335063 # typical mprof-report output
22:02 sorear also, the profiler goes insane on recursive functions
22:04 dalek 6model: a5cabb9 | diakopter++ | lua/ (9 files):
22:04 dalek 6model: more bugfixes
22:04 dalek 6model: review: https://github.com/diakopte​r/6model/commit/a5cabb93cd
22:05 diakopter yay; nearly all of the NQPSetting runs
22:06 diakopter by runs I mean Loads
22:08 jnthn :D
22:10 sorear \o/
22:20 whiteknight joined #perl6
22:27 arnsholt joined #perl6
22:34 sorear put differently: I think that, as flat as the profile is, stupidly rewriting the parser in a closer-to-the-machine language would give a better return on time spent than trying to optimize specific code regions.
22:34 sorear ...of course the ideal would be for this language to be "type-rich Perl 6"
22:39 sorear ping jnthn
22:41 jnthn sorear: pong
22:41 jnthn (I'm about for 10 more minutes...then gotta sleep...early flight)
22:44 sorear jnthn: not much time then.  (Where to if I may ask?)  I wanted an explanation of how native types should work with the binder
22:47 jnthn sorear: Rakudo's binder is largely just another thingy that works with Parrot's calling conventions.
22:47 jnthn sorear: A CallContext has a set of cells
22:47 jnthn Each cell is a union
22:48 jnthn Then there's a (static per callsite) set of flags, iirc, so you know which element of the union to take
22:48 jnthn Oh, no, I think that's not true
22:48 jnthn Yeah, it stores the type with each cell
22:48 jnthn So the binder just walks through them, sees if there's a native there, sees if it expects a native register to be set, and maybe does a box/unbox if needed.
22:49 sorear jnthn: I'm asking in a slightly more general context, to determine what Niecza should do
22:49 sorear nom: sub foo(num $x) { say $x }; foo(1)
22:50 p6eval nom b44120: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'foo' will never work with argument types (int) (line 1)␤    Expected: :(num $x)␤»
22:50 sorear What will happen when we have int8 and int16?  Should the binder widen stuff?
22:50 sorear nom: sub foo(num $x) { say $x }; foo(1.0)
22:50 p6eval nom b44120: OUTPUT«Cannot unbox argument to '$x' as a native num␤  in sub foo at /tmp/ZoKMInuSz0:1␤  in block <anon> at /tmp/ZoKMInuSz0:1␤  in <anon> at /tmp/ZoKMInuSz0:1␤»
22:50 sorear nom: sub foo(num $x) { say $x }; foo(1e0)
22:50 p6eval nom b44120: OUTPUT«1␤»
22:50 jnthn sorear: Those don't carry around type information really
22:51 jnthn sorear: I mean, an int is an int
22:51 sorear in Parrot or in Perl6?
22:51 jnthn In Perl 6.
22:52 sorear I know Parrot is limited to just INSP :D
22:52 jnthn Not sure why you're so happy about that :/
22:52 jnthn But anyway, the spec says that intermediate values are at CPU width, iirc.
22:52 jnthn So it's only on storage that we widen/narrow
22:53 jnthn So we don't have int16, int8, int candidates for infix:<+> for example
22:53 sorear oh, hmm, so native types wider than the natural CPU width are not very useful?
22:54 * sorear thought that intermediate values were supposed to be bigint
22:54 jnthn Correct
22:54 jnthn No
22:54 jnthn S09: "An implementation of Perl is not required to support 64-bit integer types or 128-bit floating-point types unless the underlying architecture supports them."
22:54 jnthn So Rakudo not supporting int64 on 32-bit hardware is completely legitimate.
22:54 jnthn Int is DTRT oriented
22:55 sftp joined #perl6
22:55 jnthn int is be fast oriented
22:55 jnthn And int itself is machine specific in meaning.
22:55 worr joined #perl6
22:56 sorear seems suboptimal since most integer hardware supports double-wide integers with a modicum of efficiency, and a lot of 32-bit C code uses long long for various essential purposes
22:56 sorear lseek64 comes to mind
22:56 jnthn I didn't say an implementation coudln't *choose* to support thsoe on 64-bit.
22:56 jnthn er, on 32-bit
22:56 jnthn The spec says it's not *required* to, not that it musn't. :)
22:56 Exodist_ joined #perl6
22:57 sorear oh right.
22:57 * sorear would like to make $i64 = $i64 + 1 DTRT
22:58 jnthn sorear: Well, to some degree you only have to worry so much about the binder handling natives really efficiently. (more)
22:58 jnthn For large routines the body of the routine will be where the cost is.
22:58 jnthn For small ones, they'll get inlined and never pass through the binder.
22:58 jnthn That's the nice thing about native types. There's always lots of type info to work with.
22:58 sorear The binder is one of the only real hot spots in Niecza
22:58 sorear probably because it gets called from every real function
22:59 jnthn In Rakudo it's fairly high, but still beats Parrot's invocation overhead in general.
22:59 jnthn And I know I can make the binder faster yet.
22:59 sorear s/beats/beaten by/?
22:59 jnthn er
22:59 jnthn well, depends what you consider winning ;)
22:59 jnthn The binder shows up lower on the profile than invocation.
22:59 sorear ok
23:00 jnthn In terms of Rakudo specific code though, yes, the binder is fairly hot.
23:00 sorear seems I'll also need to consider a new invocation protocol, 'Frame Invoke(Frame caller, Variable[] pos, VarHash named)' isn't going to work for much longer :)
23:01 jnthn Yes :)
23:01 karamorf I'd like to play with File::tools and WWW::App but can't seem to figure out which versions of rakudo/parrot/nqp that actually works with those modules ... I think I want to use 201107 but I can't get nqp to compile with parrot 3.6 for that. Also given 201109 and 201110 with parrot 3.8 and/or 3.9 without success. The MongoDB module might be nice as well ...
23:02 sorear jnthn: for mmd purposes, is int considered exactly the same as Int:D etc?
23:02 jnthn karamorf: If you're looking at 201107, it uses the nqp bundled inside Parrot, not the thing in the nqp repository
23:03 jnthn sorear: natives are always narrower than non-natives
23:03 jnthn sorear: I inherited that notion from SMOP, fwiw. It's played out well so far.
23:03 karamorf jnthm: oh, so I'm just missing a flag on my parrot compile ... thanks
23:04 sorear jnthn: what value set is an "int" parameter allowed to match?  Int & -2**31 .. 2**31+1 ?
23:04 jnthn karamorf: The nqp should be built by default.
23:05 jnthn sorear: The multi-dispatcher will only consider a native candidate if the argument being supplied is marked as a native one in the capture.
23:05 sorear And it requires the "same" native argument type?
23:06 jnthn sorear: Only at the int vs num level
23:06 jnthn sorear: Not at the int8 vs int16 level
23:07 jnthn That is, there's no sense in which foo(255) and foo(256) might dispatch to an int8 and an int16 candidate respectively.
23:07 jnthn er, those would have to be unint, but you get the point :)
23:08 jnthn OK, *really* going to sleep now...this flight won't be easy to get up for :)
23:08 sorear jnthn: But single dispatch boxes and unboxes.
23:08 sorear bye
23:08 jnthn oh, you asked where to...Vienna/Bratislava for Twin City Perl Workshop
23:09 jnthn single - yeah, I'm not at all comfortable with the unboxing there though...consider it endangered. It doesn't make sense in the face of bigints really...
23:09 jnthn and the multi-dispatcher handles the boxing direction
23:09 jnthn 'night
23:13 dalek 6model: 48f33e8 | diakopter++ | lua/runtime/Runtime/Signatures/Parameter.lua:
23:13 dalek 6model: evil evil hack.
23:13 dalek 6model: review: https://github.com/diakopte​r/6model/commit/48f33e8b5d
23:34 [Coke] whoa. http://www.xray.mpe.mpg.de/mailing-lis​ts/perl5-porters/2011-11/msg00076.html
23:44 Juerd Amazing
23:44 gfldex perl6 is contagious already :)
23:44 Juerd Oh, it has been for ages :)
23:45 Juerd I love acme's patch but I'm really surprised to see all the positive response on p5p
23:46 sorear I guess they're all just in a good mood today
23:49 * Juerd reached the end of the patch and thinks Wait, that's all?
23:53 Tene Juerd: and if someone had committed that two years ago, you could use it in distro perl today!
23:54 Juerd I'll still be using Perl in two years so I don't worry about that :)
23:56 Tene :)

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

Perl 6 | Reference Documentation | Rakudo