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
jemc has joined #ponylang
<FunkyBob> morning, jemc!
<FunkyBob> got time for more of my newb questions? :)
<doublec> If in doubt, consume. If that doesn't work, recover. That's my Pony motto.
<FunkyBob> nope, that looked like it was improving, but left me in the same place
<FunkyBob> anyone let me know what more I need to provide to make sense :/
<FunkyBob> ok, fixed one set of errors with a consume
smoon has joined #ponylang
* doublec looks
<doublec> FunkyBob: do this: let src = recover ref consume data end
<doublec> That avoids all the issues with iso aliasing
<doublec> And gets you to the next error, which is about assigning an Array[U8] to a String
smoon has quit [Quit: smoon]
<doublec> FunkyBob: make these changes https://pastebin.com/KaSgBpPG
<doublec> FunkyBob: I used "recover val consume data end" to make it a val since you don't modify it
<doublec> FunkyBob: And fix the string conversion issues by using the from_array constructor
<doublec> FunkyBob: Which requires a val argument - hence the recover block in the argument
<FunkyBob> yeah, was adding from_arary....
<FunkyBob> still grappling with when to consume, and when to reover :)
smoon has joined #ponylang
<doublec> "consume" to pass an iso around, or convert it to another rcap.
<FunkyBob> rcap?
<doublec> "recover" when you need to create something that is a particular rcap but want to use it as something else. You create it in the recover block so it's safe for it to be returned as a different one.
<doublec> rcap = reference capability
<doublec> The iso, trn, box, val, ref portion
<doublec> FunkyBob: this post may or may not help https://bluishcoder.co.nz/2016/07/18/borrowing-in-pony.html
<doublec> FunkyBob: it's about something else but discusses recover
<FunkyBob> added to my reading list :)
chemist69 has quit [Ping timeout: 276 seconds]
<SeanTAllen> endformationage: im really happy that recommended resources is coming in handy.
<SeanTAllen> there's a good list of stuff here: https://www.ponylang.org/community/planet-pony/
<FunkyBob> so close
<FunkyBob> whee! worked out how to recover on my own :)
<FunkyBob> var rsp: Array[U8] iso = recover iso Array[U8].create() end
<FunkyBob> and program now segfaults! :)
chemist69 has joined #ponylang
<doublec> FunkyBob: good progress, haha!
<FunkyBob> now I just need to narrow down what is raising the exception
<FunkyBob> found it
smoon has quit [Quit: smoon]
<SeanTAllen> Do you have a small example that can create the segfault FunkyBob ?
<FunkyBob> not any more
<FunkyBob> ok, so now I'm up to "updating a HashMap doesn't alter the HashMap" :/
<FunkyBob> /home/curtis/src/kt/main.pony:37:7: try expression never results in an error
<FunkyBob> such a pleasant error message :)
<FunkyBob> meanwhile, values are never set in my HashMap :/
<FunkyBob> ok, size is going up, but getting values is not working
<FunkyBob> yay, success!
<FunkyBob> difference between HashIs and HashEq
<FunkyBob> ok, so, it's a little bit slower than my C version
gmcabrita has quit [Quit: Connection closed for inactivity]
jemc has quit [Ping timeout: 240 seconds]
jemc has joined #ponylang
amclain 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
k0nsl has quit [Changing host]
k0nsl has joined #ponylang
smoon has joined #ponylang
smoon has quit [Quit: smoon]
graaff has joined #ponylang
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 joined #ponylang
k0nsl has quit [Changing host]
jemc has quit [Ping timeout: 260 seconds]
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 joined #ponylang
k0nsl has quit [Changing host]
<endformationage> Perhaps I've read too much material today, but I'm confused about aliases. An example which includes some questions: http://pony-playpen.lietar.net/?gist=ef8d52050a8fdb9f4a6a98c39ee6af94
endformationage has quit [Quit: WeeChat 1.7]
<doublec> endformationage: I'd answer but you seem to be gone
papey_lap has joined #ponylang
chemist69 has quit [Ping timeout: 264 seconds]
chemist69 has joined #ponylang
papey_lap has quit [Quit: WeeChat 1.7.1]
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
k0nsl has quit [Client Quit]
vaninwagen_ has joined #ponylang
k0nsl has joined #ponylang
k0nsl has joined #ponylang
k0nsl has quit [Changing host]
papey_lap has joined #ponylang
vaninwagen_ has quit [Ping timeout: 246 seconds]
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 joined #ponylang
k0nsl has quit [Changing host]
vaninwagen_ has joined #ponylang
chemist69 has quit [Ping timeout: 276 seconds]
chemist69 has joined #ponylang
gmcabrita has joined #ponylang
papey_la1 has joined #ponylang
papey_lap has quit [Ping timeout: 255 seconds]
<SeanTAllen> doublec: he has previously read the logs so i think if you answer, he'd end up seeing it.
<FunkyBob> SeanTAllen: well, seems I managed to make a working program after all :)
<FunkyBob> but your offer of help was much appreciated
plietar has joined #ponylang
aav has joined #ponylang
vaninwagen_ has quit [Ping timeout: 240 seconds]
_andre has joined #ponylang
vaninwagen_ has joined #ponylang
vaninwagen_ has quit [Ping timeout: 260 seconds]
jmiven has quit [Quit: WeeChat 1.7.1]
jmiven has joined #ponylang
chemist69 has quit [Ping timeout: 260 seconds]
chemist69 has joined #ponylang
jemc has joined #ponylang
Matthias247 has joined #ponylang
Matthias247 has quit [Read error: Connection reset by peer]
yggdr- has quit [Ping timeout: 240 seconds]
plietar has quit [Remote host closed the connection]
plietar has joined #ponylang
yggdr has joined #ponylang
plietar has quit [Ping timeout: 258 seconds]
plietar has joined #ponylang
amclain has joined #ponylang
plietar has quit [Remote host closed the connection]
plietar has joined #ponylang
plietar has quit [Ping timeout: 260 seconds]
plietar has joined #ponylang
endformationage has joined #ponylang
<endformationage> FunkyBob: I'd be interested to see your completed program.
<endformationage> doublec: Thanks, FWIW I do read the logs.
<endformationage> doublec: Reread the Aliasing section in the tutorial, and found the 'What counts as making an alias?' section again, which has cleared things up!
graaff has quit [Quit: Leaving]
chemist69 has quit [Ping timeout: 260 seconds]
chemist69 has joined #ponylang
Matthias247 has joined #ponylang
papey_la1 has quit [Quit: WeeChat 1.7.1]
vaninwagen_ has joined #ponylang
plietar has quit [Remote host closed the connection]
plietar has joined #ponylang
plietar_ has joined #ponylang
plietar has quit [Ping timeout: 240 seconds]
plietar_ has quit [Remote host closed the connection]
plietar has joined #ponylang
plietar has quit [Ping timeout: 260 seconds]
plietar has joined #ponylang
chemist69 has quit [Ping timeout: 240 seconds]
chemist69 has joined #ponylang
jemc has quit [Ping timeout: 240 seconds]
jemc has joined #ponylang
_andre has quit [Quit: leaving]
<FunkyBob> endformationage: sure
<FunkyBob> endformationage: https://dpaste.de/Edsg
<FunkyBob> now everyone can tell me the more subtle things I'm doing wrong :)
Matthias247 has quit [Read error: Connection reset by peer]
atk has quit [Ping timeout: 268 seconds]
plietar has quit [Remote host closed the connection]
malthe_ has joined #ponylang
plietar has joined #ponylang
aedigix- has joined #ponylang
QshelTier has joined #ponylang
srenatus[m]1 has joined #ponylang
atk has joined #ponylang
malthe has quit [Ping timeout: 240 seconds]
SeanTAllen has quit [Ping timeout: 240 seconds]
aedigix has quit [Ping timeout: 240 seconds]
srenatus[m] has quit [Ping timeout: 240 seconds]
Arjan has quit [Ping timeout: 240 seconds]
Bombe has quit [Ping timeout: 240 seconds]
plietar has quit [Ping timeout: 246 seconds]
Arjan has joined #ponylang
SeanTAllen has joined #ponylang
vaninwagen_ has quit [Ping timeout: 240 seconds]
<endformationage> FunkyBob: Thanks!
plietar has joined #ponylang
<FunkyBob> endformationage: am especially interested in any changes that may improve performance
jemc has quit [Ping timeout: 276 seconds]
<FunkyBob> oh... dosn't comppile on new master
<endformationage> FunkyBob: I don't think you need to recover val on cmd, seen it's already val.
<FunkyBob> hmm
<endformationage> Cool example (I don't know much about network programming)
<FunkyBob> hmm, looks like you were right on recover
<endformationage> Yay, I'm learning.
<FunkyBob> seems to have very slightly improved performance too :)
<FunkyBob> from ~27 seconds to ~25/26...
<endformationage> Hah. Nice.
<FunkyBob> for reference, the pure C version does the same work in 20-21sec
<endformationage> I assume ms or ns, not seconds?
<FunkyBob> no, seconds
chemist69 has quit [Ping timeout: 264 seconds]
<FunkyBob> to insert 10,000 records, read them back, and delete them
<FunkyBob> the C version is using a red-black tree, mind... not a hash
<endformationage> Ah, ok. I was assuming a single handling. For whatever reason.
<endformationage> Are you happy with that performance?
<FunkyBob> certainly :)
<FunkyBob> but I'd still be interested to know what little changes I could do
<FunkyBob> for instance, the reply packet formation...
<FunkyBob> tried pre-allocating the response array.. didn't seem to help
chemist69 has joined #ponylang
<FunkyBob> var rsp: Array[U8] iso = recover iso Array[U8].create(2 + key.size() + result.size()) end
<endformationage> Are persistent collections supposed to be faster? Or are they more for avoidng blocking and things like that?
<FunkyBob> why is that a recover...
<FunkyBob> persistent collctions I used at first, but... every mutation produces a 'new' instance, AIUI
<endformationage> Ah.
<FunkyBob> which tripped me up for a while
<FunkyBob> endformationage: https://github.com/funkybob/keyster