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
montanonic has quit [Ping timeout: 276 seconds]
mvzink has quit [Quit: Lost terminal]
polypus74 has joined #ponylang
<polypus74> i've got a pointer to a struct being returned bt an ffi call. i have defined a struct in pony. i'd like to access a field of that pointer to struct. how to dereference the pointer?
<polypus74> s/bt/by
<Praetonus> polypus74: A struct in Pony is implicitly a pointer, accessing the field will dereference it
<Praetonus> Oh, sorry, I misread
<Praetonus> Or not. I'm confusing myself, that's not good
<polypus74> :)
<Praetonus> So, does that solve your problem?
<polypus74> no. basically i have 'struct X var x: Y' and then i have a 'let z: Pointer[X]'. and i want to read z.x. but i'm getting an error that x is not defined on None
<polypus74> should i not wrap X in a Pointer is that what you are saying
<polypus74> because the C side has 'X* getX()'
<Praetonus> What is the declaration of your FFI function?
<polypus74> getX[Pointer[X]](...)
<Praetonus> You can do getX[X](...), you'll get a pointer in Pony
<Praetonus> A Pointer[T] is a T** under the hood
<polypus74> T**, applies only to structs then i take it
<polypus74> in that case how do you handle the case of struct returned by value?
<polypus74> how do you write the signature for 'X getXVal()'
<Praetonus> You can destructure it with a tuple. That's not really convenient and there are unresolved issues (see #1240 on Github), but I hope my upcoming RFC on some FFI stuff will improve that
<polypus74> ahh ok, so when dealing with values, use tuples, else a struct has an implicit *. merci
<polypus74> indeed it compiles :)
<Praetonus> Great!
<polypus74> so if a struct is an mplicit pointer, how do you check it for NULL? is_null() from Pointer is not defined on it
<Praetonus> You'll have to use MaybePointer for this. The name is a bit misleading, it doesn't behave like Pointer and doesn't add a level of indirection. Doing MaybePointer[X](myX) will construct a MaybePointer with the same value as the original object. You can then use is_none() to check for NULL and apply() to "re-encode" the MaybePointer into the original object type
<polypus74> ok ty. i was trying to use tuples but was running into problems with recursive type aliases. i hope pony gets those soon.
<polypus74> i'll have a look at MaybePointer
Praetonus has quit [Quit: Leaving]
pyon has quit [Quit: Reality is multi-dimensional. More precisely, two-dimensional.]
pyon has joined #ponylang
<SeanTAllen> I still don't have anything for the October Pony VUG yet. If you are interested in presenting, drop a line.
<polypus74> what about the game engine talk?
<polypus74> i hope that's still on
<SeanTAllen> O wow
<SeanTAllen> I forgot about that
<SeanTAllen> Dur
<SeanTAllen> November! Need folks for novrmber!
<polypus74> :)
<polypus74> how to deal with a wchar_t string from C-land?
<polypus74> i want to convert it to String
rurban has joined #ponylang
rurban has quit [Client Quit]
montanonic has joined #ponylang
polypus74 has quit [Remote host closed the connection]
amclain has quit [Quit: Leaving]
mitchellvanw has quit [Ping timeout: 244 seconds]
mitchellvanw has joined #ponylang
montanonic has quit [Ping timeout: 240 seconds]
montanonic has joined #ponylang
rurban has joined #ponylang
montanonic has quit [Ping timeout: 260 seconds]
rurban has left #ponylang [#ponylang]
dinfuehr has quit [Ping timeout: 265 seconds]
dinfuehr has joined #ponylang
montanonic has joined #ponylang
dimiii has joined #ponylang
dimiii has quit [Client Quit]
dimiii has joined #ponylang
montanonic has quit [Ping timeout: 272 seconds]
dimiii has quit [Quit: Leaving.]
TonyLo has joined #ponylang
rurban has joined #ponylang
_andre has joined #ponylang
Praetonus has joined #ponylang
jemc has quit [Ping timeout: 250 seconds]
rurban has quit [Quit: Leaving.]
dimiii has joined #ponylang
<dimiii> Hi there.
<dimiii> Please, add to appendices of tutorial some words about USE_TELEMETRY. Also It's interesting, is there any description of details of implementation? I see source code is excellent and has many comments, sure it would be fine to see some conceptual/general remarks over code.
<avsej> is it possible to destructure tuple so that I will capture first two memebers separately, and eveyrhing else into third variable as tuple: (var x, var y, var rest) = ("foo", "bar", "baz", "extra")
rurban has joined #ponylang
jemc has joined #ponylang
CcxCZ has quit [Read error: Connection reset by peer]
CcxCZ has joined #ponylang
<SeanTAllen> avsej: i'm not sure, did you try? i suspect it wouldn't work.
<SeanTAllen> dimiii: we'd welcome a PR for that. there's nothing out there for that right now.
<avsej> yes, I tried, and it didn't work
<avsej> :)
rurban has quit [Quit: Leaving.]
<Praetonus> Being able to slice tuples would be interesting, and I think it could cover that use case
amclain has joined #ponylang
jemc has quit [Quit: WeeChat 1.4]
jemc has joined #ponylang
runehog has quit [Remote host closed the connection]
dimiii has quit [Quit: Leaving.]
dimiii has joined #ponylang
TonyLo has quit []
<avsej> SeanTAllen, I'm trying to use FilePath, but I'm getting error. How I can determine what gone wrong in the error handler?
<avsej> https://github.com/ponylang/ponyc/blob/master/packages/files/file_path.pony#L18-L50 from source code I can see three places which generate error
<avsej> and it is not clear how to open files with absolute path
<avsej> like /etc/fstab
runehog has joined #ponylang
<avsej> okay. nevermind. I traced it
dimiii has quit [Quit: Leaving.]
montanonic has joined #ponylang
<avsej> if I have an actor, may I call it somehow to instruct it mutate itself? actor is a tag, but my function-mutator is a ref, so it does not allow to invoke the function
<avsej> oh, my fault. I didn't use 'be' for that function
<SeanTAllen> yes, using a behavior is the normal way to do it. you might also find this interesting avsej: https://patterns.ponylang.org/async/access.html
<avsej> is there some idiom how to wait until all actors done?
<SeanTAllen> what exactly do you mean>
<SeanTAllen> ?
<avsej> maybe I misunderstood the actors, but do they behave like a threads when application exits when Main actor returns?
<avsej> if so I have wait until all actors will finish in some loop, right?
<Praetonus> avsej: A program terminates when all actors have terminated
<Praetonus> There is nothing special about the Main actor other than it being the program entry point
<avsej> thanks. I think I found good example: examples/yield
<SeanTAllen> actors are garbage collected when their queue is empty and they have reached quiescience
<SeanTAllen> basically when they arent going to be able to do more work
<avsej> what is "their queue"?
<SeanTAllen> each actor has a queue, its mailbox
<SeanTAllen> an actor will not be garbage collected if it has messages waiting
runehog_ has joined #ponylang
<avsej> each message is a call of be?
<jemc> avsej: right
runehog has quit [Ping timeout: 276 seconds]
montanonic has quit [Remote host closed the connection]
k0nsl has quit [Ping timeout: 272 seconds]
k0nsl has joined #ponylang
montanonic has joined #ponylang
runehog_ has quit [Remote host closed the connection]
montanonic has quit [Ping timeout: 272 seconds]
pyon has quit [Quit: restart]
pyon has joined #ponylang
dimiii has joined #ponylang
mvzink has joined #ponylang
pyon has quit [Quit: Reality is multi-dimensional. More precisely, two-dimensional.]
pyon has joined #ponylang
dimiii has quit [Quit: Leaving.]
mvzink has quit [Quit: A merry Christmas to all, and to all a good night!]
mvzink has joined #ponylang
_andre has quit [Quit: leaving]
runehog has joined #ponylang
runehog has quit [Ping timeout: 265 seconds]
runehog has joined #ponylang
runehog has quit [Ping timeout: 265 seconds]
runehog has joined #ponylang
runehog has quit [Remote host closed the connection]
Praetonus has quit [Quit: Leaving]
runehog_ has joined #ponylang
runehog_ has quit [Remote host closed the connection]
mvzink has quit [Quit: A merry Christmas to all, and to all a good night!]
mvzink has joined #ponylang
runehog has joined #ponylang
runehog has quit [Remote host closed the connection]
runehog has joined #ponylang