Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2014-05-24

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:21 thou joined #perl6
00:25 BenGoldberg joined #perl6
00:31 perltricks joined #perl6
01:02 kurahaupo joined #perl6
01:04 klapperl joined #perl6
01:08 dalek gtk-simple: ccc0f1b | (Timo Paulssen)++ | lib/GTK/Simple.pm6:
01:08 dalek gtk-simple: introduce ToggleButton and CheckButton
01:08 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/ccc0f1bf4d
01:08 dalek gtk-simple: 3993435 | (Timo Paulssen)++ | examples/02_toggles.pm6:
01:08 dalek gtk-simple: an example using toggle- and check-button.
01:08 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/39934352bf
01:30 hoverboard joined #perl6
01:46 FROGGS_ joined #perl6
01:47 Su-Shee_ joined #perl6
01:49 Sqirrel joined #perl6
01:53 Psyche^ joined #perl6
02:10 thou joined #perl6
02:30 dj_goku joined #perl6
03:24 xragnar_ joined #perl6
03:41 pdurbin joined #perl6
03:50 SamuraiJack joined #perl6
03:58 thou joined #perl6
04:05 SamuraiJack joined #perl6
04:13 Sqirrel joined #perl6
04:37 Sqirrel joined #perl6
04:39 bjz joined #perl6
04:43 molaf joined #perl6
04:45 SamuraiJack_ joined #perl6
05:31 kaare_ joined #perl6
05:38 Woodi morning :)
05:40 Woodi hmm, delegetion for me means "delegation of responsibility", eg:  class Car { has Engine $!e; method start { $!e.start() } }
05:41 woolfy joined #perl6
05:41 Woodi but for some time I think here ppls talk about something else... delegation throught handles ?
05:42 lizmat good *, #perl6!
05:42 yoleaux 23 May 2014 23:15Z <Mouq> lizmat: I really kind of can't add tests for List.rotor at the moment :( And yes, List.rotor(1,0) should be { self }
05:42 Woodi o/
05:42 lizmat .tell Mouq I'll add tests then
05:42 yoleaux lizmat: I'll pass your message to Mouq.
05:43 lizmat Mouq, timotimo, colomon, flussence: how about giving warnings the same treatment as deprecations?
05:44 lizmat aka, only tell how many times it happened where *after* the program has finished
05:46 thou joined #perl6
05:47 woolfy left #perl6
05:49 Woodi ah, found  http://perlcabal.org/syn/S12.html#Delegation
06:42 sqirrel_ joined #perl6
06:42 Sqirrel joined #perl6
06:54 rindolf joined #perl6
07:08 FROGGS joined #perl6
07:11 FROGGS timotimo: yeah, v5 timings would be interesting... need to check if the benchmarks run on v5 though
07:11 FROGGS but I guess the chance is high because you usually do not use many modules there
07:15 lizmat joined #perl6
07:16 FROGGS lizmat: about warnings at exit... I think I like it
07:19 lizmat part 2 of commute&
07:20 FROGGS timotimo: walking the things in my v5 folder takes 1m53.453s
07:20 FROGGS dunno how to profile that offhand
07:21 FROGGS that was moar btw, running now for other backends
07:25 kaare__ joined #perl6
07:33 Sqirrel joined #perl6
07:53 Rotwang joined #perl6
07:57 darutoko joined #perl6
08:00 Woodi Release #76, nickname "Bajor" ? what Bajor is ?
08:03 SHODAN joined #perl6
08:06 moritz read the release announcement?
08:08 Woodi yes, R* 201405 "Bajor"... is there such .pm or it's singer name :)
08:18 virtualsue joined #perl6
08:18 moritz no R* yet
08:35 Sqirrel joined #perl6
08:37 sergot morning! o/
08:42 Woodi hi sergot
08:43 dmol joined #perl6
09:02 jnthn morning, #perl6
09:03 FROGGS "morning" :o)
09:03 jnthn heh, true :)
09:03 * jnthn slurps airport coffee
09:03 FROGGS Woodi: http://en.wikipedia.org/wiki/Bajor#Homeworld
09:04 vendethiel FROGGS: OH: "Perl 6 is fast now, you just need to write the code in perl 5"
09:04 FROGGS vendethiel: I don't get that sentence
09:04 vendethiel FROGGS: I thought you said v5 would be okayish-fast
09:05 FROGGS ahh, Perl 5, not perl 5 *g*
09:05 vendethiel v5
09:05 FROGGS vendethiel: v5 builds and spectests very nicely
09:05 vendethiel FROGGS: hence the "OH" :P
09:06 FROGGS but I don't know how fast it is compared to, say, perl-5.20
09:06 vendethiel (and how fast is it compared, to, say, last R*)
09:06 cosimo jnthn: we're waiting for you here :-)
09:07 cosimo ( @mojoconf )
09:07 FROGGS I hope that running code using v5 is not much slower that running similar code on rakudo directly
09:08 FROGGS but since there is some abstraction layer between some stuff, it must be slower at least to some degree
09:10 jnthn cosimo: Well, my flight looks to be on time, and it's a short flight, and flytoget is fast, so shouldn't be too much waiting ;)
09:14 cosimo jnthn: ah, i thought you were on this side already :)
09:24 jnthn flight &
09:26 chenryn joined #perl6
09:34 dalek rakudo/nom: 4bbe231 | (Tobias Leich)++ | src/core/IO.pm:
09:34 dalek rakudo/nom: obtain $*CWD.chars once before the loop in IO::Path.contains
09:34 dalek rakudo/nom:
09:34 dalek rakudo/nom: It is about 25% faster for a very simple test.
09:34 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/4bbe231f78
09:35 FROGGS okay, we really need to optimize gather/take now
09:38 FROGGS hmmm, no, maybe it is not the gather/take
09:41 FROGGS wow, IO::Path.d is very slow... do we need a stat cache?
09:44 FROGGS turning a string 500 times into a path takes 0.3s
09:44 FROGGS calling .d on a IO::Path takes 2.2s when doing it 500 times
09:45 FROGGS ewww
09:45 FROGGS method d() {
09:45 FROGGS self.e && nqp::p6bool(nqp::stat(nqp::unbox_s(IO::Spec.rel2abs(self.Str)),
09:45 FROGGS nqp::const::STAT_ISDIR))
09:45 FROGGS }
09:46 FROGGS why do we turn our IO::Path into a string??
09:48 FROGGS there must be a better way
09:57 bowtie joined #perl6
10:02 masak indeed
10:06 xinming_ joined #perl6
10:08 SamuraiJack_ joined #perl6
10:09 spider-mario joined #perl6
10:10 kaare__ joined #perl6
10:23 rindolf joined #perl6
10:31 Alula joined #perl6
10:31 denis_boyun joined #perl6
10:53 anant joined #perl6
10:57 SamuraiJack__ joined #perl6
11:06 anant what's the fastest way to loop from 0 to million in perl6?
11:06 anant I tried "for ^1e6 -> $i {  'some code' }" but it takes a really long time (more than 10s on my computer)
11:07 anant In contrast perl5 takes less than a second
11:08 Psyche^ joined #perl6
11:09 FROGGS anant: while loops are faster than for loops
11:09 timotimo when i print one million 1s it takes 15s with your method
11:10 timotimo in contrast, for ^(1e6.Int) -> $i takes only 11s
11:10 FROGGS m: my int $i = 0; while $i < 1_000_000 { $i = nqp::add_i($i, 1) } # this might be the fastet way
11:10 camelia rakudo-moar 4bbe23: ( no output )
11:11 timotimo for ^(1e6.Int) -> int $i takes one second less
11:13 anant FROGGS: thanks
11:13 FROGGS m: my int $i = 0; while $i < 1_000_000 { $i = nqp::add_i($i, 1) }; say nqp::time_n() - BEGIN nqp:time_n
11:13 camelia rakudo-moar 4bbe23: OUTPUT«===SORRY!===␤Cannot invoke null object␤»
11:13 FROGGS eww
11:13 FROGGS p: my int $i = 0; while $i < 1_000_000 { $i = nqp::add_i($i, 1) }; say nqp::time_n() - BEGIN nqp:time_n
11:13 camelia rakudo-parrot 4bbe23: OUTPUT«===SORRY!===␤Could not find sub &nqp␤»
11:13 timotimo :: at the end
11:13 FROGGS m: my int $i = 0; while $i < 1_000_000 { $i = nqp::add_i($i, 1) }; say nqp::time_n() - BEGIN nqp::time_n
11:13 timotimo :)
11:13 camelia rakudo-moar 4bbe23: OUTPUT«0.647788047790527␤»
11:13 FROGGS :o)
11:14 timotimo oh wow.
11:14 anant wow!
11:14 FROGGS m: for ^(1e6.Int) -> int $i { }; say nqp::time_n() - BEGIN nqp::time_n
11:14 camelia rakudo-moar 4bbe23: OUTPUT«5.74020648002625␤»
11:14 FROGGS :o)
11:14 timotimo ah, ok, when i had a print "1" in there, that's probably what took the most time
11:14 * FROGGS knows stuff :D
11:15 timotimo m: for ^(1e6) -> int $i { }; say nqp::time_n() - BEGIN nqp::time_n
11:15 camelia rakudo-moar 4bbe23: OUTPUT«(timeout)»
11:15 timotimo wow.
11:15 timotimo that really makes a big difference
11:15 anant are these tricks documented somewhere? :)
11:15 timotimo ideally, you wouldn't need any of those tricks ;)
11:15 anant for a newbie its pretty difficult (and frustrating) :)
11:16 dalek rakudo/nom: f538dce | (Tobias Leich)++ | src/core/IO.pm:
11:16 dalek rakudo/nom: make .IO.{d|s|z} by about 40% faster
11:16 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/f538dcefed
11:16 timotimo well, whenever you write a scientific notation number you are signaling "i really want a Real here, not a Rat"
11:16 timotimo so it may be a bad idea to try to use that for an "Int with many zeros"
11:16 anant oh
11:17 timotimo m: say 3.14159.WHAT
11:17 camelia rakudo-moar 4bbe23: OUTPUT«(Rat)␤»
11:17 timotimo m: say 3.14159e0.WHAT
11:17 camelia rakudo-moar 4bbe23: OUTPUT«(Num)␤»
11:17 timotimo m: say Rat ~~ Real
11:17 camelia rakudo-moar 4bbe23: OUTPUT«True␤»
11:17 timotimo my mistake
11:17 timotimo i meant to say Num up there, not Real.
11:17 anant ok
11:24 timotimo in general, arithmetic with native integers (when you write "int" instead of "Int") can be much faster
11:25 timotimo and arithmetic with Rats (whenever you don't write an e inside your numbers) will be quite slow
11:25 timotimo on the other hand, it will be perfectly precise up to a certain point
11:29 lizmat joined #perl6
11:30 prevost joined #perl6
11:33 Psyche^ joined #perl6
11:41 anant joined #perl6
11:42 * lizmat is back home for a little while)
11:42 Psyche^_ joined #perl6
11:52 lizmat .tell FROGGS looks like your changes break t/spec/S16-filehandles/filetest.t , at least on moar
11:52 yoleaux lizmat: I'll pass your message to FROGGS.
11:53 lizmat .tell FROGGS:  "doesnotexist.t".IO ~~ :z    dies rather than returning False
11:53 yoleaux lizmat: What kind of a name is "FROGGS:"?!
11:53 lizmat .tell FROGGS  "doesnotexist.t".IO ~~ :z    dies rather than returning False
11:54 yoleaux lizmat: I'll pass your message to FROGGS.
11:54 lizmat afk again&
12:01 dalek gtk-simple: df0b11c | (Timo Paulssen)++ | examples/02_toggles.pm6:
12:01 dalek gtk-simple: lots of comments for the second example
12:01 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/df0b11c7dd
12:02 timotimo .tell FROGGS other than the failures, good eye for optimization, those 40% will really mean a lot
12:02 yoleaux timotimo: I'll pass your message to FROGGS.
12:05 denis_boyun_ joined #perl6
12:36 telex joined #perl6
12:58 dalek rakudo/nom: 2dd18de | (Elizabeth Mattijsen)++ | docs/ChangeLog:
12:58 dalek rakudo/nom: Mention increase of speed of .IO.{d|s|z}
12:58 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/2dd18ded7e
12:59 thou joined #perl6
13:13 dalek rakudo/nom: cb77438 | (Elizabeth Mattijsen)++ | src/core/IO.pm:
13:13 dalek rakudo/nom: Fix .IO.z brokenness
13:13 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/cb774381ab
13:14 lizmat .tell FROGGS .z is now fixed, but .s seems to always return 0
13:14 yoleaux lizmat: I'll pass your message to FROGGS.
13:14 lizmat afk until much later&
13:35 ggoebel111115 joined #perl6
13:36 dmol joined #perl6
13:36 timotimo m: say 1 && 55
13:36 camelia rakudo-moar f538dc: OUTPUT«55␤»
13:37 * masak does a double-take on that, but it's actually correct
13:52 timotimo hoelzro: could you teach the pygments lexer about pod formatting codes inside comments to make them stand out a little bit?
13:52 timotimo https://github.com/perl6/gtk-simple/blob/master/examples/01_hello_world.pm6 - looks much much better in vim
13:54 denis_boyun_ joined #perl6
14:13 anaeem1_ joined #perl6
14:16 dalek gtk-simple: 58d1964 | (Timo Paulssen)++ | examples/02_toggles.pm6:
14:16 dalek gtk-simple: fix example
14:16 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/58d19649bb
14:35 hoelzro timotimo: I could add an option or something
14:36 timotimo an option?
14:36 timotimo it would be nice if it would always work, because i'm not sure if i can convince github to turn on an "option" :)
14:36 hoelzro oh, good point
14:36 hoelzro I'll put it on the TODO list =)
14:47 timotimo thank you :)
14:48 timotimo also
14:48 thou joined #perl6
14:48 * colomon is impressed at how well github is doing at p6 code-formating now...
14:48 timotimo method s() { ... } makes the whole method body look like regex, because it sees the s :)
14:48 timotimo colomon: they just use pygments, which hoelzro patched to have perl6 highlighting
14:48 timotimo hoelzro++ # for syntax highlighting again
14:49 colomon what triggers the p6 highlighting?  is it the .pm6?
14:50 FROGGS[mobile] joined #perl6
14:56 FROGGS[mobile] thanks for fixing. z
14:57 FROGGS[mobile] .z
14:57 FROGGS[mobile] will care about .s in a few hours
15:05 hoelzro colomon: .pm6 will do it, but upstream pygments is more intelligent
15:06 hoelzro also, they have a Bayesian classifier that they never update
15:06 colomon hoelzro: how about use v6 ?
15:06 hoelzro colomon: I do
15:06 hoelzro https://github.com/github/linguist/pull/900
15:06 hoelzro open for 4 months =/
15:07 hoelzro https://bitbucket.org/birkenfeld/pygments-main/src/2ba9b53c87eeed24f7c5d2895ca27e637bca40a1/pygments/lexers/agile.py?at=default#cl-2321
15:07 hoelzro that's the Python code for guessing whether or not it's Perl 6
15:08 colomon hoelzro: use v6 needs to be the first non-comment text in the file?  I think that's how I do it...
15:10 hoelzro either use v6, or a class/module/role/grammar decl
15:10 guru joined #perl6
15:10 hoelzro it's pretty reliable, and it's following S02
15:11 dj_goku timotimo: so a few weeks back I tried I think r * but was getting heap space/out of memory. you were right but didn't find the right make file until search today rakudo/nqp/tools/build/Makefile-JVM.in
15:12 dj_goku I wonder if the readme.md is out of date where it says to update the runner (nqp-j)
15:22 BenGoldberg joined #perl6
15:34 moritz or try the moarvm backend, it needs far less memory
15:39 thou joined #perl6
16:00 erdic joined #perl6
16:01 jercos joined #perl6
16:01 bjz joined #perl6
16:06 Ben_Goldberg joined #perl6
16:26 molaf joined #perl6
16:27 hummeleBop joined #perl6
16:35 FROGGS[mobile] m: say $*EXECUTABLE.IO.s
16:35 camelia rakudo-moar cb7743: OUTPUT«True␤»
16:36 FROGGS[mobile] O.o
16:40 timotimo dj_goku: you can also directly change the Makefile
16:41 timotimo dj_goku: and i'm not sure what you mean with "update the runner"
16:42 dj_goku in the readme it talks about updating nqp-j if you get outofmemory errors
16:42 dj_goku https://github.com/rakudo/rakudo/blob/c1bd7133350eaf9934765bef6d6eb109f2b6240b/README.md#configuring-rakudo-to-run-on-the-jvm
16:48 virtualsue joined #perl6
16:59 timotimo yay for the nlpw recording of jnthn's talk <3
17:01 colomon indeed
17:03 moritz URL?
17:04 moritz http://www.infoq.com/presentations/invokedynamic # also by jnthn++, about JVM's invokedynamic
17:04 timotimo https://www.youtube.com/watch?v=JROvKKei4u8&amp;feature=youtu.be
17:04 timotimo sadly, i cannot watch that presentation on my linux machines :(
17:07 colomon oh, wait, I was thinking of the invokedynamic talk.  :)
17:08 masak hi #perl6.
17:08 masak today, I'm thinking of stories as software abstractions.
17:08 timotimo i'd like to see that one, too
17:09 masak it seems to me that a lot of what we're just starting to do with promises and reactive programming as an industry, has as its logical endpoint the concept of workflows, or stories.
17:09 masak BDD people talk of "user stories". maybe we should reify them more in our programs.
17:10 moritz timotimo: works fine with firefox on linux for me (with js enabled)
17:10 masak couldn't for example a web app be designed and implemented as a set of flows through the application, consisting of various screens/views and actions taken in those? I guess the notion of "wizards" captures that, but it's a bit linear.
17:11 masak sad paths kind of "hook into" the main happy path in different places.
17:11 guru joined #perl6
17:12 moritz masak: sounds like state machines rediscovered :-)
17:12 moritz flows/stories sound like paths through a state machine
17:12 masak moritz: well, people talk a lot about "callback hell" these days. it's the unfortunate state that many frameworks want to abstract you from.
17:13 masak moritz: and yes, what I'm suggesting is close to the CPS transform approach, which does turn your program into a state machine.
17:13 timotimo moritz: what plugin handles the video for you?
17:13 masak (and yes, this could probably be *implemented* as a state machine)
17:13 moritz timotimo: dunno, how can I tell?
17:13 timotimo all i get is the "play" icon in a plugin box and nothing happens when i click play
17:13 timotimo good question
17:14 timotimo about:plugins?
17:14 masak but what I'm suggesting shouldn't look like a state machine implementation, because then the point is lost. it should look like a linear flow of things that happen in the application.
17:14 timotimo maybe right-clicking it will give a hint?
17:14 timotimo haha
17:14 moritz timotimo: do you have flash installed?
17:15 vendethiel "callback hell" is an implemention issue
17:15 masak maybe a good way to phrase it is this: Rails suggests to treat models, views and controllers as first-class entities. I suggest to treat stories as first-class entity, and have models, views, etc, hang off of a story.
17:15 moritz application/x-shockwave-flash
17:15 timotimo huh? really?
17:15 timotimo it seems to have started a gnome medial player thingie in there
17:15 masak vendethiel: that's like saying "scaling problems" are an implementation issue :P
17:16 vendethiel masak: no, not really. You can reason about scaling problems
17:16 timotimo in chrome it starts a flash player
17:16 vendethiel callback hell is just a style problem
17:16 masak vendethiel: it's not that it's false, it's just not a very prescriptive statement.
17:16 timotimo then it just shows a white box
17:16 timotimo "movie not loaded..."
17:16 vendethiel masak: I'm just saying that "callback hell" is pretty irrelevant
17:17 moritz masak: my problem with "stories" is that they sounds very linear, and linear only covers the most common case
17:17 vendethiel just get better tools
17:17 timotimo ah, in chrome in an incognito window it works!
17:18 moritz R* JVM module precompilation fails for JSON::RPC::Clinet :(
17:18 moritz http://perlpunks.de/paste/show/5380d464.7e2c.25e
17:18 timotimo i really should dig deeper into how the pyside thing works so that we could have a perl6 qt binding
17:18 moritz I guess that means that LWP::Simple precomp also failed, but I don't have that in my backlog
17:23 denis_boyun joined #perl6
17:37 moritz and rakudo-m precomp of LWP::Simple hangs
17:39 virtualsue joined #perl6
17:40 virtualsue o/
17:40 moritz \o virtualsue
17:41 moritz and JSON::RPC::Client precomp also hangs on rakudo-m
17:41 moritz this is going to be lots of work, or a very sad star release
17:42 timotimo oh crap.
17:45 itz joined #perl6
17:54 colomon reactive programming talk was great.
17:54 colomon jnthn++
17:55 Ben_Goldberg joined #perl6
17:59 timotimo agreed
18:16 masak vendethiel: "just get better tools" seems to occupy much of the industry right now. I find your dismissiveness of the problem unhelpful.
18:16 masak moritz: yes, me too. though I think of it as the trunk being linear, and the non-linearity being added in from the outside.
18:17 vendethiel masak: there are two problems. But for the style issue, really, there's not much more to that
18:17 masak moritz: compare aspect-oriented programming (with interesting concerns being added in through cutpoints) and literate programming (with the main loop being explained first, and details filled in piecewise)
18:17 vendethiel masak: for nodejs people, it's basically "it's getting hard to read". I created or contributed several alternatives because I disliked it too
18:18 masak vendethiel: I consider the style issue a fairly minor part of it. having many small disconnected functions on the same indentation level calling each other is just as bad, in my opinion.
18:19 vendethiel masak: not indenting your functions (which is not something requiring any tool) is not a suggestion I have either
18:20 vendethiel generators are another solution, for JS land, and a very good one iomho
18:20 vendethiel (well, much better to pyramid code or non-indented code :).)
18:23 * vendethiel just realized perl6's a.&b is like C++'s a.*b
18:24 masak yes, generators are powerful enough to support the kind of story-based programming I'm thinking of.
18:24 vendethiel masak: that asks for a PoC of how a story would look like - I have a hard time grasping that, no prior experience
18:25 masak I'll try to put together a proof-of-concept.
18:25 masak it's not completely clear to me either at this point.
18:26 * vendethiel usually likes discussing seeing how something would look like
18:27 vendethiel (that's probably my not-academic side speaking here)
18:27 masak m: class C { has $.x = "functions"; has $.y = "concept" }; { sub neat($self) { say "yes, adding lexically scoped $self.x() and then using them as methods is a very powerful $self.y()!" }; C.new.&neat }
18:27 camelia rakudo-moar cb7743: OUTPUT«yes, adding lexically scoped functions and then using them as methods is a very powerful concept!␤»
18:28 masak vendethiel: no, I'm the same. I want to discuss things around a concrete example.
18:28 vendethiel masak: :), :)
18:28 anaeem1 joined #perl6
18:33 denis_boyun joined #perl6
18:38 anaeem1 joined #perl6
18:40 cooper joined #perl6
18:40 cooper joined #perl6
18:53 timotimo now seems like a decent time to start work on a cairo binding
18:54 masak vendethiel: ended up writing this for stories: https://gist.github.com/masak/c3a638aa9eed83c1bf26
18:55 masak vendethiel: it's kind of rough, but should give an idea of what I'm envisioning.
18:55 vendethiel masak: reminds of cucumber testing :)
18:56 vendethiel I'm really not a fan of natural language programming
18:56 vendethiel (for I think they're bad :P)
18:59 masak same.
18:59 masak that's not my point.
18:59 masak it's just that I don't have a real syntax for this.
19:00 vendethiel masak: do you know cucumber ?
19:00 masak yeah, and I have the same objections to it as you seem to.
19:00 masak I would prefer my example to be much closer to method calls than it currently is.
19:00 moritz I think masak++ uses natural language as an example, but the "real thing" would probably be ordinary method calls, or so
19:00 masak *nod*
19:01 * moritz feels a tiny bit creepy right now
19:01 masak :)
19:01 masak the main point is that a story is a sequence that threads together the actions of a user, an app and an outside environment.
19:01 masak hm, I think that's a nice way to put it, actually.
19:01 raiph joined #perl6
19:01 masak it's like in a two player game of chance.
19:01 vendethiel masak: what feels weird is that you're mixing what the app does and what the user does
19:02 masak actions are threaded together by two players and the dice.
19:02 vendethiel which seems to be what you want
19:02 masak vendethiel: that's the whole point.
19:02 vendethiel that doesn't seem very natural to reason about
19:02 masak creating a "dialogue" between those two. three, really.
19:02 vendethiel I wonder if there's literature about mixing both of these styles (push & pull)
19:02 masak well, how natural it turns out to be is what I'm really wondering.
19:02 vendethiel how hard can it be to reason about ?
19:02 masak vendethiel: Python generators mix push and pull. so it does happen.
19:03 vendethiel masak: I didn't mean in that sense
19:03 masak vendethiel: basically giving you something that's both an iterator and an observer at the same time.
19:03 masak I know it's a difference of scale.
19:03 masak but really, an application is both push and pull, too.
19:03 vendethiel outside of scale, it's just in your code
19:04 masak what I mean to capture is something like (a) human brains are good at stories, and (b) in most application code, the story aspect is lost or never even considered.
19:04 vendethiel you don't have any IO (where IO being interaction) with generators
19:06 masak you mean except in Python's implementation of generators, or...?
19:06 vendethiel well, generators might be push and pull
19:07 vendethiel but with you're stories, as you said, you have 3 things, the app, the user, and the actions
19:07 masak s/actions/outside world/
19:07 masak such as "server was unreachable"
19:07 hoverboard joined #perl6
19:08 masak I guess the relationship is really user <--> app <--> world
19:08 vendethiel masak: "user clicks on 'DONE'" <- which part is that ?
19:09 vendethiel user seems logical
19:09 masak yes.
19:09 timotimo m: enum Foobar <<:hello(-1) goodbye howareyou>>; say hello; say goodbye;
19:09 camelia rakudo-moar cb7743: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/vTv4XjXyGXâ�¤Undeclared routine:â�¤    goodbye used at line 1â�¤â�¤Â»
19:10 timotimo m: enum Foobar (:hello(-1), "goodbye", "howareyou"); say hello; say goodbye;
19:10 camelia rakudo-moar cb7743: OUTPUT«hello␤goodbye␤»
19:10 timotimo m: enum Foobar (:hello(-1), "goodbye", "howareyou"); say +hello; say +goodbye;
19:10 camelia rakudo-moar cb7743: OUTPUT«-1␤0␤»
19:10 timotimo mhm
19:10 masak timotimo: first one should work, no?
19:11 raiph masak: have you explored seaside's web site/ui flow control mechanisms?
19:11 masak raiph: no! but clearly, I should.
19:11 masak raiph: I've only been vaguely aware of seaside.
19:11 timotimo masak: according to specs, yes
19:12 timotimo masak: nagare is similar, but in python if you prefer to look at something written in python instead
19:12 masak raiph: I'm a bit wary of doing everything through continuations, though. it has... drawbacks.
19:12 masak timotimo: thank you.
19:18 raiph masak: I just recalled the continuations stuff from way back when and thought it might be interesting to at least research how it's panned out
19:18 timotimo so ... which type most closely matches a "binary blob of data i could feed to cairo to use as raw pixel data"? is that a Blob?
19:19 masak timotimo: think so.
19:19 masak m: Blob; say "alive"
19:19 camelia rakudo-moar cb7743: OUTPUT«alive␤»
19:20 masak timotimo: a Blob is an immutable Buf.
19:20 raiph masak: seaside's use of callbacks: http://www.seaside.st/documentation/call-and-answer
19:21 * masak looks
19:22 masak by the way, my thoughts today about stories may have been triggered by some ideas sjn++ had once that he told me about. I'm not sure exactly how close his idea was to mine, but I think it may have inspired mine.
19:22 thundergnat left #perl6
19:23 masak now that I think about it, I think a story-based layout of a program can be achieved with today's technology; maybe using promises, for example.
19:23 timotimo are our bufs mutable by now? >_>
19:24 masak m: my $buf = Buf.new(1, 2, 3); $buf[1] = 42; say $buf
19:24 camelia rakudo-moar cb7743: OUTPUT«Cannot modify an immutable Int␤  in method assign_pos at src/gen/m-CORE.setting:1794␤  in sub postcircumfix:<[ ]> at src/gen/m-CORE.setting:2494␤  in block  at /tmp/AEiET9agY6:1␤␤»
19:24 masak no :/
19:25 timotimo mumble mumble
19:27 Vlavv joined #perl6
19:28 timotimo say False ~~ Cool
19:28 timotimo m: say False ~~ Cool
19:28 camelia rakudo-moar cb7743: OUTPUT«True␤»
19:28 timotimo something cool about having a parameter "Cool $stride"
19:32 FROGGS joined #perl6
19:35 itz joined #perl6
19:38 bjz joined #perl6
19:49 timotimo when i return a failure from a sub and the result isn't caught, it gets sunk and the exception gets thrown, right?
19:50 timotimo m: sub tias { return Failure.new("omg") }; say "before"; tias; say "after"
19:50 camelia rakudo-moar cb7743: OUTPUT«before␤No such method 'throw' for invocant of type 'Str'␤  in method sink at src/gen/m-CORE.setting:12841␤  in block  at /tmp/0jx2Eq1BCq:1␤␤»
19:50 timotimo m: sub tias { fail "omg" }; say "before"; tias; say "after"
19:50 camelia rakudo-moar cb7743: OUTPUT«before␤===SORRY!===␤omg␤»
19:50 timotimo excellent
19:50 timotimo (lack of stack trace: not so excellent
19:50 timotimo but we'll get there)
19:55 hoverboard joined #perl6
19:58 japhb joined #perl6
20:03 timotimo m: enum Foo::Bar <hello goodbye>; say hello;
20:03 camelia rakudo-moar cb7743: OUTPUT«hello␤»
20:06 timotimo hooray, a black square png file
20:11 dalek rakudo/nom: dca1724 | (Tobias Leich)++ | src/core/IO.pm:
20:11 dalek rakudo/nom: fix copy&pasto about .IO.s and .IO.z
20:11 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/dca17244e3
20:12 timotimo duh! i could have spotted that! :D
20:12 timotimo FROGGS++ # good optimization
20:13 timotimo this ought to shave off a bunch of time for directory.contents, right?
20:13 FROGGS yeah
20:13 yoleaux 11:52Z <lizmat> FROGGS: looks like your changes break t/spec/S16-filehandles/filetest.t , at least on moar
20:13 yoleaux 11:54Z <lizmat> FROGGS: "doesnotexist.t".IO ~~ :z    dies rather than returning False
20:13 yoleaux 12:02Z <timotimo> FROGGS: other than the failures, good eye for optimization, those 40% will really mean a lot
20:13 yoleaux 13:14Z <lizmat> FROGGS: .z is now fixed, but .s seems to always return 0
20:13 FROGGS still, 1m11s to run Build clean is kinda too much :/
20:13 FROGGS lizmat++ # btw
20:14 timotimo "Build clean"?
20:14 timotimo i don't know what that refers to
20:16 timotimo how do i set a private attribute of a foreign object that's of "my" class again?
20:16 timotimo neither $other!attribute = nor $other!$attribute = seem to work
20:17 vendethiel timotimo: (you don't ! or you write a setter)
20:18 vendethiel (that's a terrible feature of c++, btw ...)
20:20 timotimo this is for my "new" method >_>
20:20 araujo joined #perl6
20:21 timotimo well, now i have a BUILD instead.
20:21 FROGGS timotimo: it is supposed to remove all *.moarvm from v5/*
20:21 FROGGS but right now it just was all dirs/files
20:21 timotimo ah
20:21 timotimo yeah, that's not so nice :(
20:21 FROGGS and that takes 1m11s, without actually deleting a file
20:22 vendethiel timotimo: I don't think you should be able to specify it from outside of bless() :/
20:22 timotimo i wonder how much time we pay for doing the $test thingie
20:22 FROGGS timotimo: wouldn't nqp::bindattr do the trick?
20:22 timotimo the none(".", "..")
20:22 FROGGS I dunno
20:22 timotimo FROGGS: that's not Perl 6 :)
20:23 FROGGS I know :o)
20:59 masak timotimo: you can use a private method.
21:00 prevost joined #perl6
21:01 masak m: class C { has $!priv; method !update-priv($value) { $!priv = $value }; method update($other, $value) { $other!update-priv($value) }; method spill { say $!priv } }; my $x = C.new; my $y = C.new; $x.update($y, 42); $y.spill
21:01 camelia rakudo-moar cb7743: OUTPUT«42␤»
21:01 timotimo :\
21:01 * masak has, over the past year or so, come to the conclusion that private attributes are not worth it
21:02 masak or, to be more exact, that information hiding belongs on an abstraction level that's larger than object/class.
21:02 vendethiel well, private attributes are cool for implementation details
21:03 timotimo mhh
21:04 masak I'm not against privacy as such. but privacy as it's implemented in most languages fails to answer the question "who are we hiding this from?" -- and then you get all these ridiculous hoops you jump through when it turns out you're someone the attributes shouldn't have been hidden from.
21:05 masak case in point: what timotimo just wanted.
21:05 masak my currently favored solution: make everything public by default, greatly simplifying the way objects work. hide stuff on the API level.
21:06 vendethiel my currently favored solution: private is the default. Start with private.
21:06 vendethiel if you need to make something part of the API, make it public.
21:06 masak that's the way Perl 6 does it.
21:06 vendethiel how so ?
21:06 masak $!x is the default.
21:06 vendethiel how is it the "default"?
21:06 masak if you want to expose it, you do $.x or you add a method.
21:07 vendethiel yeah, so I don't see how it's a "default". You don't need to *add* something to make it public
21:07 masak it's the default because $.x is $!x plus an auto-generated accessor.
21:07 masak it's the default because the MOP only ever talks about $!x
21:07 vendethiel but that's irrelevant to the code I type
21:07 vendethiel if I type $.a or $!a it's the same amount of code
21:07 masak it's the default because $!x is the actual storage location, and $.x is something that uses $!x
21:07 vendethiel one is not "the other + something else" in terms of code
21:08 vendethiel yeah I agree, but for me a default is a derived case, so syntactically it has to be based on the previous case
21:08 masak it's the default because community best practices advise (or should advise) to create a $!x unless you already know you need a $.x
21:09 masak the interesting thing from a historical perspective is that we arrived at this set of features gradually, over the years.
21:09 vendethiel then we disagree on what "default" is, I don't include "community best practices" here
21:09 timotimo a white square on black background \o/
21:09 masak well, I listed all the ways I could think of that a thing like this could be the default.
21:09 masak oh, and maybe one more: if you write 'has $x' for some reason, you get 'has $!x'
21:10 vendethiel masak: this one is correct !
21:10 masak heh.
21:10 vendethiel that does seem like a default, definitely
21:10 masak but don't do that.
21:18 timotimo now that i can fill & stroke colored rectangles and write them out to png, i should release the first "version" of Cairo
21:24 masak timotimo++
21:24 dalek ecosystem: fd5edb0 | (Timo Paulssen)++ | META.list:
21:24 dalek ecosystem: add GTK::Simple and Cairo to ecosystem
21:24 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/fd5edb01f3
21:24 masak interesting post about why scaling kindness is difficult: http://rs.io/2014/02/26/why-online-communities-decay-over-time.html
21:52 timotimo i'm not sure how to handle this:
21:52 timotimo i have a package GTK::Simple and a package Cairo
21:53 timotimo in GTK::Simple, i'll have a GtkDrawingArea that has a method that'll be called with a Cairo context
21:53 timotimo which is just class cairo_t is repr('CPointer')
21:53 timotimo how do i manage this without explicitly pulling in Cairo as a dependency? :\
21:54 timotimo if i have a second class cairo_t is repr('CPointer'), would that be accepted in these methods?
21:55 kurahaupo joined #perl6
22:00 sjn masak: stories?
22:01 Ben_Goldberg joined #perl6
22:04 vendethiel masak: I don't know, I don't manage so big communities
22:04 vendethiel masak: is there an issue with the perl 6 community ;) ?
22:06 volodin661 joined #perl6
22:06 masak sjn: something about journalistic aspects of programming.
22:06 masak sjn: about a year ago or so.
22:07 masak vendethiel: decidedly not. but I'm pre-emptively learning about the scaling properties of communities.
22:07 volodin661 perl6: @aaa=8,78,9,0,6; say min @aaa;
22:07 masak vendethiel: so far what I've got is basically "seeding the community with the right stuff is extremely important -- but there is only so much you can do after certain tipping points"
22:07 camelia rakudo-{parrot,jvm,moar} dca172: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/tmpfileâ�¤Variable '@aaa' is not declaredâ�¤at /tmp/tmpfile:1â�¤------> [32m@aaa[33mâ��[31m=8,78,9,0,6; say min @aaa;[0mâ�¤    expecting any of:â�¤        postfixâ�¤Â»
22:07 camelia ..niecza v24-109-g48a8de3: OUTPUT«[31m===[0mSORRY![31m===[0m��Variable @aaa is not predeclared at /tmp/tmpfile line 1:�------> [32m<BOL>[33m�[31m@aaa=8,78,9,0,6; say min @aaa;[0m��Variable @aaa is not predeclared at /tmp/tmpfile line 1:�------> [32m@aaa=8,78,9,0…»
22:08 masak volodin661: 'my @aaa'
22:08 vendethiel volodin661: missing that `my`
22:08 volodin661 my @aaa=1,4,5,68,0,9; say min @aaa;
22:08 vendethiel volodin661: also, if you're not interested in comparing implementations, I'd suggest using `m:` (for rakudo-moar)
22:08 vendethiel masak: mmh, I don't know
22:09 Sqirrel joined #perl6
22:09 vendethiel masak: I actually think youtube is a great community for its size, you just have to know where to look for
22:09 sjn masak: ah, yes
22:09 vendethiel which is what the article is saying with "get smaller subreddits", i guess
22:10 sjn more than a year ago; I pitched it first at a Perl 6 hackathon in Oslo :)
22:10 sjn think it was in 2011
22:10 raiph joined #perl6
22:10 sjn masak: "Journo-literary programming" :)
22:11 masak sjn: ah, yes.
22:11 vendethiel masak: even only on github, I find stupid people and I get insulted :'(.
22:11 sjn crazy ideas
22:11 vendethiel (well, I'm *very* active on github, so that's probably not the average, but it still is bad enough when you're trying to help)
22:11 masak sjn: I like the intersection between literature/prose and programming. it makes a lot of sense.
22:12 vendethiel ^ +1
22:12 vendethiel masak: maybe you need to fragment your community to keep it heartful ?
22:13 masak vendethiel: well, programming languages sorta-kind have that, with modules and frameworks and stuff.
22:13 vendethiel masak: yeah, definitely.
22:13 masak (aka "#moose and #catalyst are very friendly channels, too")
22:13 masak but I'm not sure that leaves much hope for things like #perl or #perl-help
22:14 vendethiel I think you really ought to be strict in the beginning.
22:14 vendethiel Don't leave people be anonymous. Don't leave them starting on a wrong path, either...
22:14 vendethiel That's tremendously hard. No idea how to do it properly, and nobody else seems to know either ...
22:15 masak that's why community crafting is interesting. it's still very much experimentation and exploration.
22:15 vendethiel oh, definitely.
22:15 ren1us joined #perl6
22:16 vendethiel masak: I'm on a lot of (node) JS repos on github, and even if I'm not contributing, I always try to help where I can, but sometimes people just can't be dealt with : http://i.imgur.com/hJcSb4Y.png
22:16 ren1us When Rakudo tells me that "Slurpy positionals with type constraints are not supported," is that really saying that they are not supported YET or just plain not supported?
22:16 vendethiel ren1us: if it says sorry, then it's a "not yet" :P
22:17 ren1us Awesomeness.
22:18 vendethiel masak: I think programming is pretty okay in general
22:18 vendethiel masak: (except for hacker news. I hate it)
22:18 masak vendethiel: written discussions on the internet between people who have never met is risky. it's all too easy to assume bad intent even on something that isn't badly meant.
22:19 masak escalating things pretty quickly most of the time.
22:19 vendethiel masak: yeah, and even worse, not everybody speaks correct english
22:19 masak I bet it's something about "I've never met this person, how dare they speak to me like that"
22:19 vendethiel I'm french, pretty young, and when I read what I wrote back in 2008, it was pretty horrible, and I could not convey the point clearly
22:19 masak :)
22:19 masak we're all on some Path or other...
22:19 vendethiel so it's even easier to misunderstand somebody when they're not native
22:20 masak aye.
22:20 vendethiel and that's why I use a *lot* of smileys. I know some people look down on it like "kiddo", but I really think it's important
22:20 masak sometimes, yes.
22:20 masak that's why they were invented, after all.
22:21 vendethiel .oO( Emoji driven community )
22:23 vendethiel masak: on coffeescript/#coffeescript, we sometimes have people that are pretty hard to deal with, but they're mostly "jelly trolls" :P
22:23 vendethiel like #perl6 has pseudo-elitist-perlists, we have pseudo-elitists-jsers
22:24 masak (╯°□°)╯︵ ┻━┻
22:24 masak ┬──┬ ¯\_(ツ)
22:24 vendethiel hehehe
22:25 masak vendethiel: have you been here long enough to have experienced the "hugging trolls" effect?
22:25 masak oh, you know au, so yes.
22:25 vendethiel ha
22:25 vendethiel masak: oh, yeah, I have. I just respond normally. Just answer seriously to their trolling, or to the little serious part :-)
22:26 masak I answer seriously to everything.
22:26 vendethiel masak: have you read that ? https://gist.github.com/quchen/5280339 #haskell hugging trolls.
22:26 masak I have :)
22:26 masak it's a good example :)
22:26 BenGoldberg . o O (National give a troll a hug day)
22:27 vendethiel I especially like " Iceland_jack   . o O ( feels like Haskellers would invite Jehova's witnesses in for tea just to proselatize Haskell to them )"
22:29 Ben_Goldberg joined #perl6
22:30 raiph masak: "Online communities are just like vampire bats sharing blood"
22:30 masak fsvo "just like"
22:31 masak but yeah, I noticed that one too :P
22:31 masak I guess the important point was the prisoner's dilemma stuff
22:34 Sqirrel joined #perl6
22:34 Psyche^ joined #perl6
22:36 vendethiel masak: I don't know. You're certainly not caring about people you're not gonna see again, but then ...
22:36 vendethiel This is something we should/could fix, isn't it ?
22:39 raiph masak: "There’s no incentive not to defect [at] the end of [a] relationship,. ... That’s what happens in large internet communities. ... I have no real incentive to be polite or to put much effort into anything I say. Even my reputation will remain intact – who’s going to witness it?" seems off to me, to put it mildly
22:39 raiph -
22:41 vendethiel raiph: why so ? That's what happens, though, no question : people don't care because nothing is going to happen next.
22:41 vendethiel Even when youtube integrated G+ comments, at first, people expected the interaction to be friendlier since people had their name on public display etc ... but no
22:43 masak well, the prisoner's dilemma thing has a ring of truth to it. but it's certainly not the whole story.
22:43 raiph my quibble is with the last bit -- "who's going to witness it?"
22:43 masak the "people tend to read you the wrong way and respond defensively or aggressively" thing mentioned above also explains some things.
22:43 masak raiph: yeah.
22:44 vendethiel raiph: can you explain why you disagree ?
22:44 masak raiph: one thing I've learned that seems to work well in online games is to make people invest time and energy in their character. after that, banning them carries an actual cost; the loss of that investment.
22:45 masak which I guess translates to helping people contribute usefully somehow to a language community, so that they won't go burn up that investment.
22:45 vendethiel masak: I've seen a lot of stuff. But usually, you really have to go far to get somebody banned out of a game, even for 3 hours
22:45 vendethiel masak: other games try to have player judge other players, and it just doesn't work :(
22:45 raiph i think the game theory view is spot on
23:01 Sqirrel joined #perl6
23:06 ren1us vendethiel: I think the inherent problem with player judges is that it assumes that the average person is going to be fair.  In reality, the average person, given anonymity, will usually try to unleash their inner badness.  Even if the person being judged is a great guy, given the opportunity, people will choose anonymous cruelty.
23:07 ren1us It's cathartic.
23:07 vendethiel ren1us: I think "inner badness" is a pretty bad way to consider it; they'll just take the time to feel powerful
23:07 vendethiel I agree that it's cathartic tho
23:10 ren1us I have a nasty theory that when decent players just stomp all over weaker or less experienced players, it traces to insecurity.  I think that it's especially true if someone feels the need to use mods or hacks to "win".  Sure, maybe you smashed someone's pixels, but what is there to be gained from it that's worth going to the time, effort, and desperation of cheating?
23:11 ren1us I think it's because people have a need to feel validated somehow, and unfortunately, that need can appear to be fulfilled by somehow "beating" someone in a game.  The resulting flame wars and trolling are just trying to milk that validation of worth.
23:12 vendethiel ren1us: the idea of "triumph without peril brings no glory" is not new :)
23:12 ren1us But the problem I often see whenever I'm playing games online is, people will seek out the triumphs that require no peril, then claim glory.
23:13 vendethiel ren1us: but what people show and what they really feel happens to be very different
23:13 vendethiel well, later, because for 12 years old, it's the same
23:15 ren1us And that's part of a bigger concern, then.  If all of these people are desperate for that validation/glory, and they act like they've achieved glory, but they still feel that emptiness, then the need can build up and lead to more and more misbehavior, among other things
23:16 ren1us And in some cases, when violence in a game just isn't giving the required fulfillment, people may try a more... realistic attempt?
23:16 vendethiel ren1us: and then the bigger concern is why society makes us feel like we need to be validated
23:16 vendethiel etc, etc, that's going a bit too OT anyway :)
23:17 vendethiel ren1us: no, definitely not. I won't leave anybody say "violence in a game can lead to violence IRL"
23:19 masak well, it's kind of fascinating how few hard facts we still have about how best to (a) learn, and (b) form groups where the sum is somehow better than its parts.
23:20 ren1us vendethiel: Oh I didn't mean it like that.  In fact, I think that having a game to act as another outlet reduces violent tendencies, for the most part.  I do, however, think that regardless of the original medium, if someone's attempts to be validated continue to fail (ie: If they get no positive reinforcement for hard work at a job), it has the tendency to cause a more drastic attempt.
23:20 vendethiel ren1us: I disagree, strongly.
23:20 vendethiel ren1us: as I've seen (and I've managed game servers with 2 to 10k concurrent players); if people can't get validated by their plays, they'll just pretend.
23:21 vendethiel They'll pretend, they'll taunt other people by pretending they know everything, and they'll get happy off that
23:22 vendethiel (that's really my only experience with that bigcommunities, and players are the worst kind to handle imho ...)
23:24 ren1us vendethiel: I've always found that, if someone doesn't really get the reaction they've been pursuing, they have a tendency to try harder and harder to get that reaction.  Like, if someone PKs another player, and nothing happens, they'll then try to PK more players, or PK people who are doing more important/difficult things, ie making themselves more and more of a nuisance until they get a reaction
23:24 ren1us to validate that they're having an effect
23:24 vendethiel yeah, but that's on the same scale
23:24 ren1us I also find that any time I need to reaffirm my distaste for people, all I need to do is play a game with a small community and a pvp aspect.  Works every time.
23:34 masak ren1us: "the definition of insanity is trying the same thing again and expecting a different result" -- by what you're saying (and much of my experience), it's not just the definition of insanity, it's pretty standard behavior.
23:40 * masak stops trying to stay awake :)
23:40 masak 'night, #perl6
23:41 vendethiel 'night :)
23:50 timotimo gnite
23:53 BenGoldberg joined #perl6
23:58 woolfy joined #perl6

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

Perl 6 | Reference Documentation | Rakudo