Camelia, the Perl 6 bug

IRC log for #perl6, 2012-09-03

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | plain, newest first | full mode

All times shown according to UTC.

Time S Nick Message
00:08 TimToady the basic problem is that P5 is too closely attached to its stack model; this is also the problem with XS
02:39 sirrobert How can I delete a method from a class at runtime?  (opposite of .^add_method)
02:40 sirrobert really I want to *replace* a method, but I can't use add_method if one already exists
02:49 sirrobert I am trying to add to a grammar during runtime
02:49 sorear if you want to radically change the accepted methods at runtime you probably should be using a fallback instead
02:49 benabik Why not just use inheritance?
02:50 sirrobert so every time a new rule is added (maybe a few dozen times), just create a new grammar, inherit from the current "head" grammar
02:50 sorear sirrobert: 1. STD uses inheritance to dynamically alter the grammar 2. this is what protoregexes are for!
02:56 colomon sirrobert: rumor had it you're doing p6 stuff for $work, can you talk about it?
02:57 * colomon is planning on starting a p6 http://en.wikipedia.org/wiki/ISO_10303-21 parser soon for $work, biggest hurdle at the moment is figuring out what to name the github repo / p6 module.
02:58 sirrobert my partner had done a PhD dissertation and got his degree for the invention we're commercializing
02:58 sirrobert but it was written in crazy shell scripts and stuff... a university research environment
02:58 sirrobert so we ported it to ruby
02:58 sirrobert (for the grant), and made it all conceptually solid and what not
02:59 sirrobert more powerful, broader concept.  bigger platform (in the "Big Data" space)
02:59 sirrobert "advanced analytics" type stuff
02:59 sirrobert now we're using a LISP and P6
03:00 colomon quite a combination!
03:00 sirrobert we're having fun =)
03:00 sirrobert it was cool though that our LOC dropped amazingly
03:02 sirrobert So, LISP trades semantic complexity for syntactic simplicity
03:02 sirrobert I realized that P6 does the reverse
03:03 sirrobert so when we wanted to represent real-world concepts (in a way that's accessible to end users), P6 is GREAT for modelling that
03:03 sirrobert LISP is great for modeling more "idealized" concepts
03:03 sirrobert (no one wants a LISP API)
03:03 sirrobert anyway, I've really had almost no trouble with P6
03:04 sirrobert the hardest thing is the lack of docs... there's so much syntax
06:06 dalek ecosystem: added XML::Parser::Tiny
08:02 Timbus whats the main reason for val's behaviour? like keeping whitespace around a number
08:06 masak like, val() provides you with two views of the object: the intended (often numeric) value, and the original string.
08:11 masak yes, because everything comes in as strings, but not everything is intended as strings.
08:26 tadzik masak: did you see http://feather.perl6.nl/~sergot/modules/?
08:29 jnthn tadzik: ooh :)
08:29 tadzik jnthn: did you see http://feather.perl6.nl/~sergot/modules/? {_
09:16 masak sirrobert: protoregexes. for a long time, I thought they were this fairly magical thing in grammars. but they're quite easy.
09:16 masak sirrobert: they're a nice way to make an open set of alternative ways to parse the same thing.
09:17 masak sirrobert: like, consider "term". it is a protoregex in the Perl 6 grammar. if you specified "term" as a single rule, it would one big honking alternation of things that can be terms in Perl 6.
09:19 masak sirrobert: but with protoregexes, you say "proto token term {*}", and then you can specify all the alternatives individually after that.
09:19 masak like, "token term:value", and "token term:colonpair".
09:19 masak and it's an open-ended set, so inheriting grammars can easily add to that.
09:20 masak and the LTM treats each of these alternatives as part of one big alternation, and builds efficient NFAs based on that.
09:21 jnthn The NFAs look very much like the NFAs an alternation gives too :)
09:23 masak well, because protoregexes are essentially alternations lifted to the rule level.
09:23 masak there's a shudder-inducingly nice strange consistency there between proto methods and proto regexes.
09:24 masak it's just that a "method call" to a rule involves matching text using the LTM.
09:26 jnthn .oO( it was shudder-incuding 'cus I had to redo multi dispatch... )
09:27 jnthn masak: I had to redo multiple dispatch because the meaning of proto changed to look more like what proto means in regexes
09:30 masak I hardly remember what proto usedta mean by now. but I remember liking the change.
09:31 jnthn Most people like it overall, I think. Only the change of meaning of .+ and .* was not always liked.
09:45 mathw hello awesome people
09:45 mathw especially awesome Sir jnthn of the Debugger.
09:45 jnthn mathw: You tried it?
09:51 mathw it made colours :)
09:53 jnthn After I first demo'd it at YAPC, somebody told me afterwards they thought I had to be faking the demos. :D
11:10 GlitchMr https://gist.github.com/3608610
11:11 GlitchMr Am I doing something wrongly?
11:12 Timbus you're making the same mistakes i made.
11:18 FROGGS try that: https://gist.github.com/3608624
11:20 GlitchMr Works
11:20 FROGGS cool
11:21 GlitchMr 13:21:40   @GlitchMr | 66, add camelia »ö«
11:21 GlitchMr 13:21:44   @GlitchMr | 66, camelia
11:21 GlitchMr 13:21:44 SixtySixBot | GlitchMr: »ö«
11:21 GlitchMr Good
12:25 * moritz at his first day at $new_work
12:26 moritz perl 5 programming
14:11 estrai hi, I heard some rumors about plans to put Perl6 on JVM, is there any truth in that, if yes is there a space that has more details?
14:12 masak estrai: (yes, there are plans to make Rakudo target multiple VMs.)
14:13 estrai masak: my source is someone who went to YAPC
14:13 masak estrai: ok. yes, that was discussed at YAPC::Europe.
14:29 masak estrai: well, here's what's going on. Rakudo has needed to be prepared for other VMs. part of that has been removing (Parrot-specific) PIR from the project. if I'm not mistaken, the last big bit was removed with the last branch, toqast, on Rakudo.
14:30 masak but these are just the last refactors in a long line of refactors leading up to being positioned for VM independence.
14:31 masak I'm less clear what needs to be done now, beyond "port nqp to another VM".
14:31 [Coke] Didn't toqast in nqp just land this weekend?
14:32 gfldex Merge latest master into toqast.  jnthn authored 2 days ago
14:35 estrai that's really nice, thanks alot for the info
14:58 * masak idly wonders if work has been done to automatically derive a grammar from a sufficiently well-specified class hierarchy with .Str methods
15:00 timotimo do i misunderstand something here? wouldn't that require .Str to be essentially a reversible function?
15:01 arnsholt masak: What are you thinking of?
15:02 arnsholt This may or may not be related to my academic speciality =)
15:08 masak arnsholt: having, say, an XML grammar be deduced from the class hierarchy of Element, Attribute, ProcessingInstruction, etc, and the way they can contain each other and serialize into XML.
15:09 masak arnsholt: that is, directly using the fact that XML parsing and XML serialization are (or should be) inverse operations.
15:29 * colomon is off on a new project for $work: https://github.com/colomon/perl6-ISO_10303-21
15:38 MikeFair I'd like to do something like: say("$/") in a rule to find out what got passed into it.  What can I do inside the regex to make that happen?  I read somewhere that $/ isn't valid in the middle of the match and my attempts have so far yielded nothing but an empty string (despite that there is a match string it is operatng on).  I'm just having a really hard time getting this expression right (and it seems like it should be so
15:38 MikeFair easy!)
15:39 moritz { say "$/" }
15:39 moritz should work inside a rule
15:39 moritz that shows how much has been matched until that point
15:40 colomon MikeFair: have you looked into the grammar debugger?
15:40 MikeFair moritz: Yeah I thought that was it, that's yielding blank for me (this is also parrot's compiler toolkit, so it's NQP)
15:40 moritz MikeFair: well, works in rakudo :-)
15:42 ponbiki joined #perl6
15:43 colomon MikeFair: yeah, I'm sure the debugger doesn't work in NQP.
15:46 dalek std: 0c2b471 | larry++ | viv:
15:46 dalek std: allow variables for /$start ~ $stop <thing>/
15:46 dalek std: 6b2f25b | larry++ | CursorBase.pmc:
15:46 dalek std: support <hexdigit>
15:46 dalek std: e191c3c | larry++ | STD_P5.pm6:
15:46 dalek std: more cclass and tr cleanup; parse \xffabc right
15:48 masak it's nice to see development on STD_P5.pm6. TimToady++
16:00 arnsholt masak: Right. Well, if all you have are the Str methods, you're sort of into run-time properties of code without running it land
16:00 arnsholt (And the associated theorem whose name I keep forgetting)
16:02 arnsholt An active research field in NLP is inducing a grammar for a language solely from running text, but that's different =)
16:25 arnsholt masak: Rice's theorem
16:34 dalek roast: 1312772 | larry++ | S32-list/sort.t:
16:34 dalek roast: can't use placeholders in a hash subscript
16:43 masak the value of function is "partial function", which means that the domain is too big so the function doesn't map all its values.
16:44 masak the value of property is "all non-trivial properties". where trivial is defined as "holds for all partial computable functions, or for none". I don't know exactly what that means.
16:44 masak but that makes it sound like the trivial properties aren't very interesting, and so all the interesting properties fall victim to Rice.
17:17 dalek std: e3d3982 | larry++ | / (2 files):
17:17 dalek std: correctly parse currently defined exceptions
17:51 rindolf I watched the "Perl 6 Benchmarks/Optimization" talk by pmichaud on YouTube. It was nice.
17:51 rindolf Pretty impressive work on optimisations.
17:53 dalek roast: 5397065 | larry++ | S10-packages/basic.t:
17:53 dalek roast: prefer 'can' over [can]
17:53 dalek roast: e6ba01a | larry++ | S (8 files):
17:53 dalek roast: remove sigils from | and \
18:00 pmichaud ...what's with all of the "Perl 6 is out" tweets, I wonder?
18:00 pmichaud http://twitter.com/bufferzone/[…]42647696144470016  # example
18:00 leont blame reddit
18:00 leont No, it was HN
18:01 diakopter oh dear
18:01 GlitchMr It isn't out
18:02 diakopter not in the sense they think, I'm sure
18:03 GlitchMr But why they suddenly started to say "Perl 6 is out"
18:03 pmichaud yeah, that is what is a little weird... why *this release* to start saying "oh, Perl 6 is out!"
18:04 diakopter http://news.ycombinator.com/item?id=4469513
18:04 GlitchMr "a useful and usable distribution of Perl 6"
18:04 pmichaud anyway, I think I'm actually happy with the tweets.  Maybe it'll start to counteract the "Perl 6 is vaporware" meme  :-)
18:05 GlitchMr "The title of this submission is in fact totally wrong. Rakudo has quarterly releases. Perl 6 is not finished."
18:05 GlitchMr Aren't they monthly?
18:06 leont Star is quarterly, right?
18:06 pmichaud it's monthly now
18:07 pmichaud we'll go back to quarterly in 2013, likely.
18:08 * leont hopes someone will package it for ubuntu/debian, or makes it easy to build that debian package
18:09 pmichaud it's already packaged
18:10 pmichaud we time releases based on development momentum
18:10 pmichaud right now there are a lot of improvements occurring monthly, so we release monthly.  If there's less improvement taking place, we'll release quarterly.
18:11 leont pmichaud: there where are the .debs?
18:12 pmichaud https://launchpad.net/ubuntu/+source/rakudo
18:12 leont Those are ancient and older :-/
18:13 pmichaud we've talked about publishing our own .debs, yes.
18:13 pmichaud it's a bit tricky, though, because we'd have to publish parrot .debs also
18:15 GlitchMr Well, Ubuntu is supposed to be stable
18:15 GlitchMr So it includes outdated Perl 6
18:15 pmichaud and outdated parrot :)
18:15 GlitchMr Ubuntu also includes Perl 5.14.2. Not that it matters, it's still supported.
18:16 GlitchMr Perhaps I could make ppa with up-to-date Rakudo, but I don't know
18:16 leont Yeah, I'd love a ppa
18:17 GlitchMr Then I will try learning how to make ppa and make one :)
18:20 phenny TimToady: 17:37Z <diakopter> ask TimToady what results when you request a value of a key that doesn't exist in a hash that stores native ints?
18:20 TimToady rn: $/ := 42;
18:20 p6eval niecza v21-1-ga8aa70b:  ( no output )
18:20 p6eval ..rakudo 962b9b: OUTPUT«===SORRY!===␤Cannot use bind operator with this left-hand side␤at /tmp/ETDtUr1cLN:1␤»
18:20 TimToady rn: ($/) = 42;
18:20 p6eval rakudo 962b9b:  ( no output )
18:20 p6eval ..niecza v21-1-ga8aa70b: OUTPUT«Unhandled exception: Writing to readonly scalar␤  at /tmp/23UDmnSYaT line 1 (mainline @ 2) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4138 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4139 (module-CORE @ 571) ␤  at /home/p6eval/niecza/lib…
18:21 TimToady r and n still have very different ideas of what $/ is
18:21 frettled TimToady: which one is closest to having the right idea?
18:22 TimToady not sure
18:23 TimToady diakopter: you get a fail (note that failures are allowed to violate return type constraints)
18:26 diakopter TimToady: so for a hash that's trying to conserve space, the implementation needs to return the value and also mark a success flag, so the language can return the fail as appropriate?
18:29 pmichaud r: $/ := 42;    # seems to me this should be allowed by rakudo
18:29 pmichaud I don't know why Rakudo disallows that.
18:33 moritz aye
18:57 dalek roast: 89f0409 | larry++ | S (23 files):
18:57 dalek roast: warning suppression, mostly "not used"
19:33 dalek std: 9f91d53 | larry++ | / (3 files):
19:33 dalek std: oops, that should be xdigit, not hexdigit
20:09 diakopter I didn't see a Perl 6 Report in the last few days: http://blogs.perl.org/users/perl_6_reports/
20:12 sorear that's been commented yesterday
21:10 FROGGS_ r: my $thing = ( sub( $a ){ ... } ); $thing.(7)
21:10 p6eval rakudo 962b9b: OUTPUT«===SORRY!===␤Variable $a is not declared␤at /tmp/ZXLAojGplz:1␤»
21:11 jnthn you need a space after the word sub
21:11 FROGGS_ r: my $thing = ( sub ( $a ){ ... } ); $thing.(7)
21:12 jnthn Otherwise it interprets it as a function call
21:54 TimToady note that 'andthen' and 'orelse' have complementary topicalizing behavior as well, that is supposed to make it easy to write backtrackcing engines using lazy lists like STD does
21:55 lizmat "Returns the first undefined argument, or else the last argument. Short-circuits."
21:56 TimToady that much is true
21:56 TimToady but it also sets $! to the undefined left side when evaluating the right side
21:56 lizmat so "infix orelse" is *not* the same as "infix //"
21:57 TimToady it has additional behavior
21:57 TimToady so does 'andthen'
21:57 TimToady 'orelse' is not the same as p5's 'dor'
21:59 lizmat but infix // is the same as p5's // ?
21:59 TimToady yes
21:59 TimToady (except for where p6 defined definedness differently)
21:59 TimToady refs are always true in p5, and that's not so in p6
22:03 dalek doc: 8759962 | (Elizabeth Mattijsen)++ | lib/operators.pod:
22:03 dalek doc: Fixed copy/paste error in infix orelse documentation
22:05 sorear would appear that the $! topicalization is not currently implemented by anyone
22:05 TimToady nobody actually implements that part yet
22:07 TimToady it's not actually as important as having 'andthen' topicalize $_, I think, since one is usually more interested in adding successful constraints than unsuccessful ones
22:07 TimToady if STD is any indication, failure just implies backtracking, and you're not usually interested in why it failed
22:07 TimToady in regex terms, || doesn't usually care why the left side didn't match
22:10 TimToady if you look at the P5 output of STD, there are more than 1000 instances of 'my $C=shift;', generally used to pass in the last candidate (or candidates, if it's a lazy list)
22:11 TimToady those are what are supposed to be replaced by the topicilization of 'andthen'
22:12 TimToady those are candidate cursors in the case of STD, but they can be any backtracking choice points
22:13 TimToady that's how we're trying to get P6 close to the notion of logic programming
22:13 TimToady it's most of what you need to write a unification engine, I think
22:16 TimToady just need something resembling junction processing to handle all the threading through binding unbound parameter slots
22:18 diakopter TimToady: does Perl 6 throw an exception if an array or hash is modified by another thread while being iterated? or what?
22:20 TimToady we're looking at a single-owner mechanism that might catch that, and perhaps implement rw/readonly params as well
22:20 TimToady it would imply every write operation has to check ownership though
22:21 TimToady but reads would be free for the non-owner
22:21 TimToady one could implement an exclusive iterator that claims ownership under that view
22:21 TimToady but we'd rather push things toward immutable semantics by default
22:22 TimToady and some things will always just be erroneous, I suspect
22:22 TimToady talked about it at YAPC::EU
22:23 TimToady or maybe it was in Perl, don't remmeber
22:25 diakopter so.. describe what you're leaning towards
22:26 diakopter iterators take read locks and a writer waits for a write lock?
22:26 diakopter iterators take read locks and a writer fails on writing?
22:27 diakopter a 2nd iterator blocks until the first is done?
22:29 diakopter I guess I need "a single-owner mechanism that might catch that, and perhaps implement rw/readonly params" explained more
22:32 TimToady well, for scalar access, it's simply the owner can write, and anyone else can read (assuming these operations are fast and appear to be atomic)
22:33 TimToady there is more than one model of composite behavior however
22:34 TimToady you can have transactionally protected iterators that have "snapshot" semantics
22:35 TimToady or you can just say "it's erroneous to modify something that people are iterating through, if that results in inconsistent data"
22:36 diakopter where inconsistent data would mean not seeing one of the keys available at the start of the iteration, or seeing a key twice
22:36 TimToady under the single-owner model, you'd handle the transactions by having the transaction manager be the owner for enough of the time to direct traffic
22:37 diakopter if the hash implementation can handle it, can concurrent iterations/writes be allowed?
22:37 TimToady or just violating some constraint
22:37 TimToady "all these things need to add up to 42"
22:38 TimToady presumably
22:39 diakopter ok; I'll assume the same for the array
22:39 TimToady but Perl's hash semantics don't guarantee that
22:39 TimToady (currently)
22:41 TimToady one could also set up some kind of generational hash, where an iterator knows which generation it's iteerating and ignores new values
22:41 TimToady and deleted values don't get GC'd until nobody is interested in that generation anymore
22:42 leont A lock-free hash? I'm not sure it'd be possible, but would more strongly doubt it's performance
22:42 TimToady but there are external things that look Associative that we may have difficult enforcing transcational support for
22:43 leont No common architecture has stuff instructions like DWCAS that are necessary to do interesting things in a sane yet lock-free way
22:43 TimToady so I'm not sure Associative should imly that by default
22:43 TimToady and some of these things may be hard on some VMs
22:44 diakopter this looks interesting: http://www.cs.rice.edu/~javapl[…]ckingHashMap.html
22:44 TimToady but I do like the owner model, if only because it resembles a capabilities model rather than a prohibitions model
22:45 * leont doesn't like the owner model, TBH
22:46 * TimToady dislikes the idea of using proxies to prevent writing
22:46 TimToady when most processing involves reading rather than writing
22:47 TimToady writes violate immutability, so writes should bear the overhead, not reads
22:48 TimToady it's also nicely transitive; if you aren't the owner, you can't give away ownership either
22:49 TimToady so if we use such a model for parameters, a readonly parameter that you pass down to another routine is still readonly without any extra effort
22:55 TimToady and the owner model accounts for the large majority of bindings being readonly without regard to whether the caller has ownership
22:56 TimToady and the default for a readonly binding is to do nothing (other than making sure things are set up that the caller has a different id from the callee)
22:57 TimToady and multiple writers can still be handled with proxies that send requests to the actual owner for serialization
23:23 dalek perl6-roast-data: today
23:23 dalek perl6-roast-data: review: https://github.com/coke/perl6-[…]commit/fca7b5fb3b

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | plain, newest first | full mode

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs