6macros: discussing the finer points of Perl 6 macros, Qtrees, and how to stay sane | irclog: irclog.perlgeek.de/6macros/today
Set by moderator on 7 June 2015.
07:45 Ven joined 10:27 Ven joined 11:13 Ven joined 13:33 Ven joined 14:45 Ven joined 15:45 Ven joined 16:10 Ven joined 16:59 Ven joined
Ven seems like 17:01
that's the second perl6 conference (and incredible opportunity) I'll have to miss because my school sucks
masak :/ 17:39
17:41 Ven joined
Ven actually. 17:42
school is okay with a skype call.
masak meaning... you can come? 17:44
Ven yes 17:45
if the financial issues are sorted at, that's what it means
are you going, btw?
.oO( "my son will go instead" )
17:46
masak :P 17:48
are we talking YAPC:EU?
18:54 vendethiel joined
vendethiel no 18:57
it's the swiss perl workshop
masak ah. sorry, I wasn't sure of the context, since the first line from you (that I saw) was 19:20
<Ven> that's the second perl6 conference (and incredible opportunity) I'll have to miss because my school sucks
anyway, yes. I'll be coming to that conference. 19:21
vendethiel I'm so happy to hear that :D 19:24
I might meet the masak :D
masak heugh :) 19:25
might I/we have a Qtree implementation ready to showcase at Swiss? 19:29
what would it take to get there? 19:30
vendethiel oh! great question! 19:32
masak visualize success. then plot the course there. :) 19:39
s/the/a/ 19:40
vendethiel do you have an idea? 19:42
I don't have much
masak I think I should spend some more time on 007, with the explicit goal of informing the Qtree design. 19:43
vendethiel okay. 19:44
have an idea for me?
masak I'm always curious to tap your brain for macro ideas.
vendethiel hah :) it's all there, but that's a bit vague 19:45
masak I haven't read the "50 years" book yet. but I'll make sure to before Swiss.
maybe then we can have a productive high-bandwidth brainstorming session.
vendethiel :D
that'd be absolutely amazing.
masak yes \\o/
vendethiel mmh, now for travel expenses though
masak I was wondering the other day whether it's be possible to play around with linear variables in 007. 19:49
vendethiel googles linear variables
masak er.
wanted to say "linear types"
vendethiel ah!
masak but didn't want to say "types", because there's not much typing involved 19:50
just some alternate syntax similar to `my x`
vendethiel do you want that relatedly to escape analysis, btw?
I remember you and jnthn talking about that
masak haven't analyzed it, so dunno if escape analysis is inevitable. it might well be.
vendethiel i think it'll, somewhat 19:51
at least *some kind of analysis* will be required.
not sure how that interacts with callframe() and all
masak good news! 007 doesn't have callframe() ;)
vendethiel :D
masak anyway, I'd be tickled pink if we could (a) come up with a syntax for linear decls, and (b) try to come up with increasingly problematic programs that use them. 19:52
mebbe just `lin x`
vendethiel should the "is" syntax be reused there? 19:53
masak hmm
maybe.
vendethiel seems like I'd get to share a room with a fellow p6 hacker
vendethiel shared room with timotimo++ at apw
masak was gonna say that assignment should be mandatory on declaration, but on second thought that doesn't seem necessary 19:54
vendethiel more things to track :-) 19:55
todo: built a rust-like borrow checker built on top of that... hehehehe
masak need to track anyway, so... :)
feels like the same thing.
vendethiel yes
masak guesses he'll just have to iterate through all the control flow constructs of 007 to see how they'd interact with `lin` 19:56
vendethiel do you have some spare time now to do that? 20:00
masak I haven't had "some spare time" since the delivery... :P
vendethiel I guessed as much ;-) 20:01
masak but sometimes I have... evenings. when the household is asleep and I can sit by the computer for a while. 20:03
vendethiel alright 20:04
I'd love to do it with you, if time allows it
masak cool.
maybe a gradual way to implement this would be to start with trivially analyzable blocks 20:10
like `{ lin x = 5; say(x) }`
vendethiel oh, as a declarator? 20:11
masak and provisionally forbid everything more fancy than that
and then expand gradually, handling more and more cases
vendethiel right
masak can you think of a program that would be... interesting to trace? 20:13
or interesting in any way
vendethiel mmh.
something erlang-style maybe
masak not sure I understand that reply... 20:15
vendethiel well, okay 20:16
masak what we want is for the compiler to accept as many programs as possible where the variable is used exactly once.
vendethiel yes, so
an example
SSAF
masak within reasonable bounds, since this likely runs up against undecidability
vendethiel Idris has linear types 20:17
named "Unique" IIRC
masak ooh
vendethiel allows for mutation, even
because it can prove you're not doing anything else with it
masak "unique". that's a neat name for them
vendethiel :) 20:21
masak what about this one? `{ lin x = 5; if fn() { say(x) } else { say(x) } }` 20:31
I guess that one's OK.
vendethiel yes 20:32
masak realizes he's not that bothered by `if` statements 20:34
vendethiel well.
you need to mark the whole if stament as "using"
if any of its parts (if, (elseif), else) use it 20:35
masak no, that doesn't sound quite right.
vendethiel you can't have it the other way around without proving what the if's condition will evaluate to 20:36
masak I think you'd need to require something like "either no parts use it, or all parts do"
vendethiel lin x = 5; if $should { say(x) }
that seems reasonable to me
any reason all parts should use it?
masak a linear variable *has* to be used before block end.
vendethiel okay
then yea
masak once-and-only-once 20:37
there's something weird about that, though.
vendethiel mmh
I don't remember the names
masak what makes `say(x)` a "use"?
vendethiel the fact it's referring to the variable
really 20:38
we're missing some notions here, but mostly
1) we either consider it's "taking the value from us"
2) in some languages, you can consider that forced the value to be computed ("lazy-to-strict"?)
masak I think we need to de-confuse "lending the variable to callee" and "using the variable (thus killing it)" 20:39
syntactically.
vendethiel #1 is kind of like ownership in C. made much more explicit in C++11 with std::move, and in rust
masak mebbe `say(*x)` would be a decent syntax for killing/using a variable. 20:41
bit reminiscent of C's dereferencing. 20:42
vendethiel so, what would "say(x)" do?
fail?
masak and mebbe that means that `lin x` shoud really be `my *x`... :) 20:43
yes, `say(x)` would fail, because it doesn't hand back the linear variable properly.
I think I like it. :) 20:44
well, 'night 21:05
vendethiel 'night
i really don't want to see my *x, btw 21:06
ETOOCONFUSING