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
CcxWrk has joined #ponylang
CcxWrk has quit [Ping timeout: 260 seconds]
CcxWrk has joined #ponylang
mvzink has quit [Ping timeout: 248 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 250 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 258 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 268 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 268 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 248 seconds]
mvzink has joined #ponylang
amclain has quit [Quit: Leaving]
mvzink has quit [Ping timeout: 252 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 258 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 260 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 260 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 268 seconds]
mvzink has joined #ponylang
so has joined #ponylang
mvzink has quit [Ping timeout: 250 seconds]
techorb has joined #ponylang
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 258 seconds]
<techorb> I discovered Pony yesterday and am still reading up on the papers and various tutorials. The actor model simplifies so many issues with current programming tasks that I want to weep.
<techorb> I see that the stdlib is still in its infancy and am curious if Pony's FFI plays nice with other system libraries written in golang or rust?
<Praetonus> techorb: If those libraries are C ABI-compatible, then yes
mvzink has joined #ponylang
<techorb> ok awesome
jemc has quit [Ping timeout: 248 seconds]
mvzink has quit [Ping timeout: 260 seconds]
<techorb> what's the current thinking in terms of package management w/ Pony? a la ruby gems or rust's crate?
<Praetonus> That's not really a thing yet unfortunately. There has been some work but nothing "community-wide"
<techorb> totally understandable given the maturity of the lang.
<techorb> very excited to write a couple of simple pony programs today. thanks for the responses @Praetonus
so has quit [*.net *.split]
dinfuehr has quit [*.net *.split]
techorb has quit [*.net *.split]
xshuiniu has quit [*.net *.split]
kajstrom_ has quit [*.net *.split]
Candle has quit [*.net *.split]
shepheb has quit [*.net *.split]
Praetonus has quit [*.net *.split]
ericbmerritt_ has quit [*.net *.split]
dom96 has quit [*.net *.split]
malthe has quit [*.net *.split]
srenatus[m] has quit [*.net *.split]
M-Ingo has quit [*.net *.split]
ohir has quit [*.net *.split]
Corwin has quit [*.net *.split]
cquinn has quit [*.net *.split]
bodie_ has quit [*.net *.split]
yggdr has quit [*.net *.split]
lisael has quit [*.net *.split]
Fuuzetsu has quit [*.net *.split]
k0nsl has quit [*.net *.split]
DarkFox has quit [*.net *.split]
strmpnk has quit [*.net *.split]
irx[m] has quit [*.net *.split]
emilbayes has quit [*.net *.split]
jmiven has quit [*.net *.split]
SeanTAllen has quit [*.net *.split]
jtfmumm has quit [*.net *.split]
gornikm has quit [*.net *.split]
kushalp has quit [*.net *.split]
otremblay has quit [*.net *.split]
CcxWrk has quit [*.net *.split]
doublec has quit [*.net *.split]
BweeZ has quit [*.net *.split]
Xe has quit [*.net *.split]
NhanH has quit [Ping timeout: 256 seconds]
gornikm has joined #ponylang
_whitelogger has joined #ponylang
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 248 seconds]
_whitelogger has joined #ponylang
so has joined #ponylang
Xe has joined #ponylang
irx[m] has joined #ponylang
SeanTAllen has joined #ponylang
jtfmumm has joined #ponylang
jmiven has joined #ponylang
kushalp has joined #ponylang
otremblay has joined #ponylang
strmpnk has joined #ponylang
Xe has quit [*.net *.split]
strmpnk has quit [*.net *.split]
irx[m] has quit [*.net *.split]
jmiven has quit [*.net *.split]
SeanTAllen has quit [*.net *.split]
jtfmumm has quit [*.net *.split]
kushalp has quit [*.net *.split]
otremblay has quit [*.net *.split]
so has quit [*.net *.split]
NhanH has quit [*.net *.split]
CcxWrk has quit [*.net *.split]
doublec has quit [*.net *.split]
BweeZ has quit [*.net *.split]
dinfuehr has quit [*.net *.split]
Xe- has joined #ponylang
xshuiniu has quit [Excess Flood]
so has joined #ponylang
NhanH has joined #ponylang
doublec has joined #ponylang
CcxWrk has joined #ponylang
BweeZ has joined #ponylang
jmiven has joined #ponylang
jtfmumm has joined #ponylang
SeanTAllen has joined #ponylang
irx[m] has joined #ponylang
kushalp has joined #ponylang
strmpnk has joined #ponylang
otremblay has joined #ponylang
DarkFox has joined #ponylang
gornikm has joined #ponylang
omarkj has joined #ponylang
c355e3b has joined #ponylang
darach has joined #ponylang
sjums has joined #ponylang
mankyKitty has joined #ponylang
mcguire2 has joined #ponylang
M-hrjet has joined #ponylang
adamkittelson has joined #ponylang
prettyvanilla has joined #ponylang
jonrh has joined #ponylang
atk has joined #ponylang
bbhoss has joined #ponylang
hakvroot_ has joined #ponylang
puzza007 has joined #ponylang
avsej has joined #ponylang
jeremyheiler has joined #ponylang
unbalanced has joined #ponylang
mitchellvanw has joined #ponylang
sylvanc has joined #ponylang
dinfuehr has joined #ponylang
Xe- has joined #ponylang
Xe- has quit [Changing host]
NhanH has quit [Ping timeout: 258 seconds]
emilbayes has quit [Ping timeout: 258 seconds]
bbhoss has quit [Ping timeout: 257 seconds]
jonrh has quit [Ping timeout: 257 seconds]
Xe- is now known as Xe
jonrh has joined #ponylang
mvzink has joined #ponylang
<sblessing> hey guys, long time no see. back to ponylang :)
mvzink has quit [Ping timeout: 260 seconds]
emilbayes has joined #ponylang
NhanH has joined #ponylang
bbhoss has joined #ponylang
mvzink has joined #ponylang
_andre has joined #ponylang
mvzink has quit [Ping timeout: 260 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 260 seconds]
<SeanTAllen> Re ffi golang might be difficult. Would need to look at their gc. You can make a gc play nice w other gc' s and you can make them not play nice. AFAIK, no one has tried golang via FFI.
jmiven has quit [Ping timeout: 260 seconds]
jmiven has joined #ponylang
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 248 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 258 seconds]
jemc has joined #ponylang
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 260 seconds]
jemc has quit [Quit: WeeChat 1.4]
jemc has joined #ponylang
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 268 seconds]
dinfuehr has quit [Ping timeout: 265 seconds]
dinfuehr has joined #ponylang
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 258 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 252 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 258 seconds]
mvzink has joined #ponylang
Praetonus has joined #ponylang
amclain has joined #ponylang
<malthe> it should be possible to rework the tcp code so that it can support any data stream.
<malthe> damn irc client, sorry.
<SeanTAllen> what does that mean "support any data stream"?
<malthe> SeanTAllen: this was a line from a previous conversation. I wanted to ask a question about ref caps, but accidentally sent an old line.
<malthe> if you have a moment, here's something I don't really understand how to accomplish:
<malthe> (it's from stdin.pony:fun ref _read())
<malthe> I have an iso Array[U8] that I'd like to use temporarily as a box, before I finally consume it (in `notify(consume data)`).
<malthe> in "Recovering capabilities", the tutorial mentions that you can do "borrow" an iso as a ref temporarily using recover, but I can't really make out how that's done.
<malthe> I'm running into this because I'm thinking that `cpointer()` and `cstring()` could and perhaps should return a box reference instead of a tag, but this causes problems in certain places.
<Praetonus> malthe: Should be something like `recover let x = consume ref x_iso; do_stuff(x); x end
<malthe> Praetonus: "can't use a consumed local in an expression"
<malthe> (the "x" in this case).
<jemc> malthe - why do you think they should return a Pointer box?
<jemc> what would it buy you when there are no public `box` methods?
<malthe> jemc: because I think it's awkward that we need the private _cpointer() method that returns a box.
<malthe> isn't it artificial to return a tag for a value that we can perfectly well read.
<malthe> it buys me access to box methods on Pointer, such as `_offset` but okay they're not public.
<malthe> I just feel that it's weird that these classes can communicate to each other through private methods.
<malthe> but I also just would like to understand how to solve the case, even if it isn't really a good idea.
<malthe> I feel this could make a good example for the tutorial too.
<jemc> malthe: we don't want users to be able to call the copy_cstring method without using FFI to get their pointer - it would break memory safety
<jemc> sorry, I'll use the new term copy_cpointer to be clear
<malthe> right that makes sense. so you're saying that all user code should really just get Pointer tag.
<malthe> because it's inherently unsafe to have anything else to a pointer.
<jemc> we don't want the user to be able to get the `String.cpointer` and feed that into `String.copy_cpointer` - they could load it with a `len` that was wrong and unsafe
<malthe> gotcha
<jemc> yeah, they have to use FFI to break memory safety
<Praetonus> malthe: I think there is something wrong with recover checks here. I'll look into it
<malthe> Praetonus: ya, I'll definitely go back to "tag" ^^^ but it would still be good to understand how it could work.
<malthe> (the recover/consume stuff)
<malthe> I feel that I could make it work with destructive read, but that's just very verbose for something this simple.
<Praetonus> Maybe we could add some abridged syntax that would sugar to the above recover block, which I'm almost certain doesn't work because of a compiler bug
sblessing has quit [Quit: Lost terminal]
DarkFox has quit [Ping timeout: 260 seconds]
DarkFox has joined #ponylang
DarkFox is now known as Guest88213
Fuuzetsu has quit [Ping timeout: 248 seconds]
<malthe> Praetonus: must you return `x` in that block? because I could imagine it would be good to return some value that was created inside the block.
<malthe> like `let status = recover let x = consume x_iso; do_stuff() end` where `do_stuff()` return a status code.
<Praetonus> If the status code is sendable (something like a number), you can assign it to a variable outside of the block. If it's not sendable, I think the only solution is to recover an object containing both x and the status code. Getting x back after that can be convoluted, though
<jemc> "recover an object containing both x and the status code" -> can't be a tuple though, as that's still unsafe :P
Fuuzetsu has joined #ponylang
Guest88213 has quit [Changing host]
Guest88213 has joined #ponylang
Guest88213 is now known as DarkFox
titi has joined #ponylang
<malthe> jemc: what about the public constructor String.from_cstring which takes a `len` and `alloc`. isn't that unsafe too?
<malthe> you can get such a ref pointer from an FFI call
<malthe> or are you saying that in this case the user knows it's through the FFI so all bets are off.
<malthe> that's pretty smart actually :-)
<jemc> yeah, the pointer was acquired through FFI, so it's now up to the developer to ensure memory safety
<jemc> and because pony allows you to whitelist packages that are trusted to to do FFI, you can "bury" that abstraction, isolated in a package
titi has quit [Ping timeout: 258 seconds]
<malthe> jemc: can you try and compile packages/crypto and run "$ while ./crypto > /dev/null; do :; done"
<malthe> it sometimes traps for me:
Matthias247 has joined #ponylang
<malthe> Assertion failed: (index < POOL_COUNT), function ponyint_pool_free, file src/libponyrt/mem/pool.c, line 602.
<malthe> Abort trap: 6
<malthe> it seems to do this for me with or without the `cpointer()` patch I'm working on.
<Praetonus> That looks bad
<Praetonus> Do you have a stack trace?
<malthe> segfaults sometimes too
<Praetonus> It looks like the message queue of the scheduler threads somehow gets corrupted
<malthe> Praetonus: it's not so easy on a mac b/c gdb doesn't support core dumps :-(
<malthe> let me see if I can try on linux
<jemc> malthe: does it happen when compiling the package with --debug?
<jemc> nevermind, answered my own question - it does for me on linux:
<jemc> `crypto: src/libponyrt/mem/pool.c:602: ponyint_pool_free: Assertion `index < (20 - 5 + 1)' failed.`
<Praetonus> I'm highly suspecting a synchronisation issue somewhere in the queue
<Praetonus> So apparently it comes from the ABA handling change in 83bc2aa. That's a serious problem. I think the only solution might be to use a starvation-free algorithm instead of a lock-free one, which would drop the ABA problem completely. That might even yield better performance in the common case
<malthe> you bisected it?
<malthe> or how did you figure that out
btbytes has joined #ponylang
<Praetonus> Yeah, bisect
btbytes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
titi has joined #ponylang
titi has quit [Ping timeout: 258 seconds]
<malthe> how do I fix this (short) program: https://gist.github.com/malthe/d75e9fff12b7744e320fb51103c7086d
<malthe> trying to compare a String val to a String iso!
btbytes has joined #ponylang
<malthe> or maybe I misunderstand the error message
<malthe> Praetonus: this is the same case as before where I want to temporarily recover a ref or box from an iso, and then get it back as an iso.
<malthe> equivalent to rust's borrow
ericbmerritt_ has quit [Read error: Connection reset by peer]
ericbmerritt_ has joined #ponylang
<jemc> malthe: it looks like nothing in the program you gisted requires the String to be iso
<jemc> so I would recommend a recover block around everything in the _test_string method, and using a String ref inside the recover block
<jemc> ah, I see - you are wanting to compare it to a val for the `assert_eq[String val]` call
<jemc> one easy option would be to pass s.clone() to the `assert_eq` call
<jemc> another option would be to move the `assert_eq` to after the `assert_false` so you could pass `consume s` to the `assert_eq`
<jemc> I'm assuming you want the second option if you are dealing with null termination stuff, since I believe `s.clone()` would add a null terminator to the new string
<jemc> another option that might work is using `assert_eq[String box]` instead of `assert_eq[String val]`, though off the top of my head I'm not 100% sure it will compile
<jemc> in fact, I mostly believe it won't, but I would check the compiler to be sure
<malthe> k
<malthe> turns out I missed that there's already a bunch of tests in builtin_test!
<malthe> so I could just more or less adapt an existing case
btbytes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<malthe> ok that's in now. lots of changes :-)
_andre has quit [Quit: leaving]
btbytes has joined #ponylang
<malthe> shouldn't the compiler actually be able to infer the type for `assert_eq` in most (all?) cases?
<jemc> malthe: actually, Praetonus did an RFC for just that (inferring type parameters based on argument types)
<jemc> the RFC was accepted, and we're just waiting on implementation (which is probably non-trivial)
<jemc> here's the action ticket if you wanted to subscribe: https://github.com/ponylang/ponyc/issues/1184
btbytes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<malthe> great
btbytes has joined #ponylang
btbytes has quit [Client Quit]
btbytes has joined #ponylang
prettyvanilla has quit [Ping timeout: 250 seconds]
prettyvanilla_ has joined #ponylang
btbytes has quit [Read error: Connection reset by peer]
Matthias247 has quit [Read error: Connection reset by peer]
<jemc> wow, travis isn't running any darn builds today!
<jemc> just spinning and yellow as far as the CI can see-eye