jemc changed the topic of #ponylang to: Welcome! Please check out our Code of Conduct => https://github.com/ponylang/ponyc/blob/master/CODE_OF_CONDUCT.md | Public IRC logs are available => http://irclog.whitequark.org/ponylang | Please consider participating in our mailing lists => https://pony.groups.io/g/pony
hakvroot_ has joined #ponylang
cjh`_ has joined #ponylang
ohir_ has joined #ponylang
dtzWill has quit [Remote host closed the connection]
hakvroot has quit [Quit: No Ping reply in 180 seconds.]
malthe has quit [Remote host closed the connection]
ohir has quit [Write error: Broken pipe]
doublec has quit [Remote host closed the connection]
kajstrom has quit [Write error: Broken pipe]
atk has quit [*.net *.split]
bitcrusher has quit [*.net *.split]
dtzWill has joined #ponylang
atk has joined #ponylang
doublec has joined #ponylang
malthe has joined #ponylang
cjh` has quit [Ping timeout: 260 seconds]
kajstrom has joined #ponylang
inara has quit [Quit: Leaving]
inara has joined #ponylang
bitcrusher has joined #ponylang
jemc has quit [Ping timeout: 268 seconds]
amclain has quit [Quit: Leaving]
pduncan has quit [Ping timeout: 240 seconds]
bimawa has quit [Read error: Connection reset by peer]
bimawa has joined #ponylang
_whitelogger has joined #ponylang
endformationage has quit [Quit: WeeChat 1.7]
nyarum has joined #ponylang
vaninwagen has joined #ponylang
papey_lap has joined #ponylang
nyarum has quit [Remote host closed the connection]
k0nsl has quit [Quit: “If we don't believe in freedom of expression for people we despise, we don't believe in it at all — Noam Chomsky”]
k0nsl has joined #ponylang
k0nsl has quit [Changing host]
k0nsl has joined #ponylang
papey_lap has quit [Ping timeout: 255 seconds]
nyarum has joined #ponylang
papey_lap has joined #ponylang
nyarum has quit [Read error: Connection reset by peer]
nyarum has joined #ponylang
nyarum has quit [Remote host closed the connection]
<emilbayes> I do not understand why the print(...) says that I cannot recover val from a ref because buf is String tag: https://is.gd/FVHM9N
<emilbayes> What am I misunderstanding?
darach has quit [Ping timeout: 240 seconds]
darach has joined #ponylang
_andre has joined #ponylang
BlackYoup_ has quit [Quit: ZNC - http://znc.in]
BlackYoup has joined #ponylang
<doublec> emilbayes: env.out.print needs a String val and you're passing it a String ref
<emilbayes> doublec: Yeah, but I should be able to recover val from ref, no?
<doublec> emilbayes: no, because a val guarantees read access but the ref still exists which has write access
<doublec> emilbayes: this will work https://is.gd/98goQo
<emilbayes> doublec: Oh! Okay, I misunderstood the docs then. Doesn't the 1. bullet point here say that I should be able to recover `val` from `ref`? https://tutorial.ponylang.org/capabilities/recovering-capabilities.html
<doublec> emilbayes: because that creates the ref inside the recover so it can't escape and is therefore safe
<doublec> emilbayes: yes, that bullet point is the example I did above
<emilbayes> doublec: Ah! Neat, so I clearly am still learning about recover ^^
<doublec> emilbayes: not the words "insude a recover expression"
<doublec> s/not/note/
<emilbayes> ahh, didn't see that
<emilbayes> that's exactly what they do in the string example below
<doublec> right
<doublec> That example needs simplifying :)
<emilbayes> doublec: Can I do something like "consume" the `ref` at some point so I don't need to wrap it in a recover block?
<doublec> emilbayes: you can't consume a ref to a val because there could be other 'ref' aliases to the same object somewhere else - that's what ref is for
<doublec> emilbayes: if it was an iso you could
<emilbayes> doublec: Oh alrigth
<emilbayes> doublec: This clears up so many misconceptions I had
<doublec> emilbayes: for example https://is.gd/pfe9vu
<emilbayes> doublec: Yes ok!
<emilbayes> doublec: I was trying to find my way with passing strings to functions that mutate the original string, and thought ref would be the most suitable capability
<doublec> recover is a way to have a block where the inputs are restricted and the outputs can't escape so you can safely convert anything created inside it to something else.
<emilbayes> doublec: Ah I get it now
<doublec> emilbayes: ref is a good way to do that but it does restrict what you can do because some functions expect a val string.
<doublec> emilbayes: but you can call those mutating functions inside the recover block too
<doublec> generally you do all your mutation inside the recover and return it from that block as a val.
<emilbayes> doublec: Ah alright
<emilbayes> doublec: Is this a general pattern? I might have too many C habits still to understand how pony "should" be done
<doublec> emilbayes: yes, it's a general pattern
<emilbayes> doublec: like in C where you manage your data yourself (maybe with a init function) and then pass that various function that mutate your data
<doublec> emilbayes: I write a bit about recover here https://bluishcoder.co.nz/2016/07/18/borrowing-in-pony.html
<emilbayes> doublec: I actually think I tried to read that but it was a bit too dense/abstract for me. Maybe because I had my specific application in mind
<emilbayes> doublec: You have a lot of good resources! ^^
<doublec> yeah that post is a bit more specific about fields of an object rather than creating mutable objects to use later as a val.
<doublec> thanks :)
<emilbayes> doublec: I especially enjoyed the one on bang / hat / arrows
vaninwagen has quit [Ping timeout: 240 seconds]
<doublec> It's amazing how aliasing creeps in - Pony makes you realise how many possible race conditions you might have in your C programs without knowing.
<emilbayes> doublec: Haha yes!
<emilbayes> doublec: Pony definitely tells you how sloppy your thinking is
vaninwagen has joined #ponylang
vaninwagen has quit [Ping timeout: 260 seconds]
<emilbayes> Does "type ByteSeq is (String | Array[U8] val)" mean that I can't have a `ByteSeq ref`?
jemc has joined #ponylang
nyarum has joined #ponylang
nyarum has quit [Remote host closed the connection]
nyarum has joined #ponylang
<SeanTAllen> a string ref would be a byteseq emilbayes
<SeanTAllen> well
<SeanTAllen> that depends i suppose on context for how you were meaning that
jmiven has quit [Quit: co'o]
jmiven has joined #ponylang
fluttershy_ has joined #ponylang
obadz has quit [Ping timeout: 255 seconds]
obadz has joined #ponylang
fluttershy_ has quit [Quit: Page closed]
amclain has joined #ponylang
<emilbayes> SeanTAllen: I was trying to get this to work: https://is.gd/8gm8aq
<emilbayes> SeanTAllen: Which does work!
<emilbayes> SeanTAllen: So I don't know what I was getting wrong in my local version
<SeanTAllen> what do you get locally emilbayes ?
<emilbayes> SeanTAllen: It turned out that I was creating a Array[U8] inside a recover block so it was ref where my function was expecting val
<emilbayes> so I totally misunderstood the error message
<SeanTAllen> ah
<emilbayes> Yay, made it to twitter!
<emilbayes> SeanTAllen: Watching your CodeMesh talk atm btw. Good stuff!
nyarum has quit [Remote host closed the connection]
<SeanTAllen> thanks
<SeanTAllen> i have 2 pony talks coming up in the next 3 weeks
<SeanTAllen> although they are fairly similar, same content, different story
nyarum has joined #ponylang
nyarum has quit [Ping timeout: 268 seconds]
<emilbayes> SeanTAllen: I've recently gotten into speaking, and trying to do a bunch of original content at once is really straining. Bceause it's just as much about the delivery / progression / story telling as the content itself
<emilbayes> I don't think there's any shame in reusing the same talk because it's going to be different each time and you get to improve it between sessions :)
nyarum has joined #ponylang
pduncan has joined #ponylang
pduncan has quit [Ping timeout: 240 seconds]
nyarum has quit [Remote host closed the connection]
pduncan has joined #ponylang
pduncan has quit [Ping timeout: 246 seconds]
nyarum has joined #ponylang
nyarum has quit [Ping timeout: 240 seconds]
_andre has quit [Quit: leaving]
k0nsl has quit [Quit: “If we don't believe in freedom of expression for people we despise, we don't believe in it at all — Noam Chomsky”]
k0nsl_ has joined #ponylang
kempe has quit [Ping timeout: 246 seconds]
papey_lap has quit [Ping timeout: 240 seconds]
nyarum has joined #ponylang
nyarum has quit [Ping timeout: 255 seconds]