Perl 6 - the future is here, just unevenly distributed

IRC log for #6macros, 2015-03-29

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

All times shown according to UTC.

Time Nick Message
04:32 vendethiel joined #6macros
05:52 vendethiel joined #6macros
06:44 vendethiel joined #6macros
07:18 vendethiel joined #6macros
08:16 vendethiel joined #6macros
09:15 vendethiel joined #6macros
11:50 vendethiel joined #6macros
12:47 vendethiel joined #6macros
15:15 vendethiel joined #6macros
17:33 vendethiel joined #6macros
21:14 masak I thought of something today that I'd like to discuss here.
21:14 masak I see all these systems for creating or manipulating ASTs. most of them create variable references by naming the variable with a string.
21:15 masak first I realized that this means that you could synthetically create a piece of code like `my $x; { say $x; my $x }` -- which is forbidden in Perl 6 (and 007) if you enter it as text.
21:16 masak probably any hardening mechanism ought to look for that case and flag it up as an error. but I'm not as sure that it's an error synthetically. need to think more about it.
21:17 masak but then I thought -- what if we ditch this sloppy referring-using-strings mechanism altogether?
21:17 masak many things have been made nicer in Perl 6 by ditching similar mechanisms.
21:17 masak two cases I can think of right away are:
21:18 masak (a) regexes; no longer strings, but first-class languages. in particular, when you inject one into another, it's done with proper scoping etc
21:18 masak (b) types. Parrot made the mistake to deal with everything as strings. that's one of its fatal mistakes, IMO. 6model fixes that. now types are proper objects in a MOP.
21:20 masak so my question is, given this, would it be beneficial to think of variables that we want to refer to in an AST as *handles* that we either have already because we got them when declaring the variable, or we can query for them (by using a string and lookup, but that's the only time) ?
21:20 masak my own intuition says that this is a good idea, but that it'd take a few iterations of the API to make it feel "natural" to use.
21:21 masak one kinda cool side effect of it is -- anonymous/gensym variables.
21:22 masak in text, we name the variable and that name becomes the textual handle to use later. in the synthetic Qtree, our object handle would be our handle to use later, and we don't technically need to bother with a variable name.
21:31 masak 'night

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