Perl 6 - the future is here, just unevenly distributed

IRC log for #6macros, 2015-10-11

| Channels | #6macros index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
02:31 vendethiel joined #6macros
09:06 vendethiel joined #6macros
11:31 masak vendethiel: let me know if there's anything I can do to help with any object literal implementation.
11:32 masak I did some marginal thinking on it. I think you'll want Q::Object::Literal = Array[Q::Property], with Q::Property being abstract and having 3-or-so subtypes with different structure
14:12 FROGGS_ joined #6macros
14:33 * masak attempts to implement unquotes in 007
15:03 vendethiel joined #6macros
15:03 * vendethiel just got home
16:19 masak o/
16:50 masak I'm getting unsure about {{{identifier: id}}}. maybe I should go with {{{id: identifier}} instead?
16:50 masak that's more in line with type annotation syntax anyway.
16:51 masak in fact, maybe we should simply have {{{id: Q::Identifier}}}, and then sweep all the differences between Q types and syntactic categories under the carpet.
16:52 masak still unsure -- except if we do decide to go with Q::Identifier, it should definitely be the type last
16:52 masak {{{identifier: id}}} makes a limited amount of sense, if you pretend it's an object property or something.
16:59 vendethiel yeah
16:59 vendethiel that'd make sense... I guess
17:25 masak yeah.
17:25 masak the "Unquotes in other places" practically bags for that interpretation, to the point of asking for three things which are currently grammatical categories to also be Q types.
17:27 masak funnily, 007 still doesn't have subtyping, so we'd have to special-case the relationship between Q::Infix and (say) Q::Infix::Eq
17:30 vendethiel "bags for"?
17:30 vendethiel oh, beg
17:39 vendethiel also
17:39 vendethiel it seems the files are a bit "bloated" themselves
17:39 vendethiel my first reaction was "where is the grammar"
17:46 Ven joined #6macros
17:55 Ven joined #6macros
18:10 masak yes, begs* for -- sorry ;)
18:11 Ven joined #6macros
18:11 masak hm, are you saying there are things in Parser.pm that should not be in there? that's possible, I guess. it's easy to get blind for possible improvements like that.
18:11 Ven errr, my wifi is really bad
18:11 masak Parser.pm has ~40 lines of exceptions (used for parsing) and ~70 lines of precedence (used for parsing) before the grammar begins.
18:12 Ven >400lines files are usually a bad sign for me
18:12 masak I'm very doubtful in general to limits of that kind.
18:12 Ven I'm very doubtful in general of missing limits..:)
18:13 masak but yeah, the parser could be split up into (exceptions, precedence, grammar, actions, and parser)
18:13 masak I'll give it a try -- thanks for your input
18:13 Ven so, the object literal woudl be a term?
18:14 Ven er, how to pass -I to prove...
18:15 Ven prove -e 'perl6 -Ilib/' I guess...
18:17 masak I usually just export PERL6LIB=lib
18:17 masak but your way works too
18:17 masak yes, an object literal would be a term
18:21 Ven I should edit t/features/expr then?
18:24 masak syntax-elements.t, p'haps
18:24 Ven that's where this one is, then
18:24 masak the categories in the tests are a little bit arbitrary... :)
18:25 Ven test AST in /expr.t, and the parsing in syntax-elements? uh
18:26 masak put it anywhere you like -- objects.t would be fine, too
18:27 masak the test suite recently went through a major-ish refactor, and it hasn't found its optimal shape yet
18:27 masak pushed split-up of Parser.pm
18:27 Ven hadn't starting touching it yet, so yay
18:29 Ven huh, "grammar Syntax" is enough?
18:29 Ven the rest of it is inferred?
18:29 masak nope.
18:29 masak stomping a little bit on the "global" namespace, I guess.
18:30 masak probably should call it _007::Parser::Syntax, just like the module path.
18:30 masak hold on, let me fix that.
18:36 * Ven holds on
18:37 Ven *g*
18:37 masak pushed.
18:38 vendethiel saw it :)
18:38 Ven ty
18:39 * masak looks from Ven to vendethiel and back
18:39 vendethiel ven is laptop, but laptop's wifi is terrible...
18:40 masak Ven: got it ;)
18:40 Ven "Permission to masak/007.git denied to vendethiel." what the heck are you doing, git pull
18:40 masak ...
18:45 Ven do you want the "pair" `EXPR => EXPR` to be its own rule?
18:51 masak yes, I'm pretty sure we want that.
18:51 masak a proto rule, even
18:51 Ven heh?
18:51 masak cf statement for an example
18:51 masak or term
18:52 Ven '{a=b,c=d}' ~~ /'{' ~ '}' [$<name>=<[a..z]>+ '=' $<value>=<[a..z]>+]* % ','/;
18:52 Ven say $<name>>>.Str Z=> $<value>>>.Str
18:52 masak ':', not '='
18:52 Ven I love Perl 6.
18:53 masak do note that properties can be specified in four different ways
18:53 masak key: value
18:53 masak "key as string": value
18:53 masak keyvalue
18:53 masak keyfn() { ... }
18:54 vendethiel I was going to go 'EXPR': 'EXPR' route
18:54 vendethiel but yeah
18:54 vendethiel what's the 3rd one?
18:55 masak it's sugar for `keyvalue: keyvalue`
18:55 masak à la ES6
18:55 vendethiel ah!
18:55 vendethiel okok
18:55 vendethiel that'd be <identifier<?
18:55 vendethiel *
18:57 masak aye
18:57 Ven can I just use `rule` instead of \h* a lot? :P
18:57 Ven you don't seem to like rule
18:58 masak \h* is almost certainly wrong anyway, since newlines are fine, too
18:58 masak I confess to reaching for rule very late
18:58 masak if you manage to make rule work for you, go for it
18:58 Ven you mean in the project, or in general?
18:58 masak both ;)
18:59 Ven ok. well, let's try & see
18:59 * masak goes back to quasi unquotes
18:59 Ven hah, but moving it into a proto token means I can't go with the cool Z=> route :P
18:59 masak that wouldn't fly anyway, in the long run
19:00 Ven *g*
19:00 masak what you really want to produce is a sequence of Q::Property
19:01 Ven mmh
19:01 Ven I don't know my way around here very well, sorry :
19:01 Ven :)
19:02 masak np
19:02 Ven heh, $<a=b> is not the same as $<a>=<b>?
19:02 masak it's fun to have you try things out :)
19:02 masak I don't know
19:02 masak I don't use either syntax very much
19:02 Ven s05 says it is
19:02 masak I usually just pull things out of $/
19:03 masak see Actions.pm for loads of examples
19:03 Ven I was thinking of <EXPR> ':' <EXPR>
19:04 Ven maybe we'll want ES6-style [foo] => for computed names...
19:04 * Ven doesn't like unquoted names
19:06 masak I don't mind them. I vastly prefer them to computed names, which the issue explicitly mentions as not making the cut.
19:06 Ven why is Q::... stuff using self.bless?
19:07 Ven instead of submethod BUILD(:%elements) { }
19:07 masak to allow the .new method to take positional arguments
19:08 Ven oke
19:09 Ven aw, there's no Val::Object yet :P
19:10 masak nope; that one's all yours :)
19:10 * Ven pastes » for the tenth time
19:11 masak vim? Ctrl+K > >
19:16 Ven ctrl-k is a move command for me :)
19:16 Ven ^HJKL is
19:17 Ven keys are too far away, and I have caps lock bound to ctrl (and esc)
19:17 masak Ctrl+K is awesome. you should bind it to *something*
19:18 vendethiel it's bound to something :P
19:19 * masak scrolls down from Syntax expecting to find Actions, only to hit end-of-file :)
19:20 vendethiel so, I need to remap something to ctrl-k, is that true?
19:22 masak digraphs. don't care what key you map it to
19:23 * masak has an unquote parsing now, and failing at runtime
19:25 vendethiel heh; I can't get it to work.
19:25 vendethiel sigh.
19:26 vendethiel Ctrl-u is no good? okay.
19:26 Ven joined #6macros
19:26 vendethiel ok, C-Y works...
19:31 masak so... let's see. eval'ing a Q::Quasi should clone the whole underlying AST, then traverse the copy and replace all the unquotes with the Qtree they resolve to...
19:31 Ven I'm not sure why you space ($/) when defining a method
19:31 Ven but not the others?
19:32 masak there's a reason
19:32 Ven oh yeha
19:32 Ven I remember it now
19:32 Ven the :foo that parses as one term
19:33 masak aye
19:33 Ven fair enough
19:35 Ven how do you get that ast thing, though?
19:36 masak see Actions.pm for plenty of working examples?
19:36 vendethiel you mean Q?
19:37 vendethiel I edited some bits already, guess I have some other stuff to check out
19:38 masak hm, maybe I misunderstood your question.
19:38 masak "that ast thing" is indeed Q
19:38 Ven uh, I'm stupid. I didn't paste the bit... I meant the sexpr thing... -_-
19:38 Ven oh, it's a Test thing
19:41 masak yes
19:42 masak quick-and-dirty way to specify Qtrees in the tests
19:42 masak if Perl 6 had better slangs, I'd do it as a slang
19:43 masak dessert and TV episode with kathyz &
19:43 vendethiel have fun, kathyz
19:51 Ven WOOOHOOO
19:51 Ven parsing empty object works /o/
19:54 Ven heh, but "(object)" makes it wrong... wut
20:07 masak \o/
20:08 vendethiel thing is
20:08 vendethiel I can't get "(property (str "a") (int 5))" to parse it seems
20:13 vendethiel er, rather, ({"a": "b"})
20:14 vendethiel oh
20:14 vendethiel it's because "<foo=x:y>" doesn't work
20:21 vendethiel nope, I can't get it to parse "inner" stuff
20:22 Ven joined #6macros
20:27 Ven heh, even ({}) won't parse here..??? wtf
20:28 Ven ooh o
20:35 Ven perl6 -e 'use _007; _007.parser.parse('\''my a = 1; ({"a": 1})'\'', runtime => _007.runtime).perl.say'
20:35 Ven that works here
20:35 Ven but I can't seem to manage to write a test for it.
20:36 vendethiel -_- this internet connection is severely pissing me off
20:38 vendethiel aaah, but it's Test's parse that's failing...
20:40 Ven joined #6macros
20:43 Ven why am I so dumb
20:43 Ven sigh :(
20:44 Ven ok 1 - {}
20:44 Ven ok 2 - {"a": 1}
20:44 Ven ok 3 - {a}
20:44 Ven 1..3
20:46 masak \o/
20:48 * masak is back, and coding his unquote stuff
20:49 vendethiel I'm gonna go to sleep
20:49 vendethiel trying to push what I got for now
20:49 vendethiel bits and pieces
20:49 vendethiel if my goddamned internet wants me to, at least
20:49 masak got a URL for me to look at and review?
20:49 masak or can I guess based on user name and repo name? :P
20:49 vendethiel I forked your repo and created a branch objliteral
20:50 vendethiel but I can't push
20:50 masak oki
20:50 vendethiel okay, it went through the fifth time.
20:50 Ven joined #6macros
20:51 vendethiel well, at least I'm getting fiber in the week
20:51 vendethiel opened a PR to make it easier
20:51 masak great
20:51 masak was gonna suggest that :)
20:52 masak squee, a PR!
20:54 vendethiel *g*
20:54 vendethiel havn't had one of those in many, many moons myself. 2 years maybe?
20:58 masak ok 3 - very basic unquote
20:58 masak \o/
20:58 * masak does the necessary refactor before committing
20:59 vendethiel amazing.good night, on that note :-)
20:59 vendethiel my head hurts, it's not looking good for tomorrow
20:59 masak oki
21:00 masak I will have a look at your PR :)
21:28 masak vendethiel: lookin' good.
21:29 masak vendethiel: the rest of the code base uses `.ast`, not `.made`
21:29 masak note going to reject a PR solely based on that, but I might change it later just to be consistent.
21:30 masak also, hadn't struck me that one might actually get away with just one Q::Property type. but now that I think about it, that should be fine.
21:31 masak the $.key attribute will sometimes be a Q::Literal::Str and sometimes a Q::Identifier, that's all

| Channels | #6macros index | Today | | Search | Google Search | Plain-Text | summary