Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2015-07-28

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:01 atroxaper joined #perl6
00:06 laouji joined #perl6
00:07 rurban joined #perl6
00:14 skids m: role a { method foo { ... }; }; class b does a { };
00:14 camelia rakudo-moar 174049: OUTPUT«===SORRY!===␤Method 'foo' must be implemented by b because it is required by a role␤»
00:25 bloomburgers joined #perl6
00:39 llfourn joined #perl6
00:40 laouji joined #perl6
00:41 laouji joined #perl6
01:05 silug_ joined #perl6
01:14 virtualsue joined #perl6
01:19 rmgk_ joined #perl6
01:26 bloomburgers joined #perl6
01:27 bjz joined #perl6
01:28 dayangkun joined #perl6
01:37 Colonel-X joined #perl6
01:37 Colonel-X m:say " 1 2 3 4 5" ~~ m:g /<:Digit>+/
01:39 Colonel-X std: say " 1 2 3 4 5" ~~ m:g /<:Digit>+/
01:39 camelia std 28329a7: OUTPUT«ok 00:00 139m␤»
01:39 Colonel-X p6: say " 1 2 3 4 5" ~~ m:g /<:Digit>+/
01:39 camelia rakudo-moar 174049: OUTPUT«「 」 「 」 「 」 「 」 「 」␤»
01:39 geekosaur m: say " 1 2 3 4 5" ~~ m:g /<:Digit>+/
01:39 camelia rakudo-moar 174049: OUTPUT«「 」 「 」 「 」 「 」 「 」␤»
01:40 Colonel-X what's wrong with <:Digit>  in regex ????
01:45 Colonel-X p6: say " 1 2 3 4 5" ~~ m:g /<:HexDigit>+/
01:45 camelia rakudo-moar 174049: OUTPUT«「1」 「2」 「3」 「4」 「5」␤»
01:46 ilbot3 joined #perl6
01:46 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: http://irc.perl6.org | UTF-8 is our friend!
02:11 ugexe your shift key
02:12 ugexe m: say " 1 2 3 4 5" ~~ m:g /<:digit>+/
02:12 camelia rakudo-moar 174049: OUTPUT«「1」 「2」 「3」 「4」 「5」␤»
02:23 vendethiel joined #perl6
02:37 flussence it's kinda misleading that we have some randomly lowercase_and_maybe_underscore names there just because posix does them that way
02:40 llfourn joined #perl6
02:40 flussence m: say "abcdef".comb: /<HexDigit>/
02:40 camelia rakudo-moar 174049: OUTPUT«Method 'HexDigit' not found for invocant of class 'Cursor'␤  in block <unit> at /tmp/Hr4XExTghd:1␤␤»
02:40 flussence m: say "abcdef".comb: /<:HexDigit>/
02:40 camelia rakudo-moar 174049: OUTPUT«a b c d e f␤»
02:40 flussence m: say "abcdefghi".comb: /<:HexDigit>/
02:40 camelia rakudo-moar 174049: OUTPUT«a b c d e f␤»
02:41 flussence m: say "abcdefghi".comb: /<:hexdigit>/
02:41 camelia rakudo-moar 174049: OUTPUT«a b c d e f␤»
02:41 flussence m: say "abcdefghi".comb: /<:Digit>/
02:41 camelia rakudo-moar 174049: OUTPUT«a b c d e f g h i␤»
02:41 flussence m: say "abcdefghi".comb: /<:digit>/
02:41 camelia rakudo-moar 174049: OUTPUT«␤»
02:43 flussence m: say "abcdefghi".comb: /<:nonexistent>/
02:44 camelia rakudo-moar 174049: OUTPUT«␤»
02:48 ShimmerFairy The <:rule> rules are unicode properties, so I'm not sure what posix has to do with it :)
02:49 flussence oh, wait a sec
02:49 flussence m: say "abcdefghi".comb: /<xdigit>/
02:49 camelia rakudo-moar 174049: OUTPUT«a b c d e f␤»
02:49 flussence yeah that's the one I was thinking of...
02:50 flussence .oO( why does unicode have two hexdigit rules? )
02:50 atroxaper joined #perl6
02:53 noganex_ joined #perl6
02:53 ShimmerFairy I'm not sure if the unicode properties are (supposed to be) case-sensitive, but there are two hex properties nonetheless :)  There's <:HexDigit> and <:ASCIIHexDigit>
02:54 flussence with all these unicode ones, I'm wondering if the built in posix-character-class-equivalent stuff is just a fossil nowadays.
02:55 ShimmerFairy In some ways, though <:alpha> won't match underscores like <alpha> does, for instance.
02:56 chenryn joined #perl6
02:56 flussence m: say /<:ASCIIDigit>/
02:56 camelia rakudo-moar 174049: OUTPUT«/<:ASCIIDigit>/␤»
02:56 flussence well... that's unexpected.
02:56 flussence m: say /<:ASCIIDigit>/.WHAT
02:56 camelia rakudo-moar 174049: OUTPUT«(Regex)␤»
02:56 flussence wow, is Regex.gist really that good now?
02:57 flussence m: say /<:ASCIIDigit> (x|y) 'foo'*/.gist
02:57 camelia rakudo-moar 174049: OUTPUT«/<:ASCIIDigit> (x|y) 'foo'*/␤»
02:58 flussence I dunno if it did that before, but that's *really* nice that it does.
02:58 flussence ++ to whoever made it work :)
03:00 flussence (and :ASCIIDigit is way easier to remember than whether .digit is strictly ascii or not, I think I'll be using the unicode form from now on...)
03:01 flussence anyway I think that's enough crazy rambling from me for today, carry on :)
03:10 ShimmerFairy flussence: Perl 6 is generally Unicode friendly, so if you want to restrict something to ASCII, you'll most likely have to say so explicitly :)
03:11 ShimmerFairy m: say "0" ~~ /<digit>/
03:11 camelia rakudo-moar 174049: OUTPUT«「0」␤ digit => 「0」␤»
03:13 flussence that'd be the "misleading" part for me: those few builtins all have the same names as the standard posix char classes, which (afaik) are strictly ASCII in every other regex language
03:14 ShimmerFairy flussence: To be fair, P6 regexes are explicitly not like every other regex language :P
03:14 ShimmerFairy (If you felt strongly that, say, <digit> should be just ASCII, you could always define a lexical digit regex in the grammar, much like how you can override <ws>)
03:28 llfourn joined #perl6
03:40 atroxaper joined #perl6
04:09 kaare_ joined #perl6
04:13 BenGoldberg_ Maybe we should have a :posix-char-classes flag?
04:26 chenryn joined #perl6
04:35 bjz joined #perl6
04:44 bjz joined #perl6
04:47 obra joined #perl6
04:49 atroxaper joined #perl6
04:53 laouji joined #perl6
04:54 pyrimidine joined #perl6
04:57 atroxape_ joined #perl6
05:03 aborazmeh joined #perl6
05:03 aborazmeh joined #perl6
05:37 davido__ joined #perl6
05:39 laouji joined #perl6
05:41 Grrrr joined #perl6
05:44 Averna joined #perl6
05:54 telex joined #perl6
05:57 chenryn joined #perl6
05:58 diana_olhovik joined #perl6
05:59 azawawi joined #perl6
06:04 pdcawley joined #perl6
06:09 virtualsue joined #perl6
06:10 azawawi hi
06:15 * azawawi begins wrapping https://github.com/atom/electro​n/blob/master/docs/api/shell.md
06:16 rurban joined #perl6
06:22 RabidGravy joined #perl6
06:23 darutoko joined #perl6
06:24 mr-foobar joined #perl6
06:28 virtualsue joined #perl6
06:31 RabidGravy morning
06:35 azawawi RabidGravy: Good morning :)
06:35 RabidGravy rarr!
06:36 FROGGS joined #perl6
06:41 zakharyas joined #perl6
06:55 rurban joined #perl6
06:57 azawawi Added shell API wrapper https://github.com/azawawi/perl6-atom-elect​ron/blob/master/lib/Atom/Electron/Shell.pm6 and example script https://github.com/azawawi/perl6-atom-el​ectron/blob/master/bin/shell_example.p6
06:59 azawawi joined #perl6
07:04 Ven joined #perl6
07:05 abraxxa joined #perl6
07:11 jkva joined #perl6
07:17 RabidGravy coo, it's 2015 and I just found a y2k bug in the .dbf driver of libreoffice
07:18 brrt joined #perl6
07:21 FROGGS >.<
07:21 espadrine_ joined #perl6
07:22 nine RabidGravy: is it really still a y2k bug or rather a y2100 bug at this point?
07:23 RabidGravy it's a classic "assuming the 1 byte years field is the tens part" (I assume the table I am looking at wasn't last updated in 1905)
07:24 RabidGravy obviously there is a y2155 bug too but I don't think I'll worry about that.
07:24 ChoHag joined #perl6
07:24 ChoHag [How] can I create traits which can be applied to attributes a la rw?
07:25 moritz m: sub trait_mod:<is>(Attribute:D, :$funny!) { }; class A { has $.x is funny };
07:25 camelia rakudo-moar 174049: ( no output )
07:25 RabidGravy ChoHag, "sub trait_mod:<is>( Attribute $a, :$foo!) { ..... # do something to the attribute }"
07:25 ChoHag Oh good.
07:26 RabidGravy for a specific example see e,g, https://github.com/jonathanstowe/Accessor​Facade/blob/master/lib/AccessorFacade.pm
07:26 moritz ChoHag: in the rakudo rep, you can do a git grep -A5 'trait_mod.*Attribute' to get an idea how they are implemented
07:27 moritz *repo
07:28 ChoHag I still need to install rakudo on this setup.
07:28 RabidGravy that's a small hurdle
07:28 ChoHag I know.
07:29 ChoHag Well. It's not quite as simple as it sounds, because nothing is installed any more without the process of doing so being reproducable, but I've done it before.
07:30 ChoHag From http://doc.perl6.org/language/objects: When a role is applied to a second role, the actual application is delayed until the second class is applied to a class, at which point both roles are applied to the class. Thus
07:30 ChoHag Should read 'second role'
07:31 ChoHag Why is a punned role called a pun? Is it supposed to be some sort of pun?
07:35 RabidGravy "type punning" is a relatively old CS term, not sure of the etymology
07:35 * azawawi Atom::Electron::Clipboard API is here: https://github.com/azawawi/perl6-atom-elec​tron/blob/master/bin/clipboard_example.p6
07:38 RabidGravy azawawi++ # making stuff
07:41 moritz PSA: I'll most likely be offline from Aug 06 to Aug 21 (Norge, her kommer jeg!)
07:42 dalek doc: 47de357 | RabidGravy++ | lib/Language/objects.pod:
07:42 dalek doc: s/class/role/ from ChoHag++
07:42 dalek doc: review: https://github.com/perl6/doc/commit/47de357170
07:42 moritz if anybody needs some infrastructure permissions (root on hack or so), please ask me for it well in advance
07:43 g4 joined #perl6
07:47 estrabd joined #perl6
07:52 llfourn joined #perl6
07:52 chenryn joined #perl6
07:54 rurban_ joined #perl6
07:56 dakkar joined #perl6
07:57 raydiak since a pun is using an expected word or similar-sounding word to mean something unexpected, being able to write/"talk about" a role where a class is expected seems rather similar to making a pun (sans the humor)
07:59 chenryn joined #perl6
08:00 * DrForr wonders idly if we can work 'zeugma' in...
08:00 kaare_ joined #perl6
08:10 jdv79 any chance ThreadPoolScheduler.load could return the 3 counts as spec'd?
08:10 jdv79 *loads
08:21 dayangkun joined #perl6
08:26 Ven joined #perl6
08:33 jnthn Sure, if someone implements it :)
08:34 * jnthn can't remember what it ended up wanting in the design docs
08:34 nwc10 good *, jnthn
08:34 jnthn o/
08:34 * jnthn teaching again today
08:34 jnthn (and tomorrow)
08:35 nwc10 is the coffee good?
08:35 jnthn I'm in Sweden. So yes. :)
08:36 jnthn Though a train delay also delayed the person who puts the coffee maker on in a morning's arrival
08:36 jnthn I moved away from here and the trains here are *still* screwing me over :P
08:36 nwc10 :-)
08:36 nwc10 [I was trying to figure out a joke, but failed. Yours is much better than I would have managed]
08:37 jnthn Anyways, back to Prahy on Wed evening, and then I'll have lots of Perl 6 time
08:38 nwc10 except for all the curries that need cooking (as you previously informed us)
08:38 jnthn True :)
08:38 jnthn Though I tend to make a big load of it then it's food for two days :)
08:38 nwc10 higher order noms.
08:39 nwc10 (and that pun was even better given the line you added)
08:39 nwc10 (not that it was great)
08:39 jnthn :P
08:40 vendethiel joined #perl6
08:40 inokenty joined #perl6
08:41 estrabd joined #perl6
08:47 azawawi strange, I do not see any Alien:: namespace in modules.perl6.org. Is that intentional?
08:49 * sjn hopes so.
08:49 sjn Alien::* is something that shouldn't be necessary at all
08:51 sjn at best, the Alien modules should be considered as an emergency workaround when using software with broken dependency/deployment handling in hostile environments
08:52 azawawi true but what if i need to install electron for its wrapper API Atom::Electron
08:52 azawawi there is 'sudo npm install electron-prebuilt -g' but that means i need to depend on nodejs being installed
08:52 sjn install it yourself, until we get a better way of defining external dependencies
08:54 azawawi i figured it out, i will add instructions on installing nodejs and then installing electron since that command installs it in /usr/local/bin which is great :)
08:55 azawawi no need for Alien::Atom::Electron :)
08:55 sjn azawawi: is that the canonical way to install that package (meaning, isn't there a .deb or .rpm package of it?)
08:55 azawawi electron is distributed as a prebuilt binary or source
08:56 azawawi sjn: https://github.com/atom/electron/releases
08:57 azawawi sjn: i could write a Perl 6 installer but then we need https downloads so it is not worth the effort at the moment
09:02 * azawawi tries installation procedures on linux and windows
09:02 silug_ joined #perl6
09:05 espadrine_ joined #perl6
09:06 * sjn looks at the packaging discussion at https://github.com/atom/electron/releases
09:06 FROGGS sjn: we won't get rid of Alien::* me thinks... sometimes there is just no package at all for that platform
09:06 sjn FROGGS: :(
09:07 FROGGS that's not a bad thing
09:07 sjn the Alien::* concept is really, really, really horrible
09:07 FROGGS Perl was always a toolchain to get things working...
09:07 FROGGS no, it isnt
09:07 FROGGS depending on Alien::Foo promises that Foo is installed if the dependency is met...
09:07 RabidGravy sjn, totally disagree
09:08 FROGGS which is a distinct job, which fits very well the sense of a package
09:08 ChoHag I've not use perl6 in nearly a year. How (briefly) does the moarvm implementation stack up against the jvm?
09:08 FROGGS ChoHag: it is way faster for most stuff
09:08 sjn when you list an Alien package as a dependency, you basically say "we just have to get this stuff installed, and don't care about packaging downstream"
09:08 FROGGS and it has the most features
09:09 ChoHag It (mostly?) overtook the jvm then?
09:09 FROGGS ChoHag: moarvm is the leading backend for a long time now
09:09 brrt joined #perl6
09:10 FROGGS ChoHag: we usually prototype/implement on moarvm first, and then port the stuff to jvm
09:10 sjn so if someone downstream sees you depend on say... Alien::mysql, they have to go through all kinds of manual work to "fix" that dependency so it refers to the mysql that is available there
09:10 ChoHag So is parrot basically obsolete then?
09:10 FROGGS ChoHag: seems like
09:10 donaldh joined #perl6
09:10 FROGGS ChoHag: it could be revived with passionate hackers, but I doubt it will happen
09:11 FROGGS ChoHag: you can skim https://6guts.wordpress.com/ for details about progress
09:12 timotimo ChoHag: it's only faster than the JVM if you're below a run-time of like 10 seconds
09:12 sjn that means, from the perspective of the packager (who as it happens, are a rare breed) you're basically saying "I don't care about making life easy for you, I just want to get my stuff installed", and thereby totally missing the point of having a good relationship with your packager
09:12 RabidGravy I'm not following you
09:13 ChoHag So in a nutshell, speedwise it's much as it was but moar is more feature-complete than jvm?
09:13 sjn RabidGravy: try to look at the problem from the packager's perspective
09:13 RabidGravy I make a module that has a dependency on some library that may or may not be installed and may or may not be available for a platform
09:13 ChoHag And the parrot has been sold to John Cleese?
09:13 RabidGravy sjn, which packager?
09:14 FROGGS sjn: if there was a packager, then there would have been a package, no?
09:14 sjn RabidGravy: any packager. some guy in a Debian IRC channel who would like to make a .deb of your software
09:14 FROGGS ChoHag: the jvm backend just lacks a few features, minor ones iirc
09:15 sjn FROGGS: no, the packager makes the package. A package usually doesn't just show up all by itself :)
09:15 sjn packages don't just "magically appear" out of thin air
09:15 FROGGS sjn: yes, and when there is no package for, say, a library for some weird platform... where do you get the package from?
09:16 ChoHag Every piece of software has a packager. Sometimes it's one of the packagers from one of the distributions. Sometimes it's nobody and the package doesn't exist, and sometimes it's a system administrator who hates you and your offspring unto the 10th generation.
09:16 FROGGS it is easier to write a good Alien module than to raise or hunt down packagers
09:16 sjn FROGGS: usually someone making another package which depends on what dependency decides to try and package that dep too
09:17 RabidGravy there are for the sake of argument 10 packagers, and 1000 potential users.  Because we want to make life easy for the packagers we tell 750 of the users "tough"?
09:17 ChoHag Those packagers are the ones which make life easy for the 750.
09:18 sjn RabidGravy: there's more than two options here (not just "tough" or "Alien")
09:18 ChoHag So you can make life easy for 10 special snowflakes, or for 1000 special snowflakes.
09:18 FROGGS btw, the Alien modules I wrote check for the existence of the desired thing, and let you choose to use the existing one or build it afresh
09:18 RabidGravy sjn, I'd be delighted to see the fruits of your plan :)
09:18 FROGGS packagers just package my alien module with the 'use the bloody system lib' option
09:18 sjn those 10 special snowflakes make the software available for 10,000 people
09:18 vendethiel joined #perl6
09:19 sjn ChoHag: so what I'm saying is - let's make life easier for *them* first... I'll bet you the life for the 1000 other snowflakes will become easier too
09:20 RabidGravy a real example I have thought about recently,  I want to make a module that depends on "liquidsoap".  liquidsoap is available for debian etc, but not on Fedora, Redhat etc
09:21 ChoHag RabidGravy: Then your documentation says something along the lines of "Rabid::Gravy depends on liquidsoap. Debian has this in the 'liquidsoap' package or it can be obtained from <url>."
09:21 ChoHag Documentation's a wonderful thing.
09:21 RabidGravy and fuck usability
09:22 * sjn needs to get his deployment blog post finished. :-(
09:22 timotimo ChoHag: moar is faster than it was the last time you looked, but rakudo is slower than the last time you looked - at least i think so
09:22 timotimo i have no idea how long exactly you have been gone
09:22 ChoHag Sounds usable to me.
09:22 ChoHag About a year.
09:23 ChoHag It was only idle curiosity while it was all building anyway...
09:23 sjn RabidGravy: deployment kinda works, but no it's not making life easier
09:23 sjn s/deployment/documentation/
09:23 sjn it's certainly better than nothing
09:23 RabidGravy Users of an application that may use a module that requires some third party library or application don't or won't be bothered to install some potentially complex thing
09:24 ChoHag If your package goes trampling all over my system it can fuck off. Tell me where to get the things your Specal Snowflake software needs and get out of the way.
09:24 ChoHag Write a script to help me if you like, but make it easy to parse so I can do it myself and bypass the bugs you inevitably write into it.
09:24 RabidGravy if the software needs to be installed then it gets installed privately
09:24 FROGGS aye
09:25 ChoHag I have *never* found a piece of software which tried to magically install its dependencies and didn't royally fuck *something* up.
09:25 RabidGravy like I say I look forward to someones perfect solution to this
09:25 FROGGS ChoHag: then use my software :P
09:25 ChoHag RabidGravy: It's called README.
09:26 ChoHag Use it to lay out the assumptions your software makes about the system it runs on.
09:26 RabidGravy ChoHag, have you actually read any of the README files of any of the modules I have made?
09:26 ChoHag I have no idea what modules you make.
09:26 RabidGravy right
09:26 ChoHag Nor do I care.
09:26 DrForr s/DM/MD/ :)
09:26 ChoHag Your software makes assumptions about its environment (or is it going to install an entire HVM and OS?). Document them.
09:26 RabidGravy so don't lecture me about READMEs or Documentation
09:27 nwc10 ChoHag: "Nor do I care" does not show much respect.
09:27 ChoHag Consider it sharing the benefit of decades of experience of installing various softwares.
09:27 ChoHag nwc10: Read it as "Nor do the specifics matter" or something.
09:28 RabidGravy the specifics do matter when you are telling me to do something *that I have done*
09:28 ChoHag Well if you've done it, what's the problem?
09:29 ChoHag And besides I didn't tell you to do anything. You asked what someone's 'perfect solution' was. I told you mine.
09:29 ChoHag You may choose to do it or not at your leisure. As I don't even know what software you make, it's no skin off my nose.
09:29 FROGGS ChoHag: the problem is that a user does "cpan Awesome::Shit", and later it says something about a linker error or so and the user thinks the module is buggy instead of reading documentation
09:29 RabidGravy exactly
09:29 ChoHag However if you make it difficult, and I get employed somewhere your software is required, thank you for increasing my salary.
09:30 Begi joined #perl6
09:30 nwc10 ChoHag: you use Perl 5?
09:30 ChoHag Yes.
09:30 * azawawi https://github.com/azawawi/perl6-a​tom-electron/blob/master/README.md # updated electron installation instructions... sjn++
09:30 nwc10 ChoHag: then you already have his software installed. Via the core.
09:31 ChoHag So he made it easy and *didn't* increase my salary?
09:31 nwc10 whereas I think you have no code in the Perl 5 core.
09:31 ChoHag Bastard.
09:31 nwc10 *This* is why I think you might want to be a *little* more careful before dismissing others
09:31 nwc10 and maybe I am not being quite nice enough for #perl6 normality here.
09:32 ChoHag The only person I'm dismissing here is you.
09:32 nwc10 me?
09:32 ilogger2 joined #perl6
09:32 ChoHag I have no beef with RabidGravy.
09:32 * RabidGravy unleashes the ponies
09:32 nwc10 Cool. Now, you definately *do* have my software installed. :-)
09:32 ChoHag Not even Tesco-quality beef.
09:34 jnthn .oO( Is that the beef made of horse? )
09:35 ChoHag Ah I knew someone would get it. Ponies are sort of horse-like.
09:35 ChoHag More than horses are cow-like, certainly.
09:35 llfourn joined #perl6
09:37 RabidGravy FROGGS, that's why I made LibraryCheck - to blow the poor user out with a helpful message before the tests all fail with a linker errors
09:42 azawawi IRC is total fun. You ask one small question about Alien:: namespace and then all hell breaks loose when you come back :)
09:45 RabidGravy in summary there are differences of opinion about whether it is a good thing
09:49 azawawi panda install Alien::XYZ XYZ::Wrapper   # for usability and ease of use.
09:50 RabidGravy exactly, and if Alien::XYZ determines it doesn't have to do anything it's almost a no-op
09:50 Ven joined #perl6
09:50 azawawi now the other question, how can we download XYZ  via a panda-based installation without including it in the github repo?
09:51 azawawi any p6 modules doing that?
09:51 RabidGravy I'd be much happier if there was a way of a module to declare external non module dependencies but there isn't yet
09:51 RabidGravy I'm off out
09:52 spider-mario joined #perl6
09:52 sjn RabidGravy: I agree about declaring external deps. that's something I've been pushing for a while now. :)
09:53 ChoHag That would depend on the world's myriad package managers having some semblence of working together.
09:53 sjn ChoHag: there's a way to do that, methinks. :)
09:53 ChoHag Oh yes there are plenty.
09:53 sjn or at least make it happen
09:53 azawawi or a script to do xyz like Makefile.PL or Build.PL in p5 land
09:54 timotimo well, there's PackageKit, which kind of unifies package managing a little bit
09:54 ChoHag But there are too many egos in the way.
09:54 ChoHag Look how hard it was (and is!) to get rpm and dpkg to work together.
09:54 * sjn isn't really a big fan of having complex build scripts (like perl5/cpan's), but sadly, they seem to be necessary :-/
09:55 ChoHag Very necessary. See: gnu autotools.
09:56 sjn ChoHag: instead of getting people to "work together", I think it would be more useful to create a super-simple  common language, and make tiny tools to translate deps/metadata in that language to whatever is used locally
09:57 ChoHag You mean add another variable to the problem?
09:57 sjn nah, just standardize a grammar for declaring dependencies/metadata
09:57 azawawi DSLs always fail at doing a simple generic task  when it falls past their original design goal and they simply become a burden to the programmer
09:58 sjn there are already a bunch out there, but in the last few years some common trends have been showing up
09:59 * sjn sat with ingy at the QA hackathon a few months ago and looked at all kinds of different metadata spec files
09:59 * azawawi starts working on https://github.com/atom/electron​/blob/master/docs/api/dialog.md (Atom::Electron::Dialog)
09:59 sjn (still need to flesh out that spreadsheet though)
09:59 leont joined #perl6
10:01 amurf joined #perl6
10:01 ChoHag Until the halting problem is solved, the best you can do is list certain dependencies of certain types and then resort to human-readable documentation.
10:02 ChoHag Possibly bridging the gap with a script of some sort.
10:02 sjn ChoHag: yeah, that's true. There won't be a "perfect" solution
10:02 sjn we *can* make our jobs easier though
10:15 virtualsue joined #perl6
10:20 zakharyas1 joined #perl6
10:26 chenryn joined #perl6
10:35 azawawi anyone using rakudo on windows?
10:37 * azawawi silence :)
10:38 Begi azawawi: I use Rakudo on Windows :)
10:39 Begi azawawi: why ?
10:47 RabidMob joined #perl6
10:47 RabidMob Wahay!
10:47 RabidMob No free wireless though
10:50 RabidMob I think the last time I tried a mobile Including client was on a Nokia about ten years ago
10:57 ChoHag Found (and fixed) a bug in Rakudo's build.
10:57 ChoHag MOAR in tools/build/Makefile-Moar.in is $(BIN_DIR)/moar but should be @moar@
10:59 ChoHag (FSVO fixed because it still won't compile, but I'm willing to blame myself for that for doing things Differently)
11:02 azawawi Begi: build from source or ready msi?
11:03 Begi Actually, msi
11:04 azawawi FROGGS: ping
11:04 FROGGS pong
11:05 FROGGS I can build the msi package, yes
11:05 azawawi FROGGS: well panda still has that weird .bat not being generated on windows
11:05 FROGGS weird indeed
11:06 jkva joined #perl6
11:06 azawawi i assumed it was fixed in https://github.com/tadzik/panda/issues/182
11:07 azawawi apparently it is still there
11:08 gfldex joined #perl6
11:15 azawawi FROGGS: what determines if an panda installation is under CompUnitRepo or not?
11:15 azawawi FROGGS: s/an/a
11:17 AlexDaniel joined #perl6
11:18 Ven joined #perl6
11:18 FROGGS azawawi: isnt it always a CompUnitRepo?
11:19 azawawi FROGGS: this is not true, https://github.com/tadzik/panda/blo​b/156137bc9430b5158de6ef3094676420d​f8c3d70/lib/Panda/Installer.pm#L43
11:19 FROGGS thing is, a CUR::Local::Installation would create .bat files, but we are not using it atm
11:19 FROGGS it still is a CUR, just not a CUR that can install stuff
11:19 FROGGS a CUR::Local::File can't install stuff for example
11:20 azawawi so it is .can('install') is false
11:20 FROGGS so what we could do is either make CURLF allow to install stuff, or to extend panda to create batch files like CURLI does
11:20 FROGGS aye
11:20 azawawi and panda on windows cannot be invoke since there is no panda.bat after rebootstrap
11:20 FROGGS eww
11:21 azawawi s/invoke/invoked/
11:22 jdv79 *** Error in `/home/jdv/rakudo/install/bin/moar': double free or corruption (!prev): 0x00007f7818014870 ***
11:23 jdv79 i guess the async stuff isn't that stable yet
11:23 jdv79 i can't repro it though
11:23 brrt aw, that's a shame
11:23 FROGGS azawawi: the shortest fix is to spurt the content of a panda.bat to "$to/$bin.bat" on windows, around here: https://github.com/tadzik/panda/blo​b/156137bc9430b5158de6ef3094676420d​f8c3d70/lib/Panda/Installer.pm#L75
11:23 jdv79 spoke too soon - repro'd
11:24 azawawi FROGGS: but somehow it is not working
11:24 azawawi FROGGS: i build rakudo from source and it used to work :)
11:26 chenryn joined #perl6
11:28 llfourn joined #perl6
11:29 jdv79 https://gist.github.com/ano​nymous/280daf527dd06de6d706
11:29 jdv79 i can get a segfault in < 10 tries for that it seems atm
11:29 jdv79 is it something i did?
11:30 cognominal joined #perl6
11:31 Begi1 joined #perl6
11:31 jdv79 huh.  repro-ability seems to vary.
11:31 brrt jdv79: let me look
11:31 brrt that's what always happens with concurrency issues, isn't it :-)
11:33 brrt well, it'
11:33 brrt s nicely short, that's one thing
11:33 brrt unfortunately, we have
11:33 brrt few people with deep knowledge of concurrency issues
11:33 brrt :-(
11:33 brrt (jnthn++ being probably the most significant)
11:34 jdv79 should i just bug it then?
11:37 brrt probably.... yes
11:37 brrt :-)
11:37 brrt it would be appreciated
11:37 jdv79 cool, thanks
11:39 Ven joined #perl6
11:39 jnthn It shouldn't segv (though I know why it does, and how to fix it), but even then it's still very dubious.
11:39 jnthn my $in := @in[$i];
11:39 jnthn my $out := @out[$i];
11:40 jnthn The $out there auto-vivs on assignment
11:40 jnthn And normal resizable arrays aren't (and won't be) safe for concurrent writes
11:40 jnthn Or at least, for concurent resizes
11:40 brrt hmm
11:41 brrt ugh, that is a good point
11:41 jnthn So that code isn't going to work reliably even when the SEGV is gone.
11:42 jnthn Moving the assignment to $out inside the lock would fix it
11:42 jnthn I've probably mentioned this before, but auto-viv and concurrency really, really do not mix well.
11:45 zakharyas joined #perl6
11:49 jnthn Also, I'll bet that the MoarVM cross-thread write analyzer woulda caught this one :)
11:49 jnthn Sadly, I'm teaching and have no Rakudo build to hand to check it :)
11:50 colomon joined #perl6
11:50 amurf joined #perl6
11:50 chenryn joined #perl6
11:51 jdv79 is it a simple explanation why auto-viv isn't thread safe?
11:51 Foxcool joined #perl6
11:51 jdv79 i'm not an expert in either but that seems like it could be a common trip up
11:52 brrt jdv79: that would be a major pessimisation, methinks
11:52 brrt unless we can figure some way to do it 'optimistically'
11:53 jnthn jdv79: Well, it's more "can't be made threadsafe" really. To ensure safety you need a transaction boundary. It's impossible to establish one here, because the indexing of the array returns something that, when assigned to *at any point in the future*, will have an effect on the array.
11:54 brrt to be fair, it *is* doable, just horribly inefficient, methinks
11:54 jnthn jdv79: It's only a common trip-up if you insist on not using the concurrency mechanisms Perl 6 suggests you use.
11:55 Begi joined #perl6
11:55 brrt you'd have to start a new transaction for the entire array anytime you wnated to do that
11:55 jnthn brrt: Well, technically yes, but also it is a bad idea because it only means you end up with more problems later
11:55 jnthn I wrote a detailed blog post on this stuff.
11:55 jdv79 oh?
11:55 brrt ehm, did i read that perchance? when? :-)
11:55 jnthn https://6guts.wordpress.com/2014/04/17/​racing-to-writeness-to-wrongness-leads/
11:56 jdv79 well, i liketo play with low level stuff sometimes:)
11:56 brrt but yeah, it's fairly horrible, and java also doesn't give you that guarantee
11:56 brrt jnthn: oh yes, i did read that :-)
11:57 jdv79 what is the failure mode for this auto-viv/async issue?
11:57 brrt good post, still
11:57 jdv79 i'll read it now then
11:57 brrt jdv79: a crash, basically, in the good case
12:00 jnthn In this case, most likely "wrong answers sometimes"
12:00 jnthn (Which is why I've been looking into tooling to spot such issues a bit.)
12:00 jnthn teaching again &
12:01 jdv79 hmm, moving the autoviv line under the lock seems to stop the segv
12:02 jdv79 nice
12:02 jdv79 thanks
12:05 colomon_ joined #perl6
12:07 rurban joined #perl6
12:07 rurban left #perl6
12:08 atroxaper joined #perl6
12:10 atroxaper joined #perl6
12:17 azawawi is there a DESTROY destructor in Perl 6? that is when it goes outside of scope
12:18 arnsholt There's a DESTROY, but it gets called on GC, not end of scope
12:20 moritz apart from that, LEAVE phasers exist
12:21 azawawi moritz: could you provide an example please?
12:21 azawawi moritz: and hi
12:22 moritz azawawi: sub f($filename) { my $fh = open :w, $filename; LEAVE $fh.close; work with $fh here; }
12:22 moritz or maybe  LEAVE $fh.close if $fh;
12:23 azawawi moritz: what about objects?
12:23 moritz azawawi: objects exist too :-)
12:23 moritz for objects, DESTROY is what you want
12:23 azawawi :)
12:24 moritz LEAVE is cleaning up things in at the end of a scope
12:24 moritz *is for
12:24 arnsholt But remember that there's no guarantees that DESTROY will be called, not when or in what order
12:24 azawawi the thing is i need to kill/destroy the electron process that im launching with A:E:App
12:24 moritz I just mention LEAVE, because p5 folks sometimes build scope guard to execute code on scope exit; in p6, that's what LEAVE is for
12:25 arnsholt Yeah, LEAVE is generally going to be what people want, I think
12:27 jdv79 jnthn: finally got around to reading that post.  what "higher level" constructs would avoid that then?
12:28 Woodi hi #perl6 :)
12:29 ChoHag So do objects have a way in and of themselves of knowing when they're no longer referenced by any active scope?
12:30 ChoHag DESTROY fires only when GC'd, and LEAVE is part of the scope not part of the object. Right?
12:30 nine ChoHag: correct
12:30 Woodi in last years gap betwin traditional databases and shared memory shrinked - libraries like  http://symas.com/mdb/  are realy fast. and if more sharing is needed then redis :)
12:31 jdv79 Woodi: ok
12:32 Woodi ...chapter 23: Major Emacs modes ;)
12:34 pmurias joined #perl6
12:34 pmurias re Alien modules shouldn't they have an option of telling the package manager what should it install?
12:34 laouji joined #perl6
12:34 azawawi i cant trigger that object DESTRUCTION under moar. Any way to force it? :)
12:35 arnsholt You probably need to generate enough garbage to trigger a GC
12:35 arnsholt Destructors don't fire on interpreter tear-down
12:35 arnsholt Or there's an op, I think. nqp::forcegc() or something
12:37 azawawi class Foo { submethod DESTROY { say "DESTROY"; } }; { my $o = Foo.new; LEAVE: "LEAVE".say; }
12:37 azawawi m: class Foo { submethod DESTROY { say "DESTROY"; } }; { my $o = Foo.new; LEAVE: "LEAVE".say; }
12:37 camelia rakudo-moar 174049: OUTPUT«LEAVE␤»
12:37 azawawi arnsholt: nqp::force_gc
12:39 moritz m: use nqp; class Foo { submethod DESTROY { say "DESTROY"; } }; { my $o = Foo.new; LEAVE: "LEAVE".say; }; nqp::force_gc()
12:39 camelia rakudo-moar 174049: OUTPUT«LEAVE␤»
12:40 atroxaper joined #perl6
12:40 azawawi so safest to do is the following: my $app = Atom::Electron::App.instance; LEAVE: {   $app.destroy; }
12:41 Ven azawawi: leave is on block leave. maybe END is what you want here?
12:42 azawawi LEAVE or END will do fine
12:43 azawawi i like LEAVE more though since it is on a scope basis. You may be creating a window  and then destroying it when button X is clicked
12:48 El_Che azawawi: you're creating a UI toolkit for perl 6? :)
12:54 virtualsue joined #perl6
12:55 hoelzro_ good morning, #perl6!
12:56 azawawi El_Che: hi there :)
12:56 azawawi El_Che: long time
12:57 azawawi El_Che: Please check https://github.com/azawawi/perl6-a​tom-electron/tree/master/examples
12:59 itz git commit -m <(curl http://whatthecommit.com/index.txt )
13:00 brrt nice itz :-)
13:01 kyun joined #perl6
13:01 azawawi :)
13:02 jnthn jdv79: Well, for your case I'd just my @outs = await do for @in -> $in { start { $in * 10 } };
13:02 El_Che azawawi: yeah. Perl 6 is hip! :)
13:03 El_Che azawawi: great!
13:03 jnthn jdv79: In the future, my @outs = hyper for @in -> $in { $in * 10 }; is shorter.
13:03 jnthn Well, it's shorter now, but in the future it'll also be implemented :P
13:04 ChoHag If anyone's interested (I'm not - using the jvm is plan B) nearly every one of rakudo's nativecall tests has failed under the jvm on openbsd. I think because of the cc syntax.
13:04 ChoHag Otherwise, moar, nqp and rakudo compiled without fuss.
13:06 Woodi ChoHag: you compiled with jit ?
13:06 ChoHag If that's on by default, yes.
13:07 Woodi if host is >32 :)
13:07 jdv79 yeah.  still be nice if this stuff was all doc'ed out if the implementation isn't able to warn
13:07 jnthn *nod*
13:07 jdv79 i honestly totally forgot about your post
13:08 jdv79 though i know i read it back then
13:08 jdv79 thanks
13:08 jnthn I know some work was done on doc.perl6.org on the concurrency stuff
13:08 jnthn Please file a ticket there on what's missing so somebody (perhaps me :)) can take care of it :)
13:10 llfourn joined #perl6
13:10 ChoHag What's the rationale for repeat/(while|until) instead of do/(while|until)?
13:10 jdv79 will do
13:11 ChoHag Is repeat used for anything else? Is do somehow incompatible with the modifiers? How?
13:12 b2gills joined #perl6
13:17 jnthn ChoHag: http://design.perl6.org/S04​.html#The_repeat_statement discusses it a bit
13:18 jnthn (And I don't know anything more than it says)
13:22 Woodi would be nice if:  @outs = for @in -> $in { start { $in * 10 } };   work. but maybe s/for/something/
13:22 dalek joined #perl6
13:22 moritz hack.p6c.org is back
13:22 moritz it was hung; I rebooted it
13:22 jnthn Woodi: You need "do" to make it valid syntax
13:22 jkva joined #perl6
13:22 jnthn And then it does work, but gives you an arraty of Promise
13:23 jnthn *array
13:23 jnthn *Promises :)
13:23 Woodi jnthn: ok :) but you talking about how implemented atm or how it should be ?
13:23 jnthn Both :)
13:24 jnthn If you dont' want to write start/await, then "hyper" or "race" (when implemented) is what you want
13:24 jnthn Then a lot of the uses of the await do for ... start pattern will likely go away.
13:26 Util joined #perl6
13:26 Woodi why it can't be that: "if loop block starts with "start" then just create lots of Promises" ?
13:27 Woodi haevy DWIM...
13:28 Woodi heavy ?
13:28 * jnthn doesn't follow
13:28 jnthn Example?
13:28 Woodi like one above: for @a { start { ... $_ } }
13:29 Woodi *create and return bunch of promises
13:30 jnthn It does, it's just not valid syntax to write my @x = for ...
13:30 Woodi if it's incorect then ok, just dreaming
13:30 jnthn m: my @a = for 1..5 { 2 * $_ }
13:30 camelia rakudo-moar 174049: OUTPUT«5===SORRY!5===␤Word 'for' interpreted as a listop; please use 'do for' to introduce the statement control word␤at /tmp/M0boHGqHqm:1␤------> 3my @a = for7⏏5 1..5 { 2 * $_ }␤Unexpected block in infix position (two terms in a row)␤at /tmp/…»
13:30 jnthn m: my @a = do for 1..5 { 2 * $_ }; say @a
13:30 camelia rakudo-moar 174049: OUTPUT«2 4 6 8 10␤»
13:31 moritz you can always map
13:31 jnthn indeed :)
13:32 Woodi o, btw. do every snow flake is different ?
13:32 lizmat they do is different!
13:33 Ven joined #perl6
13:33 jnthn I never did two snowflakes that were alike so far...
13:33 Woodi *are :)
13:33 ggoebel joined #perl6
13:33 Woodi but can one count on this ? :)
13:34 lizmat one must test otherwise it does exist  :-)
13:34 jnthn Take a system using Guids and replace them with snowflakes and see what happens :-)
13:34 Woodi you know, make lot of photos in the winter, digitize to numbers and use as "identifiers" for something... next winter repeat :>
13:35 Woodi damn jnthn++ !
13:36 Woodi yes, MS use guids for apis numering, not for eg. objects
13:37 Woodi http://www.thefreedictionary.com/hyper-
13:42 dalek rakudo-star-daily: e191e29 | coke++ | log/ (9 files):
13:42 dalek rakudo-star-daily: today (automated commit)
13:42 dalek rakudo-star-daily: review: https://github.com/coke/rakudo​-star-daily/commit/e191e29ee0
13:42 dalek perl6-roast-data: b270266 | coke++ | / (9 files):
13:42 dalek perl6-roast-data: today (automated commit)
13:42 dalek perl6-roast-data: review: https://github.com/coke/perl6​-roast-data/commit/b2702667bc
13:42 [Coke] joined #perl6
13:51 skids joined #perl6
13:54 * brrt notes that the global interpreter lock could be said to be exactly the newbie-friendly DWIM we reject in moarvm
13:56 brrt re: the concurrency article :-)
14:06 khw joined #perl6
14:08 atroxaper joined #perl6
14:12 ChoHag joined #perl6
14:14 ChoHag p6: say "anything"
14:14 camelia rakudo-moar 174049: OUTPUT«anything␤»
14:14 Ven joined #perl6
14:15 ChoHag Hooray! My unicode display capability is unbroken!
14:20 RabidGravy joined #perl6
14:21 RabidGravy boo
14:22 inokenty joined #perl6
14:23 brrt joined #perl6
14:27 * [Coke] wonders what discussions he was in, since irssi seems to have forgotten a few.
14:28 ugexe lizmat: the design docs use `inst:name<work>:/installed` as an example. Ignoring the correction needed for `inst#name`, should the second half be `<work>#/installed` or `<work>:/installed`?
14:43 brrt the discussion was, among other things, 'why are arrays and hashes not thread-safe by default'
14:43 brrt and the answer was, among other things, 'containers'
14:44 jkva joined #perl6
14:49 PerlJam joined #perl6
14:50 telex joined #perl6
14:52 jnthn brrt: For "don't actaully make good use of my mutli-core CPU" meaning of DWIM, yes. :P
14:53 brrt yeah, i was talking from a newbie-standpoint
14:53 brrt Real Developers Hate GIL
14:53 brrt :-P
14:53 dalek roast: 41814eb | PerlJam++ | S04-declarations/will.t:
14:53 dalek roast: Add a test for RT#119109
14:53 dalek roast: review: https://github.com/perl6/roast/commit/41814eb6cf
14:56 leont GIL is even more useless than interpreter threads
15:02 nine Is there a way to create a sub via the MOP that also works as a method?
15:04 jnthn nine: If you add_method a Sub then provided it expects to receive an invocant parameter it'll work perfectly fine as a method.
15:05 jnthn m: Int.^add_method('foo', sub ($x) { say "a sub!" }); 42.foo
15:05 camelia rakudo-moar 174049: OUTPUT«a sub!␤»
15:06 dalek roast: 500e5c0 | PerlJam++ | S03-metaops/reverse.t:
15:06 dalek roast: Add todo test for RT#118791
15:06 dalek roast: review: https://github.com/perl6/roast/commit/500e5c0928
15:07 nine jnthn: but then it won't be available as Int::foo; I need it to work in both ways because I just don't know if it's a sub, a package method or an object method (because Perl 5 does not differ).
15:08 jnthn nine: Then you'll need to install it in both places I guess
15:08 nine jnthn: if I just do ::($module).WHO{"&$name"} := sub (*@args) { } instead of ^add_method, it seems to work fine, but I'm not sure if that's intended or accident.
15:09 jnthn nine: Well, it will work, but then it won't be available as a (Perl 6) method
15:09 jnthn gotta go &
15:09 nine jnthn: thanks
15:25 dalek Inline-Perl5/p5_class_via_mop: 44b7044 | (Stefan Seifert)++ | lib/Inline/Perl5.pm6:
15:25 dalek Inline-Perl5/p5_class_via_mop: Replace EVAL by MOP calls to create Perl5Package classes
15:25 dalek Inline-Perl5/p5_class_via_mop:
15:25 dalek Inline-Perl5/p5_class_via_mop: Wrapper classes for imported Perl 5 modules are now better introspectable.
15:25 dalek Inline-Perl5/p5_class_via_mop: Instead of <anon> the subs and methods now have a proper name.
15:25 dalek Inline-Perl5/p5_class_via_mop: review: https://github.com/niner/Inl​ine-Perl5/commit/44b70441cf
15:25 nine Should I merge this or not? ^^^
15:28 amurf joined #perl6
15:33 dalek Inline-Perl5/p5_class_via_mop: 800701b | (Stefan Seifert)++ | / (3 files):
15:33 dalek Inline-Perl5/p5_class_via_mop: Replace EVAL by MOP calls to create Perl5Package classes
15:33 dalek Inline-Perl5/p5_class_via_mop:
15:33 dalek Inline-Perl5/p5_class_via_mop: Wrapper classes for imported Perl 5 modules are now better introspectable.
15:33 dalek Inline-Perl5/p5_class_via_mop: Instead of <anon> the subs and methods now have a proper name.
15:33 dalek Inline-Perl5/p5_class_via_mop: review: https://github.com/niner/Inl​ine-Perl5/commit/800701b1fa
15:34 mr-foobar joined #perl6
15:35 nine In any case, I think this is now the most complete example of using the MOP to create a completely new class.
15:35 notjack joined #perl6
15:36 n0tjack I've been following the perl6 tag on SO more closely recently. Today someone asked a question about accessors, but I can't figure out where in the docs/blogs/advent calendar I should go to get an answer for it
15:36 nine n0tjack: what was the question?
15:37 n0tjack This is the question: http://bit.ly/1Ip7HT1 . But my question is, being a complete n00b to p6, where should I go if I wanted to answer it myself
15:37 n0tjack (besides here, of course)
15:38 nine n0tjack: http://doc.perl6.org is a pretty decent resource nowadays.
15:38 araujo joined #perl6
15:38 araujo joined #perl6
15:38 Ven I guess I'd use a "where", but I think those might still be NYIs
15:39 n0tjack nine: thanks
15:39 Ven m: class A { has $.str is rw where *.elems == 3 }; my A $a .= new; $a.str = "hey"; say $a.str; $a.str = "heyyy";
15:39 camelia rakudo-moar 174049: OUTPUT«Type check failed in assignment to '$!str'; expected '<anon>' but got 'Str'␤  in block <unit> at /tmp/qxBmzHUYc0:1␤␤»
15:39 araujo joined #perl6
15:39 Ven m: class A { has Str $.str is rw where *.elems == 3 }; my A $a .= new; $a.str = "hey"; say $a.str; $a.str = "heyyy";
15:39 camelia rakudo-moar 174049: OUTPUT«Type check failed in assignment to '$!str'; expected '<anon>' but got 'Str'␤  in block <unit> at /tmp/ypnku3mZex:1␤␤»
15:39 n0tjack the search on that site isn't working for me in Chrome, but I can use google
15:39 Ven uhhhm. what?
15:39 arnsholt A where only lets you check the validity of an input argument, though
15:40 Ven arnsholt: as opposed to?
15:40 arnsholt It doesn't really let you attach custom logic to go along with the update
15:40 Ven ah, yes, indeed. I don't know how tu do that without a Proxy :)
15:40 arnsholt Or, you could hack it in via a where, I suppose
15:40 arnsholt But that feels wrong
15:40 araujo joined #perl6
15:43 nine btw. better error message:
15:43 nine m: subset PositiveInt of Int where * >= 0; class Foo { has PositiveInt $.mana is rw; }; Foo.new(:mana(-3))
15:43 camelia rakudo-moar 174049: OUTPUT«Type check failed in assignment to '$!mana'; expected 'PositiveInt' but got 'Int'␤  in block <unit> at /tmp/ixsgEzuSnL:1␤␤»
15:43 araujo joined #perl6
15:43 Ven nine: yeah, indeed :-)
15:43 n0tjack so you guys are approaching this through the type system rather than through traditional accessor wrappers?
15:44 n0tjack what if you wanted to do arbitrary logic, perhaps with reference to other fields?
15:45 n0tjack if you had a Point(x,y) type, and you wanted to ensure the Cartesian distance from origin was never more than MAX_DIST
15:46 n0tjack you'd have to have logic in the setters for both x and y which ensured sqrt(x^2 + y^2) <= MAX_DIST
15:46 n0tjack can that be done?
15:46 nine m: class Foo { has Int $.strength; has Int $.mana is rw where * > $.strength; }; Foo.new(:strength(3), :mana(3))
15:46 camelia rakudo-moar 174049: OUTPUT«5===SORRY!5=== Error while compiling /tmp/WxgbZT9gdG␤Virtual call $.strength may not be used on partially constructed objects␤at /tmp/WxgbZT9gdG:1␤------> 3as Int $.mana is rw where * > $.strength7⏏5; }; Foo.new(:strength(3), :mana(3))␤  …»
15:47 nine I guess that fails due to ordering issues on initialization. The compiler would have to know that certain fields have to be initialized before the others.
15:48 RabidGravy n0tjack, the subset thing can cover quite a lot of the validations you might want, for anything even madder (say the validation is dynamic) you can use e.g. a  Proxy
15:48 RabidGravy but that stuff is not well documented
15:49 nine Which brings us back to the original question of where to find the documentation
15:49 n0tjack RabidGravy: Agreed on the subset thing, it's something I've wanted in programming languages for a long time. I've not heard of Proxies before, I'll go check em out
15:49 n0tjack I've honestly found the Advent Calendar the best and most motivating p6 documentation so far
15:50 n0tjack I also started reading the book, but the problem is I want to focus on the cool new stuff, and of course the book also has to cover the old standard stuff
15:50 RabidGravy the language docs are getting there but it's mostly on a best effort basis
15:51 n0tjack I tried writing my own little language using grammars, but it was too much work
15:51 nine Everything in Perl 6 is on a best effort basis :) Which I guess is better than a mediocre effort basis ;)
15:51 n0tjack well, if this thing is going to ship by Dec, someone has to be tagged with getting user docs up to snuff
15:51 n0tjack uptake will be rocky with a solid compiler but no docs
15:52 RabidGravy I'm actually beginning to thing that object attributes could be the subject of a whole doc page on their own
15:52 RabidGravy think
15:52 virtualsue joined #perl6
15:52 RabidGravy or thing at option
15:53 nine RabidGravy: if you think something deserves a whole page on its own, you are most probably right.
15:54 dalek doc: 2ba77e5 | (Steve Mynott)++ | lib/ (3 files):
15:54 dalek doc: fix minor typos
15:54 dalek doc: review: https://github.com/perl6/doc/commit/2ba77e5720
15:55 RabidGravy by my thumb in the air metric I'd say about 50% of the questions people who are new to the subject ask is "how do I do * (with|to) an attribute"
15:56 diana_olhovik_ joined #perl6
15:58 ChoHag Programming is almost entirely about managing data.
15:58 ChoHag Attributes are where the data is stored.
15:58 ChoHag 50% seems rather low.
16:00 ChoHag And on that note, how can I go about attaching some piece of data to an attribute, eg. Bool $!set_by_constructor
16:01 ChoHag I seem to recall when I was playing with perl 6 last year I ended up using a Proxy somewhere/how, but I'm completely out of the loop now.
16:04 RabidGravy usually "submethod BUILD() { $!set_by_constructor = True }"  obviously expanded to your logic
16:06 RabidGravy if you just want it to be passed to the constructor then just add it as an argument to the BUILD
16:06 rurban joined #perl6
16:06 ChoHag Yeah I didn't think that was specific enough: How can I do this: class Foo { has $!a; has $!b; has $!c }; $f = Foo->new(a=>3); $foo.a.set_by_constructor #|<returns True>; $foo.b.set_by_constructor #<returns False>; $foo.c.set_by_constructor #<raises an exception because c is a normal attribute>
16:07 ChoHag I don't want to know if something is setby the constructor, I'm trying to simplify the problem somewhat.
16:08 Calibellus joined #perl6
16:09 nine ChoHag: where's the difference to $foo.a.defined?
16:09 TEttinger joined #perl6
16:10 RabidGravy ah
16:10 RabidGravy it doesn't track that but it's doable with some trait on the accessor itself (which you would have to make yourself)
16:11 ChoHag nine: Because I couldn't expand that to 'was_set_while_the_user_was_eating_lunch'
16:11 abraxxa joined #perl6
16:12 khw joined #perl6
16:13 ChoHag I achieved something similar to what I want in Moose by defining a new method (extra_has) which added a trait, other attributes to contain the data I was interested in and fudged the trigger.
16:13 RabidGravy I'm not feeling the love for the actual requirement so I'm not going to chase it down but I think you'd want to create a trait that added a role to the attribute MOP thingy you cared about which could store the information
16:13 ChoHag Then I could do extra_has 'special_attribute' => ( isa => 'Int', ... )
16:15 moritz you could just write a separate new method
16:15 ChoHag I don't want to know if an attribute was set in a constructor.
16:16 RabidGravy so you'd do "sub trait_mod:<is>(Attribute $a, :$my_special_stuff!) { $a does MySpecialRole }" where MySpecialRole adds the additional metadata to the attribute MOP object
16:16 moritz ChoHag: then I don't understand what you want to do
16:16 RabidGravy then "has $!foo is my_special_stuff"  etc
16:16 hoelzro_ii joined #perl6
16:16 ChoHag I want to have an attribute in a class which has 'some flag or other' associated with it such that I can have, among other things, $instance.attribute.flag or in a pinch $instance._attribute_flag.
16:17 RabidGravy which I just decribed
16:17 ChoHag RabidGravy: Right. So where does my_special_stuff store its data?
16:18 RabidGravy the role can have its own attributes which it stores in the attribute MOP object, just like moose basically
16:18 ChoHag [Where] is there documentation on traits?
16:18 RabidGravy no
16:18 RabidGravy or in the design documents
16:21 robinsmidsrod joined #perl6
16:24 RabidGravy the detail may or may not be firm enough for user documentation yet
16:28 yqt joined #perl6
16:29 jonathan_ joined #perl6
16:30 jonathan_ boo
16:33 RabidGravy silly internet
16:35 timotimo silly interpreter
16:37 ChoHag Can I have Foo export the symbols Foo::Bar exports?
16:37 ChoHag (And Foo::Baz, and Foo::Bing, and Foo::Some::Other::Thing)
16:47 Ven_ joined #perl6
16:49 moritz ChoHag: do you want to address it as Foo::Bar or as Bar in the code where it was exported to?
16:50 ChoHag Foo::Bar
16:50 ChoHag I just want to be lazy and have only one 'use' in the consuming code.
16:50 dalek Inline-Perl5: 800701b | (Stefan Seifert)++ | / (3 files):
16:50 dalek Inline-Perl5: Replace EVAL by MOP calls to create Perl5Package classes
16:50 dalek Inline-Perl5:
16:50 dalek Inline-Perl5: Wrapper classes for imported Perl 5 modules are now better introspectable.
16:50 dalek Inline-Perl5: Instead of <anon> the subs and methods now have a proper name.
16:50 dalek Inline-Perl5: review: https://github.com/niner/Inl​ine-Perl5/commit/800701b1fa
16:51 dalek Inline-Perl5: 79ef766 | (Stefan Seifert)++ | / (4 files):
16:51 dalek Inline-Perl5: Support exporting Perl 5 subs o Perl 6 users
16:51 dalek Inline-Perl5:
16:51 dalek Inline-Perl5: This works now:
16:51 dalek Inline-Perl5:
16:51 dalek Inline-Perl5: use Digest::MD5:from<Perl5> <md5>;
16:51 dalek Inline-Perl5: say md5('foo');
16:51 dalek Inline-Perl5: review: https://github.com/niner/Inl​ine-Perl5/commit/79ef76617e
16:51 nine Yes, yes, yes! :)
16:51 moritz ChoHag: then it already works
16:51 moritz ChoHag: 'our' packages are global, no need for extra exporting
16:52 nine Another slide in my talk replaced with "yes, it just works as you'd expect"
16:52 ChoHag It works with the class Foo::Bar {} but not the multi trait_mod:<is>(Attribute $a, :$special) is export { ... which succeeds it.
16:53 pullphinger joined #perl6
16:53 ChoHag To get 'has $!thing is special' to work, I need to use Foo::Bar explicitely.
16:53 RabidGravy it should do as that's how traits work largely
16:54 dalek rakudo/nom: 6a3e09c | skids++ | src/core/Parameter.pm:
16:54 dalek rakudo/nom: Fix Parameter.perl when $!nominal_type is not a nominal type
16:54 dalek rakudo/nom:
16:54 dalek rakudo/nom: The :elide-type logic introduced a problem with captured types
16:54 dalek rakudo/nom: and types like ::?CLASS.  This disallows eliding said types.
16:54 RabidGravy you also need to specify :$special! or it won't select that on the multi
16:55 dalek joined #perl6
16:55 dalek rakudo/nom: 2db0596 | ugexe++ | src/core/Proc.pm:
16:55 dalek rakudo/nom: Allow non-default %*ENV for `Proc`
16:55 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/2db05960e5
16:55 dalek rakudo/nom: 3e88cf2 | moritz++ | src/core/Proc.pm:
16:55 dalek rakudo/nom: Merge pull request #482 from ugexe/patch-13
16:55 dalek rakudo/nom:
16:55 dalek rakudo/nom: Allow non-default %*ENV for `Proc`
16:55 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/3e88cf2b00
16:56 ChoHag Now I have 2 problems!
16:56 RabidGravy only two?
16:56 llfourn ChoHag: You could try exporting '&traitmod:<is>' from sub EXPORT { } in Foo.pm
16:56 ChoHag Two so far.
16:56 llfourn I have never tried exporting a multi from EXPORT though
16:57 ChoHag Is there a preferred paste site for this place?
16:57 llfourn http://docs.perl6.org/language/modules <- see EXPORT
16:57 RabidGravy github gists mostly preferred
16:59 dalek doc: 677aba6 | moritz++ | lib/Type/Proc.pod:
16:59 dalek doc: Mention :env in run()
16:59 dalek doc: review: https://github.com/perl6/doc/commit/677aba6e62
16:59 llfourn afaik there is "re-exporting" in the spec it's just not yet implemented
16:59 llfourn I may have read it wrong though
17:00 ChoHag https://gist.github.com/Ch​oHag/3645dd1638a73b32430d
17:00 RabidGravy if I can guess what you are trying to do, I'd say "module Foo { role Bar { ... } ; multi sub trait_mod:<is>(Attribute $a, :$special!} { $a does Bar; } }" is probably the thing
17:01 RabidGravy with an is export in there
17:01 ChoHag My two problems are that I need to use SAD::Special in SAD/Thing.pm, and I don't know what difference the ! RabidGravy told me to use on line 20 makes.
17:02 ChoHag Also that site is a PITA to paste text into.
17:03 ChoHag Also also I'm not good at naming things.
17:03 ChoHag But pretty good at naming things things.
17:04 RabidGravy the ! means it is required, without it may select anouther multi
17:04 RabidGravy named parameters are optional by default
17:04 ChoHag What other multi *could* 'is special' select?
17:05 RabidGravy er
17:07 llfourn how can I edit the gist?
17:08 RabidGravy it's a subroutine like any other
17:09 ChoHag llfourn: There's a comment box underneath. Maybe you need to be logged in to it.
17:09 llfourn ChoHag: ok I think i've solved one of your problems
17:09 llfourn one sec
17:12 khw joined #perl6
17:12 llfourn ChoHag: take a look
17:13 ChoHag RabidGravy: But if a variable is qualified with 'is special', how could it get into any other trait_mod unless its signature also includes :$special?
17:14 dalek perl6-roast-data: f8f7165 | coke++ | / (9 files):
17:14 dalek perl6-roast-data: today (automated commit)
17:14 dalek perl6-roast-data: review: https://github.com/coke/perl6​-roast-data/commit/f8f71658b1
17:14 ChoHag llfourn: That does it thanks.
17:15 RabidGravy because named parameters like ":$special" are optional unless made required by the !
17:15 Alina-malina joined #perl6
17:16 llfourn ChoHag: No worries :)
17:17 ChoHag So if there was a trait_mod<is>(Attribute $a, :$funky!) {}, could 'has $!foo is special is funky' call that trait_mod and not the original (:$special) one?
17:17 inokenty joined #perl6
17:20 RabidGravy you can have multiple traits without a problem
17:21 ChoHag Then I don't understand the circumstances under which my original trait_mod sub would *not* be called against any attribute which was qualified by 'is special'.
17:22 * [Coke] hurls http://stackoverflow.com/questions/31665384/how-​does-one-write-custom-accessor-methods-in-perl6 for someone to answer.
17:22 * [Coke] sees it's in review (but still unanswered on SO)
17:26 llfourn can you write custom accessors? I mean like override a $.attr's default accessor
17:26 [TuxCM] joined #perl6
17:29 RabidGravy llfourn, yes. you can make a "multi method attr() is rw { }"  etc ec
17:30 llfourn RabidGravy: eh method attr is rw?
17:30 ChoHag Protip: When testing whether your dish is salty enough, don't use the spoon with which you added the salt.
17:30 RabidGravy same goes with chilli ;-)
17:31 ChoHag Also, especially with chilli, don't scratch your eyes.
17:31 RabidGravy llfourn, yeah the last lvalue becomes writable
17:31 ChoHag You only make that mistake once with Scotch Bonnets...
17:31 llfourn RabidGravy: That's cool!
17:32 mpapec joined #perl6
17:32 llfourn We should document that!
17:33 mpapec hi, is someone reading info@rakudo.org?
17:33 geekosaur an accessor is just a method with the same name as an attribute, no?
17:34 moritz geekosaur: correct
17:35 [Coke] (info@) I would imagine maybe pmichaud?
17:35 ChoHag Can you get to the Attribute class which backs an attribute other than through $instance.^attributes, which is a list?
17:38 Ven_ joined #perl6
17:39 dalek Inline-Perl5: db3c4af | (Stefan Seifert)++ | lib/Inline/Perl5.pm6:
17:39 dalek Inline-Perl5: Mark required :$perl5 parameter for improved error message
17:39 dalek Inline-Perl5: review: https://github.com/niner/Inl​ine-Perl5/commit/db3c4afded
17:46 llfourn hmm but it seems by making a method 'is rw' you still don't get access to whatever it's being assigned to
17:46 llfourn within the method
17:47 llfourn or is there some special variable I'm not aware of...
17:48 RabidGravy If you want to separately capture control on get as opposed to set then you need to have a Proxy as it currently stands
17:49 llfourn RabidGravy: Makes sense
17:52 RabidGravy llfourn, eg:
17:53 RabidGravy m: class Foo { has $!bar; method bar() is rw { Proxy.new( FETCH => sub ($) { $!bar; }, STORE => sub ($, $b) { $!bar = $b; }); } }; my $foo = Foo.new; $foo.bar = "zub"; say $foo.bar; my $r = Foo.new; say $r.bar;
17:53 camelia rakudo-moar 3e88cf: OUTPUT«zub␤(Any)␤»
17:53 RabidGravy not entirely ideal
17:58 llfourn RabidGravy: can't we just .wrap the method after it has been created via class.^find_method
17:59 llfourn anyways I'm out 4am here :)
17:59 llfourn I started writing the answer to SO but then realised I'm too tired :S https://gist.github.com/LL​Fourn/2d1b407f06c486a12173
17:59 llfourn feel free to use :)
18:00 llfourn left #perl6
18:00 RabidGravy please don't take anything I say as canonical ;-)
18:02 [Coke] that rw method doesn't work here. updating rakudo to double check..
18:04 RabidGravy it wants to work as half the universe depends
18:05 brrt joined #perl6
18:16 ugexe should Proc::Async.start switch paramater :$ENV to :$env?
18:18 hoelzro I came across some interesting behavior this morning while working on my Xapian bindings; when I add a definition for an existing operator (ex. sub infix:<==>) to a unit, it's not visible in an importing unit unless I specify is export
18:18 hoelzro I understand why, but I was thinking how this might trip up someone new to Perl 6
18:23 hoelzro_ii joined #perl6
18:23 RabidGravy I actually like that behaviour
18:24 atroxaper joined #perl6
18:24 hoelzro RabidGravy: the behavior I just described?
18:25 [Coke] m: class Wizzard { has Int $.mana is rw; method mana is rw { say "running out of mana" if $!mana < 20; $!mana; } } ; my Wizzard $gandalf .= new; $gandalf.mana = 2; say $gandalf.perl;
18:25 camelia rakudo-moar 3e88cf: OUTPUT«Invocant requires a 'Int' instance, but a type object was passed.  Did you forget a .new?␤  in method mana at /tmp/06kTejG8vD:1␤  in block <unit> at /tmp/06kTejG8vD:1␤␤»
18:25 [Coke] ^^
18:25 dalek roast: f23ee5a | lizmat++ | S06-signature/introspection.t:
18:25 dalek roast: Unfudge now passing tests
18:25 dalek roast: review: https://github.com/perl6/roast/commit/f23ee5ac88
18:27 RabidGravy hoelzro, yeah it causes you to think what you are doing :)
18:28 hoelzro RabidGravy: I don't mind the behavior, but I'm betting that newbies will be working with Perl 6, wondering why their operator overload doesn't work =/
18:28 hoelzro maybe it's up to a linter, though
18:29 RabidGravy better documentation is the key :)
18:38 RabidGravy hoelzro, I think it would be covered by "by default all subroutines are only visible to their lexical scope (this includes operator and trait definitions.)"
18:38 domidumont joined #perl6
18:38 RabidGravy then explaining the use of either "our" or "is export"
18:42 domidumont joined #perl6
18:45 lizmat hmmm... going through S02, I found something that will make [TuxCM]  happy
18:45 * [TuxCM] is all ears …
18:45 lizmat S02:672 states: "C<Int> automatically supports promotion to arbitrary precision, as well as holding C<Inf> and C<NaN> values."
18:46 [TuxCM] ah, so I can haz Ranges :)
18:46 [TuxCM] nine, FROGGS, any view on fixing Merging GLOBAL symbols failed: duplicate definition of symbol HLL ?
18:46 lizmat well, maybe: it appears to be added quite recently (with e608859d ) to be precise
18:47 lizmat which is a formatting change
18:47 lizmat ah well
18:48 [TuxCM] YAPC::EU asked if I could shorten my p5/p6 CSV talk from 50 to 20 minutes. I prepared 58 slides :(
18:49 lizmat the original version dates to 2008: 16b83354
18:49 DrForr My talks are both 20 minutes, otherwise I'd offer to sacrifice.
18:49 [TuxCM] test             50000    47.058    46.960
18:49 [TuxCM] test-t           50000    46.398    46.300
18:49 ShimmerFairy lizmat: there's an old ticket concerning Inf and NaN wrt Int and such; I can try finding it for you if you like :)
18:50 lizmat ShimmerFairy: thank you, but no need
18:51 [TuxCM] ShimmerFairy, my point is that this is fail: my Int $i = Int.Range.max;
18:51 hoelzro RabidGravy: it's consistent with export rules, but I don't know if it'd be obvious to a newbie
18:51 [TuxCM] I understand
18:51 hoelzro since the == operator is already in scope, just not the candidate that's provided by the module
18:52 ShimmerFairy Yeah, the old bug is about how Inf/NaN aren't able to be stored in Ints (and possibly other types).
18:52 hoelzro so they'll get &infix:<==>(Any, Any) behavior instead of &infix:<==>(MyType, MyType) behavior, and they might scratch their head as to why
18:52 [TuxCM] IMHO there should be types Inf and NaN's :)
18:52 [Coke] not just an old bug - the oldest bug.
18:53 [Coke] [TuxCM]: so how would you store an Inf in a Num if Inf was a separate type?
18:53 lizmat I only see a VM-level solution, or some role mixin magic kludge
18:53 [TuxCM] auto up/downgrade
18:53 [Coke] (I think it ends up having to be a separate special value like Nil)
18:54 ShimmerFairy if only we had something like  class Int = RealInt | Inf | NaN  (assuming Inf and NaN as types, and RealInt as current Int)
18:55 ShimmerFairy [Coke]: Hm... A Nil/Empty/etc.-like value might make the most sense, come to think of it. Inf (and possibly NaN) certainly apply to more than one type.
18:55 RabidGravy hoelzro, but overloading operators is not newbie stuff, you'd expect them to have read some docs before they discovered it
18:56 * moritz isn't aware of any language that successfully and retroactively added union types
18:56 RabidGravy tum ti tum
18:56 rangerprice joined #perl6
18:56 rangerprice hi guys
18:57 RabidGravy erp
19:02 ShimmerFairy moritz: yeah, I don't think adding union types would be a good move at this point, at least not without a serious need and plenty of considerations given.
19:04 brrt joined #perl6
19:04 colomon joined #perl6
19:05 level0 joined #perl6
19:06 amurf joined #perl6
19:06 level0 from S03->Note that unlike Perl 5's flipflop, numeric values are not automatically checked against the current line number. (If you wish to have those semantics for your smartmatches, you could mixin a numeric value to $_ to create a chimeric object that is both integer and string. Conjecture: lines() should have an option that does this.)
19:07 level0 Is such option in lines() available?
19:09 RabidGravy I don't think so
19:10 zakharyas joined #perl6
19:11 Hor|zon joined #perl6
19:11 RabidGravy has today been the day of the x/y problem?
19:14 colomon_ joined #perl6
19:16 lizmat .oO( x/x problems are much friendlier :-)
19:17 colomon joined #perl6
19:19 geekosaur .oO{ and z/w problems are for the birds }
19:20 Begi joined #perl6
19:22 moritz for lines().kv -> $no, $line { next unless $line ~~ 5..12; ... }
19:22 dalek roast: e6487c5 | skids++ | / (3 files):
19:22 dalek roast: unskip some passing tests and make is-perl-idempotent more useful
19:22 dalek roast:
19:22 dalek roast: Also test some new cases which would have failed before PR#481
19:22 dalek roast: review: https://github.com/perl6/roast/commit/e6487c51e8
19:23 lizmat moritz: did you not intend $no ~~ 5..12 ?
19:23 moritz erm, yes
19:23 moritz lizmat++
19:23 lizmat ok  *phew*  :-)
19:23 rurban_ joined #perl6
19:25 moritz lizmat: re RT #125705, afaict Lock is meant to be re-entrant
19:27 lizmat S17:940 indeed states: C<Lock> is reentrant.
19:27 lizmat but it doesn't state the semantics of the reentrancy
19:29 lizmat one would hope that the inner $lock usage would be a noop and not unlock until the outer scope is exited
19:30 colomon_ joined #perl6
19:30 moritz iirc it means you can acquire the lock a second time from within the thread it was acquired in first
19:31 moritz though note that the outer $protect only protects the call to .cue, not the inner block that's passed to .cue
19:32 hoelzro RabidGravy: ok, fair point
19:33 RabidGravy it's easy for us who know all sorts of things which aren't documented :)
19:35 colomon_ joined #perl6
19:44 hoelzro =)
19:46 yqt joined #perl6
19:49 ely-se joined #perl6
19:49 ely-se left #perl6
19:50 telex joined #perl6
19:52 hoelzro could someone working on Windows do me a favor and test Linenoise on Windows for me? I'd like to see if it works so I can propose it for inclusion into Rakudo Star
19:54 DrForr Reminds me, I need to polish off the Readline stuff.
19:57 FROGGS joined #perl6
20:02 Begi joined #perl6
20:04 Begi What's the best choice to code a website with Perl 6 ? Bailador ? Web ?
20:05 * moritz hasn't used either, but has the impression that Bailador development is more active
20:08 Begi Bailador was my favorite. Is there any documentation except GitHub for Perl 6 modules ?
20:09 RabidGravy if the author made any then p6doc Foo may work
20:09 RabidGravy (don't actually know tbh)
20:10 RabidGravy I always document my stuff as if someone will read it but I don't know how they do
20:11 DrForr perl6 -doc filename # as well I think. Maybe --doc, check the app.
20:16 zostay joined #perl6
20:16 jnthn evening, #perl6
20:16 RabidGravy erp
20:17 itz perl6 module doc is usually README.md rather than embedded pod at the moment (which is a bit unfortunate)
20:17 hoelzro I would love it if we could make docs that are generated from a file in the repo separate from the .pm file, but available via .WHY
20:17 [Coke] Thanks to all the p6 people for keeping my brain working!
20:17 hoelzro we could then do the same for Rakudo
20:18 [Coke] PERL6MANPATH
20:18 itz I have wondered if panda should install README.md and p6doc parse it
20:19 RabidGravy itz that would encourage bad
20:20 itz yeah the proper solution is proper pod
20:20 jkva joined #perl6
20:20 RabidGravy pod in the .pm files yeah, readme is just enough to sell the module and get it installed :)
20:21 * jnthn continues to be very unconvinced we'll see a resolution to the Int holding Inf thingy
20:21 jnthn In 7 years nobody has proposed anything close to a viable concrete implementation strategy
20:22 RabidGravy we need the pony man to make Pod::Coverage for p6
20:23 itz actually the http://modules.perl6.org/ icons have badges for README.md and none for POD
20:24 RabidGravy jnthn, does it stop anyone from making working software or does it just offend purists?
20:24 RabidGravy itz, probably easily fixed
20:25 [Coke] m: Inf.Int.say
20:25 camelia rakudo-moar 3e88cf: OUTPUT«Cannot coerce Inf or NaN to an Int␤  in block <unit> at /tmp/_KpHQ836Nk:1␤␤Actually thrown at:␤  in block <unit> at /tmp/_KpHQ836Nk:1␤␤»
20:25 [Coke] m: my Int $a = Inf;
20:25 camelia rakudo-moar 3e88cf: OUTPUT«Type check failed in assignment to '$a'; expected 'Int' but got 'Num'␤  in block <unit> at /tmp/WGTtI7jvVd:1␤␤»
20:25 jnthn RabidGravy: Well, it apparently causes issues 'cus of the Int.range thing, but nobody had implemented that that we'd be fine :P
20:25 jnthn *but if
20:25 jnthn That's a fairly recent addition.
20:25 RabidGravy perfect
20:26 jnthn The real problem is "what type is Inf, if not Num?"
20:26 [Coke] That's pretty much the extent of the request. I would be happy if the request was rejected and we said that Inf and NaN are just Num-my.
20:26 jnthn [Coke]: If it were up to me we'd have already done that. ;)
20:26 Hor|zon joined #perl6
20:27 [Coke] Who is it blocking on? TimToady ?
20:27 RabidGravy NaN should probably be failurely
20:27 jnthn [Coke]: Mostly I'm saying, "I'm willing to be convinced, but you need to stop waving your arms and dreaming and show me a solution that isn't a kludge I'm going to refuse to implement" :)
20:27 ShimmerFairy jnthn: the cheating option would be to make Int.range.max return NaN, since arguably there is no "max" integer, thus the maximum value is not a number (and I'd imagine not being able to store NaN in an Int is more acceptable than Inf when it comes up) :P
20:28 jnthn [Coke]: Well, TimToady++ is one person who might be able to come up with a solution, yes.
20:28 jnthn The thing that drives me nuts is solutions that act like cheating/hacks in the type system won't hurt later.
20:29 jnthn We already have Failure and Nil wanting to be special.
20:30 [Coke] Perhaps Int.range.max could return Whatever.
20:30 * jnthn points out that this isn't assignable to Int either, so won't satisfy that use case...
20:31 RabidGravy is that 'wha-ever"
20:31 [Coke] If Int.range.max needs to return something typed to an Int, we're scrod.
20:32 RabidGravy :)
20:32 [Coke] Perhaps it could return something more abstractly numeric?
20:32 ShimmerFairy jnthn: I heard a suggestion that Inf/NaN could be special values like Nil. Aside from that, atm I only see either rejecting the ticket, or some truly ugly change to the type system where e.g. NaN is the base numeric type, Inf inherits NaN, and everything else inherits Inf.
20:33 RabidGravy er
20:33 jnthn ShimmerFairy: I'm going to push back pretty hard against "magic". :P
20:33 jnthn And special values sound like magic.
20:33 * RabidGravy fetches the ducking stool
20:34 jnthn [Coke]: I'm not saying it has to, just noting that it's a pain point for somebody that it doesn't, so we might want to consider that.
20:34 ShimmerFairy jnthn: yeah, the special value makes sense in a "multiple types want this" sort of way, but I think it'd be better if we were clearer about how each type handles infinity, if at all.
20:35 RabidGravy Inf only becomes a problem in my mind if you want to know what If - 1 is
20:36 jnthn Inf :P
20:36 ShimmerFairy (I imagine one possibility is that Inf and NaN could be types that can be coerced to each numeric type's idea of infinity/non-numbers, though I guess that's suspiciously similar to "magic"/"special values" :P)
20:36 jnthn Well, that one kinda runs into the "types are constraints not coercions" (except coercion types) thing
20:37 jnthn If we *really* want to do it that way, then maybe we need to formalize type check failover somehow
20:37 jnthn Since Nil relies on failing the type check and then saying "oops...but hey, wait!"
20:38 jnthn I'm just not overly fond of such things. That one is a special case in assignment.
20:38 jnthn But not in argument passing.
20:39 ShimmerFairy I imagine Int.infinity and infinity(Int) would be easy (as well as for other numeric types), it's wanting a term for infinity and NaN that's causing us grief, since multiple types want those terms.
20:40 jnthn *nod*
20:43 RabidGravy this beginning to get like when I wen to an A level maths class on acid, you never need to evaluate inf you just don't check the upper bounds until you run out of time
20:44 ShimmerFairy jnthn: One solution might be to make Inf and NaN terms of type Num (for example), and then other numeric types would have to do  NaN.Rat  or  Inf.Int . I'm not sure how nice of a solution that would be, but it's kinda similar to having to do  DateTime.new(now) , in my mind
20:44 nine [TuxCM]: sorry, no news :/
20:45 jnthn Well, we tried this problem for 7 years without any acid, so maybe... :P
20:46 timotimo only NaN, Inf, -Inf and -0 are Num but at the same time typecheck against Int! what a smart idea!
20:47 timotimo jnthn: can i interest you in looking at my broken "lexicalref lowering" nqp branch?
20:47 timotimo it complains that the code's trying to build localrefs of obj-typed locals, it seems
20:47 jnthn ugh, that shouldn't happen
20:47 timotimo i was trying to make it not happen :)
20:47 FROGGS :D
20:48 timotimo but it also made me wonder if/why we can't support obj localrefs
20:48 timotimo i suppose obj attrrefs are a bit harder due to write barriers
20:48 timotimo but localrefs may even be possible?
20:48 jnthn Wait, nqp branch?
20:48 FROGGS ation .oO( mistakes - that should not happen )
20:48 FROGGS gah!
20:48 timotimo er, rakudo branch
20:48 RabidGravy m: say 1/0
20:48 camelia rakudo-moar 3e88cf: OUTPUT«Attempt to divide 1 by zero using div␤  in block <unit> at /tmp/tBbpfNpYqh:1␤␤Actually thrown at:␤  in block <unit> at /tmp/tBbpfNpYqh:1␤␤»
20:48 jnthn ah
20:49 timotimo i merged the nqp branch that puts the code gen in
20:49 * ShimmerFairy is certainly interested in hearing TimToady's thoughts on Inf/NaN :)
20:49 timotimo (turned out the code gen was correct all along, but the test was b0rked)
20:49 RabidGravy so you can't get Inf by evaluating an expression
20:50 timotimo I'm rather interested in getting closer to fglock's perl5-to-java translator benchmark thingie
20:51 jnthn https://github.com/rakudo/rakudo/commit/c​be2ecaf65138841c34cd2de80592db64e19ffe8#d​iff-c6d4338f0fe083856631860c53453281R655
20:52 RabidGravy so the only place you care about Inf is a limit to a range, so turn up the bounds check
20:52 jnthn are you really really sure that everything that is not lexical is lexicalref in the else?
20:52 jnthn (I mean, it probably shoudl be, but...)
20:52 timotimo oh, hm, let's see
20:53 timotimo it was very late when i wrote that code :)
20:53 timotimo but to be fair
20:53 jnthn "# Also must not lexicalref it - except if it's a native var."
20:53 jnthn That's...odd too
20:53 timotimo before i put that change in it just turned it into "local" from whatever it was
20:53 timotimo oh and also, it refers to $new_name
20:53 jnthn Any code-gen that's using lexicalref must *already* be doing it on a native var
20:53 jnthn Ohterwise the code would already not compile
20:54 jnthn So that checking seems a bit bogus
20:54 timotimo oh, new name refers to what it was before, so it doesn't get set to something else explicitly
20:54 timotimo ah, that's an interesting insight
20:54 timotimo this'll lead me further towards the solution!
20:54 timotimo thanks a lot already :)
20:55 timotimo can we get an nqp::note that desugars into nqp::sayfh(nqp::getstderr, ...)? :)
20:55 jnthn I'd find the smallest example you can and then study the QAST tree before/after the opt
20:56 jnthn nqp-m: note('I can note!')
20:56 camelia nqp-moarvm: OUTPUT«I can note!␤»
20:56 jnthn ;)
20:56 timotimo ooooh!
20:56 timotimo nice
20:57 timotimo anyway, at that point in the code - in the else cause - we actually get lexicalref, localref, and local as the scope
21:00 jnthn um....the latter two sound "interesting", that means we're re-visiting things o.O
21:02 timotimo thought so
21:02 timotimo well, yeah
21:02 timotimo if we have a Want anywhere, for example
21:03 jkva joined #perl6
21:05 timotimo we usually share the QAST subtree between the void and non-void, don't we? or at least we only visit one of the branches
21:05 timotimo something like that, anyway
21:06 jnthn We go to some effort not to re-walk that though
21:07 timotimo hm
21:08 timotimo well, i'll try to do the "simplest thing that breaks" + compare
21:08 timotimo by compiling the setting with --optimize=off
21:08 jnthn OK. Good luck! I'm going to rest up for the last day of teaching. :)
21:08 RabidGravy break all the things
21:08 jnthn 'night o/
21:09 timotimo good rest!
21:09 RabidGravy toodlepip
21:09 timotimo RabidGravy: i'm working in a branch, of course!
21:09 RabidGravy wuss
21:09 timotimo hahaha
21:09 timotimo you're cute
21:10 RabidGravy I hadn't understood a word of the previous ten minutes so you carry on ;-)
21:11 timotimo hehe
21:11 timotimo if you want, i can explain a bit of it
21:12 brrt joined #perl6
21:13 RabidGravy optimising the scope saving but I don't need to know the gory details
21:14 timotimo oh damn
21:14 timotimo This container does not reference a native integer
21:14 timotimo at src/gen/m-CORE.setting:10214  (./CORE.setting.moarvm::93)
21:14 timotimo even before it tries to optimize
21:15 timotimo i will have to --optimize=off (like i said above) rather than --optimize=0
21:17 RabidGravy I was surprised that 0 and off aren't the same BTW
21:17 timotimo 0 only does some analysis, but is supposed to not change anything
21:18 jkva joined #perl6
21:20 timotimo things are still broken, though ...
21:21 RabidGravy o/ some times things get complicated o/
21:21 dolmen joined #perl6
21:22 timotimo yeah, things tend to do that :|
21:33 raiph joined #perl6
21:40 p6-riche joined #perl6
22:00 atroxaper joined #perl6
22:23 vike joined #perl6
22:37 ugexe can i override a sub using a runtime mixin? im trying to do this with copy but get collisions problems
22:41 timotimo lexically, you can always do it; you can also wrap and later unwrap the copy sub
22:41 ugexe or maybe someone has a better suggestion... i want to override copy(*@_) for a specific class so i can modify each parameter and then redispatch to the original copy
22:43 amurf joined #perl6
22:45 ugexe my $curli = CompUnitRepo::Local::Installa​tion.new(%*CUSTOM_LIB<site>); role CP[$cwd] { &copy = sub { nextwith($^a.IO.absolute($cwd), $^b); }; }; $curli does CP[$*CWD];
22:45 ugexe m: my $curli = CompUnitRepo::Local::Installa​tion.new(%*CUSTOM_LIB<site>); role CP[$cwd] { &copy = sub { nextwith($^a.IO.absolute($cwd), $^b); }; }; $curli does CP[$*CWD];
22:45 camelia rakudo-moar 3e88cf: OUTPUT«Cannot find method 'collisions'␤  in any apply at src/gen/m-Metamodel.nqp:2633␤  in any compose at src/gen/m-Metamodel.nqp:2810␤  in any generate_mixin at src/gen/m-Metamodel.nqp:1294␤  in any  at src/gen/m-Metamodel.nqp:1215␤  in any mixin at sr…»
22:45 dalek roast: 74d1cb1 | skids++ | S06-currying/misc.t:
22:45 dalek roast: Test needs to be skipped on moar as well.
22:45 dalek roast: review: https://github.com/perl6/roast/commit/74d1cb1445
22:45 ugexe what am i overlooking regarding collisions?
22:48 RabidGravy nighty night boys and girls
22:50 timotimo maybe we want to make copy a multi in the core setting
22:53 ugexe fwiw it seems related to applying at runtime
22:53 ugexe m: my &copy = sub { $^a.say; $^b.say }; copy($*CWD,$*CWD)
22:53 camelia rakudo-moar 3e88cf: OUTPUT«"/home/camelia".IO␤"/home/camelia".IO␤»
22:55 skids joined #perl6
22:56 timotimo huh, you're trying to override a sub for inside the lexical scope of a class?
22:56 timotimo or do you want to change a method? in that case you have to go via the MOP
22:59 ugexe i want to intercept sub copy(|) inside a single method ideally, but i'd settle on lexical to the class as well
22:59 ugexe https://github.com/rakudo/rakudo/blob/nom/src​/core/CompUnitRepo/Local/Installation.pm#L134
22:59 ugexe its first argument is passed a relative path. i need to be able to pass a absolute path
23:04 timotimo can't add lexicals to a class after the fact
23:05 timotimo all you can do is wrap the copy that it uses
23:07 ugexe i suppose that works just as good for me
23:08 timotimo right
23:08 * timotimo disappears into bed
23:09 timotimo after not really having done anything for the optimizer at all
23:47 * rangerprice eating lemon

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

Perl 6 | Reference Documentation | Rakudo