»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend! Set by moritz on 22 December 2015. |
|||
00:01
mr-foobar joined
00:02
cpage_ left
00:03
cpage_ joined
00:08
headcase joined
|
|||
AlexDaniel | m: use nqp; use NQPHLL:from<NQP>; say HLL::Compiler.new.version | 00:08 | |
camelia | This is version built on MoarVM version 2017.09.1-7-geeb664ea6 | ||
AlexDaniel | almost | ||
how do I get access to Perl6::Compiler? | |||
00:08
cpage_ left
|
|||
Zoffix | m: $*PERL.compiler.^name.say | 00:10 | |
camelia | Compiler | ||
Zoffix | m: $*PERL.^name.say | ||
camelia | Perl | ||
Zoffix shrugs | 00:11 | ||
m: use nqp; nqp::getcomp("perl6").^name.say | |||
camelia | Perl6::Compiler | ||
Zoffix | \o/ | ||
00:12
pyrimidine left
|
|||
MasterDuke | m: use nqp; nqp::getcomp("perl6").version.say | 00:12 | |
camelia | This is Rakudo version 2017.09-27-gda5c36c13 built on MoarVM version 2017.09.1-7-geeb664ea6 implementing Perl 6.c. |
||
MasterDuke | Zoffix++ | ||
00:13
pyrimidine joined
00:15
pyrimidine left,
pecastro left,
pyrimidi_ joined
|
|||
Zoffix | oh cool. Didn't know it was that easy. MasterDuke++ | 00:15 | |
huggable: version in code :is: Same output as from perl6 --version in code form: use nqp; nqp::getcomp("perl6").version.say | 00:16 | ||
huggable | Zoffix, Added version in code as Same output as from perl6 --version in code form: use nqp; nqp::getcomp("perl6").version.say | ||
perlawhirl | .tell as_ re: Supplier -> 6guts.wordpress.com/2015/12/05/get...christmas/ | 00:17 | |
yoleaux | perlawhirl: I'll pass your message to as_. | ||
00:18
pyrimidine joined,
pyrimidi_ left
00:19
cpage_ joined
00:20
pecastro joined
|
|||
AlexDaniel | c: all use nqp; nqp::getcomp("perl6").version.say | 00:22 | |
committable6 | AlexDaniel, gist.github.com/55b98bfe224373eacf...56f2be63c6 | ||
00:22
pyrimidine left
|
|||
Zoffix has just discovered LaTeX | 00:25 | ||
Man, this thing is dope! | 00:26 | ||
00:26
mcmillhj joined
|
|||
AlexDaniel | m: use nqp; nqp::getcomp("perl6").version; say ‘hello world’ | 00:27 | |
camelia | This is Rakudo version 2017.09-27-gda5c36c13 built on MoarVM version 2017.09.1-7-geeb664ea6 implementing Perl 6.c. |
||
AlexDaniel | xD | ||
Zoffix | NQP wasn't even a thing in 2015.02 ? | ||
before I meant | |||
AlexDaniel | c: 2015.01 nqp::getcomp("perl6").version | ||
committable6 | AlexDaniel, ¦2015.01: «This is perl6 version 2015.01 built on MoarVM version 2015.01» | ||
AlexDaniel | just not “use nqp | ||
” | |||
Zoffix | ah k | ||
AlexDaniel | the problem is that this thing exits :D | 00:28 | |
Zoffix | s: nqp::getcomp("perl6"), 'version', \() | ||
SourceBaby | Zoffix, Something's wrong: ERR: ===SORRY!=== Error while compiling -eCould not find nqp::getcomp, did you forget 'use nqp;' ?at -e:6------> put sourcery( nqp::getcomp("perl6")<HERE>, 'version', \() )[1]; | ||
Zoffix | s: (use nqp; nqp::getcomp("perl6")).head, 'version', \() | ||
SourceBaby | Zoffix, Something's wrong: ERR: Could not find candidate that can do \() in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 29 in block <unit> at -e line 6 | ||
Zoffix | s: (use nqp; nqp::getcomp("perl6")).tail, 'version', \() | ||
SourceBaby | Zoffix, Something's wrong: ERR: Died with X::Multi::NoMatch in block <unit> at -e line 6 | ||
AlexDaniel | github.com/perl6/nqp/blob/862cde8e...r.nqp#L572 | 00:29 | |
but the code to generate it is there, so… | |||
00:29
mr-foobar left
00:31
mr-foobar joined,
pyrimidine joined,
mcmillhj left
|
|||
Zoffix | huggable: version in code :is: Same output as from perl6 --version in code form: use nqp; with nqp::getcomp("perl6") { say "This is {.implementation} version {.config<version>} built on {.backend.version_string}\nimplementing {.language_name} {.language_version}." } | 00:33 | |
huggable | Zoffix, Added version in code as Same output as from perl6 --version in code form: use nqp; with nqp::getcomp("perl6") { say "This is {.implementation} version {.config<version>} built on {.backend.version_string}\nimplementing {.language_name} {.language_version}." } | ||
00:37
mcmillhj joined
00:41
mcmillhj left
00:45
cpage_ left
00:47
cpage_ joined
00:50
Cabanossi left
00:51
Cabanossi joined
|
|||
sacomo | Hi #perl6 | 00:52 | |
00:55
pyrimidine left
|
|||
AlexDaniel | hello o/ | 00:57 | |
00:57
cpage_ left
00:59
mr-foobar left
|
|||
Zoffix | <Zoffix> Man, this thing is dope! | 01:02 | |
Well, that was a short love affair. It crashes when I try to use Unicode ops in my code examples :( | |||
sacomo: \o | |||
01:03
mr-foobar joined
01:04
cpage_ joined,
headcase_ joined
|
|||
MasterDuke | huh, i would have thought latex would support unicode pretty well | 01:05 | |
Zoffix | I think it's just the issue with the code highlighter I'm using (minted) | ||
01:06
cpage_ left
01:07
headcase left
01:11
mcmillhj joined
01:16
mcmillhj left
01:22
mcmillhj joined
|
|||
Zoffix | I stand corrected. Apparently Unicode support is very problematic. All the possible solutions I find just talk about supporting some specific language or encoding specific chars only (which I guess works out for my case, since all I need a Rakudo's ops) | 01:24 | |
01:26
cpage_ joined
01:27
mcmillhj left,
headcase joined
01:29
pecastro left
01:31
cdg joined,
headcase_ left
01:34
Cabanossi left
|
|||
geekosaur | well, not so much 'problematic' as 'expects such things to be handled by appropriate fonts and packages' | 01:34 | |
TeX/LaTeX has an 'interesting' worldview though, I admit | |||
Zoffix | Ah | 01:35 | |
01:36
zakharyas joined,
Cabanossi joined
|
|||
geekosaur | including that its users are trying to get special characters on devices that don't have any support for them, so its main focus is on providing ways to enter them | 01:36 | |
(specifically entering math equations on 'glass ttys') | 01:37 | ||
01:42
mcmillhj joined
01:45
ilbot3 left
01:47
mcmillhj left,
skids left
01:48
mcmillhj joined
01:49
pecastro joined
01:54
ilbot3 joined,
ChanServ sets mode: +v ilbot3
01:56
adu left
|
|||
Geth | whateverable: 69330d1823 | (Aleks-Daniel Jakimenko-Aleksejev)++ | lib/Whateverable.pm6 Report rakudo version in 「uptime」 |
01:57 | |
01:58
pecastro left
02:04
noganex joined,
pecastro joined
02:06
audiatorix joined,
noganex_ left
02:13
audiatorix left
02:16
skids joined
02:22
headcase left
|
|||
AlexDaniel | code golf… and perl 6 :-/ | 02:22 | |
I guess I'm not doing anything useful tonight | |||
02:28
skids left
|
|||
AlexDaniel | m: { say ‘hello’ } while $++ < 5 | 02:29 | |
camelia | ( no output ) | ||
AlexDaniel | :S | ||
02:29
mr-foobar left
02:30
mr-foobar joined
|
|||
AlexDaniel | m: my $x = ‘foo’; say --$x | 02:31 | |
camelia | fon | ||
AlexDaniel feels like he is using something else, not perl 6 | |||
02:35
cdg left
02:37
mcmillhj left
02:38
eliasr left
02:39
mcmillhj joined
02:41
rngoodn joined
02:44
mcmillhj left
02:45
headcase joined
02:47
adu joined
|
|||
rngoodn | I have not used perl6 yet, but am constantly trying out new languages and am now somewhat interested in perl6. I have been googling around and one thing I am worried about before putting any time into learning the language is it's speed. I did a quick test and calculating 20 turns of hanoi took 41 seconds on perl 6... same task took 0.8 secs in Julia (another "new" language I am playing with). I then tried 30 turns and gave up | 02:49 | |
waiting after 1300 seconds... this finishes in 7 secs in Julia. I have read that perl6 was released to be stable/working, but not optimized right now. What level of performance is perl6 targeting for the future? Python speeds? Java or C speeds? Or is it reasonable to believe it will always be very slow? | |||
02:49
mcmillhj joined
|
|||
AlexDaniel | rngoodn: hello o/ | 02:52 | |
rngoodn: what rakudo version are you using? | |||
rngoodn | 2017.07 | ||
AlexDaniel | okay | 02:53 | |
rngoodn: “Or is it reasonable to believe it will always be very slow?” – here's the progress so far: tux.nl/Talks/CSV6/speed4.html | |||
rngoodn: this graph does not necessarily represent performance for typical perl 6 program, but it is still pretty accurate | |||
02:54
mcmillhj left
|
|||
AlexDaniel | rngoodn: people often look at perl5 when comparing performance, so often times we too set the goal to get as fast as perl5 if not faster | 02:56 | |
rngoodn: that's not easy, but we're moving into the right direction, as you can see :) | 02:57 | ||
rngoodn: for some people it is fast enough today, but on average it is still slow | 02:58 | ||
rngoodn: that said, if you have some particular code, you can sometimes make it faster by doing some easy tricks | 02:59 | ||
e.g. native ints come to mind | |||
or maybe you can parallelize something? Depending on the job, it may improve things | 03:00 | ||
rngoodn | Ok. Thanks much for the info. I am not a perl5 user, but in general perl5 performance is in the realm of python and the dynamic interpreted languages right? I also understand that speed is not anything.. I am a fan of common lisp and somewhat of python and enjoy using a very powerful high level language that is not necessarily "fast". | ||
03:00
mcmillhj joined
|
|||
AlexDaniel | rngoodn: yeah, you're right | 03:00 | |
rngoodn | anything = everything* | ||
AlexDaniel | rngoodn: though python startup time is not as fast as perl5's :) | ||
03:01
mr-foobar left
|
|||
AlexDaniel | rngoodn: short answer: yeah, sometimes it is slow. Working on it :) | 03:02 | |
03:02
mr-foobar joined
|
|||
AlexDaniel | I wonder if benchable can generate a graph of startup time if you just give it say 42 | 03:03 | |
may not work, but let's try… | |||
benchable6: say 42 | |||
benchable6 | AlexDaniel, ¦say: «Cannot find this revision (did you mean “all”?)» | ||
AlexDaniel | benchable6: releases say 42 | ||
benchable6 | AlexDaniel, starting to benchmark the 23 given commits | ||
AlexDaniel, benchmarked the given commits, now zooming in on performance differences | 03:04 | ||
AlexDaniel, gist.github.com/b8f670f8fee44ecc4d...2bbd6590ad | |||
AlexDaniel | oops :D | ||
03:04
mcmillhj left
|
|||
AlexDaniel | benchable6: releases say 42 # I'm guessing that's just noise | 03:04 | |
benchable6 | AlexDaniel, starting to benchmark the 23 given commits | ||
perlawhirl | rngoodn: what hanoi code are you running? is it the one on RosettaCode? | 03:05 | |
rngoodn | I am also a little worried that I don't find as many resources/articles/videos online for perl6 compared to other "new" languages. If it had been "1.0" since 2015 what is the reason for this? Are there any big projects/companies using perl6? Are many people still holding out using perl6 for some reason? | ||
benchable6 | AlexDaniel, benchmarked the given commits, now zooming in on performance differences | ||
AlexDaniel, gist.github.com/fca6f434da23cc2a84...6a017595b5 | |||
AlexDaniel | yep, noise | ||
rngoodn: we got a bunch of books this year: perl6book.com/ | 03:06 | ||
03:07
adu left
|
|||
AlexDaniel | rngoodn: as for articles… maybe you can help by blogging about it :) | 03:07 | |
perlawhirl | the Hanoi sample on RosettaCode uses a Junction as a subset type constraint. simply using Int or no contraint should make things run at least twice as fast, but still not as fast python/perl5 | 03:08 | |
AlexDaniel | perlawhirl: that's a very good point | 03:09 | |
rngoodn | pearlawhirl: It was on the wikipedia page en.wikipedia.org/wiki/Perl_6 .. close to the bottom. I noticed it and since I already have hanoi written up in a few languages I figures it would be a neat little test before diving into the language. Let me know it looks like a bad example for hanoi though. | ||
perlawhirl * | |||
perlawhirl | rngoodn: ok, that one should be faster than the one from RosettaCode. | 03:10 | |
rngoodn | Thank for answering all my questions everyone. You all have been very friendly. | 03:12 | |
perlawhirl | Ultimately, Perl 6 is slower at some tasks compared to other languages... for some select tasks, it may be quicker. Time will tell how that changes, but bear in my that python and perl have been out since the 80's, and Perl 6 has been out for a few years | ||
AlexDaniel | rngoodn: can you try it without multi dispatch? | 03:14 | |
rngoodn: sub hanoi($n, $a = 'A', $b = 'B', $c = 'C') { return unless $n; … | 03:15 | ||
this is about 5 times faster here | 03:18 | ||
03:18
raschipi joined
|
|||
rngoodn | AlexDaniel: Sure I can. I literally know no p6 though so I can't modify the code... I assume drip the "multi"... and add the base case... not familiar with your "return unless $n;" Can I use an equivalent to "if n > 0" for the base case? | 03:19 | |
drip=drop* | |||
03:19
mcmillhj joined
|
|||
AlexDaniel | rngoodn: correct. Something like this: gist.github.com/AlexDaniel/c1db30f...dfb6f70bd9 | 03:20 | |
rngoodn | AlexDaniel: Wow! 2.7 secs. Much faster. | 03:22 | |
AlexDaniel | rngoodn: maybe also this shave off another 0.1s :) gist.github.com/AlexDaniel/ed05d09...3ddea5dad4 | ||
rngoodn | for 20 steps without printing to std out... same test that took 41 secs with "multi" | 03:23 | |
AlexDaniel | maybe $n > 0 would be more correct | ||
rngoodn | 2.33 for that one. Nice. | 03:24 | |
03:24
mcmillhj left
|
|||
perlawhirl | AlexDaniel: now slash your vars :D it will shave a little more off | 03:25 | |
AlexDaniel | perlawhirl: I know another trick also… | ||
rngoodn: try this: sub hanoi(int $n | 03:26 | ||
perlawhirl | rngoodn: not all Perl6 vars require a sigil, you can to: my \x = 5; print x; | 03:27 | |
these variables are able to be better optimised, so can be a little faster | 03:28 | ||
gist.github.com/0racle/de5a1b39753...924cd96ebe | |||
AlexDaniel | perlawhirl: this does nothing here | ||
perlawhirl | that gist runs in about 1.4 seconds running on a linux vm on my crappy work laptop | 03:29 | |
printing to the terminal blows out the time, but most of that is IO buffering | |||
AlexDaniel | perlpilot: oh, actually, yes it does | ||
perlpilot: sorry | |||
perlawhirl: ^ | |||
perlawhirl | im perlawhirl... but i know who you're talking to :D I should just go by orac1e like everwhere else :) | ||
03:30
mr-foobar left
|
|||
rngoodn | 0.02 seconds with the type declaration. That is impressive. Exact same speed as my common lisp code for hanoi at 20 rings. | 03:31 | |
03:31
mr-foobar joined
|
|||
AlexDaniel | does it produce the same output though? | 03:31 | |
rngoodn | ah just a sec haha... that was an error... let me try it again | ||
AlexDaniel | should be faster than 2.33, maybe :) | 03:32 | |
rngoodn | 1.07 seconds | ||
AlexDaniel | :o | 03:33 | |
perlawhirl | rngoodn: the point is, currently sometimes to get fast performance in Perl 6, you have to write things in a less obvious way. the hope is that with enough time spent optimising, the obvious code can be made almost as fast | ||
rngoodn | still impressive that we have come from 41s -> 1s with small tweaks. | ||
AlexDaniel | we didn't make it less readable | ||
In fact… maybe it's even more readable now… | 03:34 | ||
03:34
headcase left,
Cabanossi left
03:35
mcmillhj joined,
Cabanossi joined
|
|||
AlexDaniel | rngoodn: can I suggest something crazy? :) | 03:39 | |
03:39
mcmillhj left
|
|||
rngoodn | AlexDaniel: sure | 03:40 | |
AlexDaniel | rngoodn: gist.github.com/AlexDaniel/c314002...ad79b67428 | ||
rngoodn: hold on… | 03:41 | ||
rngoodn | This is the intermediate language for the compiler right? | ||
AlexDaniel | rngoodn: yep | ||
rngoodn: I updated the code, try the latest version gist.github.com/AlexDaniel/c314002...ad79b67428 | |||
rngoodn | 0.91secs | 03:42 | |
AlexDaniel | hm, interesting. It was more impressive here | 03:43 | |
I also thought that “nqp::if($n, …” can improve thing, but it doesn't | 03:44 | ||
rngoodn: anyway, we can probably continue this for hours… :) | |||
rngoodn | AlexDaniel: Yeah. It was a fun experiment. Good to know that you can write code quick to prototype and then start typing things and what not to make it more performant within the same language. A sign that maybe the compiler can make some of these optimizations one day in the future too. | 03:48 | |
03:50
cuonglm joined
|
|||
AlexDaniel | rngoodn: correct | 03:50 | |
raschipi | rngoodn: Also, it's really easy to do a quick prototype in Perl6 and then call into a C program after profiling. Perl6 has a ridiculously easy-to-use FFI. | 03:53 | |
03:53
mcmillhj joined
03:54
aborazmeh joined,
aborazmeh left,
aborazmeh joined
03:57
mcmillhj left
03:59
nadim left
|
|||
AlexDaniel | JRaspass is amazing | 04:02 | |
how he got 99 bottles of beer golf down to 212 characters is completely beyond me | 04:03 | ||
I'm 34 characters off… 34!! | |||
raschipi | Can we get a gist? | ||
AlexDaniel | gist.github.com/AlexDaniel/673eb0d...81f4d32164 | 04:04 | |
oh, I know | |||
hm… maybe not… :-/ | 04:05 | ||
well I have some ideas on how to shave off 10 more characters or so, but 34??? | 04:07 | ||
fwiw unicode quotes are counted as 1 character | 04:08 | ||
down to 238 | 04:14 | ||
doesn't help anyway | |||
04:21
mcmillhj joined
04:26
mcmillhj left
04:28
raschipi left
04:30
mr-foobar left
04:33
mr-foobar joined
04:35
cdg joined
04:37
Ven`` joined
04:38
rngoodn left
04:40
cdg left
|
|||
AlexDaniel | 227 :O | 04:40 | |
227 but “Killed for exceeding 750ms timeout.” :D | 04:44 | ||
04:46
Ven`` left
04:48
Cabanossi left
04:49
khw left
04:50
Cabanossi joined
04:55
mcmillhj joined
04:59
mcmillhj left
05:01
mr-foobar left
05:04
mr-foobar joined
05:06
wamba joined
05:14
grondilu joined
|
|||
grondilu | m: multi f([$x] where $x %% 2) { $x div 2 }; say f([4]) | 05:15 | |
yoleaux | 18 Sep 2017 18:43Z <Zoffix> grondilu: this uses non-standard features (slangs), but it makes chained ops work, I think: BEGIN { $?LANG.refine_slang('MAIN', role { token infix:sym«smaller» { <sym> <O('prec', 'm=', 'assoc', 'left', 'dba', 'chaining', 'iffy', 1, 'diffy', 1, 'pasttype', 'chain')> } } )}; sub infix:<smaller> { $^a < $^b }; say 1 smaller 2 smaller 3 | ||
camelia | Cannot resolve caller infix:<%%>(Mu, Int); none of these signatures match: () ($) (Int:D \a, Int:D \b) (\a, \b) in sub f at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
grondilu | .tell Zoffix, nevermind it occured to me that I can attach an Int to my objects via a rank method, and then use $x.rank to sort them. | 05:16 | |
yoleaux | grondilu: What kind of a name is "Zoffix,"?! | ||
grondilu | .tell Zoffix nevermind it occured to me that I can attach an Int to my objects via a rank method, and then use $x.rank to sort them. | ||
yoleaux | grondilu: I'll pass your message to Zoffix. | ||
grondilu | m: multi f([$x where $x %% 2]) { $x div 2 }; say f([4]) | 05:17 | |
camelia | 2 | ||
grondilu | m: multi f([$x where $x %% 2]) { $x div 2 }; say f([5]) | 05:18 | |
camelia | Cannot resolve caller f([5]); none of these signatures match: (@ (Any $x where { ... })) in block <unit> at <tmp> line 1 |
||
grondilu | So I guess the where clause must be inside the array | ||
05:25
HoboWithAShotgun joined
|
|||
HoboWithAShotgun | is this guy (www.perlmonks.org/?node_id=1199629) correct in saying "1.say" is some clever boxing or is a "1" actually a "real" object akin to a user defined class | 05:27 | |
geekosaur | m: say 1.WHAT | 05:28 | |
camelia | (Int) | ||
05:29
mcmillhj joined
|
|||
geekosaur | rakudo's not quite that clever yet to do nice auto(un)boxing, sadly. iirc it gets unboxed if passed to something that wants an unboxed int | 05:30 | |
HoboWithAShotgun | I know. But that doesn't really you if there is some clever thing the parser does to pretend 1 to be an object but internally it is a primitive | ||
s/really/really tell/ | |||
05:31
mr-foobar left
05:32
mr-foobar joined
05:37
mcmillhj left
|
|||
timotimo | it's boxing, but i wouldn't necessarily call it clever | 05:42 | |
though tbh i'm not sure how exactly it's implemented | |||
geekosaur | I think it just boxes literals and then unboxes if something wants unboxed | 05:44 | |
timotimo | at the compiler level it has a cool thing for literals called "Want" | ||
geekosaur | some of the past weird issues with unboxing and binding seemed to imply that | ||
timotimo | a 1 would be put into the AST as a QAST::Want with three children: an Int object, "Ii", and a native integer value | 05:45 | |
and later stages of the compiler can figure out if a native int can be used properly and throw away the boxed integer object | |||
05:46
xtreak joined
05:48
Cabanossi left,
nadim joined
05:49
mcmillhj joined
05:50
Cabanossi joined
05:53
mcmillhj left
05:58
ChoHag left
06:00
mr-foobar left
06:05
albongo left,
perlawhirl left,
gfldex left,
wictory[m] left,
nightfrog left,
jnap_ left,
damnlie left,
Juerd joined,
nightfrog joined,
perlawhirl joined
06:06
mr-foobar joined,
Grauwolf joined,
albongo joined,
iviv joined
06:07
john51 left,
john51 joined
06:08
HoboWithAShotgun left,
committable6 left,
committable6 joined,
mienaikage left,
tyil[m] left
06:09
M-Illandan left,
Garland_g[m] left,
ilmari[m] left,
mack[m] left,
wamba[m] left,
Matthew[m] left,
tadzik left,
CIAvash[m] left,
squashable6 left,
statisfiable6 left,
unicodable6 left,
releasable6 left,
bloatable6 left,
quotable6 left,
xui_nya[m] left,
unclechu left
06:10
gfldex joined,
jnap_ joined,
damnlie joined,
chansen_ joined
06:12
AelxDnaiel left,
committable6 left
06:13
ChoHag joined
06:20
mcmillhj joined
06:23
wamba left
06:24
darutoko joined
06:25
mcmillhj left
|
|||
AlexDaniel | 223 :D | 06:28 | |
06:31
mr-foobar left
06:34
Cabanossi left,
andrzejku joined
06:35
Cabanossi joined
06:36
mr-foobar joined,
mcmillhj joined
06:38
andrzejku left,
andrzejku joined
06:39
robinsmidsrod left
06:40
robinsmidsrod joined,
domidumont joined
06:41
mcmillhj left
06:45
leont joined
06:46
andrzejku left
06:47
rindolf joined,
nadim left,
andrzejku joined
06:50
robinsmidsrod left,
robinsmidsrod joined
06:51
mcmillhj joined
|
|||
AlexDaniel | 209 … just by rewriting it without fancy stuff | 06:52 | |
06:53
cpage_ left
06:55
mcmillhj left
06:56
setty1 joined
06:59
benchable6 left
07:00
mr-foobar left
07:01
knobo joined
07:02
jonas1 joined
07:05
mr-foobar joined,
mcmillhj joined
07:10
mcmillhj left
07:12
cschwenz joined
07:16
mienaikage joined
07:18
leont left
07:19
wamba joined
07:21
lowbro joined,
lowbro left,
lowbro joined
|
|||
grondilu | m: class A does Real { has Int $.n; method Real { $!n % 3 } }; multi infix:<+>(A $a, A $b) { A.new: n => ($a.n +$b.n) % 3 }; my $a = A.new(:n(2)); say (foo => $a, foo => $a).Mix; | 07:22 | |
camelia | MoarVM panic: Memory allocation failed; could not allocate 79872 bytes | ||
grondilu | m: class A { has Int $.n; method Real { $!n % 3 } }; multi infix:<+>(A $a, A $b) { A.new: n => ($a.n +$b.n) % 3 }; my $a = A.new(:n(2)); say (foo => $a, foo => $a).Mix; | 07:24 | |
camelia | Mix(foo(4)) | ||
grondilu | m: class A { has Int $.n; method Real { $!n % 3 } }; multi infix:<+>(A $a, A $b) { A.new: n => ($a.n +$b.n) % 3 }; my $a = A.new(:n(2)); say (foo => $a).Mix; | ||
camelia | Mix(foo(2)) | ||
grondilu | m: say (foo => class {}.new).Mix | 07:25 | |
camelia | Cannot resolve caller Real(<anon|60754768>: ); none of these signatures match: (Mu:U \v: *%_) in block <unit> at <tmp> line 1 |
||
grondilu | m: say (foo => class does Real {}.new).Mix | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Unable to parse class definition at <tmp>:1 ------> 3say (foo => class does7⏏5 Real {}.new).Mix expecting any of: generic role |
||
grondilu | m: say (foo => class :: does Real {}.new).Mix | ||
camelia | MoarVM panic: Memory allocation failed; could not allocate 79872 bytes | ||
07:25
Ven`` joined
07:29
timotimo left
07:31
mr-foobar left
07:32
mr-foobar joined
07:33
mcmillhj joined,
wamba left,
cpage_ joined
07:36
cdg joined
07:38
mcmillhj left
|
|||
lizmat clickbaits p6weekly.wordpress.com/2017/09/18/...me-booked/ | 07:40 | ||
07:40
cdg left
07:41
xinming_ left
07:42
xinming joined
07:44
AelxDnaiel joined,
tadzik joined,
unclechu joined,
tyil[m] joined,
mack[m] joined,
Garland_g[m] joined,
wamba[m] joined,
M-Illandan joined,
wictory[m] joined,
Matthew[m] joined,
ilmari[m] joined,
CIAvash[m] joined,
xui_nya[m] joined,
sproctor joined
07:48
sproctor left
07:52
albertferrico joined
|
|||
albertferrico | hello everyone | 07:52 | |
07:52
dakkar joined
|
|||
moritz | hi albertferrico | 07:53 | |
albertferrico | I've just read about the fact that I can install perl6 on my raspberry pi and start building an app on "El Bailador". I tried to read the documentation of "El Bailador" but it seems to be unavailable | ||
hi Moritz | |||
does someone have the pdf of the "El Bailador" documentation? | 07:54 | ||
moritz | albertferrico: this one? leanpub.com/bailador | ||
albertferrico | I'm not sure | 07:55 | |
moritz | what are you talking about, then? | ||
albertferrico | I'm talking about this site: bailador.net/documentation | 07:56 | |
07:57
Ven`` left
|
|||
moritz | huh, ufobat and szabgab are offline | 07:59 | |
and I forgot my login on the bailador slack channel | 08:00 | ||
albertferrico | ah ok | 08:01 | |
08:01
mr-foobar left
08:02
mcmillhj joined
08:03
mr-foobar joined
08:06
mcmillhj left
08:10
albertferrico left
08:12
mcmillhj joined
08:15
xtreak left
08:16
raschipi joined
08:17
mcmillhj left
08:18
krunen joined,
krunen left,
krunen joined
08:19
krunen left
08:22
krunen joined,
krunen left
08:23
krunen joined
08:26
raschipi left,
robertle joined
08:28
zakharyas left
08:30
domidumont left
08:31
mr-foobar left
08:33
domidumont joined
08:35
mr-foobar joined
08:41
xtreak joined
08:42
mcmillhj joined
08:46
mcmillhj left
08:48
zakharyas joined
08:53
mcmillhj joined
08:57
mcmillhj left
09:00
wamba joined
09:05
mcmillhj joined
09:08
cuonglm left
09:10
mcmillhj left
09:19
TEttinger left
09:24
knobo left
|
|||
moritz | FYI, bailador.net is fixed (but albertferrico is gone) | 09:27 | |
09:31
Aaronepower left
09:32
mr-foobar left
09:34
mr-foobar joined
09:37
piojo joined
09:42
pierrot left
09:43
cdg joined
09:45
cdg_ joined
09:46
El_Che left,
cdg__ joined
09:48
zakharyas left,
zakharyas joined,
cdg left,
Cabanossi left
09:50
Cabanossi joined,
cdg_ left,
cdg__ left
09:53
El_Che joined,
zakharyas left
|
|||
AlexDaniel | m: my@x=[^∞],{@([\+] @$_)}…∞; for 0..19 -> $z { put ‘1 ’, @x[^$z].map: {.[$z-$++]} } | 09:54 | |
camelia | 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1 1 8 28 56 70 56 28 8 1 1 9 36 84 126 126 84 36 9 1 1 10 45 120 210 252 210 120 45 10 1 1 11 55 165 330 462 462 330 165 55 11 1 1 12 66 220 495 792 9… |
||
AlexDaniel | definitely not the shortest way to do it, but it's fun | ||
09:57
mcmillhj joined,
cdg joined
09:59
cdg_ joined
10:00
piojo left
10:01
cdg__ joined,
cdg left,
mcmillhj left
10:02
mr-foobar left
10:04
mr-foobar joined,
cdg_ left,
eliasr joined
10:05
cdg__ left
10:08
mcmillhj joined
10:12
mcmillhj left
10:14
wamba left
10:15
benchable6 joined,
ChanServ sets mode: +v benchable6,
unicodable6 joined
10:18
wamba joined,
S007 left
10:19
Aaronepower joined
10:20
margeas joined
|
|||
Zoffix | . | 10:21 | |
yoleaux | 05:16Z <grondilu> Zoffix: nevermind it occured to me that I can attach an Int to my objects via a rank method, and then use $x.rank to sort them. | ||
10:22
xtreak left
10:23
xtreak joined
|
|||
Zoffix | OK. So the disappeared code highlightings are just a temporary caching issue; nothing to worry about: github.com/github/linguist/issues/...-330377122 | 10:24 | |
Or this rather: github.com/github/linguist/issues/...-321189792 | 10:25 | ||
10:26
xtreak_ joined,
xtreak left
10:30
S007 joined
10:33
mr-foobar left,
Cabanossi left,
aborazmeh left
10:34
mr-foobar joined
10:35
Cabanossi joined
10:37
knobo joined
10:38
mcmillhj joined
10:39
krunen left
10:43
mcmillhj left
10:48
krunen joined
10:49
mcmillhj joined
|
|||
Zoffix | m: say Date.new('2017-10-08') - Date.today | 10:52 | |
camelia | 19 | ||
Zoffix | mst: I'm 19 days short of a whole year sober :) | 10:53 | |
10:54
mcmillhj left
10:55
krunen left,
krunen joined
|
|||
Zoffix | m: say Date.new('2018-07-01') - Date.today | 10:58 | |
camelia | 285 | ||
Zoffix | Though, I suspect in 285 days, with the new laws up here in Canukistan, I'll pick up baking as a hobby :P | ||
11:02
mr-foobar left
11:03
Cabanossi left
11:05
Cabanossi joined
|
|||
tbrowder | hi #perl6 | 11:06 | |
11:06
mr-foobar joined
|
|||
tbrowder | Zoffix: i look forward to yr books, good luck! | 11:06 | |
ref sets: how do i add another member to a defined set? | 11:07 | ||
Zoffix | tbrowder: thanks. I hope to churn them out fast. | 11:14 | |
tbrowder: sets are immutable, you can only add to SetHash, and you can do that with $sh<foo>++ | 11:15 | ||
or with $sh{@keys}>>++ if you have more than one key | 11:16 | ||
Zoffix & | |||
11:24
mcmillhj joined
11:26
konsolebox left
11:27
konsolebox joined
11:28
xtreak_ left
11:29
xtreak joined,
mcmillhj left
11:31
mr-foobar left
11:33
xtreak left
11:34
mr-foobar joined,
Cabanossi left
11:35
Cabanossi joined,
pierrot joined
11:36
mcmillhj joined
11:38
timo1 joined
11:39
timo1 is now known as timotimo
11:41
mcmillhj left
11:43
Aaronepower left
11:50
nattefrost joined
11:51
mcmillhj joined
11:52
ShalokShalom_ joined
|
|||
El_Che | ===SORRY!=== | 11:55 | |
Found /opt/rakudo/bin/moar version 2017.09, which is too old. Wanted at least 2017.09.1 | |||
11:55
ShalokShalom left
|
|||
El_Che | so, we have a subrelease as well this time? | 11:55 | |
AlexDaniel | this time again, yes | ||
but for moarvm only | |||
El_Che | ok, fixing the build | ||
AlexDaniel | so rakudo 2017.09 and moar 2017.09.1 | ||
11:56
mcmillhj left
|
|||
El_Che | AlexDaniel: by again I don't mean you, btw. It happens once in a while | 11:56 | |
AlexDaniel | El_Che: I clearly see the pattern :) We now have appveyor CI on moarvm repo so hopefully this won't happen again | 11:57 | |
El_Che | I kick travis to do the builds before I do it locally | ||
so, good canary | 11:58 | ||
I need to automate the release creation by travis | |||
12:02
mr-foobar left,
ShalokShalom_ is now known as ShalokShalom
12:03
Cabanossi left
|
|||
[Coke] | Zoffix: (regarding latex) an ex-parrot person, simon cozens has made his own thing that fills a similar space that you might be interested in: sile-typesetter.org/ | 12:04 | |
12:05
mr-foobar joined,
Cabanossi joined
|
|||
Zoffix | Thanks. | 12:07 | |
12:09
itaipu joined
12:11
llfourn left
|
|||
tbrowder | Zoffix: ref sets thanks. I've used them a lot but never needed to add to them so now on to SetHash! | 12:15 | |
[Coke] grumbles at having to take a 3 page html doc and reformat it in movable type. | 12:16 | ||
El_Che | travis-ci.org/nxadm/rakudo-pkg/jobs/277273232 <--rakudo fails on fedora 26, so far it builds fine on other OS'es | 12:17 | |
including fedora 25: travis-ci.org/nxadm/rakudo-pkg/builds/277273227 | 12:18 | ||
Zoffix | m: dd <a d e>.Set ∪ <a b c>.Set ∪ 42 | ||
camelia | set(42,"e","d","b","a","c") | ||
Zoffix | tbrowder: ^ another way to add, where you don't have to deal with SetHash | ||
12:18
Aaronepower joined,
xinming_ joined
|
|||
tbrowder | ok! | 12:19 | |
El_Che | I meant "fails on fedora 25, works on fedora 26": rerunning the jib to make sure | ||
12:20
rindolf left
12:21
mcmillhj joined
12:22
xinming left
|
|||
Zoffix | .in 10h fix make xtest on docs | 12:25 | |
yoleaux | Zoffix: I'll remind you at 22:25Z | ||
12:26
mcmillhj left
|
|||
Geth | doc: 6dc61f89d7 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/operators.pod6 Remove reference to specific implementation's details .oO( this entire paragraph on implementing a custom `eqv` probably doesn't belong here ) |
12:27 | |
12:29
xtreak joined
|
|||
El_Che | AlexDaniel: the previous rakudo built fine on Fedora 25, but fails on 26: travis-ci.org/nxadm/rakudo-pkg/job...3232#L1513 | 12:30 | |
Ubuntu, Centos and Debian build fine | |||
where there new dependencies added? | |||
AlexDaniel | El_Che: RT #132114 | ||
synopsebot6 | Link: rt.perl.org/rt3/Public/Bug/Display...?id=132114 | ||
12:32
Cabanossi left
12:35
xtreak left,
Cabanossi joined
12:40
kerframil joined
|
|||
Geth | doc: e0b271a5c8 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/operators.pod6 Document edge case eqv behaviour… …when comparing lazy iterables |
12:41 | |
12:42
aeruder left
12:43
aeruder joined
12:46
wamba left
12:52
Guest34710 left
13:01
mr-foobar left
13:05
mr-foobar joined,
sena_kun joined
|
|||
Geth | doc: 3702cc2b70 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/operators.pod6 Remove superfluous «Note that» |
13:05 | |
13:07
cdg joined
13:08
giraffe joined,
giraffe is now known as Guest431,
cdg left,
cdg joined
13:11
cdg_ joined
13:14
cdg left
13:24
skids joined
13:31
mr-foobar left
|
|||
AlexDaniel | code-golf.io/ | 13:32 | |
maybe I can go to bed now… | |||
timotimo | oh wow, well done | ||
you deserve some rest | |||
Zoffix | haha nice :) AlexDaniel++ | 13:33 | |
AlexDaniel | arabic to roman is a boring task, don't really want to think about it | 13:34 | |
but Pascal's triangle… | |||
somehow I can save 3 chars, and I just can't see it :/ | |||
13:36
mr-foobar joined
13:38
sena_kun left
13:44
xtreak joined
13:46
nowan left
13:47
xtreak left
13:51
nowan joined
|
|||
grondilu | Fibonacci in 18 chars. That's sorcery | 13:52 | |
tadzik | that's... long | 13:53 | |
mspo | how do you see the solutions? | ||
tadzik | ISTR we can 10: 1,1,*+*...* | 13:54 | |
grondilu | you also must print the first 31 elements | ||
ilmari | m: say (1,1,*+*...*)[^31] | ||
camelia | (1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269) | ||
grondilu | oh wai | 13:55 | |
oh wait | |||
I know | |||
jast | which is >20 characters | ||
tadzik | ah, but you have to print the first 31 | ||
AlexDaniel | each on new line, yeah | ||
… saves you two characters already | |||
mspo: I think you can't | 13:56 | ||
which is rather unusual | |||
mspo | useful | ||
maybe the stack exchange one is better | 13:57 | ||
too bad | |||
AlexDaniel | FWIW you'd never see tricks I used there in real code, so maybe it's good that you can't see it… :) | 13:58 | |
13:58
mcmillhj joined
|
|||
tadzik | oh, 18 is some black magic then | 13:58 | |
AlexDaniel | you can get 19 without black magic :) | 13:59 | |
but with ».say though | |||
timotimo | bad idea :) | ||
AlexDaniel | which is incorrect, but oh well… | ||
grondilu | I used .put | 14:00 | |
ilmari | what's bad about ».say? | 14:01 | |
moritz | &[+] isn't shorter than *+* :( | ||
AlexDaniel | ilmari: it prints stuff in random order | ||
moritz | ilmari: it doesn't process in order | ||
AlexDaniel | mspo: one problem with stack exchange is that they count the number of bytes | 14:02 | |
ilmari | ah, indeed | ||
AlexDaniel | which is… uhhhhh… | ||
ilmari | «Note that all hyper operators are candidates for autothreading and will cause tears if the methods have side effects.» | ||
mspo | :) | ||
14:02
mr-foobar left
|
|||
mspo | AlexDaniel: tough onn perl6 | 14:02 | |
14:04
mr-foobar joined
|
|||
ilmari | also, 832040) isn't any shorter than *)[^30] :( | 14:05 | |
moritz | can't you hard-code the 31's pasc... what ilmari said :( | ||
grondilu | ilmari: I got somthing for that pat hehe | ||
*part | |||
moritz | maybe if it's the first of the numbers that has a unique divisor | ||
than you do do ...*%%5 or so | |||
s/do/could/ | |||
grondilu | 4chars are enough :) | 14:06 | |
oh wait | |||
moritz | m: for 2..99 { say $_ if 1346269 %% $_ } | 14:07 | |
camelia | ( no output ) | ||
grondilu | isn't there a unicode alt for ... ? | ||
AlexDaniel | … | ||
grondilu | :) | ||
AlexDaniel | \o/ | ||
told ya, 19 isn't hard | |||
grondilu | still one char chort | ||
timotimo chortles | 14:09 | ||
14:09
Aaronepower left
|
|||
ilmari | feature requests: subscript digits for numbers in other bases: HU08₃₆ | 14:10 | |
s/ts/t/ | |||
AlexDaniel | heh, another use for subscripts | ||
timotimo | time for a slang | 14:11 | |
14:13
headcase joined
14:15
mcmillhj left
14:16
mcmillhj joined,
Aaronepower joined
|
|||
ugexe | is it normal for some systems copyfile api to not truncate by default? | 14:19 | |
timotimo | it's windows we're talking about here ;) ;) | 14:20 | |
ugexe | its win32/osx vs linux/bsd it looks like | ||
timotimo | i mean, surely it'll be useful to be able to open a file, seek to some place, and overwrite from there using the contents of another file | ||
and having the kernel do the work for you is great if you have networked filesystems or something | 14:21 | ||
ugexe | but do people normally use copyfile for that? | ||
timotimo | don't think so | ||
14:23
Khisanth left
14:24
Khisanth joined
|
|||
Zoffix | With only 34 options, you could just do 34 ops :) | 14:25 | |
Oh wait, it won't know that HU is a number :) nevermind | 14:26 | ||
14:32
mr-foobar left
|
|||
AlexDaniel | Zoffix: hey, I know that you know. Why does this happen? | 14:32 | |
m: $_ = 1; say $++ xx 5 | |||
camelia | (0 1 2 3 4) | ||
grondilu | yeah me! I got the lead in Pascal's triangle :) | 14:33 | |
AlexDaniel | :O | ||
damn triangle | |||
Zoffix | AlexDaniel: what happens? | ||
AlexDaniel | grondilu++ | ||
Zoffix: well, why is it not 1 1 1 1 1? | |||
jnthn | xx thunks | ||
Zoffix | and you assigned 1 to $_, which isn't used by the code | 14:34 | |
AlexDaniel | right | ||
Zoffix | m: for ^5 { say $++ } | ||
camelia | 0 1 2 3 4 |
||
jnthn | Yeah, I was wondering what the $_ = 1 was for :-) | ||
Zoffix | AlexDaniel: ^ same as here, basically | ||
AlexDaniel | but if I do something like | 14:35 | |
m: $_ = 5; say .succ xx | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing required term after infix at <tmp>:1 ------> 3$_ = 5; say .succ xx7⏏5<EOL> expecting any of: prefix term |
||
AlexDaniel | m: $_ = 5; say .succ xx 5 | ||
camelia | (6 6 6 6 6) | ||
Zoffix | Because you're not saving the result | ||
$ is a state variable | |||
and ++ saves the new value in it | |||
m: $_ = 5; say $_.=succ xx 5 | 14:36 | ||
camelia | (6 7 8 9 10) | ||
AlexDaniel | m: $_ = 5; say .=succ xx 5 | ||
camelia | (6 7 8 9 10) | ||
AlexDaniel | okay | ||
Zoffix | huh | ||
14:36
mr-foobar joined
|
|||
AlexDaniel | yeah I have no idea | 14:36 | |
Zoffix | m: $_ = 5; .=succ for ^5 | ||
camelia | Cannot modify an immutable Int (0) in block <unit> at <tmp> line 1 |
||
Zoffix | m: $_ = 5; for ^5 -> $ { .=succ } | ||
camelia | ( no output ) | ||
AlexDaniel | m: $_ = 5; say .++ xx 5 | ||
camelia | (5 6 7 8 9) | ||
Zoffix | Weird, I thought .=foo didn't work. | 14:37 | |
Wonder if I thought that because in some cases it actually doesn't :) | |||
(maybe I'm just confusing it with .»foo not working (not assuming $_ before the dot) | |||
grondilu | seems so, .=foo is a common idiom, like in .=new | 14:38 | |
Zoffix | my $x .= new is, but can't say I saw .=new (with the $_ as the variable) | 14:39 | |
geekosaur | that's just because it's something of an odd circumstance | 14:41 | |
14:48
alexk joined
|
|||
Zoffix | man the subscript slang doesn't wanna assemble :( | 14:48 | |
alexk | m: class Foo is Int {}; my Foo $x .= new: 42; say $x; say $x.WHAT; | 14:49 | |
camelia | Type check failed in assignment to $x; expected Foo but got Int (42) in block <unit> at <tmp> line 1 |
||
14:49
committable6 joined,
ChanServ sets mode: +v committable6
|
|||
Zoffix | m: BEGIN { $?LANG.refine_slang: 'MAIN', role { token number:sym<subbase> { $<num>=<[0..9A..Za..z]>+ $<base>=<[₀₁₂₃₄₅₆₇₈₉]>+ } }, role { method number:sym<subbase> ($/) { my $base = $<base>.comb.reverse.map({.unival*10**$++}).sum; make $<num>.parse-base: $base; } }, }; say HU08₃₆ | 14:49 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Bogus postfix at <tmp>:1 ------> 3um>.parse-base: $base; } }, }; say HU087⏏5₃₆ expecting any of: infix infix stopper postfix statement end … |
||
Zoffix | I guess the identifier+op matches first somehow. Oh well, too bad :) | ||
alexk: Int.new returns an Int. | 14:50 | ||
alexk: core classes aren't yet polished enough for easy subclassing like that. Especially something as basic as an Int | |||
14:50
quotable6 joined,
releasable6 joined,
bloatable6 joined,
ChanServ sets mode: +v quotable6,
squashable6 joined
14:51
statisfiable6 joined
|
|||
alexk | Zoffix: It does work with an older rakudo version ... | 14:51 | |
Zoffix | Then I bet it's because some buy added a patch to Int.new to fix something and it's still there. | 14:52 | |
s: 42, 'new', \() | |||
SourceBaby | Zoffix, Sauce is at github.com/rakudo/rakudo/blob/bb45...Mu.pm#L112 | ||
Zoffix | s/buy/guy/ | ||
s: 42, 'new', \(42) | |||
SourceBaby | Zoffix, Sauce is at github.com/rakudo/rakudo/blob/bb45...Int.pm#L25 | ||
alexk | Zoffix: I found this: blogs.perl.org/users/zoffix_znet/20...erl-6.html | 14:53 | |
Zoffix | Ah, at least it wasn't totally useless: "Fix Int.new for large values" | ||
Yeah, that patch is crap. It uses .Int to coerce to an Int | 14:55 | ||
14:57
geekosaur left,
wamba joined
|
|||
AlexDaniel | ok | 14:59 | |
now how much do I need for this… | |||
grondilu: :) | 15:00 | ||
15:01
lostinfog joined,
erratum left
|
|||
Zoffix | m: use nqp; class Foo is Int { method new ($v) { nqp::p6bindattrinvres(self.bless, Int, q|$!value|, nqp::decont($v)) } }; my Foo $x .= new: 42; say $x; say $x.WHAT; | 15:02 | |
camelia | P6opaque: representation mismatch when storing value (of type Int) to attribute (of type bigint) in method new at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
Zoffix | Is there a way to get a bigint in HLL land? I see $*W has some QAST-building stuff for bigint constants, but is there a trick to build them in src/core/Int.pm for example? | 15:03 | |
15:03
mr-foobar left
|
|||
timotimo | whoops i got my terminal into a mode where arrow keys skip whole words and now i can't code any more? | 15:04 | |
15:04
timotimo left
|
|||
Zoffix | Are you sure your CTRL key isn't stuck? | 15:04 | |
Ctrl+arrows skips by words on my terminal | |||
15:04
mr-foobar joined,
rindolf joined
|
|||
Zoffix | m: use nqp; class Foo is Int { method new ($v) { nqp::box_i($v, self.WHAT); } }; my Foo $x .= new: 42; say $x; say $x.WHAT; | 15:05 | |
camelia | 42 (Foo) |
||
15:05
timo joined,
timo is now known as timotimo
|
|||
timotimo | turns out my weechat wasn't running inside a tmux at all | 15:05 | |
Zoffix | alexk: you can use ^ that in the meantime, I guess. It still has the problem that >64bit ints don't work right that the core patch fixed. Unsure what the fix is to make it work right and subclass right. | ||
15:05
geekosaur joined
15:07
khw joined
|
|||
Zoffix | m: use nqp; class Foo is Int { method new ($v) { nqp::p6bindattrinvres(self.bless, Int, q|$!value|, nqp::getattr(nqp::decont($v), Int, q|$!value|)) } }; my Foo $x .= new: 42; say $x; say $x.WHAT; | 15:13 | |
camelia | (signal SEGV) | ||
Zoffix | fun | ||
timotimo | that shouldn't happen :) | 15:14 | |
Zoffix | Filed: rt.perl.org/Ticket/Display.html?id=132126 | 15:15 | |
moritz | if you use the wrong types (for example getattr instead of getattr_i), a segfault may well happen | ||
Geth | doc: 67bc4c3f2f | (Wenzel P. P. Peppmeyer)++ (committed by Zoffix Znet) | doc/Type/IO/Socket/Async.pod6 Better example for IO::Socket::Async, closes #1546 (#1547) * Better example, closes #1546 * Update Async.pod6 * Update Async.pod6 |
15:16 | |
timotimo | moarvm should never segfault unless you use NativeCall to do evil things | ||
moritz | really? | ||
timotimo | yeah | ||
jnthn | In this case it should be boxing | ||
Zoffix | m: use nqp; class Foo is Int { method new ($v) { nqp::p6bindattrinvres(self.bless, Int, q|$!value|, nqp::getattr_i(nqp::decont($v), Int, q|$!value|)) } }; my Foo $x .= new: 42; say $x; say $x.WHAT;' | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Unable to parse expression in single quotes; couldn't find final "'" at <tmp>:1 ------> 3Foo $x .= new: 42; say $x; say $x.WHAT;'7⏏5<EOL> expecting any of: single quotes … |
||
timotimo | somehow the repr_data ends up being a null pointer | ||
Zoffix | m: use nqp; class Foo is Int { method new ($v) { nqp::p6bindattrinvres(self.bless, Int, q|$!value|, nqp::getattr_i(nqp::decont($v), Int, q|$!value|)) } }; my Foo $x .= new: 42; say $x; say $x.WHAT; | ||
camelia | P6opaque: representation mismatch when storing value (of type Int) to attribute (of type bigint) in method new at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
timotimo | in the copy_to reprop, apparently | 15:17 | |
P6opaque's copy_to i mean | |||
jnthn | But it's in a code path that's barely used, so... | ||
Zoffix | is there a nqp::box_bi or nqp::getattr_bi or nqp::box_a_bigint_into_this_subclas_of_int? | ||
jnthn | Zoffix: No, what you wrote should probably do it though | ||
Zoffix | OK. cool. | ||
jnthn | Except the SEGV | ||
Zoffix | :) | ||
jnthn | But what it should do is wrap the normally flattened-in bigint into a box on the getattr, and extract it on the bindattr | 15:18 | |
15:22
llfourn joined
|
|||
Zoffix | .in 4d fix what you broke, bruh: rt.perl.org/Ticket/Display.html?id=132128 | 15:23 | |
yoleaux | Zoffix: I'll remind you on 23 Sep 2017 15:23Z | ||
Zoffix | alexk: I filed your issue as rt.perl.org/Ticket/Display.html?id=132128 and unless someone beats me to it, will try to fix before Monday. | 15:24 | |
alexk | Zoffix: Thank you | ||
AlexDaniel | .tell Hotkeys I remember you liked golfing in perl 6 code-golf.io | 15:28 | |
yoleaux | AlexDaniel: I'll pass your message to Hotkeys. | ||
AlexDaniel | .seen Hotkeys | ||
yoleaux | I saw Hotkeys 26 Jul 2017 19:09Z in #perl6: <Hotkeys> I'd have to go through my answers though | ||
15:30
alexk left
15:32
itaipu left
15:33
ChoHag left,
mr-foobar left
15:34
geekosaur left
15:37
mr-foobar joined
|
|||
dogbert17 | ==24818== ERROR: AddressSanitizer: SEGV on unknown address 0x00000000 (pc 0xb567a972 sp 0xbf9d4030 bp 0xbf9d4078 T0) | 15:40 | |
#0 0xb567a971 in copy_to /home/dogbert/repos/rakudo/nqp/MoarVM/src/6model/reprs/P6opaque.c:89 | |||
#1 0xb567e076 in bind_attribute /home/dogbert/repos/rakudo/nqp/MoarVM/src/6model/reprs/P6opaque.c:354 | |||
Zoffix ^^ | |||
15:42
domidumont left,
knobo left
|
|||
Zoffix | dogbert17++ thanks. | 15:42 | |
Maybe I'll play with it tonight. Hone in my newly acquired C-foo :) | 15:43 | ||
15:47
geekosaur joined
15:48
Cabanossi left
15:49
itaipu joined
15:50
Cabanossi joined
|
|||
timotimo | huh, now that is fascinating. the copy_to of P6opaque is called on a p6bigint object | 15:51 | |
got the fix | 15:53 | ||
Zoffix: sorry :( | |||
Zoffix | timotimo: nah, it's cool :) | 15:54 | |
I have plenty of other stuff to fix :D | |||
timotimo | i should spectest it before it goes in, though | ||
Zoffix | I'll write the tests and try to fix that Int.new bug | 15:55 | |
15:57
Aaronepower left
15:58
nadim joined
15:59
gregf_ joined
16:01
Aaronepower joined,
cschwenz left
16:02
geekosaur left
16:03
robertle left,
mr-foobar left
16:05
mr-foobar joined
16:07
nadim left
16:10
ChoHag joined,
mcmillhj left
16:15
geekosaur joined
16:17
mcmillhj joined
16:22
mcmillhj left
16:28
dakkar left
16:30
mcmillhj joined,
nadim joined
16:32
mr-foobar left
16:34
mcmillhj left
16:35
mr-foobar joined,
teatime left
16:36
headcase left
16:41
mcmillhj joined
16:46
mcmillhj left
16:49
Cabanossi left
16:50
Cabanossi joined
16:52
mcmillhj joined
16:58
teatime joined
17:07
Rawriful joined
17:08
Aaronepower left,
piojo joined
17:17
AlexDaniel left,
Aaronepower joined
17:34
Ven`` joined,
Cabanossi left
17:35
Cabanossi joined
17:38
rindolf left,
andrzejku_ joined
17:39
domidumont joined
|
|||
Geth | doc: b8f14bf6c9 | (Zoffix Znet)++ (committed using GitHub Web editor) | html/.htaccess De-404 /type/int* docs So URLs in form /type/$some-type work for native int types |
17:46 | |
17:50
ChoHag left
17:51
piojo left
17:52
Aaronepower left
18:09
andrzejku_ left,
andrzejku_ joined
18:20
lostinfog left
18:26
headcase joined
18:27
headcase_ joined
18:30
headcase left
18:32
cdg joined
18:35
cdg_ left
18:36
cdg left
18:41
darutoko left
18:42
ChoHag joined
18:52
domidumont left
19:01
smls joined
|
|||
Zoffix | m: class Foo is Int {}; my Foo $x .= new: 42; say $x; say $x.WHAT; | 19:03 | |
camelia | 42 (Foo) |
||
Zoffix | alexk: there, fixed forever. | ||
19:05
cognominal left
|
|||
El_Che | jnthn: rt.perl.org/Public/Bug/Display.html?id=132114 suggests you fixed the failing test on travis. However, I am building with moarvm 2017.09.1 on travis and it stills fails. Only the fedora 25 container while fedora 26, ubuntu *, debian * and centos 7 build fine | 19:07 | |
jnthn: travis-ci.org/nxadm/rakudo-pkg/jobs/277273232 | 19:08 | ||
I just restated the job as the bug suggest it's a random fail. So far it fails 2 out of 2 | |||
jnthn | El_Che: Was fixed since the release | 19:10 | |
El_Che | jnthn: then I am hitting something else since I use moarvm .1 | ||
jnthn | .1 didn't have the fix, I meant | 19:11 | |
I fixed it yesterday or something | |||
The test has been vulnerable to that failure since it was added some months ago, though. | |||
El_Che | Ah ok. Let's see if I get 3 out of 3 | ||
running now | |||
will you publish a .2? | 19:12 | ||
with the fix I mean? | |||
jnthn | No | ||
El_Che | ok | ||
jnthn | The problem has been in like 3-4 previous releases | ||
El_Che | first time I hit it and I build a lot | 19:13 | |
jnthn | In that, the bug was in the code that was added when that test was also added | ||
El_Che | I build 9 pkgs at the time (4 OS, different x64 OS releases + 386 for ubuntu) | 19:14 | |
jnthn | It's possible that something else made it more likely to appear, though | ||
Of note, native calling got faster | |||
El_Che | I wonder why only fedora 25 has the problem in my setup | 19:15 | |
while 26 doesn't | |||
jnthn | For me it failed something like 1 time in 20 | ||
Or less | |||
On a loaded system it was more like 1 time in 5 | |||
El_Che | 2 out of 2 is of course not really representative | ||
but 2 out of 2 was for each OS | 19:16 | ||
sjn | o/ | ||
sjn plays around with Cro today o/ | |||
El_Che | (as in all pass, and the same fails) | ||
sjn | is the TLS work that's been done lately finished? (having some errors about "no shared cipher" with the default fake certs) | 19:17 | |
jnthn | sjn: Haven't seen that one before. Though am still hunting github.com/jnthn/p6-io-socket-asyn.../issues/19 which is proving to be very hard to track down | 19:18 | |
jnthn bbi30 | |||
19:18
espadrine joined
|
|||
El_Che | jnthn: the third run passed | 19:18 | |
jnthn: thx for the help! | 19:22 | ||
19:38
avalenn joined
19:39
jonas1 left
19:41
Aaronepower joined
|
|||
sjn | looks like the "no shared cipher" error message is made by openssl | 19:45 | |
19:49
firecat joined
|
|||
geekosaur | modern web servers have a lot of older ciphers disabled for security reasons | 19:50 | |
sjn | hm. that would mean the default ciphers used by IO::Socket::Async::SSL and/or Cro::TLS are all old | 19:52 | |
I get that error when opening the cro service with my browser | 19:53 | ||
(Firefox 55.0.2 on Ubuntu) | |||
19:54
eliasr left
|
|||
timotimo | sjn: superuser.com/questions/109213/how...ite-offers - you could try the shell script in the second answer to see what cro offers | 19:57 | |
sjn | timotimo: it seems that cro just quits and gives absolutely no output for openssl to parse | 19:59 | |
jnthn | Got some stuff to do afk for the next while but github.com/jnthn/p6-io-socket-asyn...L.pm6#L291 is where to look in the code | ||
For the default ciphers | 20:00 | ||
El_Che | wow. Even when building on my laptop, the one that fails is fedora 25 while the rest builds fine. Weird bug | ||
timotimo | oh, is this about the cro https client? | ||
sjn | timotimo: no, I'm setting up a service with cro | 20:01 | |
in fact, I'm trying the default service that cro stub creates | |||
timotimo | wow, and cro quits with that error, that looks a bit like an oversight :) | 20:02 | |
sjn | Kinda strange that Cro::TLS::Listener just quits, isn't it? | ||
timotimo | just a case of a missing try i expect ;) | 20:05 | |
20:11
cdg joined,
nattefrost left
20:13
nadim left
20:16
cdg_ joined,
rindolf joined
20:19
cdg left,
luis` left
20:21
itaipu left
20:24
kybr joined
20:25
andrzejku_ left
20:27
smls left
20:30
rindolf left
20:32
rindolf joined
20:40
setty1 left
20:42
firecat left
|
|||
Zoffix | moritz++ # fun example of primality test with regexes in the book :) | 20:45 | |
(also gives you the idea of where I am with proofreading; hoping to put in extra hours on the weekend, in addition to proofreading for about 40m a day on the bus) | 20:46 | ||
and finish before Monday EST | |||
20:51
markmont left
20:53
TEttinger joined
20:59
firecat joined
|
|||
firecat | p6:say 5 | 21:01 | |
timotimo | m: say 5 | ||
camelia | 5 | ||
timotimo | seems like it really wants a space after the : | 21:02 | |
firecat | p6: say 3; | ||
camelia | 3 | ||
firecat | y | ||
21:06
headcase_ left
21:10
headcase joined
21:14
headcase left
21:17
mcmillhj left
21:22
cpage_ left
21:27
wamba left
|
|||
weabot | Is there a way to just pass @argv as a variable whose modifications are kept from lisp_append_args sort of like a pointer? Instead of doing this: @argv = append_args(@argv, $0); | 21:27 | |
21:27
raschipi joined
|
|||
weabot | this is thread specific and too temporary to be worth defining as a global variable | 21:27 | |
timotimo | you can "temp @*ARGV" | 21:28 | |
perl6 -e 'say @*ARGS; { temp @*ARGS; unshift @*ARGS, $*PROGRAM-NAME; say @*ARGS; }; say @*ARGS' 1 2 3 | 21:29 | ||
try this | |||
21:30
epony joined
|
|||
weabot | these are only arguments to give to a subroutine that I parse and append myself | 21:31 | |
timotimo | ooooh | ||
you mean like this: | |||
m: sub call-this($a, $b, $c) { say "a $a, b $b, c $c" }; sub add-nine(@*args) { call-this(9, |@args) }; add-nine("hi", "weabot") | 21:32 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '@args' is not declared. Did you mean '@*args'? at <tmp>:1 ------> 3}; sub add-nine(@*args) { call-this(9, |7⏏5@args) }; add-nine("hi", "weabot") |
||
timotimo | m: sub call-this($a, $b, $c) { say "a $a, b $b, c $c" }; sub add-nine(*@args) { call-this(9, |@args) }; add-nine("hi", "weabot") | ||
camelia | a 9, b hi, c weabot | ||
weabot | hmm | 21:33 | |
I think that's it yeah | |||
timotimo | cool | ||
21:34
Cabanossi left
|
|||
weabot | actually that doesn't modify @args in the calling function if I'm understanding this correctly but I can make this work | 21:34 | |
timotimo | m: sub call-this($a, $b, $c) { say "a $a, b $b, c $c" }; sub add-nine(*@args) { @args.unshift(9); call-this(|@args) }; add-nine("hi", "weabot") | 21:35 | |
camelia | a 9, b hi, c weabot | ||
timotimo | you can modify @args in that function just fine :) | ||
weabot | ooh nice | ||
21:35
Cabanossi joined
21:36
cpage_ joined
|
|||
weabot | hmm | 21:38 | |
sub test (@argv) { @argv.append("arg3"); } my @argv = ["arg1", "arg2"]; test(@argv); put(@argv); | 21:39 | ||
m: sub test (@argv) { @argv.append("arg3"); } my @argv = ["arg1", "arg2"]; test(@argv); put(@argv); | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Strange text after block (missing semicolon or comma?) at <tmp>:1 ------> 3b test (@argv) { @argv.append("arg3"); }7⏏5 my @argv = ["arg1", "arg2"]; test(@argv expecting any of: in… |
||
weabot | you see, I want this to add "arg3" to @argv | 21:40 | |
m: sub test (@argv) { @argv.append("arg3"); }; my @argv = ["arg1", "arg2"]; test(@argv); put(@argv); | |||
camelia | arg1 arg2 arg3 | ||
weabot | wait | ||
is all I've ever believed wrong? do functions that are passed arrays modify them? | 21:41 | ||
Zoffix | yup | 21:42 | |
Same with any other object. | 21:43 | ||
weabot | is that if they don't have any return values or..? | ||
Zoffix | At all times | ||
weabot | how have I written so much perl 6 without knowing this, and without screwing things up? | 21:44 | |
holy hell | |||
teatime | Zoffix: so when would you have to use 'is rw' in signature? | ||
21:45
troys joined
|
|||
Zoffix | weabot: basically a function has no control over which methods you can call on the passed argument; it doesn't restrict them. So if you call methods like appending stuff or some other method that mutates the passed object, it's not gonna stop you and it'll mutate the original object that was passed. It doesn't implicitly clone it | 21:45 | |
weabot | I've written 952 lines of code under the assumption that functions don't modify their arguments | ||
I haven't modified an argument that I've reused in a single subroutine of that code | 21:46 | ||
21:46
Ven`` left
|
|||
weabot | that's impressive | 21:46 | |
Zoffix | teatime: when you want the callee to give you a writeable container | ||
teatime | weabot: 1000 lines isn't so much, and also if you're like me you probably avoid modifying arguments even when the language assures them to be locals just for readability | ||
timotimo | teatime: if you want to re-assign to a scalar that got passed to your sub, that's when "is rw" can let you change stuff on the outside | ||
weabot | teatime yeah, it's just mind-blowing to me | 21:47 | |
Zoffix | weabot: for FWIW, even Damian Conway made that mistake and said arrays won't modified during a talk I attended :) | ||
So don't feel bad | |||
weabot | I mean I do avoid modifying arguments usually | ||
Zoffix | teatime: basically "is rw" just asks that the routine could write to the container that's given as an argument. It says nothing about immutability of the passed object | 21:48 | |
teatime | Zoffix / timotimo : gotcha, I think I follow. | ||
El_Che | New Linux packages: github.com/nxadm/rakudo-pkg/releas.../2017.09.1 | 21:49 | |
Zoffix | \o/ | ||
El_Che++ | |||
teatime | so if you 'is rw' a @-sigil'd argument, you can reassign a different Array to the @variable in the calling scope? | ||
or is it just for $scalars | |||
actually you don't really have to answer, I don't need to know / can go read instead | 21:50 | ||
geekosaur | or just try it, we do have a bot you know :p | ||
weabot | I'm surprised that rakudo wasn't ported to freebsd yet | ||
I compiled it succesfully the other day on there | |||
Zoffix | teatime: it'll complain about it :) | 21:51 | |
m: -> @ is rw {} | |||
camelia | ( no output ) | ||
teatime | geekosaur: every time I try to use the bot for a one-off test/example, I syntax error :) I have to fix up my bot stuff for a few minutes in REPL usually. | ||
Zoffix | m: -> @ is rw {}() | ||
camelia | Too few positionals passed; expected 1 argument but got 0 in block <unit> at <tmp> line 1 |
||
Zoffix | orly | ||
21:51
espadrine left
|
|||
Zoffix | m: sub (@ is rw) {}() | 21:51 | |
camelia | Too few positionals passed; expected 1 argument but got 0 in sub at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
Zoffix | m: sub (@x is rw) {}() | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> For parameter '@x', '@' sigil containers don't need 'is rw' to be writable Can only use 'is rw' on a scalar ('$' sigil) parameter, not '@x' at <tmp>:1 |
||
Zoffix | m: -> @x is rw {}() | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> For parameter '@x', '@' sigil containers don't need 'is rw' to be writable Can only use 'is rw' on a scalar ('$' sigil) parameter, not '@x' at <tmp>:1 |
||
geekosaur | so do i. so I try to remember to do it in /query first :) | ||
teatime | Zoffix: and now, I remember reading that once :) | 21:52 | |
Zoffix | teatime: FWIW, I found this article useful when trying to grasp the containers: docs.perl6.org/language/containers | ||
geekosaur | weabot, I vaguely recall there was a port back in the parrot days, the maintainer disappeared and it was dropped? | 21:53 | |
weabot | let me double check my ports tree | ||
nope, doesn't seem like it | 21:54 | ||
21:54
benchable6 left
|
|||
weabot | I mean it was dropped I guess | 21:54 | |
Zoffix | Filed the inconsistency as rt.perl.org/Ticket/Display.html?id=132133 | ||
21:55
kerframil left
22:03
Cabanossi left
22:04
pilne joined
22:05
Cabanossi joined
|
|||
Ulti | any reason why iterating through a file with encoding utf8-c8 takes 1m23s latin-1 takes 13s and default encoding is 16s? | 22:22 | |
my expectation was utf8-c8 would be less expensive than the default was that wrong? | |||
timotimo | there's a fast-path in the decoder for utf8, probably none for utf8-c8 | 22:24 | |
22:25
cognominal joined
|
|||
yoleaux | Zoffix: fix make xtest on docs | 22:25 | |
jnthn | utf8-c8 is a lot more expensive, because it's got to keep track of a bunch more | 22:28 | |
Not only to be able to recover and produce synthetics on invalid bytes, but also to be able to cope with things that aren't in NFC | 22:29 | ||
Zoffix | yoleaux: I wanted to relax, bruh | ||
Zoffix hopes there are few failures | |||
jnthn | Zoffix: I know that feeling :) | 22:30 | |
Ulti | jnthn: are all the same sort of promises made about string ops/methods as with the normalised strings? | ||
so stuff like length is based on graphemes? | |||
jnthn | With utf8-c8? | ||
Ulti | yeah | ||
jnthn | What are you using it for? | ||
Ulti | im not, just curious | 22:31 | |
jnthn | If you feed it text in NFD, then it will actually store a synthetic grapheme per byte that makes that up, iirc | ||
Ulti | given that feels a bit like an impossible task | ||
ok | |||
jnthn | The point of it is to let people pretend a filename is a Str | ||
And appending '.bak' to it and feed it back to the OS and get the Right Thing happening | 22:32 | ||
It's a pretty bad idea to use it for general input | |||
22:32
headcase joined
|
|||
Ulti | all of this was also just kicked off by Zoffix mentioning perf on reddit :3 | 22:33 | |
22:33
headcase left
|
|||
jnthn | Yeah, normal utf8 decoding is fairly well optimized | 22:33 | |
Ulti | I should probably write more stuff down but I think its been a whole number factor imporvement since last I checked | ||
about 10x off of perl5 hacktastic strings that everyone secretly really wants >:P | 22:34 | ||
if you made perl5 do exactly the same job it must be getting close now | |||
jnthn | Yes, for sufficiently large files to overcome the startup/optimizer time, `for $fh.lines { ... }` typically comes out ahead of Perl 5 if doing utf-8 decoding these days. | 22:35 | |
22:35
headcase joined
|
|||
jnthn | There's output buffering now too, so output is within a factor of about 1.2x or so | 22:35 | |
(Again, assuming utf8-8 encoding) | 22:36 | ||
Ulti | the real issue in the world is that bioinformatics uses ascii bytes for something that can be 2-3bit encoded | 22:37 | |
jnthn | Yeah, I guess for bioinformatics folks, it's ASCII performance (or "I don't care" performance :-)) that really matters. | 22:39 | |
Ulti | yeah :( plus everything is gzipped all the time everywhere because of the stupid encoding and DNA itself having lots of runs | 22:40 | |
raschipi | Can Perl6 start using an ASCII fast path and only turn on the utf-8 path when it encounters a byte bigger than 127? | 22:41 | |
teatime | Ulti: at least gzip is efficient for streaming | ||
Ulti | there is a bias in which letters of DNA have runs too... so you'd hope in a sane world youd pick the highest or lowest byte value for those to make it more compressable (obviously not) | ||
teatime apart from they gzip small chunks and put them end to end | 22:42 | ||
jnthn | raschipi: It's largely already doing that, except NFG means you gotta look out for \r too | ||
Ulti | the idea being its then easy to jump in and index | ||
but bzip2 already has that block concept built in :/ | 22:43 | ||
raschipi | Right, isn't that what dealing with DNA needs for performance? | ||
Ulti | basically | 22:44 | |
Im fairly sure its like 2x faster since I last checked this I could have sworn it was about 30s for a 1GB file | |||
22:45
pecastro left
|
|||
Ulti | not DNA though just a giant CSV where 50% of it is DNA sequence which shouldnt matter one way or the other | 22:45 | |
jnthn | Ulti: I did a bunch of work on I/O performance and got at least a factor of 2 on the benchmark I was looking at, so it's entirely possible :) | 22:46 | |
Ulti | thats fairly awesome jnthn++ | 22:47 | |
I think the last time was around when Zoffix had done a bunch of work | |||
lots of the mini "benchmarks" im doing you see Rakudo between ruby and perl5 quite often | 22:48 | ||
Zoffix | It might've been right after it. jnthn++ did the work. The only perf improvements I did was for Windows IO::Specs | ||
raschipi | Ulti: But you're making them do the same work as Perl6 is doing? | 22:49 | |
jnthn | Ulti: Hm, that's not such a bad place to be. :-) | ||
Especially when I know we've more to win yet :) | |||
Ulti | raschipi nope :) | ||
jnthn | It's just that the opts gradually get scarier. :-) | 22:50 | |
Ulti | its probably worth doing a real like for like comparisson to other languages... having slower strings but the fastest most complete unicode implementation is surely a massive win for the world | 22:51 | |
and if "slower" is still apreciably as fast or faster than other popular languages used to process strings regularly its hardly a big deal | 22:52 | ||
blog.honeybadger.io/ruby_unicode_normalization/ hmmmmm | 22:56 | ||
weabot | can I use variables in s/ replace? | 22:57 | |
like s/$var1/$var2/ | |||
Zoffix | weabot: yes, what you show works | ||
weabot | thank you | ||
timotimo | hah, looks like "i can't not normalize my strings :(" is a luxury-problem compared to "i'd have to normalize strings all the damn time or things everywhere mess up" | ||
Zoffix | wamba[m]: $var1 gets interpreted as text though, not regex. use s/<$var1>/$var2/; to make it interpret it as a regex | 22:58 | |
Ulti | I wonder if there is like the perfect unicode brown note type string that just breaks the world if you use it as input on websites | ||
weabot | Zoffix $var2 won't be interpreted as text? | ||
22:58
skids left
|
|||
raschipi | weabot: Tha'ts what the $ is for. | 22:59 | |
weabot | yeah I just assumed both are regex since it's all between // | ||
22:59
grondilu left,
grondilu joined
|
|||
jnthn | Only the stuff between the first two are parsed as regex | 23:00 | |
The others are parsed like a quoted string | |||
teatime | weabot: the s/pattern/replacement/ operation takes a string for replacement in every language. | ||
weabot | alright | ||
teatime | weabot: plus usually some special syntax like \1 for backreferences | ||
Ulti | timotimo: yeah I think so to for the vast majority of software written today it makes complete sense to normalise all the things | ||
weabot | thank you :) | ||
timotimo | Ulti: until timo comes along and wants to write a json parser ;) | 23:01 | |
"but json is so simple!" i hear you say | |||
Ulti | I think almost everyone who has done international web stuff comes to regret their life choices when a blend of your web app JS and the database conspire to literally fart line noise to the user | ||
timotimo | no, nobody says that. everybody knows nowadays | ||
teatime | Zoffix: I'm curious how /<$var>/ and /<{$var}>/ differ | ||
Ulti | timotimo: well simpler than XML :P | 23:02 | |
jnthn | teatime: iirc they're the same semantics, but the second will burn a tad more CPU cycles | 23:03 | |
<$var> looks up a variable and treats it as regex code to compile and run | |||
Zoffix | docs make xtext: All tests successful. | 23:04 | |
jnthn | <{$var}> runs a block and treats its result as regex code, but if the block just looks up a variable then it's the same thing | ||
teatime | there was a previous discussion, seems like <$var> did something weird when used multiple times ... | ||
23:04
ruoso___ left
|
|||
jnthn | Hmm | 23:05 | |
Zoffix | weabot: there're .subst and .subst-mutate methods. They do the same thing as S/// and s///, but perhaps will be easier to understand how they work | ||
jnthn | Maybe I remember wrong then. It's either a long time since I implemented that feature, or a long time since I read the implementation of that feature. Long enough that I can't recall which I did. :-) | ||
23:05
adu joined
23:06
adu left
|
|||
weabot | Zoffix I understand better now, thanks, just needed some clarifications | 23:06 | |
basically it replaces every match from the first field with the string from the second | |||
teatime | jnthn: I doubt it, I have a bad memory | ||
Zoffix | weabot: not every, just the first. You need to use s:g/// to replace every | ||
There's an article on S///, BTW: rakudo.party/post/Perl-6-S---Subst...n-Operator | 23:07 | ||
weabot | right | ||
teatime | jnthn: however, both <$var> and <{$var}> are difficult to find documentation on, e.g. docs.perl6.org/language/regexes does not mention "interpolation" or the string "<$" ... maybe worth a ticket? | ||
jnthn | teatime: I'd say so | ||
teatime | aside: having ^ and $ match begin/end-of-*string* + providing ^^ and $$ is a thing of beauty | 23:09 | |
jnthn | :) | 23:10 | |
Sleep time for me; 'night | |||
timotimo | nite jnthn | ||
23:14
pecastro joined
|
|||
Geth | doc: 63190963a1 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Type/SetHash.pod6 add idiom for adding a new SetHash element per example from Zoffix, needs utf8 quotes |
23:23 | |
23:25
pecastro left
23:27
BenGoldberg joined
|
|||
Geth | doc: 0e4fc28568 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/SetHash.pod6 Use utf8 quotes; add example for multiple keys Also declare the variable; pretty sure make xtest would complain otherwise. |
23:27 | |
23:28
margeas left
|
|||
Zoffix retreats into zofcave for a week | 23:28 | ||
timotimo | have a good one! | ||
tbrowder | hm, right, i was just looking for something to follow the previous code--kind of a bummer we have to start over just for the test--kind of interrupts the discussion | 23:30 | |
i'm sure Zoffix can fix that! | |||
timotimo | isn't there some pod command that lets us put in code that gets run but not rendered? | 23:31 | |
but in general it's nice to have code you can actually copy-paste and run immediately | |||
23:32
rindolf left
|
|||
tbrowder | um, you migh | 23:33 | |
23:33
headcase left
|
|||
tbrowder | *might add a note highlighting the >> operator for old eyes on the multi add | 23:34 | |
s/old/weak/ | 23:35 | ||
23:43
pecastro joined
23:48
cdg joined
23:50
AlexDaniel joined
23:51
troys is now known as troys_
23:52
cdg_ left
23:53
cdg left
23:57
epony left,
Rawriful left
|
|||
AlexDaniel | grondilu: if you did pascal's triangle in 33 you should be able to do fibonacci in 18 | 23:58 | |
23:59
headcase joined
|