Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-05-10

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:02 skink Is your SSL certs directory /etc/ssl/certs, /usr/local/share/ca-certificates, or /usr/lib/ssl/certs?
00:04 SVR4 It's /usr/local
00:04 SVR4 I believe
00:04 SVR4 I can't check right now.
00:04 skink Ah, okay
00:04 skink 'Cause that dir is empty for me on Linux
00:05 ugexe you can always create a HTTP server that accepts remote connections, have travis-ci on OSX run it, connect to it, and run your remote commands! (probably)
00:05 skink Why do that when I have IRC :)
00:06 ugexe because now i want such a script :(
00:06 skink It looks like any *nix with Firefox installed will have /etc/ssl/certs
00:07 SVR4 Ah
00:07 SVR4 Good to know.
00:07 skink On NetBSD that's the mozilla-rootcerts package
00:07 skink I have several dirs that amount to a hodgepodge of OpenSSL and Mozilla certs
00:08 hotel my dad just told me something was "ok iguana"
00:09 skink ugexe, I'm adding certificate verification to the OpenSSL module. I'm including OpenSSL's ca-certificates.crt in resources/ for Windows, and I'm debating between that or a system dir for *nix
00:09 ugexe skink: maybe check out https://github.com/gisle/mozilla-ca to see how Perl 5 does it
00:11 skink ugexe, That's pretty much how I'm doing it
00:11 skink I can use either Mozilla's or OpenSSL's
00:11 skink Doesn't make a huge difference
00:12 hotel I would say openssl, because imo it's more likely people have that than mozilla?
00:12 * hotel is absolutely not an expert***
00:15 geekosaur OS X won't have any of those by default; Apple stores its certs in the keychain, and has modified the openssl libs to use the keychain
00:15 ugexe skink: probably use openssls bundled with openssl, and release a module that can somehow allow it to use mozilla ca instead?
00:16 skink ugexe, Oh, actually, I'm dumb
00:16 skink There's already a use-certificate-file() :)
00:16 skink It's just not used by default
00:17 ugexe ah
00:18 pierre_ joined #perl6
00:20 pierre_ joined #perl6
00:31 hotel well maybe yours is better? :3
00:36 pierre_ joined #perl6
00:37 skink Actually, that function can only handle single pem files, not chained cert pem file ^^
00:42 skink ugexe, Right, so, current design: if any certificate issues are detected, an exception is thrown so you can pick what to do next (say, you're testing on a self-signed server)
00:42 skink Most commonly seen one will probably be "Certificate verification error: X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY", for example
00:44 mr-foobar joined #perl6
00:49 matiaslina joined #perl6
00:49 BenGoldberg joined #perl6
00:52 skink The only other real option being openssl killing the socket upon error :)
00:58 cdg joined #perl6
01:04 pierre_ joined #perl6
01:05 winger joined #perl6
01:08 hotel joined #perl6
01:08 hotel it's funny: whenever windows loses internet connection, it tries to send you to a microsoft page online (presumably telling you how to troubleshoot the problem)
01:11 grondilu joined #perl6
01:14 timotimo psch: if you want to have a game or simulation with thousands of agents where each agent is allowed their own state and script, you're probably bound to lua or something; what's your take on that?
01:14 mst hotel: mine doesn't
01:15 hotel oh
01:15 hotel maybe it's my router then
01:15 timotimo could be something your OEM installed
01:15 hotel could be
01:16 hotel oem is msi though, dunno why they would
01:16 hotel already had enough bloatware on here lol
01:16 timotimo OEMs are shit, that's why :)
01:16 mst I'm running a Thinkpad Helix 2
01:16 mst maybe the thinkpad team turned it off
01:16 vendethiel joined #perl6
01:16 timotimo lenovo also put some real terrible shit onto their devices last year
01:17 mst consumer only though
01:17 mst my pet toys were basically fine
01:17 mr-foobar joined #perl6
01:17 uruwi joined #perl6
01:17 timotimo mhm
01:17 mst I mean they totally did it and wtf
01:17 mst but I still love my thinkpads
01:17 psch timotimo: i don't think i have much more of take than "depends on compiler/interpreter footprint unless you can compile AOT to machine code"
01:17 psch +a
01:19 timotimo if you want to have dynamic stuff, it's not so easy to get by without a VM
01:19 psch true
01:20 hotel oh well, does what I bought it to do
01:21 hotel >write shitty code and play games
01:26 pierre_ joined #perl6
01:26 psch timotimo: well, there's of course the option of a feature stripped vm, i.e. the agents probably don't need any async or IO, or rather a very limited subset
01:27 psch timotimo: with that and mem sharing that's all you can do except "take a different vm that has less features in the first place"
01:27 psch ...at least that's as far as i understand it :)
01:28 timotimo my thoughts are still that most of the "bloat" you get from extra features in your vm are going to be "passive" and also shared between all processes
01:29 psch right, in the end the runtime objects for each agents are always more than the vms own footprint
01:29 psch -s
01:29 timotimo well, at least hopefully :)
01:29 psch ...in any realistic scenario
01:29 hotel yeah that's best-case scenario
01:29 psch if the agents only add two ints, yeah
01:30 psch but if there's anything that lets them fit into the philosophical concept of agent they'll most likely eclipse the vm footprint :P
01:30 hotel /ignore-me
01:30 timotimo well, you won't get far if you run eclipse on the agent VMs :) :) :)
01:32 hotel s/on the agent VMs//
01:33 hotel ;-)
01:35 finanalyst joined #perl6
01:36 MadcapJake tony-o: no, I actually haven't been at the keyboard much lately til today. Have you added anything new?
01:37 MadcapJake tony-o: I think the front page should have a recent-updates feed
01:37 hotel joined #perl6
01:38 MadcapJake speaking of updates, how do people document that? CHANGELOG.md? git tag descriptions? github releases?
01:38 MadcapJake s/people/Sixians/
01:39 MadcapJake what's the Perl 5 way?
01:39 timotimo isn't it usually "CHANGES"?
01:40 MadcapJake I've seen both
01:40 MadcapJake I think traditionally it was CHANGELOG no extension
01:47 MadcapJake https://github.com/perl6/user-experience/issues/12
01:49 winger joined #perl6
01:56 pierre_ joined #perl6
02:10 kid511 joined #perl6
02:10 molaf joined #perl6
02:11 noganex_ joined #perl6
02:18 kurahaupo joined #perl6
02:28 kurahaupo joined #perl6
02:29 hotel_california joined #perl6
02:34 SHODAN joined #perl6
02:39 cdg joined #perl6
02:47 Ben_Goldberg joined #perl6
02:52 hotel_california joined #perl6
02:55 zakharyas joined #perl6
03:02 pierre_ joined #perl6
03:17 tailgate Hi, I'm trying to resolve an error I'm having with type assignmetns in this gist.
03:17 tailgate https://gist.github.com/ahalbert/f7c56de80d3266c56ceb1f7105de3651
03:18 tailgate # Cannot call mergeUnits(Units::Unit: Hash); none of these signatures match:
03:18 tailgate #    (Units::Unit $: Units::Unit $u, *%_)
03:20 pierre_ joined #perl6
03:20 winger_ joined #perl6
03:21 grondilu try predeclaring the class
03:21 grondilu class Unit {...}
03:21 tailgate actually, ignore the above error, it's
03:22 tailgate Odd number of elements found where hash initializer expected
03:22 tailgate in sub infix:<*> at lib/math/units.pm6 line 65
03:22 tailgate in block <unit> at lib/math/units.pm6 line 77
03:22 grondilu m: class A { has A $.a }
03:22 camelia rakudo-moar df4eb8: ( no output )
03:22 grondilu m: class A { has A $.a }; say A.new(:a(A.new))
03:22 camelia rakudo-moar df4eb8: OUTPUT«A.new(a => A.new(a => A))␤»
03:22 grondilu oh that works
03:22 grondilu I thought that was not possible without predeclaring.  Nevermind.
03:23 raydiak one thing that sticks out is that $x.mergeUnits($y.units) probably ought to be $x.mergeUnits($y) on line 66
03:23 tailgate predeclare?  define it at the beginning
03:24 tailgate what is the diffrence between predfine and defining?
03:24 tailgate raydiak: yes, I fixed that
03:25 grondilu I wrote "pre-declare", not predefine.
03:25 grondilu maybe explicit cast to Hash is necessary to set units
03:25 grondilu units => ($key => $value).Hash
03:25 grondilu not just
03:25 grondilu units => $key => $value
03:26 grondilu units => ($key => $value)
03:26 grondilu m: class { has %.h }.new: h => (foo => "bar")
03:26 camelia rakudo-moar df4eb8: ( no output )
03:26 grondilu nope seems fine, my bad.
03:27 ugexe well cleanUnits never returns anything
03:27 ugexe yet you return .cleanUnits from mergeUnits
03:27 ugexe and try to put it into a hash?
03:28 ugexe i think you need to put in some say/print statements and figure out what you are really passing around
03:30 tailgate it seems to run into problems calling mergeUnits
03:30 tailgate $y is a unit
03:31 tailgate Odd number of elements found where hash initializer expected < what does this mean?
03:31 ugexe why dont you print out what its passing at that point
03:32 tailgate ugh, grondilu was right, It had to do $x.mergeUnits($y).Hash
03:32 tailgate thanks
03:34 grondilu m: say .h.perl given class { has %.h }.new: h => (foo => "bar")
03:34 camelia rakudo-moar df4eb8: OUTPUT«{:foo("bar")}␤»
03:35 grondilu meh
03:41 ugexe its the mergeUnits not returning anything
03:41 ugexe but being treated like it does
03:41 ugexe m: class Foo { has %.h; }; sub mergeUnits { }; Foo.new(h => mergeUnits);
03:41 camelia rakudo-moar df4eb8: OUTPUT«Odd number of elements found where hash initializer expected␤  in block <unit> at /tmp/arcyNjiWUm line 1␤␤»
03:42 ugexe m: class Foo { has %.h; }; sub mergeUnits { }; Foo.new(h => mergeUnits.hash);
03:42 camelia rakudo-moar df4eb8: ( no output )
03:44 ugexe its all just side effects, there doesnt seem to be a reason to assign the return values from any of these o anything
04:09 BenGoldberg m: sub empty { }; my @count = empty; say @count.elems;
04:09 camelia rakudo-moar df4eb8: OUTPUT«1␤»
04:09 BenGoldberg m: sub empty { }; my @count = empty; say @count;
04:09 camelia rakudo-moar df4eb8: OUTPUT«[(Any)]␤»
04:10 * BenGoldberg would have expected an empty sub to return a slip.
04:10 BenGoldberg m: my $test = slip; say $test;
04:10 camelia rakudo-moar df4eb8: OUTPUT«()␤»
04:11 BenGoldberg m: my $test = []; say $test;
04:11 camelia rakudo-moar df4eb8: OUTPUT«[]␤»
04:11 BenGoldberg m: my $test = (); say $test;
04:11 camelia rakudo-moar df4eb8: OUTPUT«()␤»
04:11 BenGoldberg m: my $test = (); say;
04:11 camelia rakudo-moar df4eb8: OUTPUT«5===SORRY!5=== Error while compiling /tmp/IJBMoQRwez␤Unsupported use of bare "say"; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument, or use &say to refer to the function as a noun␤at /tmp/IJBMoQRwez:1␤------> 3…»
04:16 pierre_ joined #perl6
04:20 ugexe m: sub foo returns Seq { }; say foo.perl
04:20 camelia rakudo-moar df4eb8: OUTPUT«Nil␤»
04:23 hotel joined #perl6
04:26 winger__ joined #perl6
04:27 eshansingh joined #perl6
04:27 eshansingh Hello?
04:34 tony-o hello?
04:34 pierre_ joined #perl6
04:35 Woodi joined #perl6
04:39 ssotka joined #perl6
04:57 Cabanossi joined #perl6
04:58 Possum joined #perl6
05:14 CIAvash joined #perl6
05:21 MadcapJake wrote a quick dailyprogrammer before bed: https://www.reddit.com/r/dailyprogrammer/comments/4ijtrt/20160509_challenge_266_easy_basic_graph/d2zlbl7
05:28 hotel_california joined #perl6
05:36 domidumont joined #perl6
05:37 wbill joined #perl6
05:41 jack_rabbit joined #perl6
05:42 domidumont joined #perl6
05:46 pierre_ joined #perl6
05:47 espadrine_ joined #perl6
05:57 moritz \o
05:57 yoleaux 9 May 2016 21:44Z <psch> moritz: did something wrt ulimits change on hack?  r-m builds get "Killed" during RESTRICTED.setting compilation for me since about half an hour ago
05:57 yoleaux 9 May 2016 22:32Z <psch> moritz: never mind, turns out i was just recursing infinitely
05:57 moritz psch: seems the ulimit worked :-)
06:06 wamba joined #perl6
06:09 domidumont joined #perl6
06:10 cpage_ joined #perl6
06:11 _mg_ joined #perl6
06:12 jjido joined #perl6
06:16 DrForr For those not on the book of Faces, I have 27 confirmed attendees for the tutorial next week.
06:18 rurban joined #perl6
06:22 alva joined #perl6
06:24 firstdayonthejob joined #perl6
06:27 darutoko joined #perl6
06:30 stmuk_ joined #perl6
06:37 JustinHitla left #perl6
06:42 vendethiel- joined #perl6
06:51 moritz wow
06:52 moritz is this going to be a screencast?
06:57 Xliff joined #perl6
07:04 abraxxa joined #perl6
07:26 rurban left #perl6
07:29 brrt joined #perl6
07:29 RabidGravy joined #perl6
07:42 RabidGravy weeee
07:45 moritz oomphf
07:50 aries_liuxueyang joined #perl6
07:53 rurban1 joined #perl6
07:54 ufobat morning!
07:57 DrForr moritz: Well, I had to sign a video waiver, so I'm going to guess there will be something posted eventually.
08:01 RabidGravy boom
08:01 pierre_ joined #perl6
08:01 RabidGravy DrForr, is 27 attendees good, average, don't know?
08:02 DrForr Well, the room holds 165, so there's space to grow :)
08:04 RabidGravy It'll be great, even if one of those people makes a decisive PR or a great module it will be a good thing
08:06 g4 joined #perl6
08:07 DrForr Nod, if it brings anyone into the community I'll have done my work :)
08:07 El_Che joined #perl6
08:27 rindolf joined #perl6
08:44 wamba joined #perl6
08:52 psch moritz: yeah, just weird that the code that looped on moar didn't on jvm, which made me not think of that particularly quickly... :)
09:05 Xliff joined #perl6
09:05 [particle] joined #perl6
09:24 keix joined #perl6
09:24 cognominal joined #perl6
09:25 sjoshi joined #perl6
09:28 keix joined #perl6
09:35 espadrine_ joined #perl6
09:39 dalek ecosystem: c8ac6fa | (Siavash Askari Nasr)++ | META.list:
09:39 dalek ecosystem: Add WebService::FootballData
09:39 dalek ecosystem:
09:39 dalek ecosystem: see https://gitlab.com/CIAvash/WebService-FootballData
09:39 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/c8ac6fa529
09:40 RabidGravy cool
09:44 rindolf joined #perl6
09:45 rurban joined #perl6
10:03 ranguard joined #perl6
10:08 tinita joined #perl6
10:29 kid51 joined #perl6
10:32 kid511 joined #perl6
10:35 ZoffixWin joined #perl6
10:41 dayangkun joined #perl6
10:51 sno joined #perl6
10:56 obfusk joined #perl6
10:59 huggable joined #perl6
11:01 rurban1 joined #perl6
11:15 Ven joined #perl6
11:15 Ven o/, #perl6
11:16 Ven should `.say for 0..*` leak memory?
11:18 Ven seems to hover around 2.4G mem, but never above that...
11:21 lizmat did you try for 0..* -> $a { $a.say } ?
11:21 lizmat but no, it shouldn't leak
11:26 ilmari hvering around 90MB here (2016.04 on debian unstable)
11:27 Ven weird..
11:30 Ven wait, I think it's rlwrap that's going awry >.>
11:32 Ven lizmat++ ilmari++ # thanks
11:32 lizmat Ven: on a side note, it leaks very, very slowly for me, but now sits at 88.3 MB for me
11:33 lizmat oddly enough at 128% CPU, so I guess garbage collect is working in a separate thread  :-)
11:33 Ven lizmat: oh, so it does leak *a bit*? are you sure it's not just the "int size" that's increasing?
11:33 Ven (since, well, it needs bigger and bigger numbers)
11:33 lizmat still in native territory
11:34 Ven ok :-)
11:35 lizmat yw
11:49 Ven m: my $a //= 3
11:49 camelia rakudo-moar f03564: ( no output )
11:52 lizmat m: my $a //= 3; dd $a
11:52 camelia rakudo-moar f03564: OUTPUT«Int $a = 3␤»
11:54 Ven well, that makes sense
11:54 Ven m: my $a &&= 3
11:54 camelia rakudo-moar f03564: ( no output )
11:54 Ven that one's gonna be empty still, though :P
11:54 lizmat yup
11:58 CIAvash joined #perl6
12:03 noreem joined #perl6
12:09 Xliff_ joined #perl6
12:15 dalek ecosystem: ca47798 | (Siavash Askari Nasr)++ | META.list:
12:15 dalek ecosystem: Add App::Football
12:15 dalek ecosystem:
12:15 dalek ecosystem: See https://gitlab.com/CIAvash/App-Football
12:15 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/ca4779877b
12:18 zakharyas joined #perl6
12:21 nchambers joined #perl6
12:23 aindilis` joined #perl6
12:25 kaare_ joined #perl6
12:27 autarch joined #perl6
12:27 M-matthew joined #perl6
12:28 rurban joined #perl6
12:29 |2701 joined #perl6
12:31 tadzik oh, a gitlab project :)
12:31 tadzik I can't wait for all the tools to break because they expect everything to be on github
12:31 timotimo :)
12:31 timotimo it's very good we're giving our tools that workout
12:32 timotimo like when fedora named its release "Schrödinger's Cat"
12:34 RabidGravy are there any bitbucket ones yet
12:35 timotimo i ... think so?
12:35 timotimo not in the meta.list :\
12:35 araujo_ joined #perl6
12:35 timotimo i should move JSON::Fast to bitbucket :D
12:35 RabidGravy timotimo, where does it say that - it just says "Fedora 23 (Workstation Edition)" on mine
12:36 timotimo it was f22 or f21
12:41 RabidGravy because you can't have too many passive low pass gates
12:42 chee joined #perl6
12:42 chee joined #perl6
12:47 M-matthew joined #perl6
12:47 * moritz thought the F22 was a fighter jet plane thingy
12:48 timotimo EuroFedora? :)
12:50 tony-o f22s are gross
12:51 moritz and f23s are about 4% grosser? :-)
12:52 tony-o Großer :-p
12:52 tony-o i've worked on a couple, and a bunch of 35s
12:54 tony-o oh cool, it only took the USMC 8 years to declare the 35 operational - destroying their record for the osprey that took over 25 years to become operational
12:55 pmurias joined #perl6
12:55 pmurias hi
12:55 tony-o hi pmurias
13:03 * [Coke] yawns
13:03 MadcapJake m: my $a = Nil; $a //= 3; dd $a; $a //= True; dd $a
13:03 camelia rakudo-moar f03564: OUTPUT«Int $a = 3␤Int $a = 3␤»
13:03 rurban1 joined #perl6
13:03 [Coke] Need a volunteer to do the May compiler release.
13:08 rurban joined #perl6
13:10 [particle] joined #perl6
13:12 rurban1 joined #perl6
13:15 vytas joined #perl6
13:16 skids joined #perl6
13:17 rurban joined #perl6
13:23 tony-o MadcapJake: have you been using modules.zef.pm?
13:25 MadcapJake tony-o: yeah, it's great!
13:26 MadcapJake I was thinking the homepage should have a recently updated feed
13:29 MadcapJake have you made any recent changes?
13:29 tony-o MadcapJake: i haven't, was hoping for some feedback on what else you might like to see
13:30 tony-o i can do a feed of the modules most recently added
13:41 aries_liuxueyang joined #perl6
13:44 pmurias tony-o: having the result list in a more vertical format like on modules.perl6.org would be nicer
13:44 pmurias * more horizontal
13:52 rurban1 joined #perl6
13:57 rindolf joined #perl6
14:07 tony-o pmurias: check that out
14:08 sufrostico joined #perl6
14:09 pierre_ joined #perl6
14:10 pmurias tony-o: have you seen https://metacpan.org/recent?
14:12 tony-o i hadn't until just now
14:13 tony-o i'm working on something like that from MadcapJake's suggestion
14:15 tony-o pmurias++ MadcapJake++
14:15 cdg joined #perl6
14:15 tharkun joined #perl6
14:16 MadcapJake tony-o++ # love the site!
14:21 llfourn m: my @a = (^5).map({ start { say "start $_"; sleep $_; $_ } }).eager.map({ say "await $_"; await $_; }).lazy; for @a { say "got $_" }
14:21 camelia rakudo-moar f03564: OUTPUT«start 0␤start 1␤start 2␤start 3␤start 4␤await 0␤got 0␤await 1␤got 1␤await 2␤got 2␤await 3␤got 3␤await 4␤got 4␤»
14:21 llfourn ^^ array where each element is created concurrently but works just like normal array
14:21 llfourn #LovePerl6
14:22 moritz m: my @a = (^5).map({ start { say "start $_"; sleep $_; $_ }.eager.map(*.result).lazy; for @a { say "got $_" }
14:22 camelia rakudo-moar f03564: OUTPUT«5===SORRY!5=== Error while compiling /tmp/9bPhb4vLfU␤Missing block␤at /tmp/9bPhb4vLfU:1␤------> 3(*.result).lazy; for @a { say "got $_" }7⏏5<EOL>␤»
14:22 moritz m: my @a = (^5).map({ start { say "start $_"; sleep $_; $_ }).eager.map(*.result).lazy; for @a { say "got $_" }
14:22 camelia rakudo-moar f03564: OUTPUT«5===SORRY!5=== Error while compiling /tmp/YalcB3lutw␤Missing block␤at /tmp/YalcB3lutw:1␤------> 3{ start { say "start $_"; sleep $_; $_ }7⏏5).eager.map(*.result).lazy; for @a { say␤    expecting any of:␤        statement end␤        s…»
14:22 andreoss joined #perl6
14:22 moritz m: my @a = (^5).map({ start { say "start $_"; sleep $_; $_ }}).eager.map(*.result).lazy; for @a { say "got $_" }
14:23 camelia rakudo-moar f03564: OUTPUT«start 0␤start 1␤got 0␤start 2␤start 3␤start 4␤got 1␤got 2␤got 3␤got 4␤»
14:23 moritz llfourn: .result implicitly awaits for the promise, so that's a tiny simplification
14:23 llfourn moritz: that's cool but the say "await" seems to be gone from your output?
14:23 llfourn oh of course
14:23 llfourn yes that's awesome!
14:23 llfourn moritz++
14:24 MadcapJake what does the .eager do in there?
14:24 moritz m: my @a = (^5).map({ start { say "start $_"; sleep $_; $_ }}).map(*.result).lazy; for @a { say "got $_" }
14:24 llfourn MadcapJake: makes sure that the threads are started -- might not be needed?
14:24 camelia rakudo-moar f03564: OUTPUT«start 0␤got 0␤start 1␤got 1␤start 2␤got 2␤start 3␤got 3␤start 4␤got 4␤»
14:24 llfourn ah no it is needed^^
14:24 moritz right
14:25 moritz otherwise it'll only start the threads when one accesses the result
14:25 MadcapJake i see the difference but I don't understand it :)
14:25 jnthn m: my @a = lazy await (^5).map({ start { say "start $_"; sleep $_; $_ } }); for @a { say "got $_" }
14:25 camelia rakudo-moar f03564: OUTPUT«start 0␤start 1␤start 2␤start 3␤start 4␤got 0␤got 1␤got 2␤got 3␤got 4␤»
14:25 jnthn Hmm
14:26 moritz lazy await? :-)
14:26 * jnthn kinda expected that to work
14:26 jnthn to make the assignment into @a not behave eagerly
14:26 MadcapJake oh I see, so without .eager, the start blocks are initialized at each iteration of the for loop accessing them
14:27 moritz jnthn: but isn't await eager anyway?
14:27 llfourn what didn't work? what jnthn did seems to work for me?
14:28 skids m: my @a := (^5).map({ start { say "start $_"; sleep $_; $_ } }).list; for @a { say "got $_" }
14:28 camelia rakudo-moar f03564: OUTPUT«start 0␤got 0␤start 1␤got 1␤start 2␤got 2␤start 3␤got 3␤start 4␤got 4␤»
14:28 MadcapJake await works on lists? I thought you needed Promise.allof for that?
14:28 jnthn moritz: Only on its input?
14:28 jnthn https://github.com/rakudo/rakudo/blob/nom/src/core/asyncops.pm#L13
14:29 moritz MadcapJake: you don't :-)
14:29 moritz jnthn: so I don't see the benefit of lazy assignment of an eager list
14:29 MadcapJake so is there a difference between `await @some-list` and `await Promise.allof(|@some-list)`?
14:30 moritz MadcapJake: no
14:30 jnthn moritz: Yes; Promise.allof doesn't give you any results/exceptions
14:30 jnthn uh, MadcapJake ^^ :)
14:30 moritz MadcapJake: the allof form returns a promise though, so you can say Promise.allof(list).then(...)
14:30 itaipu joined #perl6
14:31 moritz but in sink context, no difference I can see
14:31 jnthn m: my $p = start { die "oh no" }; await $p
14:31 camelia rakudo-moar 376f50: OUTPUT«oh no␤  in block <unit> at /tmp/PQA2jY4Uga line 1␤␤»
14:31 jnthn m: my $p = start { die "oh no" }; await Promise.allof($p)
14:31 camelia rakudo-moar 376f50: ( no output )
14:32 jnthn There's the difference
14:32 jnthn anyof/allof are purely used to convey that one/all of the things got done; they expect you'll then pay attention to those things so far as you care to.
14:33 MadcapJake via .then, right?
14:34 jnthn MadcapJake: Well, .then only receives the combination promise
14:34 MadcapJake how could you make the die happen while using .allof?
14:36 jnthn MadcapJake: By asking the Promise for its result, for example
14:36 MadcapJake how? I can't seem to figure it out
14:36 MadcapJake m: my $p = start { die "oh no" }; say Promise.allof($p).result # only gives the allof promise result, I assume
14:36 camelia rakudo-moar 376f50: OUTPUT«True␤»
14:36 jnthn m: my $p = start { die "oh no" }; await Promise.allof($p); say "alive here"; say $p.result
14:36 camelia rakudo-moar 376f50: OUTPUT«alive here␤oh no␤  in block <unit> at /tmp/tYf5DSkTU0 line 1␤␤»
14:37 MadcapJake oh i see you have to have some access to the internal promise, you can't get that from allof?
14:37 jnthn Correct
14:38 jnthn If you're trying to do that, you probably should be using await rather than allof :)
14:38 MadcapJake got it! Thanks!
14:38 pRiVi joined #perl6
14:41 llfourn I'm still trying to figure out how "lazy await" works. await knows that it's being called in lazy context so it doesn't block for all values like it normally would but returns a lazy Seq where each iteration is a bit like awaiting the promise at that position?
14:42 moritz llfourn: it doesn't work that way
14:42 ZoffixW joined #perl6
14:42 ZoffixW [Coke], does that volunteer need prior experience with releases?
14:43 moritz llfourn: the await is eager. The lazy part is just where the result list is assigned to the array
14:43 moritz ZoffixW: no
14:43 ZoffixW Then I can volunteer.
14:44 moritz \o/
14:44 llfourn moritz: but I would expect then that where you iterate the array it wouldn't be smart enough to iterate the values as soon as they are ready. ie all the "got X" lines should come all at once after 4 seconds.
14:45 moritz ZoffixW: hoelzro++ just signed up for the May release (over in #p6dev or #p6release or so); are you available for the May Star release or the June compiler release?
14:45 perlpilot ZoffixW: also, read over docs/release_guide.pod to see what you're in for.
14:45 llfourn moritz: but it doesn't they all come one by one as they are ready from the threads.
14:45 molaf joined #perl6
14:46 llfourn m: my @a = lazy await (^5).map({ start { say "start $_"; sleep $_; $_ } }); for @a { say "$_:{now.Int}" };
14:47 camelia rakudo-moar 376f50: OUTPUT«start 0␤start 1␤start 2␤start 3␤start 4␤0:1462891655␤1:1462891656␤2:1462891657␤3:1462891658␤4:1462891659␤»
14:47 moritz llfourn: now I'm also confused :-)
14:47 llfourn good :D
14:48 khw joined #perl6
14:48 ptolemarch joined #perl6
14:49 ZoffixW perlpilot, are there similar docs for R* release?
14:49 rurban joined #perl6
14:49 jnthn moritz: $i.eager.map(...) means that $i is evaluated eagerly before the map is performed
14:49 jnthn moritz: Not that the map itself will be eagerly performed
14:49 psch m: use nqp; my @a = lazy await (^5).map({ start { say "start $_"; sleep $_; $_ } }); say nqp::getattr(nqp::decont(@a), List, '$!reified');
14:49 camelia rakudo-moar 376f50: OUTPUT«start 0␤start 1␤start 2␤start 3␤start 4␤IterationBuffer.new␤»
14:49 MadcapJake ZoffixW: join #perl6-release
14:49 perlpilot ZoffixW: I haven't looked at R* in a long while, but I believe so.
14:50 moritz ZoffixW: yes, R* also has release docs, it's just under tools/star/ or something
14:50 pierre_ joined #perl6
14:52 rurban1 joined #perl6
14:53 MadcapJake I found a JS syntax highlighter that (iiuc) supports heredocs! http://alexgorbatchev.com/SyntaxHighlighter/
14:54 MadcapJake The re they use is XRegExp and it has named captured and backreferences (so I should be able to utilize this for heredoc support)
14:56 pierre_ joined #perl6
14:57 MadcapJake RFC: https://github.com/perl6/user-experience/issues/12
14:58 llfourn m: (await (^5).map({ start { say "start $_"; sleep $_; $_ } })).^name.say
14:58 camelia rakudo-moar 376f50: OUTPUT«start 0␤start 1␤start 2␤start 3␤start 4␤Seq␤»
14:58 itaipu joined #perl6
14:58 rurban joined #perl6
14:59 llfourn m: (await (start {},start {})).^name.say
14:59 camelia rakudo-moar 376f50: OUTPUT«Seq␤»
14:59 llfourn moritz: the mystery is solved. await LIST returns a Seq -- it doesn't actually behave like .allof
15:00 llfourn m: Promise.allof(start {},start {}).^name.say
15:00 camelia rakudo-moar 376f50: OUTPUT«Promise␤»
15:01 llfourn m: Promise.allof(start {},start {}).result.^name.say
15:01 camelia rakudo-moar 376f50: OUTPUT«Bool␤»
15:02 llfourn m: (await start {}).^name.say
15:02 camelia rakudo-moar 376f50: OUTPUT«Nil␤»
15:02 llfourn m: (await [start {}]).^name.say
15:02 camelia rakudo-moar 376f50: OUTPUT«Seq␤»
15:02 llfourn very cool
15:04 dalek star: 6c23c19 | PerlJam++ | tools/star/ (3 files):
15:04 dalek star: Add alternate nick to docs
15:04 dalek star: review: https://github.com/rakudo/star/commit/6c23c19491
15:05 ssotka joined #perl6
15:06 rurban joined #perl6
15:08 pierre_ joined #perl6
15:09 diakopter joined #perl6
15:11 wamba joined #perl6
15:12 rurban1 joined #perl6
15:12 wbill joined #perl6
15:14 pierre_ joined #perl6
15:22 pierre_ joined #perl6
15:28 esh joined #perl6
15:29 araujo joined #perl6
15:30 rurban joined #perl6
15:37 pierre_ joined #perl6
15:49 rurban1 joined #perl6
15:50 Actualeyes joined #perl6
15:54 ponbiki joined #perl6
16:12 nJohn joined #perl6
16:29 MadcapJake so funny that #p6dev is amok and #perl6 is dead right now xD
16:30 MadcapJake but to beat a dead horse: words are tools for understanding, "transpile" was created to inform (perhaps less competent, perhaps not) programmers of a specific type of compilation that is taking place and it serves that purpose well, I think.
16:31 MadcapJake geekosaur: do you have any links for that source-to-source translator you mentioned? That sounds like a real etymology of the word
16:31 nine_ To be clear: my impression of JS people does not come from that word alone. More like from the horrors I've seen.
16:32 rurban joined #perl6
16:32 geekosaur I'm looking, it was a produce in the 1980s and I've forgotten details since then
16:32 geekosaur *product
16:32 pmurias nine_: maybe they were just php people writing js ;)
16:32 MadcapJake nine_: I know and agree.  But I also think that "transpiled" langauges were designed to reduce those same horrors :)
16:32 timotimo "transpiled" languages are basically macro languages :P
16:33 jast well you can "transpile" C++ to javascript ;)
16:33 jast and if C++ is a macro language I don't want to know what m4 is
16:33 psch perl -MO=Deparse is a transpiler /o\
16:34 timotimo dunno, m4 is a practical joke gone out of hand?
16:34 MadcapJake and Scala, OCaml, Java, Erlang, and tons of others!
16:34 pmurias timotimo: you mean in the lovecraftian sense of things going out of hand?
16:35 jast if the output is bytecode I think transpiling isn't really the right term
16:35 timotimo are IRs transpiled to?
16:35 rurban left #perl6
16:35 psch timotimo: i honestly can't tell
16:36 jast Cthulhu M4'lyeh wgah'nagl fhtagn
16:36 geekosaur bleh. near impossible to search for stuff like that that predates the internet
16:36 geekosaur and my collection of computer mags from back then is long since gone
16:36 psch timotimo: i mean, there's one person saying Java is transpiled, and one saying it isn't vOv
16:36 timotimo need to go to a physical library for that :P
16:36 psch timotimo: and java bytecode is somewhat of an IR, fsvo IR
16:36 psch well, jvm bytecode*
16:36 timotimo i agree
16:37 jast I would define transpilation as something that translates one language used by humans to another language used by humans
16:37 jast with a fairly wide definition of 'human' if we're going to include the really terrible languages ;)
16:37 psch well, if i'm writing jvm bytecode semi-manually with aid of a framework, is jvm bytecode used by humans..?
16:38 jast no
16:38 jast in that situation you're half compiler and half human
16:38 timotimo would you actually handle the resulting javascript code that, say, the coffeescript transpiler spits out? what about emscripten?
16:38 psch so js-minifiers are also not transpilers, but compilers, because no one writes minified js manually?
16:38 profan maybe if intended to be used by humans is more accurate
16:38 MadcapJake https://github.com/jashkenas/coffeescript/wiki/list-of-languages-that-compile-to-js
16:39 jast timotimo: certainly I wouldn't... but I also wouldn't handle a lot of code written by humans
16:39 jast profan: I think that's what I meant
16:39 profan :)
16:39 profan i love this channel, it's always so civil
16:40 ugexe let them self identify
16:40 jast there are more of those... always nice to find another one
16:40 MadcapJake timotimo: coffeescript prints out very readable JS, but others do not.  However source maps make this moot.
16:41 profan coffeescripts semantics aren't super far from js itself either, so that helps
16:41 geekosaur was gonna say, rarely does a human want to work with the output of any of these things...
16:41 domidumont joined #perl6
16:41 profan before sourcemaps was a thing, it was probably more important
16:41 MadcapJake profan: totally disagree, coffeescript is quite different
16:42 jast I find it funny when people claim the solution to a problem is to write a code generator
16:42 * jast .oO( now you have two problems )
16:42 MadcapJake but the code generator can be made to always solve the other
16:42 jast I'm sure
16:42 MadcapJake well that's the idea :)
16:42 profan MadcapJake: it is? a lot of coffescript is largely syntactic sugar the way i see it, some things a bit different (everything as expresssions and such)
16:43 profan it looks very different, but practically?
16:43 MadcapJake profan: yes true you can avoid using coffeescript's sugar but then why are you using coffeescript.  However if you *do* use it, then there are some very weird semantics that you must follow (and really learn if you want to read coffeescript)
16:45 profan well my point was more, what in coffeescript is bulky to represent in javascript? like, what would come out as strange code if written as coffeescript and compiled to js, something that a js programmer normally wouldnt write
16:45 MadcapJake coffeescript is generally-speaking a set of semantic rules that make the use of curlies/parens less needed.
16:45 pmurias jast: re define transpilation, we already have a name for that: translator
16:45 profan the destructuring perhaps might look a bit weird, but mostly a problem in pre ES6 js as it didnt have it in the lang itself then?
16:47 jast pmurias: that doesn't sound nearly as magical, though
16:47 MadcapJake profan: go to coffeescript.org, click Try ... and type class <space>
16:47 MadcapJake for those who haven't played with coffeescript's online transpiler, it's really cool, dynamically shows you what coffeescript code will generate
16:48 profan ah right, sicne js didnt have them in the lang itself until later, makes sense
16:49 geekosaur geh. found someone else noting the word is older than current transpilers ("from last century") but nothing on where it came from, sigh
16:49 MadcapJake pmurias: translator doesn't tell you that it's for programming though, that's why the old term for it was source-to-source translator which was shortened to transpiler for ease-of-use
16:50 MadcapJake https://en.wiktionary.org/wiki/transcompiler
16:50 MadcapJake also: https://en.wikipedia.org/wiki/Source-to-source_compiler
16:51 [Coke] m: Supply.from-list(1..5).rotor
16:51 camelia rakudo-moar 9c8989: ( no output )
16:51 [Coke] m: dd Supply.from-list(1..5).rotor
16:51 camelia rakudo-moar 9c8989: OUTPUT«Supply.new␤»
16:52 geekosaur yeh, wiktionary doesn't know about the late-1980s product either but knows the other antecedents (some of which predated even the ones they mention --- source to source translation was often used to translate programs in one system programming language (last century style, stuff like DEC's BLISS series) to another one for a different CPU
16:54 pmurias MadcapJake: I would consider there to be a big difference between a source-to-source compiler and a source-to-source translator
16:54 MadcapJake pmurias: what would that difference be?
16:55 pmurias MadcapJake: a translator like some p5-to-p6 attempts would give you useable source code
16:55 MadcapJake It seems that transcompilation is the old term and I'm guessing (though I'm not able to find a definitive source) that transpilation just came about as a shortened form of that
16:55 pmurias a compiler like rakudo-js gives you something that's not supposed to be editable
16:55 MadcapJake ahh I see, well I don't think that's really inherent in the terms, I *do* like how you distinguish the two :)
16:56 * MadcapJake off to appointment &
16:57 geekosaur I really wish I had my old computer mags now --- I am almost certain that the shortened form was a marketing term for a particular commercial product
16:58 geekosaur (not a widely known one, obviously; their marketing made it pretty obvious they desperately wanted to not be niche...)
16:58 MadcapJake neat! It really seems that on the internet nobody has a clue where it originated from (but I confess to only having done some cursory digging)
16:59 sufrostico joined #perl6
17:00 geekosaur anything that advertised in the back of a computer magazine in the 1980s was not going to be --- or, by most people, expected to be --- remembered :)
17:01 geekosaur heck, people barely remember the magazines themselves
17:04 ssotka Beagle Bros. Ads.
17:04 geekosaur I could pick the one I'm thinking of out of a lineup but don't remember the name off the top of my head. was related to databases, and was mostly aimed at the marketing and sales level instead of engineering, with a bit of executive level stuff
17:05 lostinfog joined #perl6
17:06 ZoffixW joined #perl6
17:06 ZoffixW m: say  5 + 10
17:06 camelia rakudo-moar 9c8989: OUTPUT«15␤»
17:06 ZoffixW :trollface:
17:07 ZoffixW m: my $x                      = 42; say $x
17:07 camelia rakudo-moar 9c8989: OUTPUT«42␤»
17:07 ZoffixW ^_^
17:07 cdg joined #perl6
17:10 [Coke] COMPUTE!
17:13 ZoffixW (what prompted that is Python can't handle the above, despite allowing unicode for var names) 😘 Perl 6
17:15 geekosaur heh, I considered naming Compute! as one of those mags. it was one of the better known ones though; plenty of people remember Compute!/Byte/DDJ
17:16 psch .u
17:16 yoleaux U+1680 OGHAM SPACE MARK [Zs] ( )
17:16 ZoffixW m: my‸$x‸‹=‸‹‸‹‸‹‸‹5;‹say‹$x
17:16 camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ouTmb5v4sS␤Malformed my␤at /tmp/ouTmb5v4sS:1␤------> 3my7⏏5‸$x‸‹=‸‹‸‹‸‹‸‹5;‹say‹$x␤»
17:16 ZoffixW awww
17:17 psch .u ‸
17:17 yoleaux U+2038 CARET [Po] (‸)
17:18 geekosaur m: my⌴$x
17:18 camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/qA8WC4MDMz␤Malformed my␤at /tmp/qA8WC4MDMz:1␤------> 3my7⏏5⌴$x␤»
17:18 ZoffixW Oh, I just have fat fingers. It should've been 2028
17:19 kurahaupo joined #perl6
17:19 ZoffixW m: my
$x
=
5
;
say

















$x;
say
"Look, ma! No errors!"
17:19 camelia rakudo-moar 9c8989: OUTPUT«5␤Look, ma! No errors!␤»
17:19 ZoffixW haha
17:20 ZoffixW That looks funny on my client: http://i.imgur.com/2XjhKeO.png
17:20 masak evening, #perl6
17:20 ZoffixW \o
17:23 masak here's a fun riddle: in Java, what does `c1 == c2` do when c1 and c2 are objects of type java.lang.Class?
17:23 masak (warning: the riddle is not actually fun)
17:24 itaipu joined #perl6
17:25 buharin joined #perl6
17:25 buharin hello my friends
17:25 psch masak: not the same that == always does?
17:25 psch on objects that is
17:26 masak psch: oh yes, the same, the same. reference comparison, since they are reference types.
17:26 masak ...but...?
17:26 ZoffixW Cześć, Mr. Buharin
17:27 [Coke] that's "is this the same object", yes?
17:27 Coleoid_north joined #perl6
17:27 psch i'm somewhat confused now :P
17:27 psch as in, it feels like i should expect a different gotcha than "it's not .equals"
17:27 psch but i wouldn't think there is one
17:27 [Coke] were you hoping for c1.equals(c2) ?
17:28 * [Coke] appears tob e 2 lines behind psch pretty consistently here. :)
17:28 buharin ZoffixW Czesc :P
17:29 ZoffixW masak, so what's the but? :)
17:30 masak ZoffixW: before I tell you, let me just say that the exception screwed up an exercise of a course I was delivering today.
17:30 psch oh, classes are interned?=
17:31 masak not as far as I know.
17:31 masak Strings are, which indeed does mess with `==`
17:31 psch ...i'm just getting more confused :)
17:31 masak but Java devs have learned this the hard way and use .equals for Strings anyway.
17:31 ZoffixW masak, I guess this SO question is about it: http://stackoverflow.com/questions/14188766/compilation-error-with-operator
17:31 masak .equals for Class objects is defined in terms of `==` though, so there's no difference.
17:31 ZoffixW You get an exception if you do == ?
17:31 masak nope.
17:31 * ZoffixW knows exactly 0% of Java
17:32 masak it works. it returns a boolean value.
17:32 Coleoid_north Hi, #perl6!
17:32 Coleoid_north Can I, or how can I call a method from an object's BUILD submethod?
17:32 ZoffixW hi
17:33 ZoffixW Coleoid_north, I believe it'd just be self.whatever or for privates: self!whatever
17:34 ZoffixW m: class Foo { submethod BUILD { self.frob }; method frob { say 'weeee' } }; Foo.new
17:34 camelia rakudo-moar 9c8989: OUTPUT«weeee␤»
17:35 Coleoid_north Yes, that works!  Thanks--I've seen 'self' around in channel, but I didn't find that in docs.p6 on objects, and I tried $self, $!self...
17:35 masak ZoffixW: I didn't know about that exception. in my case though, that's not the issue. I got `false` from the comparison in the case where I expected `true`. (and, even weirdlier, only on some machines and not on others. though consistently the same result on a given machine.)
17:35 masak Coleoid_north: `self` was one of the most difficult parts of the language to agree on, back in ~2005
17:36 masak Coleoid_north: it used to be `self` didn't exist and the invocant was simply in $_
17:36 masak looong ago
17:36 masak early Pugs era
17:36 nine_ I guess $self has been a contender though?
17:37 masak probably; don't remember
17:38 masak oh -- haha -- for a while $?SELF was the favored candidate.
17:38 psch masak: http://stackoverflow.com/questions/3026127/is-it-possible-to-use-instanceof-when-passing-objects-between-threads/3026141#3026141
17:38 psch oh and the accepted answer here http://stackoverflow.com/questions/3738919/does-java-guarantee-that-object-getclass-object-getclass
17:38 arnsholt masak: Oooh, so given a "class Foo { ... }" "a == b", where both a and b contain the Foo.class object may or may not be true, depending on deep and mystical peculiarities of how the class objects were obtained?
17:39 masak arnsholt: there you go.
17:39 psch that is interesting
17:39 arnsholt Freaky!
17:39 psch class loader determins the class token
17:39 Coleoid_north Yep, 'self' is all through the doc, I just focussed too narrowly on the object construction section.  Thanks, ZoffixW and masak!
17:39 masak yup
17:40 masak I had completely forgotten it, but for a brief while we wrote `self.foo` in Perl 6 as `./foo`
17:40 psch so with multiple classloaders we can't even be sure if any given class is equals another..?
17:40 psch i wonder if that already happens in nqp-j somewhere :P
17:41 masak I suggest we find out
17:41 [Coke] masak: nifty.
17:42 psch i think every P6Opaque is at least loaded with the same class loader, but interop uses a different one
17:42 psch i'm not sure if each interop use reuses that classloader or not, though
17:42 psch so it probably isn't a problem for normal r-j use
17:42 masak I *think* the solid workaround is to do a mutual .isAssignableFrom check on the two class objects.
17:43 Coleoid_north left #perl6
17:45 _mg_ joined #perl6
17:45 psch heh, one SO question about this has an answer suggesting stringy comparison... :)
17:47 nine Ah...finally me again
17:54 masak psch: stringy comparison would be unwise.
17:54 masak psch: at least if you have something against false positives.
17:56 sufrostico joined #perl6
17:57 arnsholt Indeed
17:57 arnsholt I'm reminded of a masak++ quote on doing things stringly: "Like a barbarian!" =D
18:05 tomboy64 joined #perl6
18:05 nine I need to get the current position in a file after reading a couple of lines. /win 40
18:06 YP-QMUL-W joined #perl6
18:08 MadcapJake http://elm-lang.org/blog/farewell-to-frp sounds like supplies right?
18:09 masak arnsholt: I said that? :P
18:09 masak (anyway, present me agrees.)
18:12 |2701 joined #perl6
18:22 arnsholt masak: http://irclog.perlgeek.de/perl6/2016-03-20#i_12211922 =)
18:22 arnsholt No exclamation mark, as it turns out, but otherwise correct =)
18:28 masak aha :)
18:28 masak oh, that bit of coding was fun.
18:28 masak it did lead to some actual commits in a branch
18:28 masak I've yet to write it up as a blog post, but I still want to
18:29 masak and yes, I did end up comparing strings, like a barbarian: https://github.com/masak/007/commit/6baecb3f38f8b9bf91e6479999110f67f1ffdb13
18:32 dvinciguerra joined #perl6
18:39 spider-mario joined #perl6
18:39 acrussell joined #perl6
18:41 uvtc joined #perl6
18:41 acrussell joined #perl6
18:41 ufobat heya :)
18:42 |2701 joined #perl6
18:42 uvtc joined #perl6
18:44 sjoshi joined #perl6
18:44 grondilu joined #perl6
18:46 jjido_ joined #perl6
18:50 uvtc Just read on p6weekly about TimToady's "Perl 6: Believe it or not!" keynote coming up this month at OSCON. Hoping a good recording of it will be available.
18:51 Amnez777 joined #perl6
18:53 uvtc left #perl6
18:56 ZoffixW joined #perl6
18:57 ZoffixW m: my \Ε = 42; my \E = 1295; say E + Ε;
18:57 camelia rakudo-moar 9c8989: OUTPUT«1337␤»
18:57 ZoffixW Bug :P
18:59 moritz Zoffixbug :-)
19:00 ZoffixW :}
19:01 masak looks fine to me.
19:01 masak .u ΕE
19:01 yoleaux U+0045 LATIN CAPITAL LETTER E [Lu] (E)
19:01 yoleaux U+0395 GREEK CAPITAL LETTER EPSILON [Lu] (Ε)
19:02 sno joined #perl6
19:02 ZoffixW m: sub infix:<⁤> { $^a + $^b }; say 2⁤2
19:02 camelia rakudo-moar 9c8989: OUTPUT«4␤»
19:02 ZoffixW Magic trick! :D
19:06 rindolf joined #perl6
19:06 moritz ZoffixW: there are times when you scare me :-)
19:07 ZoffixW heh
19:07 ZoffixW .u ⁤
19:07 yoleaux U+2064 INVISIBLE PLUS [Cf] (<control>)
19:07 nine WAT?
19:11 yqt joined #perl6
19:16 jnthn .u INVISIBLE
19:16 yoleaux U+2062 INVISIBLE TIMES [Cf] (<control>)
19:16 yoleaux U+2063 INVISIBLE SEPARATOR [Cf] (<control>)
19:16 yoleaux U+2064 INVISIBLE PLUS [Cf] (<control>)
19:17 geekosaur .u 2061
19:17 jnthn m: say "a\c[INVISIBLE SEPARATOR]b"
19:17 camelia rakudo-moar 9c8989: OUTPUT«a⁣b␤»
19:17 yoleaux U+2061 FUNCTION APPLICATION [Cf] (<control>)
19:17 jnthn hah, it really is an invisible separator
19:17 jnthn m: say "a\c[INVISIBLE SEPARATOR]b".chars
19:17 camelia rakudo-moar 9c8989: OUTPUT«3␤»
19:17 jnthn Not *that* invisible, though :)
19:18 ufobat whats the difference between a method foo($e) { $.e = $e} and method foo($e) { self.e = $e} or what could cause a 'Cannot assign to a readonly variable or a value' with a '$.e = $e'. for 'has $.e is rw;'
19:21 moritz ufobat: it shouldn't cause that problem; but you can still try to assign to $!e directly
19:21 moritz m: class A { has $.e is rw; method foo($e) { self.e = $e } }; my $x = A.new; $x.foo(42); say $x.e
19:21 camelia rakudo-moar 9c8989: OUTPUT«42␤»
19:21 moritz m: class A { has $.e is rw; method foo($e) { $!e = $e } }; my $x = A.new; $x.foo(42); say $x.e
19:21 camelia rakudo-moar 9c8989: OUTPUT«42␤»
19:22 ufobat moritz, yeah, i did that.. but then something else seems to be strange. i'll try to reduce the code to a tiny example.
19:22 ufobat thanks
19:22 moritz ufobat: .e is a virtual method call, so if you override that in a subclass, it might cause weird behavior
19:22 ufobat hm.. but thats not the case
19:23 acrussell joined #perl6
19:24 ZoffixW m: class A { has $.e; method foo($e) { self.e = $e }; }; A.new.foo: 42
19:24 camelia rakudo-moar 9c8989: OUTPUT«Cannot modify an immutable Any␤  in method foo at /tmp/PqoH6njfG5 line 1␤  in block <unit> at /tmp/PqoH6njfG5 line 1␤␤»
19:24 ZoffixW Your error is somewhere else, since the error is different ^
19:24 ufobat aye
19:33 ufobat whats the sense behind the '$, $value' in this code: Proxy.new( FETCH => { $!env }, STORE => -> $, $value {
19:34 skids One is what you are storing into, iirc.
19:35 ZoffixW m: my $x := Proxy.new( FETCH => { ; }, STORE => { say $^a.WHAT; say $^b.WHAT }); $x = 42
19:35 camelia rakudo-moar 9c8989: OUTPUT«(Proxy)␤(Int)␤»
19:35 ZoffixW Seems to be
19:36 ZoffixW And since the question is vague: $, $value takes two parameters, similar to $foo, $bar, except it ignores the first argument.
19:37 ZoffixW m: my $x := Proxy.new( FETCH => { ; }, STORE => method ($a, $b) { say $a.WHAT; say $b.WHAT }); $x = 42
19:37 camelia rakudo-moar 9c8989: OUTPUT«Too few positionals passed; expected 3 arguments but got 2␤  in method <anon> at /tmp/QpJ01m4Vzx line 1␤  in block <unit> at /tmp/QpJ01m4Vzx line 1␤␤»
19:37 ZoffixW ufobat, where is that from? I wonder if it's better rewritten using `method` instead
19:38 ufobat i think the method is automatically creating the "self"
19:38 ufobat bailador :(
19:38 ufobat https://github.com/ufobat/Bailador/blob/master/lib/Bailador/Context.pm
19:39 ufobat i find the whole Bailador::Context strange
19:40 ufobat but so far i am thinking maybe this makes some sense that i just dont get yet
19:41 ufobat but there is a bug because in line 21 and 22 it invokes the methods in the request rather then "resetting" it https://github.com/ufobat/Bailador/blob/master/lib/Bailador/Request.pm#L57
19:42 ufobat i wanted to fix is and add a method reset and then, boom my error from above
19:43 skids ZoffixWin: the FETCH is actually supposed to have a $ as well, but there's smarts in there to fudge it if you don't provide a 1-ary.
19:43 skids I think that's mainly so you can get a unique ID from the Proxy object.
19:43 ZoffixW ufobat, ah, I see why the block form was used. method form would make those attributes inaccessible
19:43 ZoffixW m: class Foo { has $!foo = 42;method bar { my $x := Proxy.new( FETCH => { ; }, STORE => method ($a) { say $!foo; } ); $x = 42 } }; Foo.new.bar
19:43 camelia rakudo-moar 9c8989: OUTPUT«-> ;; $_? is raw { #`(Block|71611040) ... }␤»
19:43 ZoffixW m: class Foo { has $!foo = 42;method bar { my $x := Proxy.new( FETCH => { ; }, STORE => sub ($, $a) { say $!foo; } ); $x = 42 } }; Foo.new.bar
19:43 camelia rakudo-moar 9c8989: OUTPUT«42␤»
19:44 skink joined #perl6
19:45 jjido_ joined #perl6
19:45 ZoffixW m: my $x := Proxy.new( FETCH => { say 'Weee'; }, STORE => { say $^a.WHAT; say $^b.WHAT }); $x = 42; say $x
19:45 camelia rakudo-moar 9c8989: OUTPUT«(Proxy)␤(Int)␤Weee␤Weee␤Weee␤Weee␤Weee␤Weee␤Weee␤Weee␤Weee␤Weee␤Weee␤Weee␤True␤»
19:46 cdg joined #perl6
19:46 ZoffixW m: my $x; quietly $x
19:46 camelia rakudo-moar 9c8989: OUTPUT«WARNINGS for /tmp/427B9l5C6p:␤Useless use of $x in sink context (line 1)␤»
19:46 moritz wow, bitkeeper is now open source
19:46 psch m: my $x; quietly { $x }
19:46 camelia rakudo-moar 9c8989: ( no output )
19:47 ZoffixW Thanks.
19:47 diakopter anyone have a solid comparison of gitlab vs github?
19:47 yoleaux 2 May 2016 07:41Z <psch> diakopter: 'twas about dalek, but moritz++ took care off that
19:47 cdg joined #perl6
19:47 ZoffixW diakopter, gitlab is slow as hell, so I only use it for a couple of repos that I have to keep private (it offers private repos for free)
19:48 diakopter is paid gitlab faster [if that's even possible
19:48 diakopter ]?
19:48 ZoffixW ¯\_(ツ)_/¯
19:48 perlpilot bitbucket offers private repos for free too and it's not slow as hell
19:49 perlpilot FYI
19:49 huggable joined #perl6
19:50 diakopter ohh
19:50 skids One of the database app devels here was griping about gitlab, but mainly he was just angry due to some data loss occurring in the comments on an issue and thought comments should be revision controlled as well.  Or something.
19:51 diakopter data people want more data
19:53 rindolf joined #perl6
19:53 skink If I don't care about what a pointer points to, can I just use my Pointer $ptr and pass that?
20:02 MadcapJake skink: it needs to be generated by a prior nativecall sub
20:08 skink Ah, I see
20:10 ufobat i dont find it :-( and it seems to work if i reduce the code..  https://gist.github.com/ufobat/445b31daef205c6a441efafc95c80455
20:16 ufobat aha!
20:16 prammer joined #perl6
20:16 skink Hm... MadcapJake, if I needed to have a pre-existing ULONG_PTR, would that be my Pointer[ulong] .= new?
20:18 ufobat https://gist.github.com/ufobat/b32e882564057ead07de146b51672a9f
20:19 MadcapJake m: my Pointer[ulong] $l .= new; dd $l
20:19 camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5===␤Type 'Pointer' is not declared␤at /tmp/9MUgmvzMj8:1␤------> 3my Pointer7⏏5[ulong] $l .= new; dd $l␤Malformed my␤at /tmp/9MUgmvzMj8:1␤------> 3my7⏏5 Pointer[ulong] $l .= new; dd $l␤␤»
20:19 MadcapJake m: use NativeCall; my Pointer[ulong] $l .= new; dd $l
20:19 camelia rakudo-moar 9c8989: OUTPUT«NativeCall::Types::Pointer[NativeCall::Types::ulong] $l = NativeCall::Types::Pointer[NativeCall::Types::ulong].new(0)␤»
20:19 MadcapJake looks like you can actually create a generic pointer this way too, not sure if that will work for you though
20:20 MadcapJake m: use NativeCall; my Pointer $p .= new; dd $p
20:20 camelia rakudo-moar 9c8989: OUTPUT«NativeCall::Types::Pointer $p = NativeCall::Types::Pointer.new(0)␤»
20:20 skink Well I never use the pointer for anything but passing between a few C functions
20:20 skink So that's why I was wondering about just using a generic one
20:22 MadcapJake what do these C functions expect to be at the end of the pointer?
20:23 skink ULONG_PTR which is actually __int3264 which is actually __int32 or __int64 depending on environment :)
20:23 firstdayonthejob joined #perl6
20:24 MadcapJake __int32 as in int32?
20:24 skink Seems like an alias yeah
20:25 skink Specifically I have two functions which require an HCRYPTPROV, and one that requires a pointer to an HCRYPTPROV, where HCRYPTPROV is typedef'd as ULONG_PTR
20:25 MadcapJake yeah just Pointer[int64] should work (or int32)
20:25 * MadcapJake typedefs are why I hate C code :P
20:25 * MadcapJake doesn't know why he used /me there xD
20:25 skink An alias of an alias of an alias
20:26 psch m: use NativeCall; sub malloc(int32 $size) is native {*}; my $ptr = malloc(8); say $ptr.perl
20:26 camelia rakudo-moar 9c8989: OUTPUT«Mu␤»
20:26 psch uhm, not quite apparently vOv
20:26 psch but that's hacky and "don't do that" anyway i guess :P
20:27 mr-foobar joined #perl6
20:27 skink Because the type of ULONG_PTR changes according to environment, I wasn't sure if specifically Pointer[int32] or [int64] would cause it to crash and burn
20:27 psch skink: it probably would
20:27 * masak .oO( OOLONG_PTR )
20:27 psch at least that's what my (limited) NC experience points at... :)
20:27 ufobat good night :-)
20:28 psch skink: you have to have a way to make sure you have the same size as the env, somehow
20:28 nicq2 joined #perl6
20:31 masak 'night, #perl6
20:31 TEttinger joined #perl6
20:34 MadcapJake m: use NativeCall; BEGIN constant ARCHINT = $*KERNEL.arch.ends-with('64') ?? int64 !! int32; my Pointer[ARCHINT] $i .= new; dd $i; # <-- skink
20:34 camelia rakudo-moar 9c8989: OUTPUT«NativeCall::Types::Pointer[int64] $i = NativeCall::Types::Pointer[int64].new(0)␤»
20:35 MadcapJake nine++ # for that idea
20:37 skink Neat, I'll keep that in mind
20:38 geekosaur betting that has platform issues
20:38 geekosaur (OS X, at minimum)
20:38 skink ... O_O
20:38 skink Cannot locate symbol 'CryptAcquireContext' in native library 'Advapi32.dll'
20:38 skink https://msdn.microsoft.com/en-us/library/windows/desktop/aa379886%28v=vs.85%29.aspx
20:41 hotel joined #perl6
20:42 sno joined #perl6
20:43 skink The docs, they lie!
20:43 skink geekosaur, This is for the Windows-specific submodule
20:51 firstdayonthejob joined #perl6
20:53 sortiz joined #perl6
20:53 jjido joined #perl6
20:53 sortiz \o #perl6
20:53 skink hey sortiz
21:05 jjido joined #perl6
21:06 sortiz That you are on a 64 bits platform don't imply that 'long' is 64bits. That is valid LP64 systems like linux, but no for LLP64, like windows.
21:07 sortiz *valid on
21:07 ZoffixWin left #perl6
21:15 Actualeyes joined #perl6
21:16 MadcapJake geekosaur: well you could make the condition more robust, I just left it small as an example.
21:16 geekosaur heh. OS X will defeat you, I'm afraid.
21:17 geekosaur admittedly the only systems where this actually matters are ones running 10.5, since 10.6 and on are 64 bit
21:18 geekosaur but 10.5 systems running 32 bit kernels can run 64 bit userspace programs
21:18 MadcapJake sortiz: I think in this specific case, the typedefs boil down to ints
21:18 geekosaur and finding out what's actually going on programmatically is insanely difficult
21:18 sortiz Well yes, all those are ints.
21:19 AlexDaniel joined #perl6
21:19 MadcapJake Oi! Well last time I did anything on a Mac was pre OSX so I don't have a clue 😲
21:19 AlexDaniel m: say <1 2 3> »+« <4 5 6>
21:19 camelia rakudo-moar 9c8989: OUTPUT«(5 7 9)␤»
21:19 AlexDaniel m: say <1 2 3> «+» <4 5 6>
21:19 camelia rakudo-moar 9c8989: OUTPUT«(5 7 9)␤»
21:20 geekosaur (10.4 could also do that trick but only libSystem (think libc) had a 64 bit version so it didn't matter much)
21:21 _dolmen_ joined #perl6
21:22 MadcapJake Doesn't $*KERNEL or $*DISTRO provide what you would need to decide what int to use?
21:23 itaipu joined #perl6
21:23 lizmat m: say $*KERNEL.bits
21:23 camelia rakudo-moar 9c8989: OUTPUT«64␤»
21:24 geekosaur but is that about the kernel, or about the CPU? a 32-bit OS X kernel has no problem running 64-bit userspace code on a 64-bit-capable processor
21:24 MadcapJake Nice! Does that work on OSX?
21:25 lizmat $ 6 'say $*KERNEL.bits; say $*KERNEL.name'
21:25 lizmat 64
21:25 lizmat darwin
21:25 geekosaur I think you can get information about whether the CPU is 64 bit capable from sysctl, but not from much else
21:25 geekosaur (and if you're running 10.6 or later then it is definitely 64 bit as Apple dropped the 32-bit kernel)
21:25 lizmat MadcapJake: mind you, it's pretty naive: $!bits //= $.hardware ~~ m/_64|w|amd64/ ?? 64 !! 32;  # naive approach
21:26 MadcapJake Ahh that's what I was wondering
21:26 sortiz Yep, but what I'm saying is that in Windows64 sizeof(long) == 4, but in Linux64 sizeof(long) == 8; and MoarVM know that so 'long' is the correct type in both systems.
21:26 geekosaur which is why I said it's only really relevant for 10.5 and maybe 10.4 (but not practically as no 64-bit libs to speak of)
21:27 kurahaupo joined #perl6
21:28 MadcapJake sortiz: would be nice if the same was true for int
21:28 psch method bits { $!bits //= $.hardware ~~ m/_64|w|amd64/ ?? 64 !! 32;  # naive approach }
21:28 psch just fyi
21:28 cdg joined #perl6
21:29 geekosaur that said you can run stuff in 32 bit mode with the arch command --- and configure scripts can't generally tell you did it and will try to build for 64-bit
21:29 psch oh lizmat++ pasted that already
21:29 * psch goes back to other things, instead of skimming and repeating other people... :)
21:29 cpage_ joined #perl6
21:29 cdg joined #perl6
21:30 sortiz m: use NativeCall; nativesizeof(size_t).say; # For the size of pointers.
21:30 camelia rakudo-moar 9c8989: OUTPUT«8␤»
21:33 sortiz afk&
21:40 Technaton joined #perl6
21:50 sufrostico joined #perl6
21:51 hotel_california joined #perl6
21:53 Su-Shee joined #perl6
21:53 Su-Shee good evening.. is Zoffix still grooming the perl6.org website?
21:55 timotimo https://github.com/perl6/perl6.org/commits/master  -  last thing he did was for the "recent blog posts" thing
21:58 timotimo are you asking because you have a feature request or bug report?
21:59 Su-Shee just something minor, really. nothing important.
22:10 skink Can someone on Windows 'use NativeCall; sub CryptAcquireContext is native('Advapi32') { * }'
22:10 skink I'm wondering if this is an appveyor thing
22:15 eyck joined #perl6
22:17 Sgeo joined #perl6
22:18 AlexDaniel From docs: “I will not be explaining Perl 6 syntax in detail.” … who you? :D
22:21 grondilu skink: works fine for me
22:22 grondilu I have no idea what that does though
22:22 skink Okay, interesting. It's not working on AppVeyor
22:22 skink On AppVeyor I get Cannot locate symbol 'CryptAcquireContext' in native library 'Advapi32.dll'
22:22 hotel joined #perl6
22:23 grondilu FYI I was using rakudo* on Windows 10
22:26 skink Right now Crypt::Random::Win uses RtlGenRandom() for entropy because it was really, really simple to bind to
22:27 skink That's one of the functions CryptGenRandom() depends upon
22:41 skink grondilu, Any chance you'd be willing to lend a hand for a minute?
22:46 BenGoldberg joined #perl6
22:55 grondilu skink: hang on
22:55 Actualeyes joined #perl6
22:55 grondilu skink: ok, I'm available now.
22:58 hotel_california joined #perl6
23:00 sortiz skink, ping
23:01 skink sortiz, pong
23:02 sortiz Try  "sub CryptAcquireContextA(...) is native('Advapi32')"; # Note the A at end.
23:02 skink There's an A suffix for ANSI-encoded string and W for Unicode
23:03 skink But according to MS' own policy regarding that, there should be a generic function without a suffix
23:03 sortiz Yep, and in C++ you don't need it, but for NC you need to add that, 'cus the library provide both, but only those.
23:04 skink Hm, interesting
23:04 skink Shouldn't we prefer the Unicode version then?
23:04 skink Not that it matters in this case, I'm passing NULL there
23:04 sortiz Ie the compiler chooses one, depending on Defines.
23:05 sortiz No, 'cus if use the Wide, you should supply encoded Str in utf-16. :-)
23:09 psch m: my $w = "foo".encode("utf-16"); say $w.WHAT
23:09 camelia rakudo-moar 9c8989: OUTPUT«(utf16)␤»
23:10 BenGoldberg m: utf16.new("foo").say;
23:10 camelia rakudo-moar 9c8989: OUTPUT«Type check failed in initializing element #0 to utf16; expected uint16 but got Str ("foo")␤  in block <unit> at /tmp/5ILcgxVNce line 1␤␤Actually thrown at:␤  in any  at gen/moar/m-Metamodel.nqp line 3055␤  in block <unit> at /tmp/5ILcgxVNce line …»
23:13 cpage_ joined #perl6
23:15 sortiz In NC, the signature needs "Str is encoding('utf16'),…
23:16 sortiz (for the Wide versions)
23:17 psch multi trait_mod:<is>(Parameter $p, :$encoded!)
23:17 sortiz Oops
23:17 psch no worries, i had to look it up :)
23:18 sortiz The source is the best reference.
23:25 cdg joined #perl6
23:34 mr-foobar joined #perl6
23:50 skink sortiz, Yay, symbol found, just regular errors now :)
23:50 skink Progress!
23:51 sortiz :)
23:53 TEttinger joined #perl6
23:54 jervo joined #perl6
23:55 jeek joined #perl6
23:56 skink Yup, exactly as expected. ERROR_INVALID_PARAMETER
23:56 skink "This is most often a pointer that is not valid."
23:57 TimToady .oO(In NC, your signature must declare your birth gender...)

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

Perl 6 | Reference Documentation | Rakudo