»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
00:00 vendethiel joined 00:01 PZt left 00:02 Ugator left, jack_rabbit joined 00:11 vendethiel left
tony-o TimToady: me? 00:11
00:14 ptc_p61 left 00:20 gfldex left 00:25 slavik joined 00:30 grettis_ left 00:35 jack_rabbit left
TimToady wasn't referring to you :) 00:36
tony-o good cause that was lost on me 00:41
00:45 slavik left 00:49 slavik joined 00:54 Mso150 left 00:55 Mso150 joined 01:16 atroxaper joined 01:20 atroxaper left 01:29 Mso150 left, vendethiel joined 01:30 PZt joined
raydiak ponders how many combinations of invalid html dwim, while many combinations of valid css don't dwim 01:31
dalek c: 7788ce7 | raydiak++ | / (2 files):
Fix a couple validation failures
01:52
01:55 Ven joined
Ven hoelzro: not sure how I can the #|{...} value to display of a MAIN? 01:58
02:00 BenGoldberg joined
Ven is there a way to hide a multi MAIN from the list? ha 02:01
hoelzro Ven: sorry, I don't understand 02:10
Ven hoelzro: a MAIN subroutines shows the different "versions" of MAIN. I'm wondering if I can hide some of them from the listing 02:11
hoelzro: Also, I'm trying to print argument help from a MAIN's subroutine 02:14
hoelzro ah ha
well, I think that depends on USAGE, right? 02:15
Ven yes.
02:17 araujo left, rmgk_ joined, rmgk left, rmgk_ is now known as rmgk, araujo joined 02:28 anaeem1 joined 02:30 anaeem1 left 02:46 Ven left 03:03 doublelel joined
JimmyZ why I cannot pass positional args to .new? 03:10
03:14 araujo left
raydiak JimmyZ: because it doesn't know what to do with them, for most of the core classes. you should be able to use them with a .new that actually accepts them though 03:32
m: say Array.new(1, 2, 3).perl 03:33
camelia rakudo-moar deb1e6: OUTPUT«Array.new(1, 2, 3)␤»
03:37 petercom1and left, petercommand joined, petercommand left, petercommand joined
JimmyZ raydiak: I'm now using core class ... 03:39
raydiak JimmyZ: can you show us what is not working with a one-liner here or a gist? 03:41
JimmyZ raydiak: gist.github.com/zhuomingliang/26e3...6848908793 03:43
raydiak design.perl6.org/S12.html#Construct...ialization 03:48
"Other than a list of autovivifying type objects, all arguments to bless must be named arguments, not positional."
so for BUILD also 03:49
so if you want .new to take positionals, you define a .new that accepts positionals and turns them into nameds when calling .bless
JimmyZ oh, I want to avoid nameds completely 03:51
03:51 doublelel left
raydiak you can define your own method new which takes positionals, but in that method, you must call bless with only named arguments 03:52
JimmyZ :(
raydiak m: class Foo { has $.x; has $.y; method new ($x, $y) { self.bless: :$x, :$y } }; say Foo.new(1,2).perl 03:53
camelia rakudo-moar deb1e6: OUTPUT«Foo.new(x => 1, y => 2)␤»
raydiak if you wanted something that looks even more positional, you could make a class which 'does Positional', or inherits from a class which does (e.g. 'class Point is Array' 03:57
03:57 noganex_ joined
raydiak but that's more about being able to subscript it w/[] and so forth, which might not be whaat you're trying to do 03:58
JimmyZ gist.github.com/zhuomingliang/26e3...6848908793 I can't get it work.
04:00 xinming_ joined 04:01 noganex left
raydiak change 'self.bless($!x + $b.x, $!y + $b.y);' to 'self.bless: :x($!x + $b.x), :y($!y + $b.y);' 04:01
04:02 xinming left
JimmyZ got it, bless is slow... 04:04
raydiak yes, that's why it's often a good idea supposed to reuse objects when possible in hot loops like that, instead of creating a new one every time 04:06
04:06 atroxaper joined
raydiak make add a mutator instead of a constructor, it'll probably be much faster 04:07
JimmyZ raydiak: github.com/zhuomingliang/perl6-ben...ss_add2#L7 04:08
raydiak oh it's a benchmark...nevermind then :) 04:09
04:13 atroxaper left 04:18 jack_rabbit joined 04:20 azriel left 04:23 raiph left 04:26 vendethiel left
raydiak wow yeah, bless is slow...making add a mutator takes the time on my machine from 14.4s to 1.4s...so probably way more than 10x the actual runtime 04:39
I guess that means our native types and loops are pretty speedy now 04:40
04:43 vendethiel joined
raydiak wishes spurious creation/destruction in loops like that could be optimized away in simple cases 04:43
04:46 raiph joined 05:06 vendethiel left 05:11 vendethiel joined
raydiak wonders if rakudo couldn't just keep some destroyed objects around for re-use 05:29
05:31 erkan left
raydiak wonders why he didn't write Pray with all this in mind very much, and considers recitfying it 05:33
05:33 vendethiel left 05:34 erkan joined, erkan left, erkan joined 05:35 vendethiel joined 05:38 kaare__ joined 05:55 BenGoldberg left 05:59 atroxaper joined 06:05 atroxaper left 06:06 molaf__ left 06:07 atroxaper joined 06:30 erkan left 06:32 erkan joined, erkan left, erkan joined 06:39 vendethiel left 06:42 vendethiel joined 06:45 rindolf joined 07:00 Alina-malina left 07:01 Alina-malina joined, kaare__ left 07:02 kaare__ joined 07:03 raiph left 07:09 sorear left, sorear joined 07:10 clkao left, Exodist left, Spot__ left, skarn left 07:11 rindolf left 07:12 lizmat left, eternaleye left, jercos left, ecocode`` joined, lizmat joined 07:13 atroxaper left, sjohnson left, atroxaper joined, ecocode` left, Spot__ joined 07:14 jercos joined 07:15 clkao_ joined 07:16 ggherdov left 07:19 Exodist joined 07:20 ggherdov joined 07:25 Sqirrel left, Sqirrel joined, lsm-desktop left
raydiak I can't seem to find any substantial mention of destruction or DESTROY in the spec^Wdesign docs? 07:27
JimmyZ raydiak: could you paste your 1.4s version? 07:29
raydiak okay, better question: is there a way I can make instances of my class do something else when it should get GC'd? 07:30
JimmyZ raydiak: yeah
raydiak JimmyZ: sure, gimme a sec...but it's arguably not a fair comparison for a benchmark, unless the other languages' versions use mutators too
07:31 eternaleye joined
JimmyZ raydiak: yeah I know, I use it for testing 07:31
;)
07:32 eternaleye left, lsm-desktop joined, eternaleye joined
JimmyZ raydiak: submethod DESTROY() 07:33
07:33 skarn joined
raydiak JimmyZ: gist.github.com/raydiak/cab66abb2738be47b2b8 07:33
DESTROY seems to be removed from the syns and referred to as a "fossil" in the commit log 07:34
so idk if I'm supposed to use some sort of meta stuff or what... 07:35
JimmyZ raydiak: It 's useed in the core though 07:36
raydiak JimmyZ: alright thanks, suppose I'll use it and ask around more later about what happened 07:37
07:38 Mso150 joined 07:40 sjohnson joined 07:41 erkan left 07:44 erkan joined, erkan left, erkan joined
moritz \o 07:52
raydiak \o
08:03 dj_goku left, dj_goku_ joined
timotimo can while loops with native number counters die already? for loops are optimized to become that exact thing with an automatically native-or-bigint counter variable anyway 08:05
08:08 vendethiel left 08:11 gfldex joined
timotimo (we have jnthn to thank for that) 08:11
08:16 Ugator joined 08:22 darutoko joined, vendethiel joined
timotimo hmm, FROGGS post is up today 08:22
i hope he's all right
Ugator morning #perl6 (-: 08:23
Im still wondering about the conditional 'andthen' how is this different from a normal concat of commands with ; ? will perl ever execute a next command after the previous failed?
timotimo m: False andthen say "hello" 08:24
camelia rakudo-moar deb1e6: OUTPUT«hello␤»
timotimo m: False andthen say $_
camelia rakudo-moar deb1e6: OUTPUT«Nil␤»
Ugator what does this mean?
08:25 krunen left
timotimo the second output is because something is not yet implemented 08:25
m: Any andthen say "hello"
camelia ( no output )
timotimo m: Any; say "hello"
camelia rakudo-moar deb1e6: OUTPUT«hello␤»
timotimo undefined values count as "fail" for the andthen operator 08:26
Ugator ah, thats the bit I didnt get, thanks (:
timotimo YW :) 08:27
(i had to look at the synopses myself)
OK, i'm going to commute for ~an hour 08:29
o/
[Coke] timotimo: wh...oh, it's 3:35 localtime. 08:35
raydiak [Coke]: no no, *local* time is 0:36 :) 08:36
08:38 telex left
raydiak I only half make sense to even myself...that means local time is...bed. \o 08:39
08:40 telex joined 08:43 vendethiel left 08:47 vendethiel joined 08:48 ptc_p6 joined
moritz it seems that FROGGS++ hasn't written his advent post for today 08:49
I'd like to use tomorrows post by nige++ today, to give him more time 08:50
does that sound sensible?
dalek kudo/nom: b5699e3 | lizmat++ | src/core/Any.pm:
Make .end a multi
08:52
kudo/nom: 23413d3 | lizmat++ | src/core/Cool.pm:
Make .Int a multi
kudo/nom: a00041d | lizmat++ | src/core/ (4 files):
Add types to signature and make multi

Fix several cases where Type.method would give a "cannot access attribute in a type object": should that happen now, it should give you a "cannot find candidate", or should just work.
08:52 ecocode`` left
dalek kudo/nom: c94e169 | moritz++ | src/core/Temporal.pm:
Update synopsis link to design.perl6.org
08:53
08:53 erkan left
: 82e1134 | moritz++ | misc/perl6advent-2014/schedule:
advent: Switch days 20 and 21

the post for 21 is already written, the one planned for 20 not; and today is the 20th
08:55
08:56 erkan joined
moritz .tell nige I've published your advent post (scheduled for tomorrow, 21st) today already, because today's post isn't written yet 08:56
yoleaux moritz: I'll pass your message to nige.
moritz .tell FROGGS I've moved your advent slot from today to tomorrow, to give you another day :-)
yoleaux moritz: I'll pass your message to FROGGS.
moritz vendethiel: are you an advent post for the 22nd? 08:57
vendethiel: *writing 08:59
JimmyZ s/Day 20:/Day 20 -/ ? 09:02
lizmat quip.com/r69HA9GhGa7J # The Theory Of Type Hinting by Guido van Rossum
it explains "gradual typing"
moritz JimmyZ: fixed, thanks 09:03
JimmyZ hmm, i didn't see it get updated 09:04
dalek kudo/newio: 413a2d5 | moritz++ | src/core/Promise.pm:
Make Promise.Bool a multi

otherwise "so Promise" dies
09:05
09:05 dalek left
moritz JimmyZ: oops, seems I forgot to save 09:06
09:06 dalek joined, ChanServ sets mode: +v dalek, molaf joined
moritz lizmat: that theory of type hinting looks thoroughly confusing to me 09:06
lizmat yeah, but that's probably because we don't have the right mindset 09:07
moritz the example is a variable e typed Employee
and it's OK to assign Any to it
but it's not OK to assign a string to it
even though all classes (including String) inherit from Any
and the first rule is 09:08
09:08 FROGGS[mobile] joined
lizmat yeah.... what can I say 09:08
moritz If t1 is a subclass of t2, t1 is also consistent with t2. (But not the other way around.)
lizmat Maybe Any is special ?
moritz lizmat: seems like
lizmat: anyway, thanks for sharing the link
lizmat yw :-)
FROGGS[mobile] is it a problem that my advent post wont be ready before afternoon? 09:09
lizmat FROGGS[mobile]: no, because you have another day 09:10
moritz FROGGS[mobile]: no, because I moved your slot to tommorw
09:10 molaf_ joined
moritz FROGGS[mobile]: and I used the post scheduled for tomorrow (but already written) for today 09:10
09:13 FROGGS joined, molaf left
dalek ast/newio: c8f613e | lizmat++ | S (5 files):
Test changes for newio branch
09:16
lizmat so, the newio branch contains a pretty large number of primitives that are *not* part of the perl6 API 09:17
but are rakudo specific implementation detail
FROGGS \o/
yoleaux 08:56Z <moritz> FROGGS: I've moved your advent slot from today to tomorrow, to give you another day :-)
FROGGS moritz++
lizmat but I would still like to write tests for them directly 09:18
as a sort of sanity test
would it be ok if I put those tests in roast nonetheless?
clearly marking them as rakudo implementation detail ?
JimmyZ wonders what the newio branch changes
lizmat JimmyZ: the API will not change 09:19
things under the hood will
JimmyZ but what changed?
lizmat perhaps the name "newio" was wrong, and "optimizedio" would have been better
IO::Path will basically become a role
anything using a $!PIO will be a consumer of the PIO role 09:20
JimmyZ Is PIO role a API ?
lizmat dir() will (by default) not return IO::Path, but IO::File/Dir/Local objects (which are all consumers of the IO::Path role)
well, a rakudo/nqp specific one 09:21
JimmyZ so it's not API that's in specs?
lizmat nope 09:22
from a spec point of view, the most important difference is that dir() doesn't return IO::Path objects anymore
and .IO returns either a IO::File/Dir/Local or an IOU object
from an API point of view, you shouldn't need to worry: all methods will work (or fail appropriately) on all objects 09:24
you could argue that the new IOU is the old, unopened IO::Handle object
goals are: better code maintainabiility (all backend specific code in one place) 09:25
e.g. all dir() like applications now use an internal sub that is implemented differently for each backend
instead of having conditional code sprinkled around 09:26
the main reason I didn't merge newio yet, is that it still not spectest clean
and it still breaks panda :-(
and we can't have that now, can we :-) 09:27
JimmyZ cares more speed :P
lizmat JimmyZ: that's also happening :-)
JimmyZ parrot was 'refactor and refactor and slower and slower' :P 09:28
lizmat eh.... if it's slower, than I did something wrong 09:29
if anything, I'm trying to rewrite the code in such a way, that it is easier optimizable and inlineable 09:30
09:32 vendethiel left, Isp-sec joined 09:34 spider-mario joined 09:36 erkan left
dsm what is FILETEST-S? 09:37
09:37 vendethiel joined 09:39 erkan joined, anaeem1 joined
lizmat it returns the size of a file (given by an absolute path) in number of bytes 09:39
m: say FILETEST-S('/home/camelia/evalbot')
camelia rakudo-moar c94e16: OUTPUT«4096␤»
lizmat it's supposed to be an implementation specific thing
m: say 'evalbot'.IO.s 09:40
camelia rakudo-moar c94e16: OUTPUT«'evalbot' is not a regular file while trying to do '.s'␤ in method gist at src/gen/m-CORE.setting:13839␤ in sub say at src/gen/m-CORE.setting:16597␤ in block <unit> at /tmp/wcNZHEDkZW:1␤␤»
dsm is FILETEST-S function a part of NQP?
lizmat you could consider it to be that, yes
[Coke] imo, rakudo impl details should be tested in 'test', not 'spectest'
lizmat m: say 'test'.IO.s
camelia rakudo-moar c94e16: OUTPUT«0␤» 09:41
dsm is it a bad practice to use NQP functions directly in Perl 6 applcation? 09:42
lizmat I would say: yes
[Coke]: but in sanity test, I cannot use Test.pm :-( 09:44
moritz lizmat: maybe add a new test directory in rakudo that can use Test.pm?
lizmat ah, I see that 99-test-basic uses Test.pm 09:45
well, I guess to test Test.pm
so I guess I should be ok in using Test.pm after that has been tested ?? 09:46
moritz lizmat: yes 09:47
lizmat: also the days are over where loading a module was a very fragile thing, and often broke
(I hope :-)
lizmat I hope so too, but seeing panda break in mysterious ways, makes me a little bit weary :-) 09:48
dalek kudo/newio: d1b5249 | lizmat++ | src/core/IO.pm:
Add missing filetest primitives for consistency
09:49 anaeem1 left
dalek kudo/newio: b7e8ba5 | lizmat++ | t/01-sanity/ (2 files):
Rename "last" test file for post Test.pm tests
09:50
09:50 rindolf joined 09:58 rurban joined 10:01 vendethiel left, vendethiel joined
dalek kudo/newio: 9eba6f1 | lizmat++ | t/01-sanity/filetests/r (4 files):
Add some empty files for filetests
10:02
lizmat errands& 10:15
10:18 atroxaper left 10:19 isBEKaml joined 10:23 atroxaper joined
dsm m: use HTTP::UserAgent :simple; get("www.cool-proxy.net/proxies/http_pro...t/page:1") 10:25
camelia rakudo-moar c94e16: OUTPUT«===SORRY!===␤Could not find HTTP::UserAgent in any of: /home/camelia/rakudo-inst-1/languages/perl6/lib, /home/camelia/rakudo-inst-1/languages/perl6␤»
10:25 vendethiel left 10:27 vendethiel joined, atroxaper left
dsm can someone explain this? pastebin.com/hPvVzZ4Z 10:28
FROGGS star-m: use HTTP::UserAgent :simple; get("www.cool-proxy.net/proxies/http_pro...t/page:1") 10:32
camelia star-m 2014.09: OUTPUT«===SORRY!===␤Could not find HTTP::UserAgent in any of: /home/camelia/star-2014.09/languages/perl6/lib, /home/camelia/star-2014.09/languages/perl6␤»
FROGGS ahh, too old
10:32 anaeem1_ joined
FROGGS star-m: use URI; say URI.new("www.cool-proxy.net/proxies/http_pro...t/page:1") 10:33
camelia star-m 2014.09: OUTPUT«URI.new(grammar => IETF::RFC_Grammar.new(rfc => "rfc3896", grammar => IETF::RFC_Grammar::URI, parse_result => Match.new(orig => "www.cool-proxy.net/proxies/http_pro...t/page:1", from => 0, to => 56, ast => Any, list => ().list, hash => EnumMap.new("U…»
FROGGS star-m: use URI; say URI.new("www.cool-proxy.net/proxies/http_pro...e:1").host
camelia star-m 2014.09: OUTPUT«www.cool-proxy.net␤»
FROGGS star-m: use URI; say URI.new("www.cool-proxy.net/proxies/http_pro...e:1").port 10:34
camelia star-m 2014.09: OUTPUT«80␤»
FROGGS star-m: use URI; say URI.new("www.cool-proxy.net/proxies/http_pro...e:1").path
camelia star-m 2014.09: OUTPUT«/proxies/http_proxy_list/page:1␤»
10:35 anaeem1_ left
FROGGS dsm: I guess that code thinks the :1 is the port: github.com/sergot/http-useragent/b...t.pm6#L239 10:36
dsm: try page:80
dsm: and the fix would be to let HTTP::UserAgent use URI
sergot: ^^
10:36 smls joined
smls S17: «The anyof combinator creates a Promise that is kept whenever any of the specified Promises are kept. If the first promise to produce a result is instead broken, then the resulting Promise is also broken.» 10:37
^^ Is that correct?
dsm awesome
smls Does this mean that Promise.anyof basically just responds to the *first* promise that finishes (no matter if kept or broken), and ignores the rest?
FROGGS smash: I don't think so
err smls
sorry smash
smls I would have assumed (like moritz, judging from p6doc) that the promise returned by Promise.anyof is only broken, when *none* of the input promises were kept... 10:38
FROGGS smls: I'd think that the first sentence is right, but not the second
smls: exactly what I am thinking
smls m: my ($a, $b) = Promise.new xx 2; my $any = Promise.anyof($a, $b); $a.break; $b.keep; sleep 0.1; say $any.status
camelia rakudo-moar c94e16: OUTPUT«Broken␤»
FROGGS hmmmm 10:39
smls hmmmm indeed...
lizmat looking at the code
anyof indeed will break as soon as the first breaks, and succeed as soon as the first succeeds 10:40
FROGGS that is not what 'any' implies
smls If that's intended behavior, shouldn't it be named "first" or "earliest", rather than "any"?
10:40 vendethiel left
lizmat hmmm... 10:40
smls Also, isn't that inconsistent with .allof? 10:41
lizmat hmmm....
m: my $p = Promise.new; my $v = $p.vow; $v.break; $v.keep; say $p.status 10:42
camelia rakudo-moar c94e16: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤ in method break at src/gen/m-CORE.setting:20779␤ in block <unit> at /tmp/w6VsP1d0yh:1␤␤»
lizmat m: my $p = Promise.new; my $v = $p.vow; $v.break(666); $v.keep(42); say $p.status
camelia rakudo-moar c94e16: OUTPUT«Kept␤»
lizmat hmmm... it appears you can unbreak a vow
masak good antenoon, #perl6 10:44
lizmat no, looking at it further in the case of anyof
masak lizmat: I'm surprised a vow can be unbroken. I wonder if there's a use case or a reason for that, or if it's an oversight. 10:45
lizmat masak: I'm not sure either
lizmat really has to go on errands now
later&
masak moritz++ # saving advent by swapping posts 10:49
10:49 doublelel joined
masak is there a working example somewhere of a rule calling a method in a Perl 6 grammar? 11:06
timotimo all i can think of is EXPR, but that's nqp code 11:07
masak yes, I've already found that :) 11:08
timotimo maybe we should build a semantic search tool for the ecosystem 11:09
kind of like debian code search
masak I'd settle for a dumb but accurate search tool :P 11:10
ah, src/core/Cursor.pm seems to be full of clues.
timotimo right, a whole lot of the built-in rules are actually methods, right? 11:11
masak the whole expression parser is very method-y.
FROGGS masak: you call a method just like you call a subrule 11:12
timotimo i think he wants to know how to treat the $/ that comes in
masak FROGGS: that much is clear.
FROGGS you can look at ws and _ws for example
masak ok, will do.
FROGGS _ws is a method, and ws is a token
masak is it always thus? a method must eventually bottom out in a rule? 11:13
timotimo don't think so 11:15
FROGGS also, FOREIGN_LANG is a very good example
it even has comments :o)
it builds to be returned cursors, either for NQP or for Perl 6 11:16
the only 'rule' for methods that invoked like /<foo>/ is, that they have to return a cursor 11:17
that are*
they can return a cursor via returning the result from a token/rule, or they build one, like in FOREIGN_LANG 11:18
masak oh, yes. 11:19
FROGGS++ 11:20
I'm glad I asked. :)
11:26 atroxaper joined 11:28 Alina-malina left, ptc_p6 left 11:29 Alina-malina joined
dalek c: 524ff27 | smls++ | lib/Type/ (2 files):
Small tweaks and typo corrections for Promise/Channel
11:29
11:32 atroxaper left 11:37 smls left 11:44 mvuets joined 11:47 rurban1 joined
masak Woodi: regarding the imperative/declarative discussion the other day -- some people claim that the distinction does not make sense, and may even be hurtful or oversimplistic. 11:49
but I think the imporant ideal is this: as "natural" as imperative models seem, they have repeatedly turned out to be difficult to scale.
informally, "statefulness gets in the way". 11:50
in a number of ways, actually. everything from private details leaking out of their scopes, to the von Neumann bottleneck, to a general inability to see the forest for the trees.
declarative solutions show a way out of that. the focus becomes on the "what", not on the "how". in a sense, the "what" was what we were interested in all along. 11:51
xiaomiao masak: but declarative is hard to get right
11:52 rurban1 left
xiaomiao with imperative you can always just beat it into the needed shape 11:52
sergot dsm++ FROGGS++ I will fix it
hi #perl6 o/
masak \o
xiaomiao: no argument there. and it all depends on the context what you'll actually use. 11:53
xiaomiao: keep in mind, even out imperative solutions are fairly advanced these days. OO, used well, gives us a modicum of abstraction and privacy.
xiaomiao OO has been misused so much 11:57
masak poker has been played badly by so many. 12:00
words have been used in less-than-awesome ways so many times. 12:01
FROGGS word 12:03
12:05 isBEKaml left 12:13 rurban1 joined, rurban1 left 12:18 FROGGS left 12:22 Mso150 left 12:30 atroxaper joined 12:32 jack_rabbit left, erkan left 12:34 jack_rabbit joined 12:35 erkan joined, erkan left, erkan joined
xiaomiao "good idea, bad implementation" 12:35
12:35 atroxaper left 12:37 vendethiel joined 12:40 ptc_p6 joined 12:50 psch joined
masak it's easy to *think* you've gotten the point of OO, and to run off and use it in a cargo-culting rather than useful way. 12:55
12:58 ptc_p6 left
masak it's easy to stop after "classes, fields, getters and setters" and not move on to SOLID principles, architectural concerns, and design. 12:58
vendethiel masak: if you try to tell CL folks "you've used OO" they'll snicker at you :p 13:00
13:01 BenGoldberg joined
dsm what's the perl6-ish way to get a list of .ords of every single character of string? 13:02
masak m: say "OH HAI".ords
camelia rakudo-moar c94e16: OUTPUT«79 72 32 72 65 73␤»
masak can't believe he just recommended .ords ;) 13:03
vendethiel: I guess there is a sense in which both OO and FP are trying to do the same thing, but going about it in different ways.
vendethiel: certainly the distinctions break down a bit when you start finding mappings between OO things and FP things. 13:04
vendethiel mumbles something about "objects being the poor man's closures, and closures being the poor man's objects" to masak
masak right.
I wanted to say something like that to woolfy yesterday, but was overridden by my determination not to explain closures. :)
dsm masak: what if I want to convert only [a-z]? 13:06
vendethiel masak: I dunno, OO is like "I'm complicated, must mean I'm good right" 13:07
masak (1) are you sure it's only ASCII?
dsm sure
masak m: say "OH HAI".comb(/<[a..z]>/)>>.ord
camelia rakudo-moar c94e16: OUTPUT«␤»
masak m: say "OH HAI".comb(/<[a..zA..Z]>/)>>.ord
camelia rakudo-moar c94e16: OUTPUT«79 72 72 65 73␤»
masak (2) ^ 13:08
vendethiel
.oO( I don't even know what .comb() does, but at this point I'm too afraid to ask )
masak vendethiel: I think one of OO's biggest weaknesses is that it's founded on intuition, not on theory.
dsm thank you.
masak vendethiel: $s.comb($rx) gives all (non-overlapping) occurrences of $rx in $s
vendethiel: it's the figure-ground opposite of $s.split($rx) 13:09
vendethiel: I use .comb all the time, much of the time without giving it a regex (thus splitting it up into characters)
vendethiel masak: non-overlapping? 13:10
m: say "hello".comb.perl
camelia rakudo-moar c94e16: OUTPUT«("h", "e", "l", "l", "o").list␤»
masak m: say "aaaaaa".comb(/aaa/) # two, not four
camelia rakudo-moar c94e16: OUTPUT«aaa aaa␤»
masak that's non-overlapping 13:11
13:11 ptc_p6 joined
psch "convert only [a-z]" doesn't mean "leave everything else in place"? 13:12
m: say "OH HAI".trans: /(a..zA..Z)/ => { $0.ords } # this doesn't work yet though
camelia rakudo-moar c94e16: OUTPUT«OH HAI␤»
masak that's not how you do character classes.
psch rigth 13:13
m: say "OH HAI".trans: /(<[a..zA..Z]>)/ => { $0.ords } # this doesn't work yet though
camelia rakudo-moar c94e16: OUTPUT«Invocant requires an instance, but a type object was passed␤ in method ords at src/gen/m-CORE.setting:4046␤ in block <unit> at /tmp/HEA8Fp7Pkp:1␤␤»
psch still not? :/
i feel forgetful
masak m: say "OH HAI".trans: /<[a..zA..Z]>/ => &ord 13:14
camelia rakudo-moar c94e16: OUTPUT«Too few positionals passed; expected 1 argument but got 0␤ in sub ord at src/gen/m-CORE.setting:4112␤ in method next_substitution at src/gen/m-CORE.setting:7247␤ in method trans at src/gen/m-CORE.setting:7288␤ in block <unit> at /tmp/wGcBOCA4_7…»
masak that would work, if that feature exists at all. 13:15
I'm not sure. hold on, I'll check.
psch S05-transliteration/trans.t:201
if my spec is up to date or nothing changed
masak yeah, found it in S05, too. 13:16
psch s/spec/roast/
says we need the block
masak S05:4553
synopsebot Link: perlcabal.org/syn/S05.html#line_4553
psch github.com/rakudo/rakudo/pull/317
that says i fixed it... :) 13:17
although there was a point about runtime generation of grammars for .trans i think
masak yeah, in a dream future. 13:18
13:25 erkan left
psch m: 6; $x = 123;say $x ~~ tr/1/4/ # this is also fixed in the adverb PR above 13:27
camelia rakudo-moar c94e16: OUTPUT«Type check failed in assignment to '$!before'; expected 'Str' but got 'Int'␤ in block at src/gen/m-CORE.setting:968␤ in method BUILDALL at src/gen/m-CORE.setting:951␤ in method bless at src/gen/m-CORE.setting:939␤ in method new at src/gen/m-CO…»
13:27 erkan joined
psch arguably should have had its own commit though 13:27
13:28 ptc_p6 left
masak aye. 13:28
masak .oO( not Cool )
psch m: StrDistance.new(:before(1), :after(2)) 13:29
camelia rakudo-moar c94e16: OUTPUT«Type check failed in assignment to '$!before'; expected 'Str' but got 'Int'␤ in block at src/gen/m-CORE.setting:968␤ in method BUILDALL at src/gen/m-CORE.setting:951␤ in method bless at src/gen/m-CORE.setting:939␤ in method new at src/gen/m-CO…»
psch hrm, java's Constructor.newInstance() is weird :/ 13:30
13:33 Ugator left
psch oh, nvm, the problem was actually that constructor descriptors don't contain the class it's called on 13:39
but obviously we get that as the first arg from the perl6 side
vendethiel masak: well, I was looking for a screenshot "OO vs FP design principles", but since I can't find it...
masak: "The JVM ecosystem has a rich suite of tools that solve problems that don't exist in Haskell"
masak and yet, people don't flock around Haskell... :) 13:41
vendethiel hard to flock around something nobody teaches you 13:42
masak that's not precisely what I want to say. hm, more like: that quote makes it sound like Haskell has strictly fewer problems than (languages in) the JVM ecosystem.
could be Haskell is a neater solution. it probably is. but I'm pretty sure there is at least one problem somewhere better solved on the JVM.
vendethiel okay, let's remove haskell from the equation. 13:43
The JVM sucks pretty badly in several different aspect, java being one of them
masak the JVM shows its age in some ways, I guess. 13:44
actually, I don't have that much direct experience with it.
I know a fair bit of Java. I know Java is very limited.
vendethiel I have hope, though, cause it looks like more and more, people are move off java. 13:45
masak Java picks most of its OO inspiration from Smalltalk, but it does a fairly bad job borrowing the ideas from Smalltalk.
vendethiel I severely disagree 13:46
masak interesting.
vendethiel java picks most of its OO from C++, which picked most of its OO from Algol 13:47
masak: that's a very loose definition of "OO", however, as self is probably more object-oriented than smalltalk (and it has prototypes instead of classes) 13:49
13:50 ptc_p6 joined
vendethiel masak: to be completly honest, I mostly refuse to use the terms "OO" and "FP" nowadays... 13:52
masak well, they're tags for a lot of other related concepts.
when teaching, it's almost impossible to avoid talking about them.
vendethiel "tags" seems well-fited 13:53
but you can't define them.
masak "The Tao that can be told is not the eternal Tao; The name that can be named is not the eternal name." 13:54
13:58 ptc_p6 left 14:00 erkan left
Woodi hallo perl6 :) 14:02
14:03 erkan joined, erkan left, erkan joined
masak \o, Woodi 14:03
Woodi but Java get at least one thing good: GUI. C# also. I am a bit mad on Perl community becouse making GUI is relative hard here compared to Java and C#... 14:04
do Tk was Perls attempt to make universal GUI system that not taked over World ? 14:05
masak: but declarative part (teoretically) is also easy :) just make a "request" for something: in SQL or in restaurant: tomato soup and bloody steak pleas. and bear and coffe. 14:07
vendethiel Woodi: I disagree. Java didn't get the GUI right, I don't know of a good GUI framework
Woodi vendethiel: I think Swing is realy usefull and crosplatform stuff 14:08
masak Woodi: 'just make a "request" for something' -- I don't see what point you are trying to make.
vendethiel Woodi: it looks awful.
masak Woodi: declarative is not about making requests. it's about establishing properties and relationships. the instructions happen somewhere else. 14:09
Woodi vendethiel: it's cute :)
masak vendethiel: I used to think Swing looked awful too. but IntelliJ actually looks quite decent on all platforms.
vendethiel intellij made big big efforts to look decent
masak then that's what it takes. 14:10
vendethiel they built something else completly on top of swing...
Woodi masak: so SELECT * FROM table isn't proper declarative thing ?
vendethiel: Java is 1991 idea (probably), it cant be perfec thes days :)
vendethiel ... so let's use something better:) 14:11
masak Woodi: I have no idea what "proper declarative thing" means in your world :)
Woodi masak: something blurry to fit to the desctiption on Wikipedia :) 14:12
masak anyway, I'm not overly interested in pinning down exactly how declarative SQL is.
14:14 nige joined
Woodi declarative approach looks 1-level thing: you want something and implementation is just problem of someone else... and this is where imperative part comes in. eg. regular expressions: description of request and result comes out 14:15
14:15 jack_rabbit left 14:16 dj_goku_ left
masak that's a bit like saying "a car is just handing off the problem of walking by foot to someone else". 14:16
if you succeed with your declarative slang, not only have you lifted a bit of imperative boilerplate off your shoulders, you've made things so much more readable and accessible that it's a *qualitative* difference rather than a quantitative one. 14:17
aka "I'd rather write a 20-line grammar than the underlying 1000-line loops and .substr calls" 14:18
a good declarative language allows you to disregard the imperative parts, because *they are not that interesting* to the problem you want to solve. 14:19
Woodi if I understand correctly then I agree with that... all hard work is implementations detail, or someones 14:21
a bit despotic or bossy thing :) 14:22
masak it's a kind of abstraction on the syntax level, I guess.
it doesn't automatically imply that you delegate all the heavy lifting to *someone else*; just that the implementation behind the scenes is not what we're focusing on.
14:23 atroxaper joined, dj_goku joined
Woodi masak: probably I can't find peace until I sure that "request" will be done right :) so I care about teory of implementation :) 14:24
damn words...
masak it's admirable that you want to look under the hood. and I'm not arguing against that -- quite the opposite. 14:25
but the strength of a declarative approach -- or any mechanism of abstraction, really -- is that at any point, you can "tune out" the parts that have been abstracted away.
human attention/brainpower is often the biggest bottleneck in programming. 14:26
Woodi yes, I started today thinking: Makefile files are declarative or imperative :)
masak I'd peg them as declarative. they declare the dependencies between tasks. 14:27
they don't tell you in which order to run the tasks.
they induce a DAG of tasks. :)
14:27 atroxaper left
Woodi Makefiles tend to grow and starts to be complicated. maybe new layer of abstraction could help... 14:30
masak you mean, like a Configure.pl ? :) 14:31
Woodi I was thinking about inside Makefile thing... or some UI, still thinking... 14:33
masak Woodi: you remind me of me when I was younger :)
Woodi but TimToady mentioned makefiles today, was it about NativeCalls maybe ? :) 14:34
masak: I'm way to young for my age :)
14:40 erkan left
Woodi .so.X again tripped on NCurse case, which probably have bugged or complicated package on Debian. I wonder what shared libraries should be located on *nixes or *nuxes thes days... a) .so alone usually works; b) do multiarch systems use .so.X ?; c) do we need to support .so.X.Y.Z or more complicated cases ? this can result in loading "first found" library 14:41
14:41 nige left 14:42 erkan joined
Woodi d) do parsing linker scripts is a work for NativeCall or should be done by system ? 14:42
14:47 vendethiel left
masak could someone explain this... grammar oddity to me? 14:52
m: grammar G { rule TOP { <term> [<infix> <term>]* }; token term { "T" }; token infix { "+" } }; say ?G.parse("T + T + T")
camelia rakudo-moar c94e16: OUTPUT«False␤»
masak m: grammar G { rule TOP { <term> [<infix> <term>]* }; rule term { "T" }; token infix { "+" } }; say ?G.parse("T + T + T")
camelia rakudo-moar c94e16: OUTPUT«True␤»
masak I'm pretty sure I haven't discovered a bug or anything (*gasp*). 14:53
I just want to make it clear to myself why it matters whether term is a rule or token here.
I know the whitespace rules changed sometime in 2013. maybe I haven't fully internalized the new rules. 14:54
m: grammar G { rule TOP { <term> [<infix> <term> <.ws>]* }; token term { "T" }; token infix { "+" } }; say ?G.parse("T + T + T") 14:55
camelia rakudo-moar c94e16: OUTPUT«True␤»
masak this also works.
psch masak: design.perl6.org/S05.html#line_380
masak reads
psch turning term into a rule gives you the "<.ws> $ <.ws>" there 14:56
masak doesn't seem applicable. TOP is a rule in both of my first two evals.
and yet the result differs.
try again :)
psch tokem term vs rule term was the first case, no? :) 14:57
masak yes.
but you're talking about TOP.
psch no, i'm just referencing an example of the difference between token and rule that uses TOP
masak I think the paragraph staring with "Specifically, " after that is relevant, though.
aha. 14:58
m: grammar G { rule TOP { <term> [<infix> <term>]* }; rule term { "T" }; token infix { "+" } }; say ?G.parse("T + T + T")
camelia rakudo-moar c94e16: OUTPUT«True␤»
masak m: grammar G { rule TOP { <term> [<infix> <term>]* }; rule term { "T"}; token infix { "+" } }; say ?G.parse("T + T + T")
camelia rakudo-moar c94e16: OUTPUT«False␤»
masak yeah. got it.
the whitespace after the "T" in 'rule term' is significant. that's the difference. 14:59
and that's why inserting '<.ws>' after '<term>' helped, too.
ok, confusion resolved.
psch++ 15:00
15:03 erkan left 15:07 erkan joined, erkan left, erkan joined 15:26 doublelel left 15:29 raiph joined
masak has the privilege to remind himself of the workings of an operator precedence parser 15:30
15:33 vendethiel joined
sivoais shouldn't <en.wikipedia.org/wiki/Gradual_typing> list Perl 6? 15:40
masak yes.
feel free to add it.
sivoais will do! \o/ 15:41
15:41 FROGGS joined
masak finds that many times he writes 'return' instead of 'make' inside action methods 15:43
timotimo but facebook invented gradual typing
masak was there a reason for not just returning the ast in action methods?
hm, I guess that wouldn't be possible inside {} blocks in rules, tho'
FROGGS masak: it does not return it, that might be the reason :o) 15:44
and there is code that make-s something, and then does other stuff
psch m: grammar Foo { token TOP { "a"+ } }; class FooActs { method TOP($match) { make "an 'a'" } }; my $a = Foo.parse("aa", :actions(FooActs.new)); say $a.perl 15:51
camelia rakudo-moar c94e16: OUTPUT«Cannot bind attributes in a type object␤ in sub make at src/gen/m-CORE.setting:13964␤ in method TOP at /tmp/CxSEjGevNH:1␤ in any !reduce at gen/moar/stage2/QRegex.nqp:1241␤ in any !cursor_pass at gen/moar/stage2/QRegex.nqp:1202␤ in regex TOP…»
psch similarly to the "i want to ~~ regex in an actions method"
m: grammar Foo { token TOP { "a"+ } }; class FooActs { method TOP($match) { my $/ := $match; make "an 'a'" } }; my $a = Foo.parse("aa", :actions(FooActs.new)); say $a.perl 15:53
camelia rakudo-moar c94e16: OUTPUT«Potential difficulties:␤ Redeclaration of symbol $/␤ at /tmp/1fVZaTwh0z:1␤ ------> s FooActs { method TOP($match) { my $/ :⏏= $match; make "an 'a'" } }; my $a = Foo␤Match.new(orig => "aa", from => 0, to => 2, ast => "a…»
15:53 pecastro joined
psch ... yeah 15:53
action class methods having to be that special feels a bit weird to me, i gotta say 15:55
15:58 raiph left 16:07 raiph joined 16:11 zakharyas joined 16:13 atroxaper joined 16:18 broquain1 joined 16:19 pecastro left, zakharyas left, atroxaper left, bjz_ joined 16:21 spider-mario_ joined 16:22 arnsholt_ joined
vendethiel moritz: backlogging only now 16:22
16:22 spider-mario left, spider-mario_ is now known as spider-mario
vendethiel moritz: I got a bit stuck in what I wanted to do :( 16:23
16:23 bartolin_ joined, hahainte1net joined, skaufman_ joined, bartolin_ left
vendethiel wait... unless... 16:28
16:28 [Sno] left
vendethiel m: subset File of Str where *.IO.e || die "critical error"; say "foo" ~~ File 16:28
camelia rakudo-moar c94e16: OUTPUT«False␤»
vendethiel ha :(
16:29 darutoko- joined 16:30 raiph left, jercos left, eiro left, labster left, DarthGandalf left, bjz left, bartolin left, ribasushi left, broquaint left, ribasushi_ joined, ribasushi_ is now known as ribasushi 16:31 immortal joined, immortal left, immortal joined 16:32 isacloud joined, dj_goku_ joined 16:33 carlin left, gfldex left, ruoso_ joined, japhb_ joined, clkao__ joined, ugexe_ joined 16:34 lue left, prammer_ left, Spot__ left, isacloud_ left, darutoko left, clkao_ left, petercommand left, ugexe left, Sqirrel left, kaare__ left, telex left, dylanwh left, nine left, ruoso left, integral_ left, molaf_ left, slavik left, japhb left 16:35 isacloud is now known as isacloud_, clkao__ is now known as clkao_, gfldex joined, carlin joined 16:36 dana joined, Spot__ joined, btyler_ joined, dana is now known as Guest68514 16:37 bjz_ left, dj_goku left 16:38 dagurval joined, rhr_ joined 16:39 telex joined 16:40 dwarring joined 16:42 skaufman_ left, Alina-malina left, Isp-sec left, noganex_ left, raydiak left, colomon left, yakudza left, Grrrr left, Alula left, anaeem1 joined 16:43 kaare_ joined, btyler left, skaufman1 joined, prime- joined, felher_ joined, muraiki left 16:44 Rounin joined, noganex_ joined, colomon joined, yakudza joined, molaf_ joined, bjz joined, jercos joined 16:45 woolfy left, dalek left, [TuxCM] left, timotimo joined, dalek joined, woolfy joined, Vlavv left, telex left, ChanServ sets mode: +v dalek, muraiki joined, yogan joined, Celelibi left, erkan left, prime left, nige joined 16:46 integral joined, slavik joined, Grrrr joined, petercommand joined, prammer joined, nine joined, Isp-sec joined, telex joined, petercommand is now known as Guest67097 16:47 pnu joined, DarthGandalf joined 16:49 Vlavv joined, [TuxCM] joined 16:50 ilogger2 joined, ChanServ sets mode: +v ilogger2, isacloud_ joined, clkao_ joined, Spot__ joined 16:51 dwarring joined, Celelibi joined 16:52 pnu joined 16:53 Guest67097 joined, Guest67097 is now known as petercommand 16:59 synopsebot joined, dylanwh joined 17:03 Alula joined 17:04 lue joined 17:05 Alina-malina joined, Alina-malina left, Alina-malina joined
timotimo the autogenerated ro and rw accessors do the attribute access indirectly through a string grabbed from a lexical that's put into the closure ... 17:06
17:06 dolmen joined
timotimo i'm not terribly happy about this, but what can i do 17:11
i don't really want to put an EVAL in there, and i'm not sure if macros will work that early
17:14 anaeem1 joined 17:16 Sqirrel joined 17:24 dolmen left
psch imgur.com/rOVcIup \o/ 17:31
17:31 Ven joined 17:32 Ven left
psch as in, shortname constructors work 17:35
timotimo yay
17:36 anaeem1 left
psch leaving them positional seems like the only sane way to go, too 17:36
now there's fields and method resloution order left 17:37
at least from what i can see right now
timotimo :)
i'm glad
psch me too 17:41
although i don't actually have a use-case... :)
timotimo that makes stuff harder, believe me
i've had trouble being a good gtk::simple maintainer
psch yeah, doubly so for maintaining, in my opinion 17:45
timotimo dubly 17:46
psch i mean, just getting this jvm interop stuff working was mostly motivated by "it doesn't work currently", with a side of "but it would be cool if it did" 17:47
timotimo :S
psch i'm dreading trying to make it fast :P
timotimo hehe 17:48
time to become pessimistic about perl6's future :P
psch a big thing for that is caches for methods and constructors
don't people who want fast perl6 use mvm anyway..? ;) 17:49
timotimo well, yeah, but mvm is also not frighteningly fast
psch what's the adage? "make it work, make it right, wait for moore's law to make it fast" or something... :) 17:54
fwiw, i do know how to make the jvm interop a tad faster for repeated calls to the same method, but i don't think i know where to start to make perl6-j in general fastert 17:56
which i guess is more important than having a slightly faster interop - which is only faster when you're always calling the same foreign method
18:04 raiph joined 18:05 ab5tract joined 18:07 atroxaper joined
timotimo yes 18:07
FROGGS[mobile] psch++
psch: btw, it was discussed and decided that it should be :from<Java> instead 18:09
like it should be :from<C> and not :from<c>
psch FROGGS[mobile]: that does make sense. i'll patch the ModuleLoader accordingly 18:10
FROGGS[mobile] please allow the old way with a deprecation message 18:11
psch hm, not sure how to do that
afaict, we have a hash that holds the argument to :from<> as keys
and the perl6 ModuleLoader loads the corresponding module loader from the value 18:12
as in, i'm not sure how to adapt the normal 'is DEPRECATED' way of doing it for that :)
i guess i'll just shove it in an if and comment it with DEPRECATED or somesuch 18:18
TimToady m: grammar G { rule TOP { <term> [<infix> <term> ]* }; token term { "T" }; token infix { "+" } }; say ?G.parse("T + T + T") 18:22
camelia rakudo-moar c94e16: OUTPUT«True␤»
TimToady masak: that's how I'd've written it
well, except I'd really write it like this: 18:23
m: grammar G { rule TOP { <term> +% <infix> }; token term { "T" }; token infix { "+" } }; say ?G.parse("T + T + T")
camelia rakudo-moar c94e16: OUTPUT«True␤»
TimToady Whitespace only matters in the rule, so if you want the rule to control whitespace matching, then you have to pay attention to where the whitespace is in the rule. That is all. 18:24
well, I'd probably also throw a ^ in there to allow whitespace after the ^ 18:27
m: grammar G { rule TOP { <term> +% <infix> }; token term { "T" }; token infix { "+" } }; say ?G.parse(" T + T + T") 18:28
camelia rakudo-moar c94e16: OUTPUT«False␤»
TimToady m: grammar G { rule TOP { ^ <term> +% <infix> }; token term { "T" }; token infix { "+" } }; say ?G.parse(" T + T + T")
camelia rakudo-moar c94e16: OUTPUT«True␤»
TimToady it's only the whitespace after actual matchers that matters, so you have to put an actual matcher (^ in this case) to match the leading whitespace 18:30
18:31 raydiak joined
FROGGS[mobile] psch: just nqp::say the deprecation message? 18:31
TimToady the other oddity of the simplification is that it became useful to clump +% as a mental unit to get whitespace after the left term
so I always write it like that, even in tokens 18:32
(where it doesn't matter)
psch FROGGS[mobile]: yeah, that's probably what i'd have to do here. it feels a bit wasteful, considering we have this awesome tool for deprecations... 18:33
18:34 ab5tract left
psch but heck if i know if i even can use it from the ModuleLoader... i'd assume "maybe" :) 18:35
18:39 czara joined 18:41 nine joined 18:43 erkan joined, erkan left, erkan joined 18:57 czara left 19:00 dakkar joined
raydiak m: subset Foo of Str|Int; my Foo $foo; say($foo = "foo"); say($foo = 123); 19:00
camelia rakudo-moar c94e16: OUTPUT«foo␤Type check failed in assignment to '$foo'; expected 'Foo' but got 'Int'␤ in block <unit> at /tmp/_VIozDslNT:1␤␤»
masak TimToady: is it significant that there is whitespace before the +% ?
raydiak ^^ those should either both work or both fail, shouldn't they? (idk which)
TimToady masak: no, it is significant that there is whitespace after the <term> :) 19:01
raydiak: I don't think that's parsing hte way you think it is
raydiak m: subset Foo of (Str|Int); my Foo $foo; say($foo = "foo"); say($foo = 123); 19:02
camelia rakudo-moar c94e16: OUTPUT«===SORRY!=== Error while compiling /tmp/hJ67ndUwBa␤Missing semicolon.␤at /tmp/hJ67ndUwBa:1␤------> subset Foo of ⏏(Str|Int); my Foo $foo; say($foo = "foo"␤ expecting any of:␤ statement list␤ …»
TimToady you're getting (subset Foo of Str) | Int
raydiak yeah that's not what I meant :)
TimToady which ought to complain about useless use of | in a sink context
m: 1 | 2 19:03
camelia ( no output )
TimToady m: 1 | 2; 3
camelia ( no output )
TimToady m: 1 + 2; 3
camelia rakudo-moar c94e16: OUTPUT«WARNINGS:␤Useless use of "+" in expression "1 + 2" in sink context (line 1)␤»
TimToady like that
so a bug of sorts
raydiak ah
TimToady anyway, 'of' requires a type name, not an expression
19:04 dakkar left, dakkar joined
raydiak I should be using where instead, them? 19:05
TimToady that's an odd parse error in the second case
raydiak *then
TimToady yes
std: subset Foo of (Str|Int); my Foo $foo; say($foo = "foo"); say($foo = 123);
camelia std 76ccee1: OUTPUT«===SORRY!===␤Invalid type name at /tmp/PINVt1WTMJ line 1:␤------> subset Foo of ⏏(Str|Int); my Foo $foo; say($foo = "foo"␤ expecting typename␤Parse failed␤FAILED 00:00 135m␤»
TimToady that's a much better message
I have no idea what rakudo is thinking there... 19:06
raydiak do we have something like deparse?
well, I guess if it doesn't compile that wouldn't necessarily help
TimToady expecting a statement list after 'of' is just completely bogus 19:07
it probably thinks there's a missing semicolon after 'Foo', but in that case the ⏏ is misplaced 19:08
19:08 pmurias joined
pmurias hi 19:08
raydiak the way I read it, I expects the ; where it found 'of' instead
but yeah it'd kinda make more sense to put the cursor where the ; would go, given how it's worded 19:09
TimToady yes, but it should point to the beginning of the thing, not the end
raydiak \o pmurias
TimToady and it should really be committing to the typename after it sees 'of'
not backtracking to the 'Foo' 19:10
raydiak ah...I definitely run into inconsistencies with that thing, I kinda use it more like a fuzzy "around here somewhere" clue
TimToady that's...not what we want...
pmurias dalek stopped informing about commits? 19:11
raydiak sounds like a whole 'nother group of tests could be written
TimToady was just assuming nobody was committing...
pmurias TimToady: I just implemented contextual/dynamic variables in nqp-js, and dalek kept silent 19:12
psch: re making perl6-j is speed the thing that's keeping it from being used? 19:13
* psch: is slowness keeping perl6-js from being used? 19:14
psch pmurias: i'd say startup is one reason, yes. 10 seconds on my machine for 'perl6-j -e1' is too much to use it for the odd script 19:16
raydiak the url for the github hook to dalek changes with the new server...did the nqp-js hook get updated?
pmurias 10 seconds... :/
psch pmurias: i don't have any real data though, just the anecdote of myself not using perl6-j for scripting :) 19:17
pmurias why is the startup so slow? 19:19
psch pmurias: probably partly because we're reflecting and writing bytecode quite much 19:20
although the jvm in general is said to take a while to get warm i think
i have even less data for that though. i've read reflections are slow, but org.objectweb.asm is supposedly rather fast 19:22
maybe we can get the startup time down by shifting to asm instead of reflect where possible, but those two packages don't really serve the exact same purpose 19:23
pmurias isn't it possible to generate bytecode at compile time? 19:25
psch not in all cases, i don't think 19:30
but i'm not exactly sure how it works 19:31
m: say *.REPR for Str, Int, Num, Complex # these might all have different REPRs instances on the jvm
camelia rakudo-moar c94e16: OUTPUT«P6opaque␤P6opaque␤P6opaque␤P6opaque␤»
19:32 denis_boyun_ joined
psch in my test code for jvm-interop i regularly come across __P6Opaque72__ or similarly spelled 19:32
no idea how bad space requirements could get, and we'd likely shift potential performance problems towards the jvm ClassLoaders 19:33
keep in mind i haven't really look much at all of that, i've just looked through it a bit to figure out how to implement shortname methods and constructors for interop :) 19:34
raydiak so I was trying to read about object destruction last night, and noticed it isn't really covered in the synopses, and saw DESTROY referred to as a 'fossil' in the commit log 19:38
so my question is how can I run some code when an object would be GC'd?
19:39 Mso150 joined 19:40 denis_boyun_ left
raydiak specifically, I want to take the object and stuff it away somewhere else instead of destroying it 19:41
19:44 labster joined 19:47 liztormato joined
liztormato raydiak: afaik, DESTROY is only implemented on Moar 19:47
Also: there is no guarantee when it will be run 19:48
The gc decides when, basically
19:48 FROGGS_ joined
liztormato Please use the LEAVE phaser if you want to be sure when cleanup code gets run 19:49
19:50 Sqirrel left
liztormato That works on all backends 19:50
19:50 Mso150 left
raydiak I was going to try to write a role that implements a bless and DESTROY which re-uses old objects from a cache rather than creating new ones when possible, was the idea 19:51
dalek kudo/nom: fb9127c | TimToady++ | src/Perl6/Grammar.nqp:
commit to trait mods to avoid misleading messages
19:52
TimToady well, it worked there...
liztormato raydiak: why would you do that? 19:53
raydiak liztormato: lazy optimization...in simple cases you could just add 'does Reusable' to your class and get a speedup 19:54
raydiak waits for ensuing lecture on proper software architecture
liztormato Not really. It just feels like a premature opt 19:55
19:55 user3 joined 19:56 Mso150 joined, user3 left
raydiak maybe...was just looking at a benchmark and thinking about how my mental interpreter doesn't create a new data structure for every loop even though that's what the code says...it re-uses one object over and over 19:56
b/c turning a constructor into a mutator for the benchmark made it more than an order of magnitude faster 19:57
(which of course made it an unfair benchmark, but that's not the point)
20:02 liztormato left 20:06 liztormato joined 20:07 atroxaper left
TimToady so...basically you're confusing 'my' with 'state', and wish the computer would too... 20:08
moritz \o 20:09
FROGGS_: how's your advent post coming along?
FROGGS_ moritz: quite well I think
sjn is enjoying the advent posts a lot 20:12
liztormato sjn: o/
sjn liztormentor|liztormato|liz o/ 20:13
:)
liztormato ;-)
It's actually inspired by a Yes album 20:14
raydiak I'm not sure if "confused" applies in this case, unlike most of my thoughts. it's an intentional modification that I make at compile time when I'm determine to my own satisfaction that logical consistency is uncompromised by the transformation. isn't that what optimization is, for at least one point of view? 20:15
liztormato I guess so
raydiak s/I\'m // 20:16
sjn raydiak: your modification could also be a pessimization, even if consistency is perserved. :)
sjn loves dropping into the middle of conversations without having any clue about what they're about 20:17
raydiak unfortunately doing it at compile time is a bit beyond my scope at this time, so I was trying to emulate the idea in the first way that seemed obvious to my limited toolbox
raydiak is a bit fuzzy on the precise meaning of "pessimization" in this context 20:18
liztormato Cost > income 20:20
raydiak if you mean that, done wrong, it could easily be slower than just creating a new object, then sure that's true...so too with many optimizations
but don't you think that in a substantial number of cases, popping a ref off an array and filling the properties in could be faster than destroying that object and blessing a new one? 20:21
seemed kinda obvious to me, but maybe I poorly estimate the relative speed of such operations...???... 20:22
liztormato It's just that I feel you may be confusing / disabling other optimisations that way 20:27
jnthn would know
raydiak the way I imagined it initially was a class trait..."is reusable" or whatever, basically as a promise that the object doesn't rely on other external state or meta stuff that would break when used this way
so if it's explicitly enabled that way, I wonder if that helps with the problem you're talking about 20:28
it should be obvious by now that I have a less than complete picture of how the internals work :) 20:29
liztormato Perhaps. I don't know
20:40 zakharyas joined
masak g'ah, I still quite can't figure out how to make a method match like a rule... :/ 20:43
let me see if I can come up with a question specific enough to get me unstuck. 20:44
20:45 liztormato left
masak right, ok. say I want to write a method that's the equivalent of /./ -- it always matches one character. how would that method look? I would need to generate a new cursor with the right values, right? 20:45
again, I'm in Perl 6 doing this -- which might mean no-one's done it before. 20:47
but it does seem like it should be possible.
vendethiel masak: I'm not sure I understand what you're trying to do 20:48
moritz m: grammar A { token TOP { <a> }; method a(|c) { say c.perl my \res = /./(self, |c); say res.perl; res } } }; say A.parse('x') 20:50
camelia rakudo-moar fb9127: OUTPUT«===SORRY!=== Error while compiling /tmp/bo1z8qfnss␤Two terms in a row␤at /tmp/bo1z8qfnss:1␤------> TOP { <a> }; method a(|c) { say c.perl ⏏my \res = /./(self, |c); say res.perl; r␤ expecting any of:␤ …»
moritz m: grammar A { token TOP { <a> }; method a(|c) { say c.perl; my \res = /./(self, |c); say res.perl; res } } }; say A.parse('x')
camelia rakudo-moar fb9127: OUTPUT«===SORRY!=== Error while compiling /tmp/jMHiKbYZgA␤Unexpected closing bracket␤at /tmp/jMHiKbYZgA:1␤------> = /./(self, |c); say res.perl; res } } ⏏}; say A.parse('x')␤»
moritz m: grammar A { token TOP { <a> }; method a(|c) { say c.perl; my \res = /./(self, |c); say res.perl; res } }; say A.parse('x')
camelia rakudo-moar fb9127: OUTPUT«Capture.new()␤A.new()␤「x」␤ a => 「x」␤␤»
masak moritz++
m: grammar A { token TOP { <a> }; method a { /./(self) } }; say A.parse('x') 20:51
camelia rakudo-moar fb9127: OUTPUT«「x」␤ a => 「x」␤␤»
masak moritz: just curious -- why did you feel the need to have |c along for the ride?
seems to work without it.
vendethiel I have absolutely no idea what's going on here.. 20:52
masak seems you can call a regex with a cursor! o.O
at least that's how I read it.
vendethiel yes, yes...
masak yes, this will make things immensely simpler.
vendethiel my mind just got shattered...
20:53 slavik joined
raydiak regex isa method 20:58
should be able to wrap it too, I'd guess 20:59
FROGGS_ please read: perl6advent.wordpress.com/?p=2792&a...ew_id=2792 21:02
masak heh, I think I found a bug in the regex engine :)
m: /+/; say "alive" 21:03
camelia rakudo-moar fb9127: OUTPUT«===SORRY!=== Error while compiling /tmp/MtEpSUUPer␤Quantifier quantifies nothing␤at /tmp/MtEpSUUPer:1␤------> /+⏏/; say "alive"␤ expecting any of:␤ statement list␤ prefix or term␤ …»
masak m: my $rx = "+"; /<$rx>/; say "alive"
camelia rakudo-moar fb9127: OUTPUT«Cannot call 'match'; none of these signatures match:␤:(Cool:D: Any $target, *%adverbs)␤ in method Bool at src/gen/m-CORE.setting:14324␤ in block <unit> at /tmp/Ak5EexM_9h:1␤␤»
masak m: my $rx = "+"; +/<$rx>/; say "alive"
camelia rakudo-moar fb9127: OUTPUT«WARNINGS:␤Useless use of "+" in expression "+/<$rx>/" in sink context (line 1)␤Cannot call 'Numeric'; none of these signatures match:␤:(Mu:U \v: *%_)␤ in sub prefix:<+> at src/gen/m-CORE.setting:4407␤ in block <unit> at /tmp/3_Rr_Ik0O7:1␤␤»
masak m: my $rx = "+"; "" ~~ /<$rx>/; say "alive"
camelia rakudo-moar fb9127: OUTPUT«Memory allocation failed; could not allocate 929136640 bytes␤»
masak (timeout)
masak submits rakudobug 21:04
my assumption here is the /+/ is still a syntax error, even if it happens through an injected regex.
probably doesn't go through the normal syntax checks, for some reason. 21:05
FROGGS_ m: say EVAL 'anon regex { + }' 21:06
camelia rakudo-moar fb9127: OUTPUT«===SORRY!=== Error while compiling EVAL_0␤Quantifier quantifies nothing␤at EVAL_0:1␤------> anon regex { +⏏ }␤ expecting any of:␤ scoped declarator␤ new name to be defined␤»
FROGGS_ I think that is what we do to interpolate a string as a regex rule
21:06 ab5tract joined
moritz m: my $s = ';'; '' ~~ /<$s>/ 21:08
camelia rakudo-moar fb9127: OUTPUT«===SORRY!=== Error while compiling EVAL_0␤Unrecognized regex metacharacter ; (must be quoted to match literally)␤at EVAL_0:1␤------> anon regex { ^⏏;}␤ expecting any of:␤ scoped declarator␤ …»
21:08 atroxaper joined 21:09 erkan left
raydiak FROGGS_: "your expectations and assumptions when it ones to your test suite" ~~ s/ones/comes/ 21:09
FROGGS_ raydiak: fixed :o) 21:10
raydiak also, several of the paragraphs have odd-looking breaks before the last sentence
FROGGS_ hmmm, I don't see it 21:11
21:11 erkan joined, erkan left, erkan joined
moritz masak: it was my first attempt, so I treid to impose as few constraints as possible 21:11
masak :) 21:12
raydiak FROGGS_: even in the first paragraph, after "end of the day." before "But even when you are a"
masak hm, follow-up question. how do I indicate a failed match from a method?
I guess I match with a regex that definitely fails 21:13
FROGGS_ raydiak: ahh, that was intentional... but I can remove these
masak like /<!>/
raydiak FROGGS_: unless those should be separate, in which case a second line break is missing
FROGGS_: ah, or maybe just a writing convention I'm unfamiliar with 21:14
FROGGS_ raydiak: maybe *g*
I fixed it anyway
masak moritz: it doesn't work, it turns out. :/ 21:15
m: grammar G { regex TOP { <foo> B }; method foo { /A/(self) } }; say ?G.parse("AB")
camelia rakudo-moar fb9127: OUTPUT«True␤»
masak hm.
21:15 atroxaper left
moritz masak: I'm unconvinced :-) 21:16
FROGGS_ masak: create a cursor that has a from > to
masak what am I doing right?
moritz m: grammar G { method TOP { /<!>/(self) } }; say so G.parse('')
camelia rakudo-moar fb9127: OUTPUT«False␤»
raydiak FROGGS_: should bleading (as in bleading my car's brakes) be bleeding (as in blood, the result of cutting)? or is that just U.S. english?
moritz m: grammar G { method TOP { /<?>/(self) } }; say so G.parse('')
camelia rakudo-moar fb9127: OUTPUT«True␤»
FROGGS_ raydiak: should be bleeding, ups 21:17
moritz masak: NQPCursorRole has useful methods like !cursor_pass(int $pos, str $name = '', :$backtrack) and !cursor_fail() 21:19
masak yes, but I'm in Perl 6 land...
moritz masak: but they are all private, so not directly available to Grammar.pm
raydiak FROGGS_: "flags how that backend was build, and you" ~~ s/build/built/
masak for some reason, my big grammar is different, and I keep getting "P6opaque: no such attribute '$!pos'"
FROGGS_ m: grammar G { method TOP { self."!cursor_start_cur"() } }; say G.parse('foo') 21:20
camelia rakudo-moar fb9127: OUTPUT«(Any)␤»
FROGGS_ raydiak: fixed
21:21 raiph left
moritz m: grammar G { method TOP() { say $.target; /<?>/(self) } }; say so G.parse(''') 21:21
camelia rakudo-moar fb9127: OUTPUT«===SORRY!=== Error while compiling /tmp/UIKZDwNcM4␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/UIKZDwNcM4:1␤------> rget; /<?>/(self) } }; say so G.parse(''⏏')␤ expecting a…»
FROGGS_ m: grammar G { method TOP { self."!cursor_pass"(3, '') } }; say G.parse('foo')
camelia rakudo-moar fb9127: OUTPUT«「foo」␤␤»
masak If the compilation of the string form fails, the error message is converted
to a warning and the assertion fails.
raydiak FROGGS_: "but besides that everything run cleanly" ~~ s/run/ran/
masak blargh. paste-o. 21:22
m: grammar G { method TOP() { say $.target; /<?>/(self) } }; say so G.parse('')
camelia rakudo-moar fb9127: OUTPUT«␤True␤»
FROGGS_ dang, I am a legasthenic
masak m: grammar G { method TOP() { say $.target; /<?>/(self) } }; say so G.parse('OH HAI')
camelia rakudo-moar fb9127: OUTPUT«OH HAI␤False␤»
masak m: grammar G { method TOP() { say $.pos; /<?>/(self) } }; say so G.parse('OH HAI')
camelia rakudo-moar fb9127: OUTPUT«0␤False␤»
masak wow.
raydiak FROGGS_: "list of compiler version can grow" ~~ s/version/versions/ 21:24
FROGGS_ :S
fixed
masak FROGGS_: what's the second parameter, $name, good for in method !cursor_pass ? 21:27
FROGGS_ m: grammar G { method TOP { self."!cursor_pass"(3, 'baz') } }; say G.parse('foo')
camelia rakudo-moar fb9127: OUTPUT«「foo」␤␤»
FROGGS_ hmmm
masak: ahh, it will 'reduce' to that name 21:28
so it would call action mathod baz in my example
masak aha.
FROGGS_ method*
masak now I'm getting "This representation (Null) does not support positional access". 21:31
very interesting.
FROGGS_ hmmm, I never had that with Null 21:32
raydiak FROGGS_: was "doit" intentional? I think that's all, besides a couple grammatical nits but they could be specific to my region and I'm not trying to be pedantic :)
FROGGS_ ohh, hmmm, I think doit is just how I write it accidently :o) 21:33
vendethiel I'd like to find a way to give better error reporting when a MAIN doesn't match
FROGGS_ raydiak: thank you very much
21:33 denis_boyun_ joined
FROGGS_ vendethiel: do you want to list almost matching candidates instead of the full list each time? 21:34
raydiak FROGGS_: you're welcome. thank you for the great advent article, I enjoyed reading it, look forward to putting your advice to use when tuits allow
FROGGS_ raydiak: thanks for the nice feedback :o) 21:35
vendethiel FROGGS_: my gist gist.github.com/vendethiel/32057dc3750fc670937f
FROGGS_: I have two extra "MAIN"s supposedly giving a better error message. But now, the --help lists them as well 21:36
dalek rl6-roast-data: e7c513b | coke++ | / (4 files):
today (automated commit)
raydiak and while I'm on the subject, thanks to all the other advent authors this year...I haven't kept up enough lately to give proper feedback each day
21:38 denis_boyun_ left
FROGGS_ vendethiel: I dunno if there is a trait specced that let you hide MAIN candidates... 21:38
but that would certainly help
and src/core/Main.pm would just need to check for that trait 21:39
masak ended up having to call "!reduce" manually to trigger the action method
...but now it works! o.O
FROGGS_ either that or the gen-usage needs to be improved to show only interesting candidates 21:40
21:40 ab5tract left
masak this is the weirdest code I've written in a while :) 21:40
FROGGS_ masak: *g*
I've written some very decent code for $work that I am very proud of... 21:41
21:41 Sqirrel joined
FROGGS_ that is also the reason I am not that active recently 21:41
(the application I wrote is about to outrule a product that is worth 450_000€) 21:42
well, "worth"
21:42 slavik left
moritz wonders if masak++ is doing a user-space macro implementation 21:43
21:45 dolmen joined
masak that would be pretty sweet. 21:47
vendethiel FROGGS_: not sure gen-usage could know the interesting ones 21:48
pmurias hopes masak isn't doing a kernel-space marco implementation ;) 21:49
FROGGS_ vendethiel: well, I can imagine that you can calc the distance between the input params and the candidates, and if some are very close, then these could be highlighted
vendethiel FROGGS_: ha, right -- but I just want to plain hide them
FROGGS_ like we propose subs/types for typo'd/unknown things 21:50
vendethiel: invent a trait 'is hidden' or so, spec it and implement it :o)
masak 'night, #perl6 21:52
raydiak g'night masak
FROGGS_ gnight masak
21:52 ab5tract joined 21:53 erkan left 21:55 erkan joined, erkan left, erkan joined
lizmat FROGGS_: s/absense/absence/ 21:57
FROGGS_ fixed
lizmat write tests in before hand -> write tests beforehand 21:58
one problem left: (lose the aside)
FROGGS_ fixed 21:59
lizmat run a particular code : the "code" feels funny there, I expect "program" would be more correct 22:00
same with "these test codes"
s/achive/achieve/ 22:02
FROGGS_ fixed 22:04
lizmat FROGGS_: you are aware that we only need to nudge mst to start working on CPAN Testers integration for rakudo Perl 6, right ? 22:05
(otherwise I have no comments: FROGGS_++ )
FROGGS_ lizmat: as I said earlier I don't believe in a CPAN testers integration
because P5's infrastructure is quite different from ours, and getting this into cpantesters would take several months/years 22:06
and then we have something we don't have under control, or we have at least no way to change things as we like 22:07
lizmat but it would almost instantly give you a wide set of testers all over the world
and all of the associated goodies
FROGGS_ in case the testers would install rakudo
lizmat not to forget the exposure 22:08
but anyways, I guess we agree to disagree :-)
FROGGS_ :o)
lizmat the future will tell
FROGGS_ I mean, I'd like to hear mst's story about how that actually can work out 22:09
my problem is just that I lack imagination there
(and knowledge)
lizmat CPAN Testers have *lot* of experience and knowledge on how *not* to do things
I would hate to see Perl 6 make the same mistakes 22:10
FROGGS_ yes, of course... that's why I want to attend q/a 22:11
lizmat and it will be around the corner :-)
FROGGS_ but learning from P5 does not imply squishing P6 test results into cpantesters that does not know about different backends nor compiler 22:12
true :o)
lizmat if that turns out to be a bridge too far, then we can decide not to want to cross it
and there is much to be said for dogfooding a test infrastructure framework 22:13
:-)
FROGGS_ my experience is just that I did not even get near that bridge, because ppl like barbie are too busy to reply to emails
lizmat
.oO( maybe I should send Barbie an email :-)
22:14
FROGGS_ nah, I don't need features added for reviewing P5 modules anymore :o) 22:15
the few modules I still maintain are doing well
would be nice if both of us had tuits for panda/CPAN before q/a 22:18
err, panda/eleven
or both :o)
lizmat yes, it would 22:20
gnight #perl6! 22:27
FROGGS_ gnight @all o/
raydiak g'night lizmat & FROGGS_
FROGGS_ see ya raydiak
22:35 zakharyas left 22:55 dolmen left 23:01 atroxaper joined 23:08 atroxaper left 23:17 erkan left 23:18 dakkar left 23:19 erkan joined 23:40 ab5tract left, pmurias left 23:46 ninjazach joined 23:49 ab5tract joined 23:57 araujo joined