»ö« 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 mcmillhj left 00:02 cyphase left 00:07 cyphase joined, cyphase left 00:08 cyphase joined 00:13 pierre_ joined 00:14 perlawhirl joined 00:26 mcmillhj joined 00:29 dataangel joined 00:31 mcmillhj left 00:33 dj_goku left 00:45 mcmillhj joined
tushar I would like to add an element in an array at specific index. When I add the element, I don't want to replace the old element value with new rather I would like to shift the elements to the right. I hope that make sense. How can I achieve that? E.g. "Input --> my @a = [1,2,3]; --- add element at specific index and shift other elements on right -- @a = [1,4,2,3]" 00:45
timotimo that's what splice is for 00:47
geekosaur docs.perl6.org/type/Array#routine_splice
timotimo splice is really "at index i, remove n elements and replace them with this list: ..."
so you'll just be removing 0 elements
tushar timotimo: I thought so.. Thanks.. 00:48
00:49 mcmillhj left
dalek href="https://perl6.org:">perl6.org: 7b463a5 | (Angelo Compagnucci)++ | includes/menu-nav:
doc.perl6.org not prominent enough

  * Documentation now point to docs.perl6.org
  * Added Resources pointing to /documentation/
Fixes: #48
00:54
href="https://perl6.org:">perl6.org: dc08a96 | (Zoffix Znet)++ | includes/menu-nav:
Merge pull request #56 from angeloc/issue_48

  doc.perl6.org not prominent enough
