Perl 6 - the future is here, just unevenly distributed

IRC log for #6macros, 2017-07-14

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

All times shown according to UTC.

Time Nick Message
04:50 vendethiel joined #6macros
05:51 vendethiel- joined #6macros
10:09 vendethiel joined #6macros
18:34 * masak only now spotted ven's 28 jun reference to a paper in the backlog
19:21 Ven joined #6macros
19:22 Guest69722 o/
19:23 Guest69722 I just got to work a tiny bit on my perl-lisp, and I realized something that should've been obvious a long time ago...
19:23 Ven`` much better.
19:24 Ven`` So, I added a test for "a macro returning a macro"
19:24 Ven`` and it finally dawned on me that, I believe, we got something wrong WRT "how perl6/007 is special in regards to scope"
19:25 Ven`` People have said (me included) "it's weird that I can write `my $x; quasi { $x }` "
19:25 Ven`` It took me to write macro expansion "by hand" to realize that, actually, lisp also had that.
19:26 Ven`` It's just that, since we usually keep using semiquotation, we need to think about the scope level of whatever term we're looking at. But if you write something using nested lists, then the scope is much clearer.
19:27 Ven`` what made me realize this is https://github.com/vendethiel/simplist/commit/ad4b8d574097b3ca89cca483123fb18ca5733475
19:27 Ven`` if I'm just generating macros using `list` and as many `quote`/`'` as needed, circumventing semiquotation completly, then what Perl 6/007 does actually makes a lot of sense.
19:27 Ven`` (it's surprising Perl 6 "mixes" them, still)
19:29 Ven`` masak: Also – totally unrelated to the previous lines – I'd like to get some time to discuss the case of "inside out macros". I mean, macros that change code around them, like `each` other several other
19:31 Ven`` Also, <( )>
19:32 Ven`` >>Also it reminds me a bit of Common Lisp's prog1.
19:32 Ven`` >Yes, clearly reminiscent. I see prog1 is a macro, too. Main difference is here we manually pick out any subexpression, not just the first one.
19:33 Ven`` I'm gonna say something that'll probably look insane, but it reminds me a bit of "call with current continuation"
19:34 masak :)
19:34 masak I'd be happy to discuss the case of inside-out macros
19:34 Ven`` In Lisp, you could write a code walker that'd parse the tree, until it finds a call to <>. It uses that as a topic to prog1, evaluates the rest with that expression replaced in
19:34 Ven`` hi masak :)
19:34 masak I guess you saw my comment defending them (ish)
19:34 Ven`` yup
19:34 masak ok
19:35 masak also, I'm happy about my idea to put macros inside `inside` rather than the other way around
19:35 Ven`` sorry? I'm a bit tired, and that flew totally past my head
19:35 masak ah; I'll link you
19:36 masak https://github.com/masak/007/issues/158#issuecomment-314329631
19:37 Ven`` I totally missed that somehow, but to give myself an excuse, I was still at PolyConf
19:37 masak :)
19:37 masak how was PolyConf?
19:38 Ven`` It was pretty amazing. All the speakers were great! I was staff so I could talk with all the speakers right before/after talk :-)
19:38 Ven`` Also had the opportunity to do a very quick lightning talk on Perl 6 :P
19:38 masak \o/
19:38 Ven`` I need to find an online interpreter for CL...
19:38 Ven`` Ideone isn't a very good one
19:39 masak wish I could help
19:42 masak anyway, super-happy to hear that Perl 6/007 quasiquotation makes more sense for you (or anyone) :)
19:43 Ven`` \o/
19:44 Ven`` .oO( you can understand just about anything by nesting macros enough times )
19:46 Ven`` urgh, of course, mutation is never quite that easy ._.
19:48 masak I have a still-unsubmitted 007 issue that starts out complaining about macro-ish operators having their implementation out in Q.pm rather than Runtime/Builtins.pm...
19:49 masak ...and then ends up asking which one should be primary, a 007 macro definition or its underlying Qnode
19:50 Ven`` OK, basically my idea was: traverse the macro body, find <>. Remplace with a gensymmed symbol. prog1 on that gensymmed symbol
19:50 Ven`` But this needs defining a setf-expander for that gensym >_>
19:51 masak I get the first thing you said; not the second :)
19:51 Ven`` ooor we could consider you're not allowed to write `my x = foo(<(a)>++)`
19:51 masak ah, you're talking about lvalues?
19:51 Ven`` yes
19:52 Ven`` well, the issue right now is that if you write `(prog<> (incf (<> a)))` it gets translated to `(let ((GENSYM a)) (incf GENSYM) a)`
19:52 Ven`` *boom*
19:52 masak I think we could disallow that, because that's not what <( )> is for
19:52 Ven`` nice.
19:53 masak have you read about the plans for an "assignment protocol"?
19:53 Ven`` I've posted a good chunk of the comments there :P
19:53 Ven`` wrt #158, I'm just too tired right now to comprehend I think
19:53 masak 'k, no problem
19:54 masak oh right, you commented about setf in #214
19:54 Ven`` Yeah, I wrote a lenghty comparison
19:54 Ven`` lengthy
19:58 masak re-reading it now
20:02 masak I guess my question is -- what do you think of the Location type as laid out in the original post of #214?
20:03 Ven`` it's a bit... weird
20:04 Ven`` it's like adding methods to every single object in existence
20:04 masak from my perspective, Location is mostly the compiler's way to hand over just enough power to the macro author to assign to a "slot"
20:07 masak not sure why it would be like adding methods to every single object in existence -- note that you still have to deliberately construct a Location through the `lvalue()` function
20:08 masak ...which can refuse, if it gets something that's not l-valuable
20:13 Ven`` Ah!
20:13 Ven`` My bad, I read that incorrectly.
20:13 Ven`` Ok, I think I'm done writing my <>
20:14 masak hm, correction: `lvalue()` -- then things go through a {{{ }}} -- then out comes a Location
20:14 Ven`` masak: please tell me if that's legible. https://gist.github.com/vendethiel/c46fbc58d881d346c8eb0270eb1d8b3e
20:14 * masak looks
20:14 Ven`` (you probably want to skip to the end, to start with)
20:15 masak ah, cute
20:15 masak I understand the effect; now for the implementation
20:15 Ven`` er, whoops
20:16 masak yeah, more or less
20:16 Ven`` i messed up, I had that <> for naught
20:18 Ven`` okay, updated
20:18 Ven`` anyway, yeah. here: explicit <()> boundary
20:18 Ven`` I didn't actually name it <()>, but why not
20:19 masak and yes, I do see how it reminds you of call/cc
20:19 Ven`` masak: I find it a bit surprising that the lvalue shall be called inside the macro "level" (inside {{{) but the .modify is called in the actual quasi
20:19 Ven`` I know it makes sense, it's just a bit surprising
20:19 Ven`` ah!
20:19 Ven`` so I'm not insane. great :P
20:19 masak despite the fact that if someone asked me to cleanroom an implementation of call/cc, I couldn't do it
20:19 masak :)
20:20 Ven`` fairly sure i couldn't either. to be honest, I reread articles on call/cc every year or so to remind myself the semantics
20:20 Ven`` I wouldn't remember them otherwise
20:20 masak re the {{{lvalue(ast)}}}.modify decision: what I'm trying to make sure is that the assignment API basically isn't useful except through quasi unquoting
20:20 Ven`` are you afraid of another `melt`, or..?
20:21 masak yeah, something like that
20:21 masak I don't want people to be able to mess with stuff outside of macros/quasis
20:22 Ven joined #6macros
20:22 * masak pretends there was tons of backlog
20:23 masak "...and that's why I've decided to go with textual macros instead"
20:40 Ven_ joined #6macros
20:40 Ven_ masak: Sorry. I'm just tethering internet from my phone and it's a bit flaky
20:41 masak :)
20:42 masak going to bed soon here. nice discussin' with you this fine evening.
20:42 Ven_ Aye! It'd been too long :p.
22:02 Ven joined #6macros

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