»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
00:03 ethndbst joined, ethndbst left, ethndbst joined 00:10 colomon_Droid left
dalek ecza: 193ca57 | sorear++ | lib/ (3 files):
[Threads.pm6] Fix build; exception-safe &lock
00:10
00:10 Radvendii joined
sorear I'd be interested in hearing how this works on a real multiprocessor system 00:11
00:12 ethndbst left
Radvendii what's the deal with panda, does it install on rakudo now? 00:15
00:16 xinming left, Trashlord left
japhb jnthn, ping 00:18
sorear Radvendii: by "rakudo" do you mean Rakudo Star, Beijing, the most recent monthly monthly, or the HEAD 00:19
?
Radvendii i don't believe i have rakudo star
does it work better with that?
sorear actually I think Rakudo Star includes it 00:20
Radvendii ag
ah*
sorear the thing is that Star is a few months old
Radvendii good to know
jnthn Rakudo Star distributions include panda and various modules
japhb phenny, ask jnthn Can &fail from src/core/Failure.pm be written more simply (with less Q:PIR and pir::) in current nom without losing too much performance?
phenny japhb: I'll pass that on when jnthn is around.
sorear there have recently been major compatibility-disrupting refactors in Rakudo, and the ecosystem hasn't fully caught up
Radvendii i'll check that out, thanks 00:21
sorear until things are more stabilized we recommend outside users stay with the 'Beijing' monthly release, or the most recent Star which is based on Beijinng
japhb jnthn, you have a curious habit of appearing just about the time I've assumed you went to sleep and finished asking phenny to forward to you. And then I see in the backlog you speaking just before my message to phenny appears. ;-) 00:22
00:22 xinming joined
jnthn Current Rakudo master can handle Panda *but* the bootstrap is busted because one (or two) of the modules that Panda depends on fail tests. 00:22
phenny jnthn: 00:20Z <japhb> ask jnthn Can &fail from src/core/Failure.pm be written more simply (with less Q:PIR and pir::) in current nom without losing too much performance?
sorear jnthn: pff, I thought we already killed master off 00:23
jnthn sorear: gah
s/master/nom/
sorry, in the middle of $bughunt...and it's late :)
Timbus sorear 00:24
Timbus: I'm not sure if niecza's Threads.pm6 supports nonconsentual termination of threads. That kind of feature is quite out of favor in modern libs like the CLR :|
jnthn japhb: Will look in a moment
Timbus uh, i meant, can the threads end themselves
sorear Yes
japhb jnthn, thank you
Timbus in p5 they kill gtk of they end.
if they end*
sorear Timbus: ah. 00:29
Timbus: I just got done adding multithreading to colomon's gtk mandelbrot, seems to work fine although I've only one processor so I'm not hitting the data races as hard as they could be hit 00:30
jnthn japhb: hmm. It may be possible with an actual try { die $value; CATCH { default { $ex = $! } } } 00:32
japhb: Though at the cost of efficiency and not sure if it'll accidentally introduce frames.
Timbus you can avoid data races in gtk by setting your return data in a var and then, after all that, spawning a g_add_idle in the main thread to collect the data and use it 00:35
00:36 araujo left
japhb jnthn, hmmm. OK, thanks. I wanted to make a variant of &fail for reporting Str -> other type conversion parsefails, that would report extra information, like position of problem in source string. I was hoping not to have to duplicate all that code again. Makes my DRY muscle itch. :-/ 00:36
00:37 Mowah_ left
Timbus a less optimal way could be to spawn the idle at the same time you make the thread, if its impossible to get glib to add an idle from your second thread.. but thatll waste a lot of cycles and you need a semaphore to signal when data is ready 00:37
jnthn japhb: YOu can't just call fail directory? 00:38
*directly
japhb: Or you don't want to return at that point?
sorear Timbus: looks like I'm using g_timeout_add(0, ...) 00:40
via Application.Invoke() from gtk#
japhb jnthn, it was a factoring issue. I could do 'sub parse_fail ($msg) { fail $msg ~ $other_useful_info }' then later 'return parse_fail $msg;' ... or I could do 'sub with_extra_info ($msg) { return $msg ~ $other-useful-info }' then later 'fail extra_info $msg' ... but I wanted to just do 'parse_fail $msg'. 00:41
Timbus that's the one
japhb * fail with_extra_info $msg 00:42
Timbus i don't have a reference and I gave up on remembering library function names after memorizing half of MSDN
japhb jnthn, in any case, I was hoping &parse_fail could be short and sweet. 00:43
(I should note that because of the layered parsing of numbers, &parse_fail could be called from several different levels of the call stack, but I only wanted to define it once, so I needed the RETURN finding magic of &fail. 00:44
jnthn japhb: Hmm, would doing 00:45
my &parse_fail := -> $info { fail $info ~ $other_info }
help?
japhb: That fail will fail the lexically enclosing routine.
00:46 colomon joined
japhb jnthn, I don't think so, because I have three different lexical levels inside Str.Numeric, and I want the Failure fail up *one* level when it happens. And I was planning to define &parse_fail only once, at the topmost level, so it could be seen at all levels. 00:47
Radvendii is that the new syntax for anonymous subroutine references? -> $args {} ?
japhb Radvendii, it is one type of anon code; in particular it is a type that does not capture RETURN control flow. 00:48
jnthn Radvendii: Well, an anonymous subroutine is still sub ($args) { ... }
japhb so a return within it returns from the *enclosing* routine.
jnthn Radvendii: The -> $args {} is a lambda/closure that takes parameters. It has different return behavior, as japhb pointed out 00:49
Radvendii what is the difference in when you would use the two?
00:49 cognominal_ joined
colomon Radvendii: the classic place to use -> $args is a for statement 00:50
Radvendii right. i've seen that.
colomon nom: for 1..3 -> $x { say $x * $x; }
p6eval nom 80669d: OUTPUT«1␤4␤9␤»
japhb Radvendii, you find '-> { }' most often used in a for loop. The use that jnthn put it too is advanced usage, in my mind.
Radvendii okay
that makes sense
japhb (very useful to know about, mind you, just not something you'll do every day)
Radvendii could you also use a normal subroutine in a for loop? 00:51
sorear o/ colomon
Radvendii like for 1..3 sub (…){…}
sorear Radvendii: no, you can't; the syntax requires either { or -> to terminate the expression
colomon nom: my $c = .5 + .5i; my @mandelbrot := 0, -> $z { $z * $z + $c } ... *; say @mandelbrot[^5].perl
p6eval nom 80669d: OUTPUT«(0, Complex.new(0.5, 0.5), Complex.new(0.5, 1), Complex.new(-0.25, 1.5), Complex.new(-1.6875, -0.25))␤»
colomon sorear, o/ # finally solidly logged in again 00:52
Radvendii okay.
00:52 wolfman2000 left, araujo joined
sorear colomon: I'd like you to check out my last commit, you absolutely need niecza HEAD 00:52
00:52 cognominal left
colomon is settled in at his in-laws with pretzels, hard cider, the big ten championship, and his macbook pro 00:52
sorear well, it sounds like you have other priorities. 00:53
00:53 xinming left
colomon no, this is good 00:53
hacking, drinking, and football. Doesn't get any better! (unless music is involved) 00:54
sorear one thing that would make a cool smallish task would be to display the uncalculated part of the fractal as something other than black 00:55
00:55 xinming joined
Timbus hmmmm.. does padre have a split view 00:56
cant seem to find it. probably not 00:57
:<
colomon sorear: huh. Just seem to have gotten a black window? 00:58
jnthn Mmmmm. Beer aged in oak rum casks.
00:59 Radvendii left 01:00 xinming left
colomon sorear: definitely does not appear to be working correctly here. 01:00
hmmm... I can zoom... into more black 01:06
Timbus but does the void stare back 01:07
colomon always it does 01:08
sorear: doesn't look like it ever actually calls "row" 01:09
Timbus is this in a separate repo or
dalek kudo/nom: df73d45 | jnthn++ | src/Perl6/Metamodel/ (3 files):
Fix type checking with parametric roles instantiated with type variables that are later reified.
kudo/nom: 4c8bc09 | jnthn++ | src/Perl6/Actions.pm:
Allow things like 'Int %h' in signatures.
kudo/nom: 6825f44 | jnthn++ | src/core/Hash.pm:
Add stuff to Hash to support typed hashes. Just leaves my Int %h syntax to be wired up.
Timbus i built niecza yesterday.. apparently (i was very drunk)
colomon jnthn++ 01:10
Timbus: is what in a separate repo?
Timbus the gtk stuff
jnthn Will fix the other bits tomorrow...
The wiring up of "my T %h" gets a bit subtle...especially in the case T is a type var or something. 01:11
colomon Timbus: nope, niecza just does Gtk (assuming you have the libraries available with your Mono) 01:12
01:12 xinming joined
jnthn rest & 01:13
colomon sorear: oh, you call start-work only in resize 01:18
I can fix that.
huh 01:19
I don't get the impression this is particularly fast? 01:20
I definitely like having it draw as it goes
01:21 xinming left 01:22 PacoLinux joined, xinming joined
sorear aha. oops. 01:27
colomon sorear: okay, I've got a patch so it starts to draw when the window is first created.
sorear colomon: go for it 01:28
colomon but it's still significantly slower than the unthreaded version was, at least on my machine
sorear oh? interesting 01:29
colomon yeah, might be as much as four times slower
sorear there's definitely room for optimizing in ExposeEvent (only drawing the actual dirty rows from the clip region, and pulling the locking out of the inner loop 01:30
)
what happens with THREADS=1?
colomon pushed my bug fix.
was just going to check that
vastly faster 01:31
01:31 xinming left
colomon I'd say it's still about running in about 125% of the time the non-threaded version did. 01:32
let me try 2...
2 is noticeably slower than 1 01:33
01:37 tadzik left
Timbus why such a slowdown? 01:38
colomon Timbus: I'm guessing sorear and I are both looking at it. 01:39
01:39 Radvendii joined
colomon it looks like the drawing loop in our ExposeEvent gets called over and over again -- I don't understand how. But My guess is that accounts for all the difference when THREADS=1 01:40
01:40 xinming joined
Timbus so its not supposed to be? 01:40
01:40 donri left
Timbus hrm :/ 01:41
colomon well, somehow that's how sorear got it to display each line of the fractal as it is calculated. 01:42
but based on my earlier timing tests, that many Gtk calls in a row probably hurts performance
Timbus can i get a link to the repo 01:43
colomon github.com/colomon/mandelbrot
Timbus thanks
01:44 tadzik joined, toebu joined 01:45 zby_home___ left
colomon oh, hey, wonder if operating on battery power is messing up my threading? 01:50
01:50 scottp_ joined 01:52 mls_ joined
colomon nope 01:52
(Or at least, plugging in doesn't seem to help.)
01:53 spacebat_ joined
Timbus so the real difference here is that the threaded model swars line by line, and the old one drew only once, since it drew after calculating the whole image 01:53
meaning it froze the UI on redraw
01:53 Util_ joined
Timbus draws* 01:53
01:54 szbalint_ joined 01:55 shachaf_ joined
colomon Timbus: the threaded model does the line-by-line draw loop repeatedly until the entire image is drawn. If you add "say $y" to the ExposeEvent loop, you can see it counting repeatedly from 0 to $windowHeight until the fractal is completely drawn 01:55
01:55 sorear_ joined, zamolxes_ joined
Timbus yep 01:55
colomon like I said, I don't know why that happens 01:56
01:56 takesako_ joined
Timbus well, that's so you can make a progressive image, which is a good example of threading kinda. but it'd be a lot slower 01:57
01:57 fsergot left
Timbus oh dear 01:57
yeah. you should be using threads so that the UI just remains responsive, allows for a 'stop' button, etc. just don't draw the image until its fully rendered by the thread imo. don't bother with lines 01:58
its not really for speed anyway
02:08 xinming left 02:09 fridim_ left, xinming joined 02:14 xinming left 02:16 xinming joined 02:21 xinming left 02:26 xinming joined, orafu left 02:27 orafu joined
colomon hmmm, QueueDrawArea? 02:28
02:31 overrosy joined 02:37 xinming left 02:38 overrosy left 02:39 jimmy1980 left, xinming joined
colomon so that's what causes ExposeEvent to be called so much. 02:41
02:45 overrosy joined, jimmy1980 joined 02:50 xinming left 02:51 xinming joined 02:55 xinming left 02:56 tokuhirom joined 02:57 toebu left 02:58 xinming joined
Radvendii is there a round() function in the core? i know there are floor() and ceil() but is there a round()? 03:03
colomon yes 03:04
truncate too 03:05
noml
nom: say 23.542323.round
p6eval nom 6825f4: OUTPUT«(timeout)»
colomon ummm....
b: say 23.542323.round
p6eval b 1b7dd1: OUTPUT«24␤»
colomon that seems like a rather surprising nom bug 03:06
Radvendii perl6: say round(23.54)
p6eval rakudo 6825f4: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&round' called (line 1)␤»
..pugs b927740, niecza v12-3-g193ca57: OUTPUT«24␤»
Radvendii yeah…
not in rakudo apparently… what's b:?
colomon nom: say 23.542323.floor
p6eval nom 6825f4: OUTPUT«23␤»
colomon b is the last major version of rakudo (pre-nom)
Radvendii b: say 23.54.round 03:07
p6eval b 1b7dd1: OUTPUT«24␤»
Radvendii b: say round 23.54
p6eval b 1b7dd1: OUTPUT«24␤»
Radvendii that's odd…
03:07 xinming left
Radvendii why doesn't it work with perl6: or with my perl6 implimentation? 03:07
i just downloaded rakudo star… 03:08
colomon rakudo star *is* b
at least, to a very close approximation
Radvendii ooooh
colomon > say round 23.54 03:09
24
that's what I get from rakudo star
Radvendii never mind. i think i didnt finish the installation process. because make install doesnt install it in /usr/bin/
does anyone know how to make it?
colomon ah, right
Radvendii i didnt find anything in Configure.pl --help
colomon make it install it in /usr/bin? There isn't a way
Radvendii so i just have to move it manually?
colomon I just made a symbolic link 03:10
Radvendii wha?
how do i do taht?
colomon cd /usr/bin
sudo ln -s /your/path/to/perl6
(or su if you cannot sudo) 03:11
Radvendii then i can just use perl6 from the command line?
colomon yes
(only if you have done make install, otherwise you cannot call it from outside your rakudo directory) 03:12
Radvendii i have
colomon nom: say 23.542323.round 03:14
p6eval nom 6825f4: OUTPUT«(timeout)»
03:14 xinming joined
colomon nom: say round 23.54 03:14
p6eval nom 6825f4: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&round' called (line 1)␤»
colomon bug reported 03:15
Radvendii++
Radvendii what? 03:16
03:18 Jeffrey__ joined 03:19 Jeffrey__ left
colomon I gave you karma, because your curiosity about round turned up a bug. 03:19
Radvendii okay..? 03:20
in anycase, now im getting a strange error:
PARROT VM: Could not initialize new interpreter PackFile_Header_validate: This Parrot cannot read bytecode files with version 11.0.
03:22 cognominal_ left
colomon hmmm... now that I cannot explain. 03:22
might you have another version of parrot installed on the machine?
03:22 xinming left
Radvendii it's quite possible 03:22
probably even, i installed rakudo several times
could i move all the files to the /usr/ directory? 03:23
if it's more convenient. . . 03:24
03:24 cognominal joined
colomon I don't know what happens if you do that. Sorry. 03:25
03:28 jimmy1980 left 03:30 quietfanatic_ joined
quietfanatic_ niecza: run 03:31
p6eval niecza v12-3-g193ca57: OUTPUT«===SORRY!===␤␤Undeclared routine:␤ 'run' used at line 1␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 880 (die @ 2) ␤ at /home/p6eval/niecza/src/STD.pm6 line 1139 (P6.comp_unit @ 32) ␤ at /home/p…
quietfanatic_ Is there a workaround for run in niecza?
03:34 wolfman2000 joined 03:36 quietfanatic_ left 03:38 quietfanatic joined, xinming joined
colomon phenny: tell quietfanatic_ stackoverflow.com/questions/878632/...rse-output 03:39
phenny colomon: I'll pass that on when quietfanatic_ is around.
quietfanatic oh, so
colomon I haven't tried that, but I think it should work pretty easily 03:40
quietfanatic are those classes accessible in p6 then?
or do I have to do the equivalent of Q:PIR?
colomon you can do it like we've been doing Gtk. 03:41
give me a sec, I'll code up an example for you.
quietfanatic thanks
colomon hmmm, seems Glib.Process is different from the one described in that post 03:44
well, bother, it's not proving to be as easy as I had hoped 03:47
03:48 quietfanatic_ joined
quietfanatic_ Sorry about the dropping in and out. 03:48
phenny quietfanatic_: 03:39Z <colomon> tell quietfanatic_ stackoverflow.com/questions/878632/...rse-output
03:49 quietfanatic left
colomon no worries 03:49
quietfanatic_ My college wifi is a little less than reliable.
If it's too much trouble, I guess I could try switching to the optimized Rakudo. 03:50
colomon It *should* be easy. :\ 03:55
03:55 xinming left
quietfanatic_ so one would think. 03:56
colomon one sec 03:58
*frown* 03:59
04:02 xinming joined
colomon bloody hell, capitalization issues 04:02
quietfanatic_ oh, hah
colomon what platform are you running on? 04:03
quietfanatic_ Linux
Arch
colomon okay, this code may be mono-specific
gist.github.com/1429114
quietfanatic_ okay, I'll try that.
thanks
Unhandled exception: Unable to resolve method SpawnCommandLineSync in class CLR::GLib::Process,glib-sharp, Version=2::12::0::0, Culture=neutral, PublicKeyToken=35e10195dab3c99f 04:06
I got that
04:06 xinming left
quietfanatic_ Perhaps I need a library 04:06
colomon hmmm, could be 04:07
sorry I don't know more about mono installs
quietfanatic_ I don't see any packages in my system relating mono to glib 04:08
oh well. I'll figure something out. Thanks for the help
colomon try saying monop GLib.Process 04:09
quietfanatic_ "Could not find GLib.Process"
yeah 04:10
colomon yeah, that's your problem there. :)
quietfanatic_ Aha 04:13
I found it in a package called gtk-sharp-2
colomon \o/
quietfanatic_ And it works perfectly 04:14
wish I could say as much for my code that calls it :)
s/calls/uses
but that's my problem
btw, you gave me an implementation of shell, rather than run
not like there's a big difference
At least, I think that's what this does 04:15
colomon run doesn't return standard out, etc? 04:16
quietfanatic_ Run doesn't call the shell, I believe
the multi-argument and single-argument forms of run were split up, at least according to how I'm reading this spec
looks like I can skip the shell with SpawnSync 04:17
colomon ah
you're now officially ahead of me on this. :)
quietfanatic_ Heh :) 04:18
Oh dear, looks like SpawnSync takes all sorts of nasty arguments. 04:19
I think I may stick with SpawnCommandLineSync. 04:20
colomon constant String-Array = CLR::("System.String[]"); 04:21
String-Array.new(0);
if string[] is what you're worried about, and 0 elements is good enough. :)
quietfanatic_ There's like a 04:22
SpawnFlags
and
SpawnChildSetupFunc
Flags I can probably give 0 or a bitty number, but I have no clue what to do with that second thing 04:23
colomon should be able to do something like
constant GlibSpawnChildSetupFunc = CLR::("GLib::SpawnChildSetupFunc,$GLIB");
and then GlibSpawnChildSetupFunc.enum-you-want
quietfanatic_ hm 04:24
Well, I'll figure that out later if the shell proves to be too much overhead 04:26
04:27 xinming joined 04:29 xinming left, xinming joined 04:33 shachaf_ is now known as shachaf 04:34 xinming left 04:38 colomon left 04:39 mdxi joined 04:50 xinming joined 04:51 jeffreykegler joined 04:58 xinming left 05:00 colomon joined 05:02 xinming joined 05:09 jeffreykegler left
moritz \o 05:12
diakopter o/ 05:13
05:14 xinming left 05:20 xinming joined 05:21 agentzh joined 05:25 xinming left 05:27 xinming joined
Radvendii how do i reference a captured value in a replace clause of .subst(:g,//,{replacement})? 05:33
i have tried $/ $() and *
moritz Radvendii: the match object is passed as the argument to the {replacement} closure
so it's available as $_
Radvendii ah 05:34
thank you muchly
and if there is only one match, then $_ will be it?
moritz or you can also write -> $/ { $0 ~ $2 }
Radvendii: if there are multiple matchs, then the block in invoked multiple times, each time with a different match
Radvendii ok. that makes sense. thanks 05:35
you guys are so helpful!
05:35 xinming left 05:38 sorear_ is now known as sorear
Radvendii b: say "".subst(:g, /<![#]>(\d)/, {$_}); 05:40
p6eval b 1b7dd1: OUTPUT«Cannot take substr outside string␤ in <anon> at line 22:/tmp/D5MA62rdzf␤ in <anon> at line 2647:src/gen/core.pm␤ in 'Cool::match' at line 1:src/metamodel/RoleToInstanceApplier.nqp␤ in 'Cool::subst' at line 2312:src/gen/core.pm␤ in main program body at line 22:/tmp/…
Radvendii why does it do that?
b: say "".subst(/<![#]>(\d)/, {$_});
p6eval b 1b7dd1: OUTPUT«Cannot take substr outside string␤ in <anon> at line 22:/tmp/2FbIG2wPI6␤ in 'Cool::match' at line 2684:src/gen/core.pm␤ in 'Cool::subst' at line 2312:src/gen/core.pm␤ in main program body at line 22:/tmp/2FbIG2wPI6␤»
sorear colomon: the QueueDrawArea calls are really important - that's how we actually make the data appear on screen
colomon: HOWEVER it would be possible to optimize ExposeEvent a lot so that it makes 1 gtk call instead of O(height) 05:41
quietfanatic_: run is not available in Niecza because of a major impedance mismatch between the C# API and the Perl 6 API
Radvendii how do i match not a series of characters in a regex? 05:42
if i want to match everything that is not a #?
sorear quietfanatic_: C# is a Windows export - it uses command tails. run("whatever", 'arg1 arg2 "arg 3"'). The called process is responsible for parsing the data which comes in via GetCommandLine, what used to show up at 80h in the PSP... 05:43
Radvendii: <![#]>(\d) is equivalent to <!before '#'> \d; I don't think that's what you mean (take a moment to understand why the <!before '#'> is redundant) 05:45
Radvendii what do you mean by <!before '#'>?
what is the before?
05:46 cooper left
Radvendii litterally an exclamation point followed by a #? 05:47
sorear Radvendii: are you familiar with the concept of a zero-width assertion? <![#]> is one 05:50
05:50 quietfanatic_ left
Radvendii i am not. how would i get it to match a series of numbers, except when preceded by a # 05:50
sorear Radvendii: consider the string "#234". neither 3 nor 4 is immediately preceded by a #. should they match? 05:52
Radvendii well… no
sorear how about "12 # 34 56". What should match?
Radvendii 12 and 56 should and it doesn't matter if 34 does or not 05:53
well
lets say it should match
the entire number cant be immediately preceded by a pound.
sorear so, "12 #34 56" -> 12 56? 05:54
Radvendii yeah 05:55
sorear niecza: .say for "12 #34 56".comb(/\#? \d+/).grep({ !m/\#/ }) # I guess something like this 05:57
p6eval niecza v12-3-g193ca57: OUTPUT«===SORRY!===␤␤No unspace allowed in regex; if you meant to match the literal character, please enclose in single quotes ('#') or use a backslashed form like \x23 at /tmp/CPYZjcbk_c line 1:␤------> .say for "12 #34 56".comb(/\⏏[3…
sorear niecza: .say for "12 #34 56".comb(/'#'? \d+/).grep({ !m/'#'/ }) # I guess something like this 05:58
p6eval niecza v12-3-g193ca57: OUTPUT«12␤56␤»
Radvendii and to only match ones that had no # could i do /'#'! \d+/ 06:00
where does the ! (not) go?
moritz it doesn't work like that. 06:01
Radvendii dang. how does it work?
moritz when <after> is implemented, <!after '#'> \d+ 06:02
sorear moritz: that won't work
moritz hm, needs <!after '#> << \d+ maybe 06:03
sorear niecza: say "123 #456 789".comb(/<!after '#'> \d+/)
p6eval niecza v12-3-g193ca57: OUTPUT«123 56 789␤»
moritz niecza: say "123 #456 789".comb(/<!after '#'> « \d+/)
p6eval niecza v12-3-g193ca57: OUTPUT«123 789␤»
moritz better
sorear that also won't work if there are letters before the numbers
Radvendii there arent
so no worries
what does the « modifier do generically 06:04
sorear does anyone have a favorite regex tutorial to recommend?
moritz not modifiers, word boundary assertions
sorear embarrasingly, I seem to have forgotten all my regex pedagogy 06:05
moritz sorear: you mean, general ones?
sorear moritz: yes
moritz sorear: "Mastering Regular Expressions" be J. Friedl
or perldoc perlretut
Radvendii alright. it seems regex has been kicked up a notch since perl5 :P ill hit the books. thanks 06:06
06:09 cooper joined
Radvendii wait, you said after they impliment "after" is that not implimented yet? 06:18
06:22 cooper left
moritz not in rakudo, iirc 06:24
sorear niecza has after in some cases 06:37
06:37 cooper joined 06:43 sayu joined 06:56 ponbiki joined 06:57 Radvendii left
moritz does it reverse the string or the regex? 07:12
07:23 zby_home joined
sorear moritz: oooooh! 07:24
moritz: it reverses the regex, which is why it only the very simple case of a list of character classes
supports
reversing the string is a brillia... wait no that won't work. 07:25
moritz right, I should have thought a bit more about it :-) 07:26
p5 does a nice cheat for look-behind
it keeps track of the lengths that a regex can match 07:27
and only allows fixed length pattern in look-behind
and then simply anchors the regex to $pos - $expected_len, and matches forward
from there
07:29 jimmy1980 joined
sorear p5 can cheat a lot more than we can because p5regexes are so much more declarative 07:32
07:32 Chillance joined 07:34 mkramer joined, mkramer left 07:42 f00li5h joined 07:43 mkramer1 joined, mkramer1 left 07:52 grondilu joined
grondilu perl6: say 'foo bar' ~~ /(.*) \s bar/ 07:53
p6eval rakudo 6825f4: OUTPUT«#<failed match>␤»
..pugs b927740: OUTPUT«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {␤ unshift @INC, '/home/p6eval/.cabal/share/Pugs-6.2.13.20111008/blib6/pugs/perl5/lib';␤ eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;␤}␤'Pugs::Runtime::Match::HsBridge'␤"␤*** '<HAND…
..niecza v12-3-g193ca57: OUTPUT«#<match from(0) to(7) text(foo bar) pos([#<match from(0) to(3) text(foo) pos([].list) named({}.hash)>].list) named({}.hash)>␤»
grondilu ^ bug, right?
nom: say 'foo bar' ~~ /(.*) \s bar/ 07:54
p6eval nom 6825f4: OUTPUT«#<failed match>␤»
grondilu this should match, shouldn't it?
07:55 tokuhirom left
moritz seems it doesn't backtrack :( 07:55
ah, it's submitted as a bug already, iirc 07:56
backtracking over captures doesn't seem to work
sorear moritz: not captures, subrules 08:02
non-capturing subrules like <.foo> also don't backtrack properly
nom: say 'foo bar' ~~ /$0=[.*] \s bar/
p6eval nom 6825f4: OUTPUT«=> <foo bar>␤ 0 => <foo>␤␤»
sorear and capturing non-subrules seem to work
moritz sorear: the example above did not involve a subrule 08:06
sorear I call () an anonymous subrule, since it's semantically very much like $0=<$( / ... / )> 08:11
sorear is feeling very self-concious about contraryness now
08:15 grondilu left
lue Am I wrong in thinking (.*) captures all of 'foo bar' here ? 08:21
sorear lue: not really 08:23
lue: usually we reserve the term "captures" for when the enclosing match is sucessfull
lue just realizes the significance of the statement "seems it doesn't backtrack :(" to his question 08:25
Woodi sorear: I am second to recomend "Mastering Regular Expressions"
08:26 colomon_ joined 08:28 colomon left, colomon_ is now known as colomon 08:35 Trashlord joined 09:10 fsergot joined
sorear shocking. I just made the optimization I talked about earlier to ExposeEvent in colomon 's mandelbrot, 40% speedup 09:31
Woodi gratz ! :) 09:34
09:34 jimmy1980 left
Woodi btw. to make subs awailable from module I need to put "proto ..." stuf ? 09:35
09:37 sayu left 09:41 jimmy1980 joined
sorear no 09:53
to make subs available from module you use "is export"
Woodi ok. i steal examples from Test.pm and everything there is proto-marked and multi-marked... 09:56
sorear: but just adding 'is export' work. thanx
09:57 GlitchMr joined
GlitchMr perl6: print «Hello world!» 09:57
p6eval niecza v12-3-g193ca57: OUTPUT«Hello world!»
..pugs b927740: OUTPUT«decodeUTF8': bad data: '\171'␤decodeUTF8': bad data: '\187'␤Helloworld!»
..rakudo 6825f4: OUTPUT«Helloworld!»
GlitchMr ... 09:58
I see small difference... 1 space of difference... it's weird...
But I find it nice that it recognized those quotes...
10:00 GlitchMr left 10:05 agentzh left
Woodi add_method adds routines __into__ class body so $class_instance->added_method works. is, in modules, kind of routines table I can add sub ? storing subs in hash require useing one lvl of calls more eg: execute( $name) { &%cmdhash{ $name} } 10:08
sorear perl6: print 1..6 10:16
p6eval niecza v12-3-g193ca57: OUTPUT«1..6»
..pugs b927740, rakudo 6825f4: OUTPUT«123456»
sorear -> sleep 10:18
10:19 agentzh joined 10:47 wk joined 10:49 jimmy1980 left 10:54 GlitchMr joined, jimmy1980 joined, mj41 joined 10:59 icwiener joined 11:03 mj41 left 11:04 toebu joined 11:17 mj41 joined 11:21 toebu left 11:26 jimmy1980 left, jimmy1980 joined 11:35 xinming joined 11:45 Chillance left 11:46 toebu joined 11:50 Chillance joined 11:51 fsergot left 12:02 toebu left 12:04 Moukeddar joined 12:13 fsergot joined, Psyche^ joined 12:16 Patterner left, Psyche^ is now known as Patterner
colomon sorear: nice optimization! 12:33
sorear: I thought that loop must be really hurting us, because it involved a lot of both costly Gtk calls and lock checks. 12:34
12:34 MayDaniel joined 12:41 shinobicl_ joined 12:46 shinobicl_ left 12:47 icwiener left 12:48 Moukeddar left, icwiener joined 13:00 mkramer joined, mkramer left, toebu joined 13:02 mishin joined 13:05 wk left 13:10 MayDaniel left, agentzh left 13:17 am0c left 13:28 fsergot left, mj41 left 13:30 colomon left 13:39 kaare_ joined 13:46 hundskatt left 13:47 ilogger2 joined, dju joined 13:48 _ilbot joined, buubot_backup joined, jimmy1980 joined 13:49 DarthGandalf joined, imarcusthis joined, simcop2387 joined 13:51 fsergot joined 13:52 jlaire joined, jrockway joined, cxreg joined, LoRe joined, kthakore joined, avar joined, jnthn_ joined, mishin joined, icwiener joined, ponbiki joined, sorear joined, domidumont joined, fhelmberger joined, Exodist joined, rsimoes joined, mattp_ joined, Lothar joined, rhr joined, PAAC234 joined, mantovani joined, mux joined, broquaint joined, zamolxes_ joined, tadzik joined, estrabd joined, Sarten-X joined, stepnem joined, kranius joined, s1n joined 13:53 risou joined, djanatyn joined, kaare_ joined, xinming joined, GlitchMr joined, ribasushi joined, REPLeffect joined, [particle] joined, Khisanth joined, silug joined, Juerd joined, amkrankruleuen joined, zostay joined, aloha joined, revdiablo joined, hillu joined, kst joined, mikemol joined, HarryS joined, Tene joined, sftp joined, yves joined, frettled joined, clkao joined, pochi joined, og01 joined, BooK joined, apejens joined, Gothmog_ joined, Patterner joined, Chillance joined, overrosy joined, orafu joined, shachaf joined, szbalint_ joined, PacoLinux joined, wooden joined, preflex joined, lestrrat joined, lue joined, jaldhar joined, felher joined, cosimo joined, alvis joined, flussence joined, sivoais joined, arlinius joined, betterworld joined, gfldex joined, plobsing joined, mtk joined, dakkar joined, kcwu joined, awwaiid joined, prammer joined, jasonmay joined, ashleydev joined, jerome__ joined, aindilis joined, daemon joined, Helios joined, p6eval joined, Ingis joined, charsbar__ joined, sendak.freenode.net sets mode: +v p6eval, ruoso_ joined, z-b joined, bbkr joined, drbean joined, Woodi joined, rafl joined, twinshadow joined, integral joined, jjore_ joined, krakan joined, Timbus joined, phenny joined, nsh joined, Lorn joined, arnsholt joined, ingy joined, szabgab joined, TimToady joined, pnu joined, __sri joined, ranguard joined, athomason_ joined, jtpalmer joined
GlitchMr > qw qw q; 13:53
Alphanumeric character is not allowed as a delimiter at line 1, near "qw q;\n"
Perl 6 is fun...
Also, I see a lot of people there :).
13:54 jimmy1980 left, skangas_ joined, skangas_ is now known as skangas
GlitchMr ... unless it was just a lag... 13:54
13:54 dalek joined 13:55 BinGOs joined 13:56 jimmy1980 joined 14:02 dju left, dju joined, DarthGandalf left, DarthGandalf joined, ChanServ sets mode: +v dalek, HarryS is now known as Guest11641 14:06 jimmy1980 left 14:07 jimmy1980 joined 14:08 carlin joined 14:09 Sarten-X left 14:14 agentzh joined 14:16 Radvendii joined, PZt joined
Radvendii what is the syntax for calling a method on each element of an array? 14:16
and what happens to the return values?
never mind. .map({}) works for me 14:17
moritz @a>>.meth 14:27
jnthn_ afternoon, #perl6 14:32
14:32 jnthn_ is now known as jnthn
jnthn hmm...we hadded a netsplit or two, did we... :) 14:32
14:35 BinGOs left, BinGOs joined
moritz \o jnthn 14:39
jnthn hi moritz
14:39 simcop2387 left, imarcusthis left 14:40 imarcusthis joined, simcop2387 joined 14:44 jimmy1980 left, mj41 joined, jimmy1980 joined 14:45 prammer left 14:46 MayDaniel joined 14:48 prammer joined 14:58 kaare_ left, sayu joined 15:02 jimmy1980 left 15:03 am0c joined, Radvendii left 15:06 hundskatt joined 15:08 Woodi left 15:09 jimmy1980 joined 15:10 Woodi joined
GlitchMr perl6: eval {print "I know that I was supposed to use try {}"} 15:22
p6eval niecza v12-3-g193ca57: OUTPUT«Unhandled exception: Cannot invoke an undef sub␤ at (eval) line 1 (mainline @ 1) ␤ at /home/p6eval/niecza/lib/CORE.setting line 2003 (eval @ 3) ␤ at /tmp/HO3Epa1XNk line 1 (mainline @ 1) ␤ at /home/p6eval/niecza/lib/CORE.setting line 2224 (ANON @ 2) ␤ …
..rakudo 6825f4: OUTPUT«Nominal type check failed for parameter '$code'; expected Str but got Block instead␤ in sub eval at src/gen/CORE.setting:449␤ in block <anon> at /tmp/0Z4hB_dCEM:1␤ in <anon> at /tmp/0Z4hB_dCEM:1␤»
..pugs b927740: ( no output )
GlitchMr ... too bad that eval {} block form doesn't have helpful error messages... not surprised...
15:23 Radvendii joined
moritz what's not helpful about it? 15:23
jnthn The Rakudo one told you that eval expected a Str rather than a Block.
moritz it says it wants a Str, not a Block
GlitchMr ... right...
moritz which should be enough hint, no?
15:23 agentzh left
GlitchMr yeah... 15:23
jnthn At a stretch we could add a candidate that takes a block and tells you to use "try" :)
dalek kudo/nom: 2f10ef6 | jnthn++ | src/Perl6/ (2 files):
Refactor sigiltype to do the type object lookup, so we have it to hand a bit earlier.
15:27
15:27 jimmy1980 left 15:33 donri joined 15:35 jimmy1980 joined
GlitchMr perl6: qq(is not a function...) 15:37
p6eval pugs b927740: OUTPUT«*** No such subroutine: "&qq"␤ at /tmp/7cdCeDjust line 1, column 1 - line 2, column 1␤»
..niecza v12-3-g193ca57: OUTPUT«===SORRY!===␤␤Bogus term at /tmp/DtfuLccAvo line 1:␤------> qq(is not a function...⏏)␤␤Undeclared routine:␤ 'function' used at line 1␤␤Parse failed␤␤»
..rakudo 6825f4: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 1␤»
GlitchMr That's good thing :).
Radvendii what does the unable to parse postcircumfix:sym<()> thing mean? i'm getting that a lot. 15:39
GlitchMr It means that it couldn't find ending parentheses... 15:41
... or not...
Radvendii but i have the ending parentheses. they're all matched. . .
jnthn It tends to mean something you wrote inside a set of parens could not be parsed. It hit a parse failure before finding the final ) 15:42
Radvendii ah 15:44
object orientation always makes errors uninteligible…
moritz nom: (1 1)
p6eval nom 6825f4: OUTPUT«===SORRY!===␤Confused at line 1, near "(1 1)"␤» 15:45
GlitchMr rakudo: burgers (|) are (|) awesome
p6eval rakudo 6825f4: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 1␤»
15:45 donri left
moritz Radvendii: parse errors have nothing to do with object orientation 15:45
Radvendii then why are they so much less understandable in perl6 than perl5
moritz Radvendii: because rakudo doesn't implement them very well yet 15:46
GlitchMr Because it's... WIP?
moritz niecza: (1 1)
15:46 toebu joined
p6eval niecza v12-3-g193ca57: OUTPUT«===SORRY!===␤␤Two terms in a row at /tmp/gqn9SOgqyq line 1:␤------> (1 ⏏1)␤␤Parse failed␤␤» 15:46
moritz much better
GlitchMr Trust me, errors in languages other than Perl are way less understandable... so it's not that bad...
Radvendii ah, and, what's WIP?
yeah, i know
GlitchMr work in progress
Radvendii ah 15:47
fair enough
moritz perl 5 quite often just says "syntax error"
GlitchMr With location of error :).
It's actually not that bad...
moritz ... which is often just as inaccurate as that of rakudo
Radvendii just saying, this isn't even giving me the line number, it's giving me a range of lines it could be on (between the parens) 15:48
GlitchMr syntax error at - line 13, near "")"
(Might be a runaway multi-line "" string starting on line 1)
...
Yeah, not really helpful 15:49
But it's way better than what PHP does for example...
Radvendii mhmm 15:50
or java
15:50 jimmy1980 left
GlitchMr if (isset($_GET['user']) {} 15:50
Parse error: syntax error, unexpected '{' in /code/uRjY0V on line 2
... but Perl 5 gives similar results in this code, so yeah... 15:51
syntax error at - line 1, near ") {"
15:52 jimmy1980 joined
GlitchMr But I think that with removed parentheses in if statement I will avoid such errors... It's hard to make such errors if you don't have parentheses... 15:53
Radvendii huh? 15:54
GlitchMr if defined $variable {}, or even if defined($variable) {}
Actually, isset() is pretty funny in PHP... 15:55
if (isset(CONSTANT)) {echo CONSTANT}
And error:
Parse error: syntax error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM in /code/i9f450 on line 2
15:55 Chillance left
GlitchMr Now try to find it :). 15:55
Radvendii haha. were you really expecting me to randomly type T_PAAMAYIM_NEKUDOTAYIM? 15:56
and why are they using hebrew words...
GlitchMr It's token name...
lol 15:57
Radvendii paamayim is twice and nekudotayim is two punctuations
GlitchMr It's actually double colon, but in this case you shouldn't use isset() at all...
Radvendii uh...
oh
15:57 donri joined
Radvendii that makes sense 15:57
nekudotayim must be how they say colon 15:58
GlitchMr You should use defined() to check constants, but well... that's really confusing...
Radvendii but why the hell do they use hebrew?
mhmm
GlitchMr Who knows... 15:59
It expects "::" which is used to activate static class variables in PHP...
And functions...
It's really confusing when PHP gives token names in error messages... 16:00
Especially if some of those tokens mean only one thing... like T_PAAMAYIM_NEKUDOTAYIM which only marks ::...
Radvendii im stumped. what's the syntax error in this: 16:02
( 5 ( #AVERAGE ANNUAL SALARY 6 ([+] #sum 7 (@as = #Contract value divied by the contract length 8 (@data= (slurp 'draftdata.txt').split("\n").map({ [.split(' ')] }) ) 9 #parse text(split by newline then split each by space 10 .map(->$_ {$_[1]/$_[0]}) #divide each value by length of contract 11 ) 12 )/@data.elems #divide th
aw crap
hang on 16:03
GlitchMr ...
can you put this to pastebin
moritz Radvendii: please use a paste bin for pasting code here
Radvendii how do i do that?
moritz Radvendii: go to gist.github.com, and paste your code into the big text box 16:04
Radvendii: and then submit it, and paste the result URL here
djanatyn: do you need a deadline extension for www.google-melange.com/gci/task/vie...11/7177376 ?
Radvendii okay 16:05
moritz jnthn: your commits seem to have caused a regression in t/spec/S02-types/declare.t 16:07
"Type Array cannot accept type arguments"
16:08 s1n left 16:10 jimmy1980 left
jnthn moritz: Yeah, I'm aware 16:11
moritz: It was passing bogusly before. I'd fudge it part from I'm going to put in commits that fix it in just a moment.
moritz jnthn: np, just stumbled over it while spectesting another patch 16:12
oh hell, this is taking ages, I'll just commit it :-) 16:13
dalek kudo/nom: 48514ff | moritz++ | src/core/Failure.pm:
restore "use fatal"
jnthn ;) 16:14
16:15 GlitchMr left, jimmy1980 joined 16:16 z-b is now known as zb, colomon joined
Radvendii why is it that i can't have an object, and then on the next line have a method call. like so:gist.github.com/1430575 16:18
16:19 sayu left
colomon Radvendii: If you're getting a parse error message you can't figure out from Rakudo, it may be helpful to run it through std: here, which is a completely different implementation of the Perl 6 grammar. 16:20
std: if (isset($_GET['user']) {}
p6eval std be1f10e: OUTPUT«===SORRY!===␤Variable $_GET is not predeclared at /tmp/5djNPTfPve line 1:␤------> if (isset(⏏$_GET['user']) {}␤Unexpected block in infix position (two terms in a row, or previous statement missing semicolon?) at /tmp/5djNPTfPve li…
colomon (for instance) (looks better if your IRC client supports colors) 16:21
16:21 sayu joined
Radvendii i figured out what the error was 16:21
now i just want to know why it was implimented that way
im trying to break one statement over several lines
and it doesnt let me put the method call on the line after the object 16:22
jnthn Radvendii: That's the way Perl 6 syntax is; I suspect the spec (S02) has some justification on that. You can get around the issue by sticking a \ at the end of the previous line ("unspace") 16:23
Radvendii ah. i solved it by putting parens around the object, but thanks!
colomon Actually, that detail of the p6 grammar spec has always bugged me, too.
16:26 JimmyZ joined 16:27 three18ti joined 16:28 kaare_ joined 16:29 MayDaniel left 16:44 GlitchMr joined 16:46 JimmyZ left
colomon nom: say 12313.WHICH; my $a = 12313; say $a.WHICH 16:46
p6eval nom 48514f: OUTPUT«-3029978659897549649␤-3029978659897549649␤»
colomon nom: say (12313/2).WHICH; my $a = (12313/2); say $a.WHICH
p6eval nom 48514f: OUTPUT«-9175363216054543126␤-9175363216054536736␤»
colomon nom: say (12313/2).WHICH; my $a = (12311/2)+1; say $a.WHICH 16:47
p6eval nom 48514f: OUTPUT«-587439194525867475␤-587439194515431390␤»
colomon how is that working?!
jnthn Does Rat override WHICH? 16:49
colomon I don't know.
16:49 icwiener left, lichtkind joined
colomon nope 16:49
The only definition coming up in my ack source is in Mu.pm 16:50
nqp::p6box_i(nqp::where(self)) 16:51
moritz it should, I think 16:53
colomon next question is: how? 16:54
heck, how does Int get a proper WHICH?
jnthn nom: say 42 === 42
p6eval nom 48514f: OUTPUT«Bool::True␤»
jnthn nom: my $a = 42; my $b = 42; say $a === $b
p6eval nom 48514f: OUTPUT«Bool::True␤» 16:55
colomon I don't mean current-programming-wise, I just mean concept wise
jnthn nom: my $a = 42; my $b = 41 + 1; say $a === $b
moritz colomon: with a cheating multi infix:<===>(Int, Int)
p6eval nom 48514f: OUTPUT«Bool::True␤»
moritz colomon: ah
jnthn ah
moritz colomon: value types are supposed to overwrite .WHICH
colomon right.
moritz and they shouldn't return a Str or an Int
colomon but every Int value needs a ... wait, what?
moritz but rather an object that captures the type and the value or memory location 16:56
colomon I thought .WHICH returned an Int
jnthn Should be an ObjAt, but NYI
colomon ObjAt?
moritz see S02/The ObjAt Type/ 16:57
dalek ast: c73f724 | moritz++ | S (2 files):
unfudge now passing "use fatal" tests for rakudo
16:58
colomon afkish # someone is demanding "The Little Engine that Could" 16:59
moritz the spec is very vague on ObjAt 17:00
17:01 molaf joined
moritz it says it's a "value, rather than another object" 17:01
but it also says that it can be memory location, plus other information
and then that the serialization can also be used for value types
so it seems to that ObjAt is rather flexible for a value type 17:02
colomon so ObjAt is a magic class, eh? :) 17:06
moritz well, I dunno what it is
I can't be both very magic and a value type
colomon and can you call .WHICH on an ObjAt? 17:08
moritz yes
jnthn
.oO( tbh, I prefer it when moritz is magic rather than a value type )
17:09
jnthn is one test off having typed hashes and stuff working 17:13
colomon \o/
jnthn Well, actually the test is to do with typed arrays.
Well, actually, the test is a terrifying generic instantiation bug...but anyways :)
*is to do with
ah, I see what's going on. Hm. 17:14
17:16 birdwindupbird joined 17:17 birdwindupbird left, Guest11641 left, HarryS joined 17:33 toebu left
dalek kudo/nom: cb2abae | jnthn++ | src/Perl6/ (2 files):
Refactor container handling to get various bits of decision making in one place and get initial support for 'my Int %foo' in place. Not all working yet, and a couple of regressions.
17:37
kudo/nom: 0e33341 | jnthn++ | src/core/Hash.pm:
Quick, temporary fiddle to get typed hashes to correctly fail type checks, though error will need awesomizing.
kudo/nom: 7b121b5 | jnthn++ | src/core/Array.pm:
Just enough to make 'my Int @foo' style declarations compile properly; it's not donig the proper checks yet.
kudo/nom: 0142df3 | jnthn++ | src/Perl6/Actions.pm:
Make sure we correctly pass along type information about what's inside a typed container.
kudo/nom: a4e91b0 | jnthn++ | src/Perl6/Metamodel/Mixins.pm:
Add a way to introspect if a type is one created due to a mixin.
kudo/nom: 5ef2d9e | jnthn++ | src/Perl6/Metamodel/BOOTSTRAP.pm:
Fix a subtle bug that showed up in constructs like role TreeNode[::T] does Positional { has TreeNode[T] @!foo }; we actually used to ignore that type constraint and bogusly pass the test, and with this fix we can pass it for the right reasons.
ast: 9ca2f14 | jnthn++ | S09-typed-arrays/hashes.t:
Re-fudge typed hashes test (mostly unfudges).
17:41
kudo/nom: 7fd864b | jnthn++ | t/spectest.data:
Turn on typed hashes test file.
17:42
17:46 ksi joined
tadzik greetings, #perl6 17:49
phenny tadzik: 02 Dec 22:17Z <japhb> ask tadzik Why did you choose to clone Dancer, as opposed to Mojolicious or one of the other Perl 5 frameworks? Just the one you were most familiar with, or was there a deeper reason?
tadzik japhb: I knew and liked Dancer. Also, I knew mberends from the Dancer community, and have heard about the Perl 6 port for some time 17:50
japhb tadzik: I thought you were the one that created Bailador? Or did you mean you had heard that people were working on the lower-level stuff with the intent of eventually porting Dancer? 17:51
tadzik japhb: I am the one. I've heard stories on #dancer about plans for a Perl 6 port, but didn's see action 17:52
japhb Ah, I get it.
The #mojo people (well, at least sri) are very interested in a Mojo/Mojolicious port as well. 17:53
17:53 Sarten-X joined
tadzik yeah, right 17:53
I've heard it like 10 times already
well, sri is complaining about the lack of docs now, which is kind of reasonable
17:53 MayDaniel joined
__sri i'm very interested in a perl 6 port of mojolicious, in case you've not heard it yet 17:54
tadzik in a port, or in creating a port?
__sri creating
tadzik mojolicious seems Perl 6 friendly, I've seen something like this in its docs
__sri it is designed to be easy to port 17:55
tadzik you're missing mostly docs, right?
__sri right
tadzik now that we have proper NCI I may be able to figure out some proper epoll :)
__sri epoll is an optimization, to get started select/poll are perfectly fine 17:56
jnthn Would be a god test for it.
er, good
tadzik there's poll()
well, IO::Socket.poll
__sri all i need to get started is the functionality of what perl5 core currently offers with reasonable reference documentation 17:57
17:57 benabik joined
tadzik __sri: if you can, please maintain a list of things like "I was looking for some docs on XXX and didn't find any" 17:57
would be great to know such stuff 17:58
__sri github.com/kraih/mojo/blob/master/...ile.PL#L44 # core modules we use
17:58 mtk left
japhb __sri, I think you might run into a chicken and egg problem -- the functionality is being filled in whenever there is both a direct need and someone capable of filling that need. Until we know exactly what is needed that is not already there, you'd have to wait an unknown time for someone to either build it because someone *else* needs it, or we get far enough along we're just filling gaps to get "completeness" 17:59
tadzik I don't see anything exotic at the first glance, maybe aside from B
__sri mojolicious itself is just 11k lines of code, so once started it shouldn't take too long
japhb The problem is, until someone starts the port, we won't know what *in precise detail* we're missing. 18:00
A lot of features were implemented not to completion, but to "good enough for the present needs" 18:01
That's unfortunately the way of things when a project is "75% complete"
However, my gut feeling is that there is enough there now to get pretty far along until there's an impassible barrier, 18:02
and at that point there will be strong incentive to find a way to break that barrier down.
__sri maybe i should make it more clear that i'm not interested in a toy port 18:04
18:04 mugenken joined
tadzik :) 18:04
japhb __sri, I didn't mean that. 18:05
I meant that at this stage, it's probably best to start with a sketch of the port, and then fill in things iteratively until a missing Perl 6 feature is found, then someone works on fixing the missing feature and someone works on continuing the iteration of the port. 18:06
I don't think you can start by utterly completing one layer of the Mojo* stack at a time before moving to the next, without getting rather frustrated. 18:07
I think the end result is a complete port, just not one build in classic bricklaying fashion.
*built
18:12 risou is now known as risou_awy 18:13 toebu joined 18:29 sayu left 18:33 packetknife joined
moritz nom: say (-1234).base(16) 18:42
p6eval nom 7fd864: OUTPUT«-4D2␤»
dalek p: 65a9ad3 | moritz++ | / (3 files):
add base_I op that converts a bigint to a string with a given base
18:44
19:01 s1n1 joined 19:05 s1n1 left 19:11 pat_js joined 19:15 mishin left
moritz nom: my $t = now; for ^1000 { 1234.base(16) }; say now - $t 19:15
p6eval nom 7fd864: OUTPUT«5.20457565984858␤»
jnthn o.O 19:16
moritz I'm about to change that to use the C implementation in libtommath
jnthn moritz++
wolverian I'm more surprised it doesn't eliminate the whole for loop ;)
tadzik :P
moritz wolverian: well, it will as soon as we detect void context 19:17
jnthn heh. And can prove that 1234.base(16) always has no side-effects :)
benabik wolverian: What would be difficult as it would have to know that base… what jnthn said
moritz ah well, I forgot that void context is eager...
jnthn Optimizing away for ^1000 { 1234.say } in void context probably will get us bug reports :)
moritz $ ./perl6 -e 'my $t = now; for ^1000 { 1234.base(16) }; say now - $t' 19:19
0.0538511770344779
flussence
.oO( maybe things should have a .void to go with .item and .list, to give the compiler a hint they have side effects )
moritz ok, that CPU is a wee bit faster than the one on p6eval
but not a factor of 100 19:20
dalek kudo/nom: c97b172 | moritz++ | src/core/Int.pm:
simplify Cool.base by using the appropriate nqp op
moritz evalbot rebuild nom 19:21
p6eval OK (started asynchronously)
19:21 s1n1 joined 19:25 Radvendii left 19:27 pat_js left
lichtkind cheers 19:33
tadzik hey lichtkind
moritz \o lichtkind
nom: say 1
p6eval nom 7fd864: OUTPUT«1␤»
moritz hasn't rebuilt yet :( 19:34
lichtkind moritz: du bist da in erlangen? 19:35
moritz lichtkind: I'm in Erlangen 99% of the time :-) 19:36
lichtkind im speeking about 3 days in march
sorear good * #perl6 19:37
moritz lichtkind: yes. I'm one of the organizers.
lichtkind moritz: its because i had lately another idea for a talk just wated make sure that our talks dont overlap 19:38
moritz Unrecognized nqp:: opcode 'nqp::base_I' at line 2342, near ");\n }\n}" 19:39
seems I didn't bump the nqp revision correctly :(
dalek kudo/nom: 48b979e | moritz++ | tools/build/NQP_REVISION:
bump NQP revision
19:40
19:44 Radvendii joined
lichtkind moritz: but if you orgnaizer yur aware of my submissions anyway 19:45
19:47 Radvendii left
moritz nom: my $t = now; for ^1000 { 1234.base(16) }; say now - $t 20:09
p6eval nom 48b979: OUTPUT«0.0757341564784759␤»
moritz nom: say 5.2 / 0.076
p6eval nom 48b979: OUTPUT«68.4210526315789␤»
moritz that's how much my last patch sped up Int.base :-) 20:10
colomon \o/
20:10 fsergot left
sorear o/ colomon 20:10
colomon \o
djanatyn Heyo! 20:11
colomon sorear: the last optimization you pushed was quite nice!
20:13 wolfman2000 joined
sorear colomon: how well does it work now? 20:19
colomon: do threads give a speedup now?
colomon with THREADS=1, it's about as fast as the last non-threaded version, and looks much nicer. THREADS=2 still makes it go slower, alas. 20:20
give me a minute
benabik more threading should not be slower. :-/
20:22 Radvendii joined
colomon back 20:23
I'm wondering if we're suffering lots of lock contention.
And extra threads just makes that worse
sorear *shrug* could be. 20:25
the WorkQueue.monitor lock is only taken O(height) times because the work unit granularity is the line, not the pixel
I had hpped that would be enough to make lock contention a non-issue 20:26
colomon it does seem like that should be enough, I agree. but I'm not sure what else it could be. You've got the DrawRgbImage calls down to a minimum, and adding threads shouldn't ever add more... 20:28
but yeah, with THREADS=1, I get Waiting for work at 12.910678; with =2, it's 25.953764 20:31
and I think there actually are more calls to ExposeEvent -- I've got it dumping the Y and height of the expose event, and I'm pretty sure there are more height 2 calls in the THREADS=1 run. 20:33
20:34 fsergot joined 20:35 MayDaniel left 20:36 Radvendii left 20:37 localhost joined
sorear colomon: mmm, expose event merging 20:37
japhb nom: my $val := fail "boo"; say "NO BLOCK"; try { ~$val }; say ~$!; say "alive"; say "WITH BLOCK"; { try { ~$val }; say $!; say "alive"; } 20:45
p6eval nom 48b979: OUTPUT«NO BLOCK␤boo␤alive␤WITH BLOCK␤boo␤ in block <anon> at /tmp/TLc4yC1zrZ:1␤ in <anon> at /tmp/TLc4yC1zrZ:1␤»
japhb ^^ That took me forever to find and golf ...
sorear uh 20:46
fail does a return implicitly, or it's supposed to anyway
so nothing after the first statement should be run at all
jnthn ...how does that not immediately explode?
nom: fail 20:47
p6eval nom 48b979: ( no output )
jnthn nom: return
p6eval nom 48b979: OUTPUT«Attempt to return outside of any Routine␤ in block <anon> at /tmp/FTgq6yZYua:1␤ in <anon> at /tmp/FTgq6yZYua:1␤»
moritz nom: fail; say 1
p6eval nom 48b979: OUTPUT«1␤»
moritz nom: my $x = fail; say 1 20:48
p6eval nom 48b979: OUTPUT«1␤»
jnthn nom: my $x = fail; say $x
p6eval nom 48b979: OUTPUT«Failure.new()␤»
jnthn $return($fail) unless nqp::isnull($return);
$fail
argh!
japhb jnthn, that's not the real problem. 20:49
Because someone *should* be able to do what I did in mainline code.
The real problem is that, having bound the Failure, try {} acts differently inside and outside the block.
20:51 molaf left
colomon sorear: hmm, just crashed the program 20:52
jnthn nom: my $val := fail "boo"; say "NO BLOCK"; try { ~$val }; say ~$!; say "alive"; say "NO BLOCK AGAIN"; try { ~$val }; say $!; say "alive"; 20:53
p6eval nom 48b979: OUTPUT«NO BLOCK␤boo␤alive␤NO BLOCK AGAIN␤boo␤ in block <anon> at /tmp/gWIstq77lb:1␤ in <anon> at /tmp/gWIstq77lb:1␤»
jnthn japhb: Not block related, it seems, but using the failure twice. 20:54
japhb jnthn, NICE
I totally didn't see that.
(I had golfed it down from something that used it first without a block, and then again inside an if block)
20:54 birdwindupbird joined 20:55 GlitchMr left
jnthn nom: my $val := fail "boo"; say "NO BLOCK"; try { ~$val }; say $!.WHAT; say "alive"; say "NO BLOCK AGAIN"; try { ~$val }; say $!.WHAT; say "alive"; 20:55
20:55 birdwindupbird left
p6eval nom 48b979: OUTPUT«NO BLOCK␤Exception()␤alive␤NO BLOCK AGAIN␤boo␤ in block <anon> at /tmp/q6Ib9GRfPY:1␤ in <anon> at /tmp/q6Ib9GRfPY:1␤» 20:55
jnthn nom: my $val := fail "boo"; say "NO BLOCK"; try { ~$val }; say $!.WHAT; say "alive"; say "NO BLOCK AGAIN"; try { ~$val };
p6eval nom 48b979: OUTPUT«NO BLOCK␤Exception()␤alive␤NO BLOCK AGAIN␤boo␤ in block <anon> at /tmp/fIohgfGtHZ:1␤ in <anon> at /tmp/fIohgfGtHZ:1␤»
japhb Yeah, the second try {} throws.
jnthn Well, fails to swallow at least, yeah 20:56
nom: my $val := fail "boo"; say "NO BLOCK"; try { ~$val }; say $!.WHAT; say "alive"; say "NO BLOCK AGAIN"; try { ~$val; CATCH { say "was here" } };
p6eval nom 48b979: OUTPUT«NO BLOCK␤Exception()␤alive␤NO BLOCK AGAIN␤boo␤ in block <anon> at /tmp/kNvyELZY0L:1␤ in <anon> at /tmp/kNvyELZY0L:1␤»
japhb jnthn, right, that's what I meant, just poorly said.
jnthn japhb: Well, but it's weird it doesn't even run that CATCH block. 20:57
japhb nodnod
jnthn nom: try { die "foo" }; try { die "foo" }; say "alive" 20:58
p6eval nom 48b979: OUTPUT«alive␤»
jnthn Dang. It's not *that* subtle.
er
*that* simple
It is more subtle.
japhb nom: my $val := fail "boo"; try { ~$val }; try { ~$val; }; 20:59
p6eval nom 48b979: OUTPUT«boo␤ in block <anon> at /tmp/fQj2rwNxvn:1␤ in <anon> at /tmp/fQj2rwNxvn:1␤»
jnthn nom: sub foo { fail "boo" }; my $val = foo(); say "NO BLOCK"; try { ~$val }; say $!.WHAT; say "alive"; say "NO BLOCK AGAIN"; try { ~$val; };
p6eval nom 48b979: OUTPUT«NO BLOCK␤Exception()␤alive␤NO BLOCK AGAIN␤boo␤ in sub foo at /tmp/1rcHs8nYL1:1␤ in block <anon> at /tmp/1rcHs8nYL1:1␤ in <anon> at /tmp/1rcHs8nYL1:1␤»
jnthn OK, so we can reproduce it without needing binding, and with a completely valid use of fail. 21:00
japhb nom: my $val := fail "boo"; try { ~$val }; say "foo"; try { ~$val; };
p6eval nom 48b979: OUTPUT«foo␤boo␤ in block <anon> at /tmp/fo1Tj9StJq:1␤ in <anon> at /tmp/fo1Tj9StJq:1␤»
jnthn nom: sub foo { fail "boo" }; my $val = foo(); try { ~$val }; say $!; try { ~$val; }; say $!;
p6eval nom 48b979: OUTPUT«Exception.new()␤boo␤ in sub foo at /tmp/nhVqWZ2IYL:1␤ in block <anon> at /tmp/nhVqWZ2IYL:1␤ in <anon> at /tmp/nhVqWZ2IYL:1␤»
jnthn nom: sub foo { fail "boo" }; my $val = foo(); try { ~$val }; say $!; try { ~$val; }; say "alive"
p6eval nom 48b979: OUTPUT«Exception.new()␤boo␤ in sub foo at /tmp/C_3q6Pt90c:1␤ in block <anon> at /tmp/C_3q6Pt90c:1␤ in <anon> at /tmp/C_3q6Pt90c:1␤»
jnthn phenny: tell mls_ If you have a moment for an exception-related bug, in the following program the second try fails to catch: sub foo { fail "boo" }; my $val = foo(); try { ~$val }; say $!; try { ~$val; }; say "alive" 21:01
phenny jnthn: I'll pass that on when mls_ is around.
japhb nom: my $val := fail "boo"; say try { ~$val; 1 }; say try { ~$val; 2 }; 21:02
p6eval nom 48b979: OUTPUT«Exception.new()␤boo␤ in block <anon> at /tmp/86UMNrDMiO:1␤ in <anon> at /tmp/86UMNrDMiO:1␤»
jnthn japhb: mls_++ is the Rakudo exceptions guru, so can probably find this rather faster than I can.
japhb jnthn, roger that, thanks
Wait, why does the first part of my last eval say 'Exception.new()' instead of '1'? 21:04
jnthn japhb: Because a try that encounters an exception evaluates to the exception. 21:05
japhb: The 1 is never reached
japhb *smack*
Duh.
Its not *surpressing*, it's *catching*.
jnthn Correct 21:06
japhb has clearly been looking at the same code far too long.
21:16 fsergot left 21:22 kaare_ left 21:26 araujo joined, araujo left, araujo joined 21:36 jimmy1980 left 21:40 kfo joined 21:41 araujo left 21:42 wolfman2000 left, jimmy1980 joined
djanatyn plays around with roast 21:45
21:46 Radvendii joined 21:47 araujo joined, araujo left, araujo joined, araujo left
djanatyn moritz: *poke* 21:49
21:50 fridim_ joined 21:58 fsergot joined 22:01 Radvendii left 22:02 Moukeddar joined, Radvendii joined
Moukeddar can someone please explain why ListDictionary is so slow? 22:04
tadzik what is ListDictionary?
Moukeddar oops, wrong window, my bad
lichtkind tadzik: souds like a list that emulates a fixed hash 22:05
Moukeddar a collection in .NET
tadzik wild guess: it has an O(n) lookup?
Moukeddar not sure about O(n), but it's pretty slow 22:06
really reall slow
really*
benabik Item, Add, Remove, Contains are all O(n). It's supposed to have "fasted keyed retrieval" 22:07
tadzik logarithmic I guess
22:09 toebu left
Moukeddar got it, yes it's O(n) 22:11
22:15 risou_awy is now known as risou
flussence I've seen some of the code in PHP's associative arrays; all I can say is that it's definitely not optimised for large data structures... 22:17
sorear Moukeddar: ListDictionary is horribly slow. It just is. I think it was designed by someone who doesn't know assembly, doesn't use profilers, or both. 22:23
Moukeddar the thing that baffles me, why it got shipped with other collections, i find it quite useless 22:24
benabik The docs say it's designed for small collections. Perhaps more space efficient that other dictionaries, but (nearly) as fast?
sorear Moukeddar: I recommend you steal the hybrid dictionary I implemented for Niecza, say $args.Event.Area.Y; 22:25
say $args.Event.Area.Height;
what the?
github.com/sorear/niecza/blob/mast...ls.cs#L153
Moukeddar ok, a sec
sorear I select text in one window, middle click in another, and it pastes something I deleted in vim hours ago
benabik Not all apps deal with the Selection clipboard, only the pasteboard. 22:26
Moukeddar hmm, seems that they already shipped a HybridDictionary, which converts to a hashtable when reaching a specific size 22:27
22:27 ggoebel joined
flussence (I've found chromium loses an URL bar selection 95% of the time I try to use it. Really annoying.) 22:28
sorear Moukeddar: yes, and it's even slower than ListDictionary
Moukeddar lol, don't know which to use anymore 22:29
diakopter why not List<>
sorear Moukeddar: use Dictionary<,> 22:30
Moukeddar yeah, i guess Dictionary<,> is the safe ground
sorear Moukeddar: if you have to store 250,000 dictionaries, most of which have 0-1 element, use VarHash
Moukeddar sweet 22:33
22:36 dorlamm joined
tadzik Tests=19975 22:40
woooo, when did we get there?
22:40 wolfman2000 joined
tadzik btw, I get Failed tests: 4-6, 11-13 in t/spec/S05-mass/properties-general.rakudo 22:40
22:41 araujo joined, araujo left, araujo joined 22:48 am0c left 22:50 mugenken left 22:51 Moukeddar left 22:52 mj41 left 22:55 tokuhirom joined 23:01 risou is now known as risou_awy 23:02 PacoLinux left 23:05 ksi left 23:10 jeffreykegler joined 23:21 fridim_ left 23:26 patspam joined
jnthn tadzik: wow, should break 20k soon :) 23:31
tadzik aye
almost ng :)
jnthn What did that peak at? 23:32
tadzik 21-something I believe 23:33
23:36 cooper joined 23:40 patspam left 23:41 patspam1 joined
lue hello world o/ 23:41
tadzik hello lue 23:42
23:42 patspam1 left, patspam joined 23:43 toebu joined 23:44 patspam left, jaldhar left 23:49 patspam joined 23:51 dorlamm left
dalek ast: 7127a14 | tadzik++ | S02-lexical-conventions/comments.t:
Fix Pod in S02-lexical-conventions/comments.t

Per S26, content is not allowed in the same line with a paragraph block declaration. Use abbreviated blocks instead.
23:57
tadzik g'night #perl6