BenGoldberg m: my @a = 1..3; @a.splice 1, 0, 4; @a.say;
camelia rakudo-moar ed0ced: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3my @a = 1..3; @a.splice7⏏5 1, 0, 4; @a.say;␤ expecting any of:␤ infix␤ infix stopper␤ statement end␤ statement modifi…»
timotimo ^- i am quite okay with that
the perl6.org change, that is
BenGoldberg m: my @a = 1..3; @a.splice: 1, 0, 4; @a.say;
camelia rakudo-moar ed0ced: OUTPUT«[1 4 2 3]␤»
BenGoldberg tushar, ^
00:57 mcmillhj joined
tushar BenGoldberg: thanks. Still, I am not quite use to with the syntax without parenthesis. I just followed the syntax that shown in Perl6 doc. But it's good to know. 00:57
00:57 rgrinberg joined
tushar m: my @a = [1,2,3]; @a.splice(2,0,4).say; 00:58
camelia rakudo-moar ed0ced: OUTPUT«[]␤»
tushar m: my @a = [1,2,3]; @a.splice(2,0,4); @a;
camelia rakudo-moar ed0ced: OUTPUT«WARNINGS for <tmp>:␤Useless use of @a in sink context (line 1)␤»
tushar m: my @a = [1,2,3]; @a.splice(2,0,4); @a.say;
camelia rakudo-moar ed0ced: OUTPUT«[1 2 4 3]␤»
tushar Can I replace multiple values at the same time? 01:00
Meaning adding multiple values at multiple indexes of an array and shifting the existing values. All at the same time. I hope that make sense. 01:02
01:02 mcmillhj left
tushar m: my @a = [1,2,3]; @a.splice([0..1],0,[4..5]); @a.say; 01:03
camelia rakudo-moar ed0ced: OUTPUT«Memory allocation failed; could not allocate 87040 bytes␤»
tushar uhhh... Here is the output that I got while running above in REPL. Ouptut --> [1 2 4 5 3] 01:04
Looks like it took the last index i.e. 1 in and add new values after it. 01:05
01:05 noganex left 01:07 noganex joined
tushar @a; 01:09
01:09 canopus left 01:12 mcmillhj joined 01:14 canopus joined
tushar m: my @b = [[1..3],[4..6]]; @b.splice[0,0,[7..8]); @b.say; 01:14
camelia rakudo-moar ed0ced: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in subscript; couldn't find final ']' ␤at <tmp>:1␤------> 3 = [[1..3],[4..6]]; @b.splice[0,0,[7..8]7⏏5); @b.say;␤ expecting any of:␤ statement end␤ …»
tushar m: my @b = [[1..3],[4..6]]; ; @b.splice(0,0,[[7..8]]); @b.say; 01:15
camelia rakudo-moar ed0ced: OUTPUT«[7 8 [1 2 3] [4 5 6]]␤»
tushar In above, the array get flatten. I would like to get output like this -- [[7,8],[12,3],[4,5,6]]. How can avoid array flattening? 01:16
I hope I am clear enough
01:17 mcmillhj left
MasterDuke m: my @b = [[1..3],[4..6]]; ; @b.splice(0,0,[[7..8],]); @b.say; 01:18
camelia rakudo-moar ed0ced: OUTPUT«[[7 8] [1 2 3] [4 5 6]]␤»
AlexDaniel Haha. “Definitely there is no need to repeat that 4 four times.” – but apparently there is a need to repeat number 4 two times. // #125596 01:19
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=125596
01:20 ponbiki left, ponbiki joined 01:21 ponbiki is now known as Guest65191
tushar MasterDuke++ 01:21
01:21 zakharyas joined
AlexDaniel alright, I'm failing to find a bug report 01:21
my gut says that there was one
MasterDuke tushar: that's an example of the single argument rule in action 01:22
which i'm just creating an issue in the docs for now because it should be listed/searchable
tushar MasterDuke: can you be little more expressive? Can I adapt that for my work or is it an issue? 01:23
AlexDaniel /o\ wtf 01:24
m: my @a = < aaa bbbbb cc >; say max @a, :by(*.chars > *.chars)
camelia rakudo-moar ed0ced: OUTPUT«bbbbb␤»
AlexDaniel m: my @a = < aaa bbbbb cc >; say min @a, :by(*.chars > *.chars)
camelia rakudo-moar ed0ced: OUTPUT«aaa␤»
AlexDaniel alright, yes?
m: my @a = < aaa bbbbb cc >; say @a.max: :by(*.chars > *.chars)
camelia rakudo-moar ed0ced: OUTPUT«cc␤»
AlexDaniel m: my @a = < aaa bbbbb cc >; say @a.min: :by(*.chars > *.chars)
camelia rakudo-moar ed0ced: OUTPUT«aaa␤»
AlexDaniel ??
in other words, :by is just ignored 01:25
I've seen that some time ago, can anybody remember a ticket title or something?
MasterDuke tushar: sure you can use that. is isn't really an issue, just something that people don't always realize at first
AlexDaniel by the way, it is even worse: 01:26
m: my @a = < aaa bbbbb cc >; say sort @a, :by(*.chars > *.chars)
camelia rakudo-moar ed0ced: OUTPUT«Unexpected named argument 'by' passed␤ in block <unit> at <tmp> line 1␤␤»
MasterDuke AlexDaniel: i've seen a similar ticket also
rt.perl.org/Ticket/Display.html?id=115758
AlexDaniel if only bisectable was here… perhaps it worked some time ago
tushar MasterDuke: Thanks.. 01:27
01:27 mcmillhj joined
AlexDaniel not a bug? Not funny 01:28
BenGoldberg m: < aaa bbbbb cc >; @a.sort(:by(*.chars)).say;
camelia rakudo-moar ed0ced: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@a' is not declared␤at <tmp>:1␤------> 3< aaa bbbbb cc >; 7⏏5@a.sort(:by(*.chars)).say;␤»
BenGoldberg m: < aaa bbbbb cc >.sort(:by(*.chars)).say;
camelia rakudo-moar ed0ced: OUTPUT«(aaa bbbbb cc)␤»
01:28 Actualeyes joined 01:29 bstamour joined
BenGoldberg m: < aaa bbbbb cc >.sort(*.chars).say; 01:29
camelia rakudo-moar ed0ced: OUTPUT«(cc aaa bbbbb)␤»
bstamour Quick question for anyone who can help me out. What does the line "use v6" actually do?
Does it matter if I only run my scripts through a perl 6 interpreter?
BenGoldberg Nothing, except that it makes perl5 bail out.
bstamour Ah, so in case I accidentally fire it through the wrong program 01:30
Thank you
BenGoldberg Right. Many perl5 and perl6 modules end in .pm or .pl
01:30 dj_goku joined
bstamour Makes sense. 01:30
AlexDaniel it makes sense to use .pm6 and .p6 ;)
BenGoldberg The newest version of perl5 will automatically use the C-level exec() function to replace itself with perl6, if the first line starts with a # and contains 'perl6' somewhere in it. 01:31
01:32 mcmillhj left, rgrinberg left
AlexDaniel m: my @a = < aaaaa bbbbb cc >; say unique @a, :with(*.chars == *.chars) 01:35
camelia rakudo-moar ed0ced: OUTPUT«(aaaaa cc)␤»
AlexDaniel /o\
so it is :by for some things and :with for others
/o\ 01:36
01:36 dj_goku left, cyphase left
AlexDaniel my biggest problem with it however is this: 01:36
m: my @a = < aaaaa bbbbb cc >; say unique @a, :as(*.chars)
camelia rakudo-moar ed0ced: OUTPUT«(aaaaa cc)␤»
AlexDaniel unique has a very useful :as parameter
yet nothing else has it, as far as I can see 01:37
just imagine: @a.sort(as => *.chars)
just imagine: @a.max(as => *.chars)
very readable, no *.chars ><= *.chars crap
I will open a few tickets for these. Feel free to start a holy war there. 01:39
01:39 mcmillhj joined 01:41 cyphase joined
AlexDaniel MasterDuke: can you try clicking a “New ticket” button in RT? 01:42
I'm wondering if it is broken for everyone or just for me 01:43
MasterDuke AlexDaniel: blank page
AlexDaniel :(
01:43 mcmillhj left 01:44 cyphase left, cyphase joined, cyphase left 01:45 cyphase joined, cyphase left
[Coke] broken here too. i'll ping the rt admins 01:45
01:46 ilbot3 left, cyphase joined 01:47 cyphase left, cyphase joined, ilbot3 joined
AlexDaniel [Coke]: thank you 01:49
MasterDuke m: sub foo($a where {* < 5 and * > 2}) {dd $a}; foo(6) 01:55
camelia rakudo-moar ed0ced: OUTPUT«Int $a = 6␤»
MasterDuke m: sub foo($a where * < 5 and * > 2) {dd $a}; foo(6)
camelia rakudo-moar ed0ced: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3sub foo($a where * < 57⏏5 and * > 2) {dd $a}; foo(6)␤ expecting any of:␤ constraint␤ infix␤ infix stopper␤»
MasterDuke m: sub foo($a where {* < 5}) {dd $a}; foo(6) 01:56
camelia rakudo-moar ed0ced: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed double closure; WhateverCode is already a closure without curlies, so either remove the curlies or use valid parameter syntax instead of *␤at <tmp>:1␤------> 3sub foo($a where {* < 5}7⏏5) …»
MasterDuke bug that the first one didn't give me the same error as the last?
01:58 cyphase left 02:00 dwarring joined
AlexDaniel MasterDuke: it is less than awesome 02:01
fwiw: github.com/rakudo/rakudo/blob/5f91....nqp#L6034
02:02 mcmillhj joined 02:03 cyphase joined, ufobat left
MasterDuke thanks, hadn't found it yet 02:03
02:04 cyphase left, cyphase joined, cyphase left, tushar left 02:05 cyphase joined, cyphase left 02:06 cyphase joined, noganex_ joined 02:09 noganex left, ccakes left 02:12 ccakes joined, mcmillhj left
dalek c: c776b84 | MasterDuke17++ | doc/Type/Signature.pod6:
Fix typos and grammaros in Signature
02:16
02:19 mcmillhj joined
BenGoldberg m: constant μ = Mu; my μ $x = &say; dd $x; 02:20
camelia rakudo-moar ed0ced: OUTPUT«Sub $x = sub say (| is raw) { #`(Sub|51498416) ... }␤»
02:25 mcmillhj left 02:30 mcmillhj joined 02:31 cyphase left, dj_goku joined, dj_goku left, dj_goku joined, rgrinberg joined 02:35 mcmillhj left 02:36 cyphase joined, dj_goku left 02:39 cyphase left, cyphase joined 02:40 cyphase left, cyphase joined, cyphase left, cyphase joined 02:42 cyphase left 02:43 cyphase joined, cyphase left 02:44 eliasr left, cyphase joined 02:46 mcmillhj joined 02:48 wamba joined 02:50 mcmillhj left 02:56 mcmillhj joined
[Coke] the "new ticket" button was deliberately disabled following a big spam attack on the p5 queue. 02:56
(today)
abuse prevention measures need to be put into place. (volunteers welcome, but I don't know what skill sets are needed0 02:57
03:01 mcmillhj left 03:03 mohae joined 03:07 perlawhi1l joined, Actualeyes left 03:08 kaare_ joined 03:14 labster joined 03:15 mcmillhj joined
perlawhi1l AlexDaniel: I brought up my concerns with sort about 5 months ago, but it never really went anywhere 03:19
I put up a gist here: gist.github.com/0racle/134921795a6...554492d824
03:19 mcmillhj left
AlexDaniel uhh! 03:19
perlawhi1l the crux of the issue is that unique takes a named parameter, whereas most of these other methods take a code block 03:20
i feel it's not really consistent, and certainly not dwimmy 03:22
03:22 khw left 03:24 dj_goku joined, dj_goku left, dj_goku joined 03:26 mcmillhj joined, cyphase left 03:31 mcmillhj left, cyphase joined
AlexDaniel m: my @a = < aaa bbbbb cc >; say @a.max: :by(*.chars > *.chars) 03:36
camelia rakudo-moar ed0ced: OUTPUT«cc␤»
AlexDaniel m: my @a = < aaa bbbbb cc >; say @a.max: *.chars
camelia rakudo-moar ed0ced: OUTPUT«bbbbb␤»
AlexDaniel m: my @a = < aaa bbbbb cc >; say @a.min: *.chars
camelia rakudo-moar ed0ced: OUTPUT«cc␤»
AlexDaniel oh, alright
03:38 mcmillhj joined, pierre_ left 03:40 nadim left 03:41 pierre_ joined 03:43 mcmillhj left, giraffe_ left 03:45 giraffe joined, skids left, giraffe is now known as Guest84199 03:46 cyphase left, wamba left, saki left, saki joined 03:47 canopus left, perlawhirl left, spider-mario left, salva left 03:48 M-Illandan left 03:49 canopus joined, ab5tract left, ab5tract joined 03:50 mtj_ joined 03:52 wamba joined, cyphase joined 03:53 mcmillhj joined 03:56 labster left, labster joined 03:57 ruoso joined 03:58 mcmillhj left 03:59 ufobat joined, wamba left, salva joined 04:00 spider-mario joined 04:04 tony-o joined 04:10 BenGoldberg left 04:12 mcmillhj joined, pierre_ left 04:14 cyphase left, aries_liuxueyang left 04:16 aries_liuxueyang joined, mcmillhj left 04:19 cyphase joined 04:21 pierre_ joined 04:26 AlexDaniel left, pierre_ left, mcmillhj joined 04:31 mcmillhj left 04:36 Actualeyes joined 04:49 djbkd joined 04:58 mcmillhj joined 04:59 Cabanossi left 05:01 rgrinberg left 05:02 mcmillhj left 05:03 pierre_ joined, Cabanossi joined 05:04 pierre_ left 05:06 holyghost left, pierre_ joined 05:08 wamba joined 05:13 mcmillhj joined, domidumont joined 05:14 dwarring left 05:18 domidumont left, zengargoyle left, domidumont joined 05:19 mcmillhj left 05:22 zengargoyle joined, domidumont left 05:28 cyphase left 05:31 M-Illandan joined 05:33 cyphase joined 05:42 wamba left 05:47 mcmillhj joined 05:51 cyphase left 05:52 mcmillhj left 05:56 cyphase joined, holyghost joined 05:57 domidumont joined 06:00 holyghost left 06:06 pierre_ left, canopus left 06:12 pierre_ joined 06:13 canopus joined, mcmillhj joined 06:17 pierre_ left 06:18 mcmillhj left, labster left 06:21 pierre_ joined 06:24 andrzejku joined 06:25 darutoko joined 06:28 darutoko- joined 06:31 darutoko left 06:34 mcmillhj joined 06:35 wamba joined
andrzejku hello my friends x) 06:38
06:39 mcmillhj left
perlawhi1l hello 06:48
06:48 perlawhi1l is now known as perlawhirl
andrzejku perlawhirl, are you guy from whirlpool? 06:49
perlawhirl nope.
andrzejku oh okay, your nickname suggest it
perlawhirl well.. i have an account, but i haven't been there in 10 years or so
06:56 zengargoyle left 06:58 RabidGravy joined 06:59 zengargoyle joined 07:04 wamba left 07:10 djbkd left
moritz \o 07:10
ufobat morning perl6 :) 07:11
andrzejku hello :) 07:12
07:12 wamba joined 07:13 ccakes left 07:14 mcmillhj joined 07:15 djbkd joined 07:19 mcmillhj left, perlawhirl left 07:29 mcmillhj joined
RabidGravy boom! 07:29
07:32 jsimonet2 left 07:34 mcmillhj left, jsimonet joined, ccakes joined 07:39 ccakes left
andrzejku last days I tried to play with avr chips 07:39
and all failed :(
07:41 darutoko joined 07:44 darutoko- left 07:48 djbkd left 07:49 djbkd joined 08:01 _slade_ left 08:03 mcmillhj joined, jonas1 joined 08:08 mcmillhj left 08:12 Actualeyes left 08:14 labster joined, mcmillhj joined
masak good antenoon, #perl6 08:15
08:16 andrzejku left 08:19 mcmillhj left
moritz \o masak 08:27
08:31 mcmillhj joined
arnsholt mst: I retract any previous statements I have made about OpenSSL. It's precision-engineered to drive people insane >.< 08:34
TEttinger arnsholt, I believe it
why does it have a heartbeat function anyway 08:35
"madness"
08:36 mcmillhj left 08:40 dakkar joined
zengargoyle TEttinger: firewalls and session timeouts. 08:43
no traffic for X minutes, NAT session times out, remote sends data and fails, session lost. 08:44
TEttinger could that be resolved without exposing a buffer overflow vulnerability for much of the internet? :)
zengargoyle most probably 08:46
masak ...nah :)
08:46 mcmillhj joined 08:48 wamba left 08:51 mcmillhj left 08:52 rindolf joined 08:54 wamba joined 08:55 andrzejku joined
Woodi_ hi #perl6 :) 08:56
arnsholt: if someone want simler cryptography would be enought to extract from OpenSSL number generators, algoritms and drop eg. network code, (always buggy) ASN.1, file formats ? 08:59
...drop anything X.50X related ? 09:00
09:03 mcmillhj joined 09:08 mcmillhj left
arnsholt Woodi_: Probably 09:12
Of course, the X509 stuff and friends is a core part of SSL/TLS
So you'll only get so far with just the crypto
Woodi_ arnsholt: I just want math parts :) equations, pluses minuses. rest is totally ecosystem... 09:18
but probably I know nothing about network security :)
SSL/TLS is total foobar, it should be replaced 09:21
fubar even :)
zengargoyle i tend to prefer vpn like solutions where possible. vpn or ipsec or wireguard between boxes. then it's sorta a no brainer, remote side IP is just at secure as talking to localhost. 09:22
09:23 eliasr joined 09:30 zakharyas left
zengargoyle Woodi_: if you just want crypto, maybe check www.wireguard.io/ ... it's a linux kernel module vpn/ipsec replacement based on pre-shared keys and "WireGuard uses state-of-the-art cryptography, like the Noise protocol framework, Curve25519, ChaCha20, Poly1305, BLAKE2, SipHash24, HKDF, and secure trusted constructions. It makes conservative and reasonable choices and has been reviewed by 09:31
cryptographers."
dalek c: 9008874 | (Tom Browder)++ | doc/Language/modules.pod6:
correct spelling of possessive 'its'
09:35
09:36 mcmillhj joined, nadim joined
Woodi_ zengargoyle: would be nice to split that even more, extracting math and numbers calculations into more understendable form. vpns like systems shoould be everydays tools for businesses but as we know vpns was backdored long time ago (in OpenBSD) :) 09:39
09:41 mcmillhj left 09:45 kurahaupo joined 09:47 kurahaupo_ joined 09:50 mcmillhj joined, kurahaupo left 09:52 kurahaupo_ is now known as kurahaupo 09:55 mcmillhj left
dalek c: e5ddbfe | gfldex++ | doc/Language/functions.pod6:
fix typo
09:56
10:06 kurahaupo left 10:18 gregf_ left 10:22 labster left, labster joined, pierre_ left 10:25 TEttinger left 10:27 pierre_ joined 10:30 ocbtec joined 10:33 mcmillhj joined 10:38 mcmillhj left 10:44 pierre_ left 10:47 wamba left 10:49 mcmillhj joined 10:54 mcmillhj left 11:16 mcmillhj joined 11:20 labster left 11:21 mcmillhj left 11:34 andrzejku left 11:36 mcmillhj joined
Ulti has anyone reported a borken OSX build? 11:39
noticing its since I updated to the latest XCode
"Symbol not found: _clock_gettime"
I can try and hunt down where this has moved to if no one is already checking it out 11:40
11:41 mcmillhj left 11:42 andrzejku joined
Ulti full output gist.github.com/MattOates/45e87e3a...f396a56c01 11:44
11:45 pierre_ joined
moritz I'm not aware of anybody chasing it down 11:46
Ulti looks like its a problem for a lot of people over a tonne of projects for this version of XCode+OSX 11:47
OSX 10.11.6 XCode 8.0 11:48
the current solution online is update the whole of your OS :Z 11:49
11:49 Dunearhp left 12:06 andrzejku left 12:07 andrzejku joined
moritz does that make it OS Y? :-) 12:10
12:15 bjz_ joined
El_Che Ulti: be careful when upgrading the OS. The signature needed to downgrade is only valid a short period of time. 12:16
ios :)
oh, I am too early? Give it a few years :)
12:19 bjz__ joined 12:20 bjz_ left 12:21 ocbtec left 12:23 jcallen joined 12:26 andrzejku left 12:28 bjz__ left 12:31 Celelibi left 12:32 aries_liuxueyang left, user9 left 12:33 aries_liuxueyang joined 12:34 Celelibi joined 12:40 sftp joined, rgrinberg joined 12:42 RabidGravy left 12:43 bjz joined
[Coke] I am on xcode 8.0 (8A218a) and have noticed no issues. 12:43
12:46 bdmatatu joined, andrzejku joined
bdmatatu Is it possible to use nqp::sha1 (or is there a related nqp function) to compute the sha1 of bytes that are not valid UTF-8? 12:51
12:53 wamba joined, RabidGravy joined 12:54 djbkd_ joined 12:55 djbkd left
gfldex m: use nqp; say nqp::sha1("abc"); 12:56
camelia rakudo-moar 5a3df8: OUTPUT«A9993E364706816ABA3E25717850C26C9CD0D89D␤»
gfldex bdmatatu: ^^^ possible but may be unwise
12:57 sftp left
andrzejku hey guys 12:58
why no-one tried to write llvm perl6 interpreter?
12:58 buggable joined
perlpilot andrzejku: I think it's because llvm is more of a VM toolkit than a VM 12:59
12:59 NeuralAnomaly joined
bdmatatu gfldex: oh, too bad...nqp::sha1 is very fast, was hoping to use it as part of an hmac computation 13:00
gfldex bdmatatu: you can test if you are on rakudo and if not provide a Perl 6 variant or load a module 13:01
bdmatatu: right now it's a little tricky to have automatic tests for not being on Rakudo tho (hence my unwise-remark) 13:02
bdmatatu gfldex: unfortunately it only seems to work for utf-8, so this makes it unsuitable for hmac (since it calls the hash twice, once with potentially invalid utf-8 bytes) 13:03
DrForr bdmatatu: IIRC there's a Digest::HMAC, are you working with that?
bdmatatu I tried that, but was looking to improve performance.
(of the hash part, not the hmac part) 13:04
DrForr Nice.
13:04 djbkd_ left 13:05 bjz left, djbkd joined 13:06 bjz joined, mcmillhj joined 13:07 itaipu joined 13:08 sftp joined
perlpilot bdmatatu: I'd guess that the underlying sha1 implementation works on arbitrary octets and the only reason nqp::sha1 says anything about UTF-8 is because you have to feed it a str. Maybe someone could change it to be encoding agnostic? 13:11
hackedNODE gfldex: why is it tricky? 13:12
13:13 andrzejku left
hackedNODE m: $*PERL.compiler.name.say 13:13
camelia rakudo-moar 5a3df8: OUTPUT«rakudo␤»
hackedNODE Oh, you mean at nqp level. Nevermind
gfldex hackedNODE: no i meant testing it against a non-Rakudo 13:14
13:14 djbkd left
jnthn fwiw, the nqp::sha1 op is built for the specific purpose of hashing source code for dependency management purposes, and isn't really intended to be exposed/used more widely. 13:14
13:15 djbkd joined, andrzejku joined 13:16 El_Che joined, ptolemarch joined 13:18 cdg joined 13:21 gregf_ joined
[Coke] adds that to the docs. 13:22
dalek c: 99a8666 | (Tom Browder)++ | doc/Type/Signature.pod6:
add example of type constraint on an optional argument
13:23
13:26 djbkd_ joined 13:27 djbkd left 13:34 djbkd_ left 13:36 djbkd joined
nine 5~/win 13 13:37
masak m: sub infix:<~/win>($l, $r) { $l / $r }; say 5~/win 13 13:40
camelia rakudo-moar 5a3df8: OUTPUT«0.384615␤»
masak irssi window division :) 13:41
jnthn m) 13:44
13:46 djbkd_ joined
andrzejku hey should someone explain me 13:47
some details about nap
nqp
timotimo OK, like what?
andrzejku nap is something similar to perl? 13:48
13:48 djbkd left
andrzejku nqp 13:48
timotimo "not quite perl6"
it's what we use to implement rakudo 13:49
andrzejku rakudo is perl6?
timotimo rakudo is our perl6 compiler
andrzejku okay
so
timotimo there used to be other projects, but only rakudo remains in active development
13:50 skids joined
andrzejku why nqp was invented at all? 13:50
why just not to write perl6 interpreter
in C or C++
whatever
timotimo rakudo started on Parrot. it would have been terrible to write rakudo completely in parrot's assembly-language
andrzejku and when the basic Perl6 things were implemented "they" will be used to implement standard library 13:51
timotimo there's currently a project that writes a perl6 compiler in C++
andrzejku ohh 13:52
timotimo, I am looking for it
where can I find it?
timotimo good question
13:52 pierre_ left
timotimo github.com/Itay2805/Perl6-Native-Compiler 13:52
there it is
oh, look at the first line of the readme
i don't see a repo for a native nqp compiler, though 13:53
13:53 andrzejku left 13:55 andrzejku joined, acrussell joined 13:56 djbkd_ left 13:57 bjz left, bjz_ joined, djbkd joined
andrzejku timotimo, sorry [kid] will be soon back 13:58
timotimo i might be AFK when you return
andrzejku ok
14:00 rindolf left 14:06 djbkd left
hackedNODE andrzejku: one of the benefits is the compiler is more accessible to Perl 6 *users* to hack on. nqp really has a feel of a Perl 6 module for a lot of things. The grammar that parses Perl 6 is pretty much the same grammar users of Perl 6 use, etc. Many parts of Rakudo would require knowledge of Perl 6 only to modify, and the end-goal is to as much as possible of Rakudo in Perl 6. 14:08
s: Hash, 'classify-list'
SourceBaby hackedNODE, Sauce is at github.com/rakudo/rakudo/blob/5a3d...sh.pm#L309
14:08 andrzejku left
hackedNODE andrzejku: ^ any Perl 6 user can fix a problem in that method. But if Rakudo were written in C, they would need to know C to do so. 14:08
14:09 djbkd joined
hackedNODE plugs perl6.party/post/Perl-6-is-written-in...-Perl-6 14:09
14:10 rindolf joined
hackedNODE andrewalker: also: optimizations. It's easier to optimize a subset than a huge language. 14:11
timotimo on top of that, nqp has a few limitations that make optimization a whole lot more feasible 14:12
14:13 andrzejku joined, itcharlie1 joined 14:14 khw joined
andrzejku hackedNODE, I don't think to let users modify just for fun 14:15
is good idea
it is better if they write libs which extend language
timotimo this isn't really about "modify perl6 for fun", it's about "please help us with core development" 14:16
skids m: class A { has $!a = Channel.new; sub s($a) { start { my $r = 42; react { whenever $a { "{$r.VAR.name} == {$r.perl} {$r.VAR.WHICH}".note; LAST { "{$r.VAR.name} == {$r.perl} {$r.VAR.WHICH}".note } } } } }; has $!t = s($!a); method f { $!a.send(0) }; method DESTROY {$!a.close} }; use nqp; A.new.f; for 0..5 {sleep 0.1; nqp::force_gc; Rat.new}; # ok 14:17
camelia rakudo-moar 5a3df8: OUTPUT«$r == 42 Scalar|140475831250104␤$r == 42 Scalar|140475831250104␤»
timotimo on the other hand, making it easier for users to change rakudo and nqp for their purposes is also good
skids m: class A { has $!a = Channel.new; sub s($a) { start { my $r = 42; react { whenever $a { "{$r.VAR.name} == {$r.perl} {$r.VAR.WHICH}".note; LAST { "{$r.VAR.name} == {$r.perl} {$r.VAR.WHICH}".note } } } } }; has $!t = s($!a); method f { }; method DESTROY { $!a.close } }; use nqp; A.new.f; for 0..5 {sleep 0.1; nqp::force_gc; Rat.new}; # Where'd my 42 go?
camelia rakudo-moar 5a3df8: OUTPUT«$r == Any Scalar|63362808␤»
skids It seems the local variable scope does not get constructed until the whenever gets normally entered. 14:18
14:20 grondilu joined
hackedNODE andrzejku: I'm not sure what you mean by "modify for fun". The implication being that making the codebase more accessible somehow makes it more prone to unauthorized edits? :) 14:20
14:21 djbkd left
timotimo open source software is super insecure because anyone can just go and edit the code! 14:21
andrzejku I don't mean prone
timotimo imagine all the backdoors and viruses you get!
grondilu is currently writing some javascript and misses a lot of perl6 features, but when he reads about ES6 he realizes that most of these features are in ES6 or will come soon.
hackedNODE andrzejku: making the compiler in Perl 6 makes the number of people capable of improving the compiler proportionate to the number of people interested in those improvements.
andrzejku I think it makes Perl much more slower 14:22
skids Until the compiler is improved, sure :-)
hackedNODE andrzejku: slower to... what?
grondilu basically is wishing whoever designs javascript would just decide ES7 would be Perl 6 :)
14:23 djbkd joined
andrzejku I think it will be better to implement the basic command staff in native language and then add language extension which can be made in Perl using previously implemented things 14:23
hackedNODE andrzejku: MoarVM is written in C
andrzejku right now thinks looks odd
yeah
but why MoarVM take so strange staff 14:24
moar.nqp
timotimo ?
hackedNODE andrzejku: I'm not understanding what you mean. What strange stuff?
andrzejku moarvm it is just interpreter for nqp 14:25
skids Unfortunately we are a long way off from rewriting MoarVM in Perl6, you just have to look at how much is invested in cc optimization/binfmt handling to see that.
hackedNODE andrzejku: I can put it another way: why aren't you writing EVEYRTHING in C? You know, 'cause the rest of the langs make things slower. There are many benefits.
timotimo for nqp and rakudo
tbrowder m: sub f($a
camelia rakudo-moar 5a3df8: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3sub f($a7⏏5<EOL>␤ expecting any of:␤ constraint␤»
andrzejku and nqp is core lang design
timotimo "core lang design"? 14:26
tbrowder m: sub a($f? where $f >= 0
camelia rakudo-moar 5a3df8: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3sub a($f? where $f >= 07⏏5<EOL>␤ expecting any of:␤ constraint␤»
hackedNODE andrzejku: moarvm is a VM that can run QAST generated by nqp. nqp is a compiler tool chain. Rakudo is a compiler written using that toolchain.
andrzejku: and what you're imagining is it's better to write Rakudo in C. Which would be a monstrous effort and would make it accessible to a handful of people, but then we'd have a faster perl. 14:27
andrzejku okay
hackedNODE andrzejku: timotimo already mentioned recent effort to do just that, and the person gave up when they realized the amount of work involved. 14:28
timotimo honestly, having good performance for perl6 is mostly about dynamic optimization
andrzejku so Perl6 should be slower by design?
hackedNODE andrzejku: "slower" than what?
andrzejku slower than Swift for ex.
hackedNODE andrzejku: "slower" at what?
andrzejku slower at all
omg
tadzik the answer to "why don't we write all compilers in C" is really the same as to "why do we not write everything in C in the first place"
timotimo we're already faster at some things compared to perl5, and perl5 is written in C 14:29
14:29 pmurias joined
arnsholt The basic architecture of Perl 6 is broadly the same as used in most other VM-backed languages 14:30
There's a compiler, and it generates bytecodes for the target VM
mspo timotimo: really?
dalek c: d5272a6 | MasterDuke17++ | doc/Programs/00-running.pod6:
Update the description text for 00-running.pod6

It now matches what Rakudo currently shows.
hackedNODE andrzejku: omg what? What is it faster at? I can write a Perl 6 program twice as fast than the same program in Perl 5, so the person paying me for that job will have to spend half the money to receive the program they want. Comparing fastness of languages is nonsensical. There's a good saying: "Premature optimization is the root of all evil" and you're trying to optimize code you haven't even thought about
writing yet.
14:30 djbkd left
tbrowder trying to demo an LTA error msg... 14:31
hackedNODE andrzejku: saying X is faster than Y is useless without context and code's purpose.
andrzejku hackedNODE, okay but think why Perl6 is not used on ARM chips?
arnsholt The presence of NQP as a language specifically for implementing compilers is perhaps a bit different, but that's mostly due to the dynamism of Perl 6 making it really hard to directly implement a bootstrapping Perl 6 compiler
andrzejku and Python? yes
timotimo 6guts.wordpress.com/2016/06/12/gri...rovements/ - mspo, mostly on small examples, though
14:31 djbkd joined, wamba left
hackedNODE andrzejku: and think why is a hammer not used to drive screws in? 14:32
and a screwdriver is
tadzik python people tried to write an OS in it too, doesn't mean it was a good idea
mspo timotimo: did that print a string a million times get fixed? :)
tbrowder sub f(Int $i? where $i >= 0){}; f()
hackedNODE andrzejku: and you're comparing apples to oranges there in the first place. Perl 6 has by far less optimization effort. 14:33
*has had
timotimo mspo: we're still using libuv async I/O for synchronous output, so i'm guessing that's still slow
arnsholt m: sub f(Int $i? where $i >= 0){}; f() # tbrowder =) 14:34
camelia rakudo-moar 5a3df8: OUTPUT«Invocant requires an instance of type Int, but a type object was passed. Did you forget a .new?␤ in sub f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
hackedNODE I think that issue was due to parsing, no?
m: ("print 42;" x 10000).EVAL; say now - INIT now;
timotimo oh, was that when we generate a source file that is a million lines of code, each just 'say "some string"'?
camelia rakudo-moar 5a3df8: OUTPUT«4242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242…»
andrzejku ok I won't argue with you
hackedNODE oh oops
mspo timotimo: yes that one
hackedNODE m: ("print '';" x 10000).EVAL; say now - INIT now;
camelia rakudo-moar 5a3df8: OUTPUT«7.3626973␤» 14:35
pmurias andrzejku: the speed of Perl6 programs once they are compiled is not dependent on what the compiler is written in
tbrowder arnsholt: thanks! that error helps not a bit for a newbie; i added an example in the docs this morning to show how to get a type constraint on an optional arg:
hackedNODE Yeah, seems fixed. I think that one took ages to parse even with a few hundred prints and I'm not seeing the ticket on perl6.fail 14:36
pmurias andrzejku: and a huge reason why the Rakudo is written in nqp is to allow extending of Perl 6 language by modules/slangs
timotimo mspo: 6guts.wordpress.com/2016/03/06/dig...lity-work/ this one, too
DrForr andrzejku: Perl6 has been cross-compiled to ARM; there was a talk at YAPC::EU on it.
arnsholt tbrowder: Yeah, it's an odd error! Does adding the where clause implicitly make it Int:D, or something like that? 14:37
tbrowder m: sub f(Int $i where $i >= 0 = 0){}; f()
camelia ( no output )
tbrowder that works but is ugly, i prefer to use a block containing the constraint: 14:38
grondilu is suprised $i >= 0 = 0 is legal 14:40
tbrowder m: sub f(Int $i where {$i >= 0} = 0){}; f()
camelia ( no output )
grondilu o_O
14:40 djbkd left
timotimo grondilu: only because it's in a parameter declaration 14:40
hackedNODE grondilu: default value
grondilu oh yeah 14:41
arnsholt Yeah, it took me a while to parse it too 14:42
14:42 djbkd joined
tbrowder grondilu: i remember seeing that construct somewhere, maybe in the Christmas blogs; anyway, i'm going to file a rakudo bug unless someone objects 14:42
14:43 Actualeyes joined
hackedNODE tbrowder: what's the bug? 14:43
tbrowder the default value is the key to making it optional
the bug is the opaque error msg 14:44
hackedNODE m: sub f(Int $i? where {$ // True} ){}; f()
camelia ( no output )
tbrowder the original try was to put a constraint on an optional param 14:45