Perl 6 - the future is here, just unevenly distributed

IRC log for #6macros, 2015-08-31

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

All times shown according to UTC.

Time Nick Message
01:20 vendethiel joined #6macros
01:41 cgfbee joined #6macros
06:28 FROGGS joined #6macros
07:31 Ven joined #6macros
07:42 Ven joined #6macros
07:47 Ven joined #6macros
09:26 Ven joined #6macros
10:07 Ven joined #6macros
11:43 Ven joined #6macros
13:19 Ven joined #6macros
13:57 masak FROGGS: hi. vendethiel invited you to this channel because the two of you had discussed macros, and it might be useful to share things here.
13:57 masak current status: I'm still learning about macros. I have a pretty good sense of what it is we want in Perl 6 at this point, but there is precious little in the form of mechanisms.
13:59 FROGGS and I have problems groking the scope of macros and/or slangs, and how they should play together in case they should play together at all
14:00 FROGGS so, maybe it would help me if I had usecases mapped to (pseudo)code, so I can image how a problem might be solved eventually
14:00 FROGGS the implementation is then just a matter of details me thinks
14:01 masak ok, so
14:01 Ven I should've be writing things down when you were talking
14:01 masak looking simply at popular demand, people want to build-auto+generate program fragments using macros
14:01 masak auto-generate*
14:02 masak the top three is probably (a) methods, (b) subs, (c) classes
14:02 masak but I've also seen people wanting to construct given/when statements using a macro
14:02 masak it would be good to have stories for those
14:07 FROGGS okay...
14:07 FROGGS you know the one use case I provided...
14:08 masak yes
14:08 FROGGS say there is a sub declared foo_i64, and I want to have a macro call('i64') that will expand the subname
14:09 FROGGS now this is just a string and seems simple
14:09 FROGGS but if the call() surrounds a bigger code block, who parses it?
14:09 FROGGS s/who/what/
14:10 FROGGS because Perl 6 cant parse stuff like i64 and pretend it will expand to a subroutine name, it will blow up instead because we do one pass parsing
14:10 FROGGS so my issue is that I don't know how the usage of macros will *look* like
14:10 FROGGS to then abstract what it means implementation wise
14:11 masak I've been thinking about exactly that bit lately
14:11 masak there are two ends to it, so to speak
14:12 masak on the caller end, you're absolutely right -- writing it without the string quotes is problematic because we're passing in something we want to define but there's no "signal" that says we are.
14:12 masak so barring 'is parsed', we have to do something like the string quotes
14:13 masak on the callee end, I think we want something like a "symbol type" which can go in a slot like `class {{{$symbol}}}` or `sub {{{$symbol}}}`
14:13 masak passing in a string feels odd, but wrapping it in a symbol to say "this is something I want to declare here" feels about right
14:14 masak and there's prior art
14:16 masak beyond that, with the sub there's just the minor technical limitation that `quasi { sub foo { ... } }` defines a sub &foo *inside the quasi block*, which then gets spliced into mainline, but it's still just a lexical sub inside a block, so its scope/lifetime is pretty useless
14:17 masak if I were to express it, it's almost as if we want sub declarations to be unhygienic by default.
14:17 masak except I don't know if that's what we want.
14:18 FROGGS hmmm
14:20 FROGGS I think I understand
14:21 masak consider the above a kind of snapshot of my thinking right now... :)
14:22 masak it's all the obstacles I see to have your use case
14:22 masak by the way, chances are 007 will implement your use case before Rakudo does
14:25 FROGGS after fiddling with CompUnitRepos (which is what I'm doing now), I want to hook into slangs again
14:26 FROGGS which might let us play with macroish stuff too
15:04 masak aye
15:05 masak I think the macro story and the slang story should at least acknowledge each other, even if they end up being different-ish
15:06 masak from my perspective, just as a class is a group of subs that formed a hippie commune and a grammar is a group of regexes that formed a terrorist cell, a slang is a group of macros that formed a monastery.
15:26 masak ...kind of.
15:38 FROGGS I can live with that :o)
15:38 FROGGS bbiab
15:52 Ven joined #6macros
16:27 vendethiel joined #6macros
17:20 FROGGS joined #6macros

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