»ö« 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.
raschipi Thanks for the explanation guys. 00:07
AlexDaniel m: say %*ENV<ME>.comb.pick(*).join 01:07
camelia lixAelenDa
raschipi m: say %*ENV<ME> 01:10
camelia raschipi
ugexe m: m: use lib "inst#/home/camelia/star-2017.07/share/perl6/site"; use Zef::Client; use Zef::Config; my $client = Zef::Client.new(:config(Zef::Config::parse-file( Zef::Config::guess-path()))); .dist.name.say for $client.search("HTTP"); 01:59
camelia HTTP::Server::Tiny
HTTP::Server::Simple
HTTP::UserAgent
HTTP::Easy
HTTP::Status
02:00
ugexe i'm leaving installing modules onto camelia as an exercise to the user
mspo where should lib sources go? 02:01
ckraniak Question 10 or so about Native Call: how does one declare a function pointer in a CStruct? With a Pointer? 02:04
timotimo ckraniak: you should be able to nativecast from Pointer to any function pointer type you can imagine and backwards, too 02:41
ckraniak: btw, i can compile your nativecall issue code just fine, what exact perl6 --version do you have so i can maybe reproduce the issue? 02:42
ckraniak perl6 --version outputs 2017.07, 6.c 02:43
Is there a more verbose version somewhere?
[Coke] that version should be slightly more verbose than what you C&P'd
ckraniak IRC on phone not computer, cannot copypaste 02:44
timotimo that's as verbose as you can get
ckraniak Hmm. Well I downloaded whichever it was on Friday I think 02:45
This would have been the msi version
timotimo oh, right, you're on windows
i don't have a windows rakudo to test things out with, but it shouldn't matter 02:46
ckraniak Wednesday, actually, idk how fast y'all change stuff
Try deleting the whole SHUT-UP class and see what it does 02:47
timotimo we release the compiler monthly, but we only build msi for Rakudo Star, which is compiler + modules + documentation
sure
same output
ckraniak Outputting 284?
Welp just chalk it down to MS just knocking it out of the park again I suppose 02:48
Thanks for looking into it anyway
timotimo i find it hard to believe MS is at fault here o_O 02:56
timotimo i'll try falling asleep again :| 02:58
ckraniak Doesn't matter if it works 03:06
Even if the code looks completely stupid
s/if/so long as/ # for clarity
stmuk you can use choco install rakudostar and appveyor to easily test windows via MSI 06:36
moritz ok, I forgot to reboot irc.p6c.org yesterday night; doing it now 06:57
stmuk dont forget to replace systemd by sysvinit ;)
moritz ok, it came back up 06:59
I guess www.p6c.org comes next 07:00
Koong I don't to know about for perl6. 07:22
-_-' 07:23
Hi
moritz hello Koong
Koong hello moritz 07:24
ckraniak Want to say I am enjoying the language so far 07:30
ryu0 That was odd. 07:33
moritz ckraniak: that's great to read 07:42
ryu0 Though nothing compared to the weird web chat visitors we get in #learnprogramming. lol 07:44
moritz thinking about parsing a bit more, I think there could be a relatively simple way to improve pasing errors from grammars 08:06
we could have an assertion that makes a failure fatal for the whole whole parse after the grammar got there 08:07
moritz oh, it seems <commit> is meant to do just that 08:08
ryu0 moritz: i assume perl 6 grammars are meant as a substitute for stuff like YACC and LEX? 08:09
moritz ryu0: yes 08:10
jnthn: what would it take to implement <commit> in regexes?
ryu0 interesting. never seen that built into a language before.
usually it's an addon.
moritz the really cool thing is that regexes are code objects in Perl 6 08:11
so you can use all the usual techniques for code reuse (role composition, inheritance, delegation) for regexes and grammars as well
ryu0 Not an opaque compiled engine like other implementations?
moritz it's more like a declarative way to write a recusrive descend parser, with regexes (optionally without backtracking) for tokenization 08:14
moritz *recursive 08:16
ryu0 i also saw that the JVM is being targeted by nqp/rakudo. is there plans to expand it to other VMs too? 08:20
moritz pmurias is working on a js backend 08:21
ryu0 ah.
lisbeths The main three targets are llvm, jvm, and webassembly
perhaps .net core
ryu0 I take it CIR isn't very popular. heh
moritz and I think it's pretty far along; like rakudo.js being able to compile the setting, and even use Test.pm 08:22
ryu0 but i assume MoarVM will continue to remain the default VM, hm? 08:23
moritz until something better comes along :-) 08:24
ryu0 lol. i thought you were developing one to have your own regardless of where the 3rd party ones go.
moritz we are very pragmatic around here when it comes to such choices 08:25
like, parrot used to be target of choice
moritz until moarvm became better in basically all dimensions 08:25
moritz if we find a 3rd party VM that does better than MoarVM, less maintainence effort to us 08:25
though it's going to be pretty hard to beat something that implements grapheme-level strings at VM level, and I don't see other VMs doing that right now 08:26
ryu0 that makes me wonder. Is stuff like NativeCall standardized across backends?
moritz somewhat, yes 08:27
ryu0 ah.
as_ Morning! Anyone can tell why do we need both Supply and Supplier classes? Looks a bit confusing and overcomplicated to have Supplier.new and then Supplier.new.Supply. Supplier is only to be used as a factory? Why are they split? 08:30
gfldex m: my @a = [{a=>1, b=>2}, {a=>3, c=>55}]; dd @a».<c>.grep(*.values.defined)
camelia (Any, 55).Seq
gfldex m: my @a = [{a=>1, b=>2}, {a=>3, c=>55}]; dd @a».<c>.grep(*.values».defined) 08:30
camelia (55,).Seq
gfldex It's like Perl 6 was made to work with JSON. :) 08:31
moritz it's like Perl 6 was made to work with data structures :-) 08:34
lisbeths Some perl developers could learn a bit from minimal languages like forth where you deal with direct memory addresses and the only type is a byte 08:44
All you really need for a type system is ints
lisbeths all you need for most things is arrays of ints 08:45
ryu0 lisbeths: i've used languages that are typeless before. shell script is also typeless, since everything is a string more or less.
lisbeths Strings are a bit easier to get into than just ints
lisbeths The problem with most string typed languages is escaping strings 08:48
ryu0 that's a problem in many languages when you're embedding a string type of a different context. 08:49
especially C or C++.
lisbeths Nesting strings is very painful, especially because most languages use the same symbol for the left hand and the right hand of the string. 08:50
moritz good thing we offer more data structures than just strings 09:10
lisbeths Yeah thats what makes the perls so much better than bash. 09:11
In part.
moritz PSA: I'm going to reboot the server that hosts www.perl6.org and other Perl 6 websites 09:12
... back up 09:14
lisbeths Jeez what os are you running on that?
moritz now Debian Stretch 09:16
used to be Jessie
lisbeths That was a pretty fast reboot
moritz not many services running 09:17
and it's a VM, so no ultra-slow server bios
rebooting the hypervisor spends about a minute or so just in the bios 09:18
lisbeths When I reboot my machine in azure it takes maybe four minutes but that's on hdd
gfldex JSON::Tiny got a broken test with This is Rakudo version 2017.07-152-g30584da built on MoarVM version 2017.07-378-g5e94da0
moritz gfldex: yes, we have a rakudo bug report for that 09:19
gfldex goes to find a fresh bug
moritz RT #131881 09:20
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=131881
pmurias ryu0: re standardized, all the VMs generally try to implement the same layer of low level operations 10:02
ryu0: the differences are mostly some of them lacking features
pmurias ryu0: re have our own we can always take over and fork an existing VM 10:04
ryu0: the main reason for MoarVM is that JVM has a slow startup so the MoarVM developers wanted something tailor built for Perl 6 10:05
pmurias lisbeths: for me the most interesting thing we could target that we aren't is the graal/truffle thing on the JVM 10:14
TEttinger aaaargh graaaaaaaal 10:30
it's so frustrating to build 10:31
TEttinger and if you want slow startup time, graal has that covered 10:31
pmurias_ TEttinger: didn't they reduce the startup time with substrate VM? 10:53
TEttinger: AFAIR I got graal to build by just following the instructions they provided 10:54
TEttinger pmurias: i'm on windows. 11:29
gfldex m: sub f(|c){ dd c }; constant term:<GMT> = :0timezone; f GMT 12:10
camelia \(:timezone(0))
gfldex First time I found a good use for term:<> 12:15
piojo9 p6: sub returns_int(--> Int) { return "a"; } 12:33
camelia ( no output )
piojo9 According to the docs, that should be a compiler error
Good to confirm that it's not just my computer that's misbehaving 12:34
piojo9 Are compile-time restraints on return types not implemented yet? (docs.perl6.org/language/functions#...nstraints) 12:34
gfldex piojo9: the docs are wrong, return type constraints are always runtime checks 12:47
(and I hope I didn't write that part)
audiatorix I have a question about the react/whenever structure. Let's say I'm working with IO::Socket::Async for example, and I have two whenevers inside a react block (react { whenever ... -> $connection { whenever ... { ... } } }) 12:48
will the outer whenever block until the inner processing is done? 12:49
by block I mean wait, not as in a block of code
piojo9 @gfldex: Thanks. Would it be appropriate to submit a feature request about this? I'm new to the p6 world.
gfldex piojo9: that would be very helpful 12:50
piojo9 Obviously static checking on return types is wildly useful
will do, as soon as I register an account. Thanks!
gfldex piojo9: Perl 6 is inherently dynamic, you can't even bet on a static type check of a constant value. 12:51
piojo9 gfldex: Yes, but some things can be guaranteed. For instance, a type check will fail statically if you use a function returning Int as a parameter where a Str is required 12:52
p6: sub returns_str(-->Str) { return "a"; }; sub returns_int(--> Int) { return returns_str(); } 12:53
camelia ( no output )
piojo9 the compiler should know what's going on in that case.
piojo9 p6: sub needs_str(Str $val) { }; sub returns_int(--> Int) { return 0; }; sub tester { needs_str(returns_int()); } 12:55
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling needs_str(Int) will never work with declared signature (Str $val)
at <tmp>:1
------> 3nt(--> Int) { return 0; }; sub tester { 7⏏5needs_str(returns_int()); }
gfldex m: class A {}; role R { method m { say 'oi‽' } }; sub f(--> R){ A.new but R }; say f
camelia A+{R}.new
piojo9 That fails, as it should--the type checking for parameters works like you would expect, and it takes advantage of knowledge about return constraints.
gfldex piojo9: ^^^
ryu0 hm. 12:57
gfldex piojo9: the type of any value in Perl 6 is determied at runtime _by_definition_. 12:58
piojo9 gfldex: That's not how it looks from a user perspective. From a static background (with dabbling in dynamic languages), I expect gradual typing to be as static as it can be (based on the knowledge that's supplied) 13:00
Isn't static checking the point? Otherwise, it's not much different than throwing exceptions when argument types don't match 13:01
gfldex piojo9: the documentation of the MOP is indeed incomplete
ryu0 either way, the explicit typing syntax is more convenient than doing manual runtime type checking.
piojo9 And the 20:55 example I sent does show the compiler doing a static check and failing
I didn't call any function--it fails when they're defined (as it should) 13:02
gfldex the compiler can cheat when it comes to native types, because it's the stated user intend to be unsafe.
piojo9 Okay, I'm sure this will become clearer as I use the language more (and read more) 13:03
thanks!
ryu0 piojo9: there's languages with very sophisticated static typing if you know where to look. 13:05
and i'm not talking about any of the top 10 languages. 13:06
timotimo you mean like dependent types?
piojo9 Haskell?
ryu0 functional languages tend to have very advanced stuff from what i've seen.
piojo9 Pattern matching as part of the type system is pretty cool
ryu0 I was impressed by SML.
AlexDaniel m: sub returns-int(--> Numeric) { ‘a’ }; returns-int 13:12
camelia Type check failed for return value; expected Numeric but got Str ("a")
in sub returns-int at <tmp> line 1
in block <unit> at <tmp> line 1
AlexDaniel m: sub returns-int(--> Numeric) { ‘a’ }; use MONKEY-TYPING; augment class Str does Numeric { }; returns-int
camelia ( no output )
AlexDaniel m: sub returns-int(--> Numeric) { ‘a’ }; use MONKEY-TYPING; augment class Str does Numeric { }; returns-int.say
camelia a
AlexDaniel m: sub returns-int(--> Numeric) { ‘a’ }; use MONKEY; EVAL ‘use MONKEY; augment class Str does Numeric { };’; say returns-int 13:14
camelia a
ryu0 piojo9: it's a shame though. the compile time type checking should only be deferred to runtime if it can't be determined at compile time.
AlexDaniel ryu0: how can you determine it with my snippet above? ↑
ryu0 which one? 13:15
AlexDaniel m: sub returns-int(--> Numeric) { ‘a’ }; use MONKEY; EVAL ‘use MONKEY; augment class Str does Numeric { };’; say returns-int
camelia a
AlexDaniel this for example
ryu0 Well. it should be able to perform type-checking within the function definition as well. 13:16
all exit pathes should return a type compatible with "Numeric", but as you can see it doesn't.
piojo9 but EVAL is runtime
I now see the problem with trying to augment perl6's static type checking--the types aren't static, as gfldex said. 13:17
ryu0 indeed it is. dynamic languages are hard to add static features to.
because dynamic opens up a lot of possible scenarioes that don't exist when you start statically. 13:18
piojo9 It all comes down to "what do you mean by dynamic?"
And if the types themselves are open for modification at runtime, all bets are off
For a less permissive "dynamic", like $a can be a string, then $a can change to Int, the checking would be much easier.
eater how do I include a lib path relative to the file I'm currently in? 13:19
ryu0 eater: try using -Ilib or w/e as an argument to perl6.
eater but how do I do it from inside perl? 13:20
s/perl/perl6
AlexDaniel piojo9: well, we can fantasize about some strict-er mode where some things are disallowed and compile-time type checking works… but let's not hold our breath for this :)
piojo9 eater: use lib <the script's directory>;
but I need to look up the perl6 equivalent of abs_path and __FILE__ 13:21
eater piojo9: `use lib "{$?FILE.dirname}/../lib"` doesn't work :(
piojo9 you can do it with pure perl and not including a static path
eater or any type of variable there
piojo9 really? wow
eater m: use lib "{$?FILE.dirname}/../lib";
camelia 5===SORRY!5=== Error while compiling <tmp>
Could not evaluate arguments
at <tmp>:1
------> 3use lib "{$?FILE.dirname}/../lib"7⏏5;
13:22
eater m: say "{$?FILE.dirname}/../lib";
camelia No such method 'dirname' for invocant of type 'Str'
in block <unit> at <tmp> line 1
eater well
AlexDaniel m: say "{$?FILE.IO.dirname}/../lib";
camelia /tmp/../lib
AlexDaniel m: use lib "{$?FILE.IO.dirname}/../lib";
camelia ( no output )
eater .-.
eater grabs the skillet
I guess I need to educate myself for a bit, brb 13:23
ryu0 piojo9: so what do you think of perl6 so far? i'm looking into it mostly because i find that i end up relying on runtime type checking anyway in certain static languages so it seems to be not too different in that respect.
timotimo waiting almost patiently for more TPCiA videos to hit the youtubes 13:25
piojo9 eater: looks like: use lib $?FILE.IO.parent.parent.add("lib");
eater piojo9: :')))
well that's one way
ryu0 it seems like Perl6 has a better design than most for mixing permissive and restrictive type checks. 13:26
eater but ayy, TimToady :)
piojo9 I didn't test that--I'm not casting it back to a string. It may not work...
eater piojo9: see AlexDaniel his solution
that also works :)
piojo9 Okay, that makes a lot more sense :) 13:27
ryu0 what does?
piojo9 AlexDaniel gave a better solution than mine 13:28
ryu0 oh.
eater piojo9: not exactly better tho
your solution is more verbose
piojo9 OTOH, ".." doesn't seem to work well in cygwin
eater his more implicit
AlexDaniel blushes
piojo9 I had to use .parent to get the paths to clean up
ryu0 better is relative. if you need to include multiple files from the same directory, it might be better to add to the search path instead, assuming you can do that from the module.
piojo9 But in this case, there's no need to make the path look nice
jnthn audiatorix: No, nesting one whenever inside another doesn't imply any relationship between the two at all. A server written that way will be able to process concurrent requests. 13:29
piojo9 ryu0: Perl6 seems like a pretty huge language. I mildly don't like the ways the syntax breaks with what all the other programming languages do (like the snake string concatenation operator) 13:30
But that stuff is minor
ryu0 uh, perl6 isn't the only language to use that convention. 13:30
D is the same.
piojo9 oh! Sorry
I've not used D 13:31
ryu0 they may not be mainstream but that's beside the point.
piojo9 right 13:31
piojo9 I have no problem with Perl trying to start from scratch 13:31
ryu0 D is also a complex language that likes to advertise themselves as C++ done right. 13:32
piojo9 I've heard of it--just not had an opportunity to use it
ryu0 course it's not as feature packed as Perl6 it seems like. 13:33
piojo9 ryu0: I haven't seen any language that is 13:33
ryu0 part of me feels like a language is really broken if people write tools to overcome major shortcomings :x 13:34
JavaScript. People actually wrote a static type checker for it called flow.
piojo9 Haha. I've heard of a static type checker for python, but I didn't investigate. *shudder*
You could say Boost was a workaround for the limitations of C++, but that mostly just got incorporated into the language :) 13:35
ryu0 wasn't that a weakness of the stdlib rather than the language though?
piojo9 C++ is an awfully big language, but I wouldn't call all of its complexity "features"
ryu0: most of it, yeah, but the lack of lambda features, and the lack of first class functions/currying was more fundamental to the language 13:36
ryu0 C++ lacked lambda because C does. 13:37
iirc, closest thing is C blocks extensions, but only clang supports it.
piojo9 I think C++ stopped trying to be "c with classes" some years ago... 13:38
timotimo haven't heard of blocks extensions
ryu0 en.wikipedia.org/wiki/Blocks_%28C_...tension%29
not too surprising. C is one language i've learned a lot about. 13:39
Hardly anyone uses blocks outside of Mac OS X or so.
but it's a way to get something resembling closure and such. 13:40
iirc, it's mostly used an auxiliary feature to Objective-C. 13:41
ryu0 as an* 13:41
timotimo mhm
piojo9 ryu0: I think one problem with a) being a big language, and b) having uncommon syntaxes: you need to use it all the time or you forget it. 13:42
ryu0 is that a remark about Perl6? 13:43
piojo9 That's what I'm afraid will happen. It happened to me with ruby--I just couldn't remember all the class names and method names
and their docs aren't as good as perldoc
ryu0: Yeah, but it's just speculation.
piojo9 Time will tell. I remembered a reasonable amount of the core ideas of perl5 after using it for a few weeks at work, then not using it again for years 13:44
I don't think I could remember perl6 the same way.
But it's damn useful to be able to pick up a language even if you're not fluent in it. C# and Java seem that way--they just follow the conventions you'd expect, and the compilers are pretty helpful 13:45
ryu0 i've looked for a language to supplement C and never quite found one i wanted to stick with yet.
moritz piojo9: perl 6 has some advantages over Perl 5 here, with more regular syntax 13:46
don't need to remember the @a vs. $a[0] stuff, for example
piojo9 moritz: right, and you can always call functions, no matter what the context is
moritz and since you can just write signatures, you don't need to remember to get elements for @_ or by calling shift()
s/elements/arguments/
piojo9 p6: sub xxx() {}();
camelia ( no output )
ryu0 but i've gotten fed up with how much work it takes to do anything in C. 13:47
piojo9 moritz: I thought s/elements/replacements/ was perfect in perl5--just like sed and vim, but a little more powerful.
ryu0 even when using libraries the pains of how careful you have to be gets old.
piojo9 I guess that says more about me than about perl
ryu0 perl6 seems promising because it's a hybrid of the unix languages i already rely on. 13:48
piojo9 ryu0: I feel the same about C++. I can do it, but it's a constant effort. I liked it when I was younger, but I wonder if I'll still tolerate it when I'm older. 13:49
ryu0 piojo9: C is worse, honestly. The language is less complex but you pay the price in greater code complexity.
piojo9 I believe that. Using void pointers instead of templates is like celibacy. 13:50
(That's an example as seen from the outside, since I don't really know C.)
ryu0 C is like telling all the atoms how to reform themselves in the form that happens to be the result you want. 13:51
lol
piojo9 haha
ryu0 and there's even different specialized uses for C.
how you write userspace C is different from embedded or even kernel space C. 13:52
piojo9 Oh, I forgot about that "little detail"--I never actually understood kernel space C
ryu0 Ever write raw userspace ASM?
A hello world takes more instructions than few lines of C. lol 13:53
piojo9 Haha, I never got good at low-level code (or even profiling based on generated assembly)
ryu0 first i had to allocate storage space for the string. 13:54
ryu0 then i had to write the instructions to make a system call for write and then exit. 13:55
not very hard to do but it gives you a lot of perspective on how much work it is.
piojo9 in the snow, uphill both ways :)
ryu0 I imagine we'd still be using ASM if we had all agreed on a single CPU architecture. 13:56
But that never happened.
AlexDaniel moritz: hm, or: sub foo($foo, $bar = 50) { say $foo; say $bar }; foo 42 13:57
piojo9 It seems hard to imagine people wouldn't have added more and more shortcuts to compilers, until it was considered a programming language.
ryu0 how do you think C can to be?
AlexDaniel moritz: it's still experimental even in v5.26 it seems, but maybe a worthy option anyway
ryu0 lol
piojo9 though it might have taken a lot longer before someone thought to make a language that was completely divorced from the hardware. 13:58
ryu0 it started as a portable way to describe general ASM characteristics.
andrzejku :-)
piojo9 ryu0: yeah, that's what I was taught
But eventually, it still would have happened, even without the need for aid in portability 13:59
ryu0 course it doesn't have a standard way to check stuff like CPU flags.
piojo9 because people are lazy, in a good way.
moritz AlexDaniel: the experience with smartmatching and given/when kinda keeps me off experimental p5 features
AlexDaniel moritz: yes :(
moritz not to mention that Debian Stretch comes with 5.24, and at $work we use system perl on Debian for most stuff 14:00
(and we're still struggeling with getting rid of wheezy, which comes with perl 5.14)
AlexDaniel it's available since v5.20
ryu0 wheezy? debian 7? 14:01
wow. ancient.
AlexDaniel there is this ticket but no information in it: RT #121481
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=121481
ryu0 i imagine the introduction of systemd doesn't make upgrading easy. 14:02
AlexDaniel not even a mention of what could possibly make them non-experimental and when
Juerd I encountered 0 problems on the dozens of Debian installations that were upgraded to a version with systemd.
moritz ryu0: not really; systemd hasn't been a pain point for us
ryu0 oh.
moritz in fact, it makes writing our own services easier
Juerd They did a good job to make that process pretty smooth. 14:03
moritz the pain points come more from the fact that some of these systems have been up 12+ years, and there's not much documentation on what they actually do
(upgraded from one debian version to the next, that is)
ryu0 aka the legacy systems everyone seems to have.
Juerd moritz: I have 3 of those and I'm always scared shitless to upgrade them :)
moritz and now we want to rsync them to virtual machines so that we can snapshot them 14:04
Juerd root@c4:~# ls -lh /etc/hostname
-rw-r--r-- 1 root root 3 Feb 17 2004 /etc/hostname
2004... :)
moritz and ideally build replacements using some config management systems, and then get rid of the auld ones 14:04
Juerd The only things this thing still does is syslog and auth dns. 14:05
Still, upgrading it is scary. There's a lot of software on the thing, even if it doesn't run anymore.
moritz we have done this with a few of the systems, and it's always been way more work than anticipated
Juerd: yes, that does sound scary 14:06
and some of our stuff runs on blade centers that haven't had maintenace contracts for the last 6 years or so :-)
and then there's always the issue with firewall rules; if we don't know who talks to the system, the only reliable way is to give the new system the old IP 14:09
Juerd That's also the case with this c4 thing; it's the auth dns server, so changing the IP is at least a month of work :)
moritz (we have firewall hardware/appliances all over, and they are managed by another team) 14:09
eater zoffix, does IRC::Client support SSL? 14:15
eater I'm afraid the answer is no :( 14:18
ryu0 eater: if it doesn't, you can use stunnel as a fallback.
or try it i assume.
eater no, we'll create a MR that adds SSL support! :D 14:18
ryu0 ok, have fun. just an idea if you didn't want to implement it. 14:19
eater ryu0: thanks for the tip tho :)
ryu0 oddly, i've seen people use it to implement HTTPS in obscure HTTP servers.
ryu0 does follow unix principles though. 14:20
socket pipelines. lol
moritz ok, time to dist-upgrade hack.p6c.org, I guess 14:21
"what could possibly go wrong?" 14:22
eater :')
gl moritz
AlexDaniel hm, I should do that also 14:22
eater \o/ rolling releases 14:23
AlexDaniel or maybe wait for a few more years… :P
ryu0 moritz: assets.amuniversal.com/9a085dc06d63...1dd8b71c47 14:26
Zoffix eater: no, it doesn't. When I wrote it, we didn't have IO::Socket::Async::SSL yet 14:27
eater Zoffix: cool, you'll have 1 PR soon then :)
ryu0 Zoffix: does it support SASL authentication? 14:28
Zoffix ryu0: no, it's not much more than an opened sock with a bit of processing on its data on top. 14:29
ryu0 ok.
nadim hi, do we have a tool, or an ambrio of tool, which can listen to a port and when data is received diplay it on the terminal. debuging NCurses apps kinda sucks. 14:32
Zoffix second code block on docs.perl6.org/type/IO::Socket::INET 14:34
nadim Zoffix++
I was still looking in the modules list but simple is better 14:35
piojo10 Nice meeting you guys. It's getting late, I've gotta go. I'll file that feature request about type checking, on the off chance that it's not impossible. 14:56
ckraniak m: use NativeCall; sub foo (Pointer $x = Pointer[void].new(0) ) { say "ok; } foo(); 16:24
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in double quotes; couldn't find final '"'
at <tmp>:1
------> 3inter[void].new(0) ) { say "ok; } foo();7⏏5<EOL>
expecting any of:
argument list
ckraniak m: use NativeCall; sub foo (Pointer $x = Pointer[void].new(0) ) { say "ok"; } foo(); 16:24
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3x = Pointer[void].new(0) ) { say "ok"; }7⏏5 foo();
expecting any of:
infix
infix stopper
ckraniak m: use NativeCall; sub foo (Pointer $x = Pointer[void].new(0) ) { say "ok; }; foo();
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in double quotes; couldn't find final '"'
at <tmp>:1
------> 3nter[void].new(0) ) { say "ok; }; foo();7⏏5<EOL>
expecting any of:
argument list
ckraniak Hang on 16:25
sena_kun m: use NativeCall; sub foo (Pointer $x = Pointer[void].new(0) ) { say "ok"; }; foo(); 16:26
camelia ok
ckraniak m: use NativeCall; sub foo (Pointer $x = Pointer[void].new(0) ) { say "ok"; }; foo(); 16:27
camelia ok
ckraniak Ok now:
m: use NativeCall; sub foo (Pointer[void] $x = Pointer[void].new(0) ) { say "ok; } foo();
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in double quotes; couldn't find final '"'
at <tmp>:1
------> 3inter[void].new(0) ) { say "ok; } foo();7⏏5<EOL>
expecting any of:
argument list
ckraniak m: use NativeCall; sub foo (Pointer[void] $x = Pointer[void].new(0) ) { say "ok"; }; foo();
camelia Type check failed in binding to parameter '$x'; expected NativeCall::Types::Pointer[NativeCall::Types::void] but got NativeCall::Types::Pointer (NativeCall::Types::Po...)
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
ckraniak There 16:28
Adding [void] to the type is killing ot
*it
sena_kun hmmm.
sena_kun not sure about expected behavior. ckraniak, you probably want to fill a rakudo issue. 16:30
BenGoldberg m: use NativeCall; my constant voidP = Pointer[void]; sub foo( voidp $x = voidp.new(0) ) { say "ok" }; foo(); 16:37
camelia 5===SORRY!5=== Error while compiling <tmp>
Invalid typename 'voidp' in parameter declaration. Did you mean 'voidP', 'void'?
at <tmp>:1
------> 3nt voidP = Pointer[void]; sub foo( voidp7⏏5 $x = voidp.new(0) ) { say "ok" }; foo()
BenGoldberg m: use NativeCall; my constant voidp = Pointer[void]; sub foo( voidp $x = voidp.new(0) ) { say "ok" }; foo();
camelia Type check failed in binding to parameter '$x'; expected NativeCall::Types::Pointer[NativeCall::Types::void] but got NativeCall::Types::Pointer (NativeCall::Types::Po...)
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
BenGoldberg m: use NativeCall; my constant voidp = Pointer[void]; sub foo( voidp $x is default(voidp.new(0)) ) { say "ok" }; foo(); 16:38
camelia 5===SORRY!5=== Error while compiling <tmp>
Can't use unknown trait 'is default' in a parameter declaration.
at <tmp>:1
expecting any of:
rw
readonly
copy
required
raw
leading_docs…
BenGoldberg ckraniak, As a simple workaround, any undefined instance of a pointer type can be used to represent a C NULL value. 16:40
BenGoldberg m: use NativeCall; sub foo( Pointer $foo ) { say "ok" }; foo(); 16:41
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling foo() will never work with declared signature (NativeCall::Types::Pointer $foo)
at <tmp>:1
------> 3; sub foo( Pointer $foo ) { say "ok" }; 7⏏5foo();
BenGoldberg m: use NativeCall; sub foo( Pointer $foo = Pointer ) { say "ok" }; foo();
camelia ok
BenGoldberg m: use NativeCall; sub foo( Pointer $foo? ) { say "ok" }; foo();
camelia ok
ckraniak ... The question mark is what I'll try 16:42
That makes more sense in the context I'm using this
Although I don't think I suffer anything by using Pointer instead of Pointer[void] 16:43
Thanks 16:44
andreoss is it possible to not inherit Any for a new class? 16:48
seems only through MOP 16:52
timotimo m: class Foo is Mu { }; say Foo.^mro 16:57
camelia ((Foo) (Mu))
timotimo andreoss: ^
eater hmm, is there a catch-all function for classes? like __call in php? 18:15
moritz there's FALLBACK 18:18
and for direct invocation of the class, CALL-ME
eater \o/ 18:18
thanks moritz
moritz you're welcome 18:19
pepe__ Hi, (for a school task) I'm looking for implementations of strings in different systems. I know in language C strings are arrays (continuous positions in memory). In haskell strings are linked lists. I'm looking for a description about perl 6 implementation, because somewhere I read that it was in trees. 18:30
Can you confirm that? Where can i read about that implementation? 18:31
timotimo it's trees, but we try to keep them flat
you'd want to look at MoarVM/MoarVM on github, especially src/6model/reprs/MVMString.h and src/strings/stringops.c 18:32
pepe__: ^
pepe__ ok. Thats great. Thanks.
ryu0 pepe__: you're describing a rope data structure i believe.
pepe__ Yes. 18:33
timotimo the tree-ish parts we call "strands"
moritz the more interesting part is NFG 18:35
timotimo aye, that has its own .h and .c
moritz which encodes grapheme clusters as a single, synthethic codepoint
timotimo the datastructure that manages synthetic codepoints is a trie with some concurrent-access-safe mechanisms in place 18:36
moritz lockless reads, iirc 18:48
timotimo right 18:49
we have the "free at safepoint" mechanism we use in many places to ensure things don't blow up 18:50
and we'll use them in more places in the future
moritz finds he doesn't understand the $!highwater stuff 19:04
mspo is this because my rakudo is old? Serialization Error: missing static code ref for closure 'BUILD' 19:08
b2gills pepe__: There was a talk video posted to www.facebook.com/theperlconference/ called “Unicode Internals of Perl 6” that may be of interest to you. 19:15
AlexDaniel m: sub foo(:color(:$colour)) { $colour + 1 }; my $s; for ^1000000 { $s += foo(:color($_)) }; say $s; say now - INIT now
camelia Unexpected named argument 'color' passed
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
mspo also is there an 08 coming soon? 19:16
AlexDaniel mspo: yes 19:21
soon-ish :)
mscha sub foo { ($^a+$^b) % 13 }; my @bar = [\[&foo]] 1..10; say @bar; 19:29
m: sub foo { ($^a+$^b) % 13 }; my @bar = [\[&foo]] 1..10; say @bar;
camelia [1 3 6 10 2 8 2 10 6 3]
mscha Is there a way to do this without a named sub?
m: my @bar = [\[&{ ($^a+$^b) % 13 }]] 1..10; say @bar;
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3my @bar = [\[&{ ($^a+$^b) % 13 }]]7⏏5 1..10; say @bar;
expecting any of:
infix
infix stopper
postfix
statement…
mscha m: my @bar = [\[{ ($^a+$^b) % 13 }]] 1..10; say @bar; 19:29
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3my @bar = [\[{ ($^a+$^b) % 13 }]]7⏏5 1..10; say @bar;
expecting any of:
infix
infix stopper
postfix
statement …
mscha m: my @bar = [\[sub { ($^a+$^b) % 13 }]] 1..10; say @bar; 19:30
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3my @bar = [\[sub { ($^a+$^b) % 13 }]]7⏏5 1..10; say @bar;
expecting any of:
infix
infix stopper
postfix
statem…
b2gills m: my @bar = [\[{($^a+$^b)%13}]] 1..10; say @bar; 19:32
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3my @bar = [\[{($^a+$^b)%13}]]7⏏5 1..10; say @bar;
expecting any of:
infix
infix stopper
postfix
statement end…
b2gills m: my @bar = [\[&({($^a+$^b)%13})]] 1..10; say @bar; 19:33
camelia [1 3 6 10 2 8 2 10 6 3]
AlexDaniel b2gills: /o\
I need to configure my editor to highlight matched brackets in random colors
it feels like I had this already, hmm…
b2gills There can't be any spaces and you need an & after the [ that denotes the code to use as an infix operator 19:34
b2gills m: my @bar = [\[&((*+*)%13)]] 1..10; say @bar; 19:36
camelia [1 3 6 10 2 8 2 10 6 3]
AlexDaniel why is there no :triangle named arg in reduce? 19:37
like, is [\…] the only way to do it?
renormalist I know I do it every year and often it stalls again but anyway - perl6 is gettign better and better, I even wrote my first little Perl6 program this time (Rakudo*2017.07). It feels very polished, just like a normal programming language. Thank you all.
b2gills produce
renormalist me stalls again with it, that is, not perl6
AlexDaniel ah, it's produce! 19:38
Okay
renormalist (in the past)
AlexDaniel m: my @bar = (1..10) .produce: (* + *) % 13; say @bar
camelia [1 3 6 10 2 8 2 10 6 3]
AlexDaniel b2gills++
m: my @bar = 1..10 .produce: (* + *) % 13; say @bar
camelia Seq objects are not valid endpoints for Ranges
in block <unit> at <tmp> line 1
AlexDaniel squints 19:39
mscha Thanks b2gills, AlexDaniels... 19:39
moritz AlexDaniel: precedence
mscha The "no spaces in the code" is really weird...
moritz AlexDaniel: parsed 1..(10.produce: ...) 19:40
mscha But produce is probably better - less “golfy”.
AlexDaniel moritz: I see that, but how come I expected it to do something different…
moritz what is produce, btw? 19:41
AlexDaniel moritz: [\…] @a
moritz ah
AlexDaniel m: say ^10 .Str
camelia 0 1 2 3 4 5 6 7 8 9
moritz reduce with intermediate results
AlexDaniel m: say 0..10 .Str
camelia 0..10
AlexDaniel this is why I wrote that
mscha m: say produce({ ($^a + $^b) % 13 }, 1..10)
camelia (1 3 6 10 2 8 2 10 6 3)
moritz m: infix:<@>($a, $b) { ($a + $b) % 13 }; say [\@] 1..10 19:42
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$a' is not declared
at <tmp>:1
------> 3infix:<@>(7⏏5$a, $b) { ($a + $b) % 13 }; say [\@] 1..
moritz m: sub infix:<@>($a, $b) { ($a + $b) % 13 }; say [\@] 1..10
camelia (1 3 6 10 2 8 2 10 6 3)
b2gills mscha: It can be hard to tell if 「[+] List」 should be parsed as a left fold or an array literal, so there are no spaces allowed in 「[+] List」
b2gills m: my \term:<R+> = 5; say [ R+ ] # array literal 19:46
camelia [5]
b2gills m: my \term:<R+> = 5; say [R+] # left fold
camelia 0
AlexDaniel renormalist: that's great to hear :) Thank you for your feedback 19:48
pepe__ b2gills: Thanks. I'm starting the video now. As I see, Perl 6 doesn't implement real ropes in strings because ropes are full trees with several levels of depth. Perl 6 implements something lighter: a list of substrings. 19:55
b2gills pepe__: Note that is an implementation detail, and is not visible within the language 19:57
b2gills A Str is a singular opaque object in Perl 6, that consists internally of a list of graphemes. It is opaque in that you can't use array indexing operations on a Str, instead you use methods and subroutines to access parts of it 20:01
timotimo a list of substrings where each substring is allowed to be repeated
mspo AlexDaniel: okay I'll wait for it 20:44
AlexDaniel NeuralAnomaly: status
NeuralAnomaly AlexDaniel, [✘] Next release will be in 5 days and 7 hours. Since last release, there are 49 new still-open tickets (2 unreviewed and 3 blockers) and 151 unreviewed commits. See perl6.fail/release/stats for details
AlexDaniel mspo: I mean, 5 days 20:45
mspo blah
nqp never got a 07.1
how about an early release for that/ :)
AlexDaniel I think we can wait for 5 days :)
sorry :(
mspo np
I can't do crap during the work week anyway 20:46
raschipi m: ?('aaa0001'..'zzz9999')[^91].grep('aaa0100') # Why false?
camelia WARNINGS for <tmp>:
Useless use of "?" in expression "?('aaa0001'..'zzz9999')[^91].grep('aaa0100')" in sink context (line 1)
raschipi m: say ?('aaa0001'..'zzz9999')[^91].grep('aaa0100') # Why false?
camelia False
AlexDaniel not string ranges again… 20:48
but
m: .say for (‘01’..‘99’)[^15]
camelia 01
02
03
04
05
06
07
08
09
11
12
13
14
15
16
AlexDaniel 10 is missing
m: .say for (‘00’..‘99’)[^15] 20:49
camelia 00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
raschipi I see that, but why? I had tested the 'aaa0000' case and I saw that it works.
m: .say for (‘06’..‘99’)[^15] 20:50
camelia 06
07
08
09
16
17
18
19
26
27
28
29
36
37
38
AlexDaniel raschipi: it does some kind of per character increment thingy. I never really understood it, sorry :(
ugexe a string range could work so many different ways its natural that it will seemingly do what you want in some cases but not others 20:51
raschipi I see now, thanks. It wraps around to the number specified as the start of the sequence.
AlexDaniel raschipi: docs.perl6.org/language/traps#Stri.../Sequences
raschipi Thanks everybody. 20:52
mscha m: say 0.1e0 + 0.2e0 == 0.3e0; say 1e-1 + 2e-1 == 3e-1 22:15
camelia False
False
mscha m: say 0.1e0 + 0.2e0 == 0.3e0;
camelia False
mscha m: say 1e-1 + 2e-1 == 3e-1
camelia True
mscha Huh?
jdv79 Attempt to unlock mutex by thread not holding it 22:17
thats a new one for me
raschipi m: (1e-1).^name 22:21
camelia ( no output )
raschipi m: (1e-1).^name.say
camelia Num
jdv79 looks like its on a supplier.emit call 22:46
timotimo hm, supplier isn't thread-safe?!
jnthn jdv79: The only place I know that can happen is when using 6.d.PREVIEW 22:47
(Supplies need changes to work properly with it. Those haven't happened yet.) 22:48
jdv79 i am 22:49
NO
ok
haha
jnthn In theory, will be working on that in September. :) 22:50
sullivan I want to build Rakudo 2017-07 so the executables are in the standard system directories 22:52
So is it enough to give the argument "--prefix=/usr" to Configure.pl,
sullivan Or do I need also to give an arg to "--libdir=" and what should it be? 22:52
timotimo i think --prefix can very well be enough 22:53
but i've not installed rakudo into /usr or similar before
raschipi sullivan: You should look into what distros are doing, I will look for you in a minute. 22:54
jdv79 it seems like i run into a bunch of issues everytime i try to make headway with the only real app i'm trying to do in p6. well, at least i'll be on vaca til september this time:) 22:54
timotimo no harm installing it to /opt/foobar and investigating if everything would end up looking correct
jdv79: thanks for sticking with us and pointing out problems along the way!
jdv79 i think this one is a blocker
sullivan raschipi, good idea .. 22:55
QUIT
jdv79 cause if i go back to blocking await and up to the thread count i need (maybe ~64 or so) i'll run out of mem
timotimo hmm, will we one day look back at texas operators (both in perl6 and the equivalents in other languages) and think of them the same way we think of trigraphs nowadays? 22:55
"we used to need them because you couldn't enter *those characters* on a regular keyboard"
back then it was curly braces, now it's ≥
raschipi timotimo: Yes, because soon every operating system will have an on-screen keyboard to input emoji and these symbols will be available there. Therefore it will be easy to input them everywhere, even without changing keyboards. 22:59
timotimo "on-screen keyboard", "easy" ... :\ 23:00
AlexDaniel timotimo: IMO for that to happen we should throw away the idea of keyboard layouts being static and unmodifiable 23:01
timotimo time for LCARS 23:02
AlexDaniel hm, now I wonder if there's a way to have the keyboard layout file located outside of standard xkb paths 23:04
so that it's at least editable by non-root 23:05
AlexDaniel setxkbmap has -I option, so YES! 23:06
timotimo nice 23:10
i wonder, can you get code execution with a malicious xkbmap file? :)
timotimo "Supposedly there’s a JIT in the works, but it appears to have been in the works for a number of years, so I’m not holding my breath." - snrk 23:17
sjn www.reddit.com/r/perl/comments/6th...of_perl_6/ 23:21
timotimo i wish i could point out to him that he can instead of .out-supply literally just .out.Supply 23:23
i'll post a little tweet 23:24