<doublec>
endformationage: I assume it has something to do with the partial application closing over an iso which could result in that iso being aliased multiple times?
<doublec>
endformationage: because bar_make~apply returns a ref, but encloses an iso
<doublec>
endformationage: that ref could be copied, therefore making multiple aliases of the iso
<doublec>
Hmm, maybe not
<doublec>
I don't know really :)
<endformationage>
Ah. Heh. Me neither! :P
<endformationage>
Thanks for finding some solutions though!
<doublec>
Since I can go: let bar_marker2 = bar_maker which seems to me to result in multiple aliases of the iso too
<endformationage>
I can see that.
<endformationage>
But setting aside the construction of the bar, why does this match an iso!, and not iso ?
<doublec>
Ah, Although you can have multiple references to the bar_marker, there's still only one reference to the iso because it's a reference to bar_marker not a copy
<doublec>
makes sense now
* doublec
looks at your gist
<doublec>
endformationage: because "Foo iso!" means "whatever can be alias a Foo iso"
<doublec>
endformationage: which is probably equivalent to "Foo tag"
<endformationage>
OK
<doublec>
Anything will match that first statement in the match really
<endformationage>
I switched the match cases and it does match as foo iso first
<doublec>
since "consume destructive_read_foo" is an iso^ which converts to anything
<endformationage>
I had an incorrect understanding of iso!
<doublec>
It's why you see "let x: Foo iso!" and things mainly in generic code
<doublec>
eg. "let x: A iso!"
<doublec>
Since the A type can be any reference capability if the generic code is written that way and you want 'x' to be assignable for anything that can alias it as an iso, etc
<endformationage>
This is very helpful, thanks again. iso is quite tricky.
<doublec>
endformationage: glad I could help. iso is indeed tricky. Especially if you want generic code to work with it.
<doublec>
When iso is involved I tend to use object literals instead of lambda syntax as it helps me reason out what's happening under the covers
<endformationage>
On that note, could you 'expand' the partial application into the object literal so I can see the difference between it and the solution you presented?
<endformationage>
I'm still unsure why the lambda version doesn't work.
<doublec>
endformationage: I don't know why either - the object literal version that uses partial application I pasted just before is equivalent and it doesn't work - but I thought it should
<jemc>
I think the partial application is what's causing your issue
<jemc>
(sorry, haven't read the full backlog, so I apologize if that's already established)
<endformationage>
Though I can see why the object literal version does.
<doublec>
jemc: yes, if we manually do the partial application via an object literal it works
<endformationage>
Does partial application change the refcap on the apply back to box, causing the iso to alias?
<jemc>
which paste is the object literal version that works?
<jemc>
from what I see, what you're doing is unsafe
<jemc>
you'd be creating a partially-applied-`bar_maker` that could keep making more copies of the same `Foo iso`
<jemc>
yeah, so the object literal version works because it does a destructive read on the `f` so it can't be used more than once - the partial application doesn't do that, so it's not really equivalent
<doublec>
Right, we discussed that earlier
<jemc>
do you see why the partially-applied-`bar_maker` is unsafe?
<endformationage>
yes
<endformationage>
Thanks again to the both of you. It's difficult to get correct & see the issues involved, but it's great that Pony doesn't let me do the unsafe things I ask it to do.
<endformationage>
Me: Go jump over this cliff. Pony: Nope.
ShalokShalom has quit [Remote host closed the connection]
<endformationage>
doublec: jemc: WHoo! Got it working!
<doublec>
endformationage: great!
ShalokShalom has joined #ponylang
endformationage has quit [Quit: WeeChat 1.9]
jemc has quit [Ping timeout: 240 seconds]
bimawa has quit [Read error: Connection reset by peer]
bimawa has joined #ponylang
bitcrusher has joined #ponylang
samuell has joined #ponylang
hobomatic has quit [Read error: Connection reset by peer]
ShalokShalom has quit [Remote host closed the connection]
ShalokShalom has joined #ponylang
jemc has joined #ponylang
endformationage has joined #ponylang
ShalokShalom has quit [Remote host closed the connection]
_andre has joined #ponylang
samuell has quit [Remote host closed the connection]
tscho has quit [Read error: Connection reset by peer]
tscho has joined #ponylang
samuell has joined #ponylang
user10032 has joined #ponylang
ShalokShalom has joined #ponylang
bitcrusher1 has joined #ponylang
bitcrusher has quit [Ping timeout: 248 seconds]
Matthias247 has quit [Read error: Connection reset by peer]
Matthias247 has joined #ponylang
_andre has quit [Quit: leaving]
samuell has quit [Remote host closed the connection]
user10032 has quit [Quit: Leaving]
mikeyhew has joined #ponylang
mikeyhew has left #ponylang [#ponylang]
Acorn2 has joined #ponylang
<Acorn2>
Hello again. I recently wrote a paper entitled "A framework for Gradual Memory Management". It proposes a mechanism for supporting multiple memory management strategies within a single program to optimize for performance, with compile-time safety guarantees.
<Acorn2>
The paper heavily borrows from Pony's (and Midori's) reference capabilities as well as Rust's static mechanism for automatic memory management
<Acorn2>
Given that some of its heritage comes from Pony, I thought it might have some passing interesting to some members of the Pony community.
<Acorn2>
If there is any interest, please let me know and I will provide a link in whatever public Pony forum I am told would be the best place for me to use.