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
trapped has quit [Read error: Connection reset by peer]
jemc has quit [Ping timeout: 260 seconds]
aturley has joined #ponylang
mcguire has quit [Ping timeout: 276 seconds]
aturley has quit [Ping timeout: 240 seconds]
amclain has quit [Quit: Leaving]
nyarum has joined #ponylang
nyarumes has quit [Ping timeout: 272 seconds]
SilverKey has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 240 seconds]
devbug has joined #ponylang
SilverKey has quit [Quit: Halted.]
SirWillem has joined #ponylang
SirWillem has quit [Ping timeout: 240 seconds]
SilverKey has joined #ponylang
aturley has joined #ponylang
Praetonus has quit [Quit: Leaving]
c355e3b has quit [Quit: Connection closed for inactivity]
aturley has quit [Ping timeout: 260 seconds]
unbalancedparen has joined #ponylang
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
SilverKey has quit [Client Quit]
SilverKey has joined #ponylang
SilverKey has quit [Quit: Halted.]
aturley has joined #ponylang
jemc has joined #ponylang
aturley has quit [Ping timeout: 250 seconds]
SirWillem has joined #ponylang
copy` has quit [Quit: Connection closed for inactivity]
SirWillem has quit [Remote host closed the connection]
aturley has joined #ponylang
aturley has quit [Ping timeout: 258 seconds]
Applejack_ has joined #ponylang
Applejack_ has quit [Ping timeout: 252 seconds]
rurban has joined #ponylang
srenatus has joined #ponylang
rurban has left #ponylang [#ponylang]
aturley has joined #ponylang
aturley has quit [Ping timeout: 276 seconds]
rurban1 has joined #ponylang
gsteed has joined #ponylang
trapped has joined #ponylang
Applejack_ has joined #ponylang
jemc has quit [Ping timeout: 240 seconds]
Applejack_ has quit [Ping timeout: 276 seconds]
dom96 has quit [Changing host]
dom96 has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 244 seconds]
Applejack_ has joined #ponylang
c355e3b has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 264 seconds]
devbug has quit [Ping timeout: 258 seconds]
Applejack_ has quit [Ping timeout: 240 seconds]
aturley has joined #ponylang
aturley has quit [Ping timeout: 240 seconds]
Applejack_ has joined #ponylang
Applejack_ has quit [Ping timeout: 250 seconds]
copy` has joined #ponylang
Applejack_ has joined #ponylang
<malthe> a question about the memory model; what exactly happens when a (consumed) object is assigned to a pointer?
<malthe> is there a reference count that is increased somewhere?
<malthe> I see that object_t has a "rc" field.
rurban has joined #ponylang
rurban1 has quit [Ping timeout: 260 seconds]
<shepheb> malthe: at runtime there's no difference from any other alias. consume is compile-time only, and it changes the type of the pointer.
<shepheb> in particular, it removes the ! from the type.
<shepheb> or exchanges it for a ^, I guess.
<shepheb> so that instead of iso! == tag you get iso^ == iso
<malthe> so if I create an object and assign it to a raw pointer, when is that object freed?
<malthe> (like what happens in an array).
<shepheb> what do you mean by "raw pointer"?
<shepheb> oh, I see.
<malthe> Pointer[A] for example
<shepheb> depends on whether Pony or C allocated that pointer.
<malthe> pony did, let's say.
<malthe> I made room for 1 A.
<shepheb> then I think it gets gc'd. actually, there are finalizers in Pony, so maybe the finalizer for an array manually frees the array?
<shepheb> I haven't really looked.
<shepheb> for pointers that are returned from FFI calls, and were allocated by C code, they're never freed automatically by the Pony code.
<malthe> like in HashMap._resize, there is code to iterate over the old underlying array and tombstone each item.
<malthe> since each key/value is eventually added to a new array, this seems inefficient.
<malthe> but it's also a bit hard to really understand what's going on.
<malthe> why isn't erasing the reference to the old array enough to free it (eventually).
<malthe> (it would be in java)
SilverKey has joined #ponylang
<shepheb> raw arrays exist outside the GC, I think.
<shepheb> so if it didn't iterate over them, the refcounts would never reach 0 again.
Praetonus has joined #ponylang
rurban1 has joined #ponylang
rurban has quit [Ping timeout: 246 seconds]
SilverKey has quit [Quit: Halted.]
rurban has joined #ponylang
aturley has joined #ponylang
rurban1 has quit [Ping timeout: 260 seconds]
aturley has quit [Ping timeout: 244 seconds]
SilverKey has joined #ponylang
<malthe> it must happen somewhere in the compile intrinsics
<malthe> like in the functions generated in genprim.c
<malthe> some sort of magic is happening outside of the pony code
<Praetonus> Pony allocated memory is always freed during GC
M-hrjet has quit [Remote host closed the connection]
M-hrjet has joined #ponylang
jemc has joined #ponylang
Praetonus has quit [Quit: Leaving]
Applejack_ has quit [Ping timeout: 244 seconds]
SilverKey has quit [Read error: Connection reset by peer]
SilverKe_ has joined #ponylang
mcguire has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 244 seconds]
amclain has joined #ponylang
<jemc> wow, travis is super unreliable lately...
<jemc> shepheb, malthe: regarding the GC of arrays - the integration with the GC happens in the compile_intrinsics of the Pointer class
SilverKe_ has quit [Quit: Halted.]
SilverKey has joined #ponylang
SilverKey has quit [Client Quit]
SilverKey has joined #ponylang
rurban has left #ponylang [#ponylang]
copy` has quit [Quit: Connection closed for inactivity]
aturley has joined #ponylang
aturley has quit [Ping timeout: 240 seconds]
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
Applejack_ has joined #ponylang
Praetonus has joined #ponylang
SilverKey has quit [Quit: Halted.]
Matthias247 has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 260 seconds]
dos000 has joined #ponylang
<dos000> howdy all )))
<dos000> just wanted to let you guys know that this lecture on ponylang page is missing the video
<dos000> hopefully it can be fixed ..
<dos000> the audio and presentation is fine
<dos000> i just cant get to the actual demos ... they only work at the beginning then they stop
<dos000> The lecture is titled "October 22: Part two of "Actor-based programming in Pony" at Imperial Programming Lectures in London (slides and recording)"
runehog_ has joined #ponylang
runehog has quit [Read error: No route to host]
runehog has joined #ponylang
runehog__ has joined #ponylang
runehog has quit [Read error: Connection reset by peer]
runehog_ has quit [Ping timeout: 244 seconds]
SilverKey has joined #ponylang
<Praetonus> dos000: If I recall correctly, somebody said a while back that the recording is pretty much screwed up. You can find the code of the demos here: https://github.com/sylvanc/pony-lecture
gsteed has quit [Quit: Leaving]
rurban has joined #ponylang
sjums has joined #ponylang
<malthe> jemc: how exactly does the mechanism work in the case of let's say, Pointer[A]._update - ?
srenatus has quit [Quit: Connection closed for inactivity]
<dos000> Praetonus: any chance someone can post this to youtube ?
<dos000> just the video and slides in the link
copy` has joined #ponylang
<jemc> malthe: for all the `compile_intrinsic`s in Pony, there is special-case code in the compiler that will replace the `compile_intrinsic` keyword with some custom LLVM IR
<jemc> these are matched up by looking at the type name and the method name for the method that is marked as `compiler_intrinsic`
<jemc> for the Pointer.update example, here is the relevant code: https://github.com/ponylang/ponyc/blob/master/src/libponyc/codegen/genprim.c#L181
<jemc> if you look at the LLVM builder methods called, you can see that it basically ends up as an LLVM "get element pointer" construct
<jemc> so, in effect, the Pony `Pointer` type is a syntax wrapper around the LLVM `PointerType`, using `compile_intrinsic`s to do the transformation
<jemc> similarly you can see that Pointer._alloc effectively wraps the C function `pony_alloc`, provided by the Pony runtime and thus integrated with the memory allocator and GC
aturley has joined #ponylang
SilverKey has quit [Quit: Halted.]
aturley has quit [Ping timeout: 240 seconds]
zaquest has joined #ponylang
rurban1 has joined #ponylang
devbug has joined #ponylang
rurban has quit [Ping timeout: 276 seconds]
rurban1 has left #ponylang [#ponylang]
pulpfiction has joined #ponylang
TwoNotes has joined #ponylang
rurban has joined #ponylang
rurban1 has joined #ponylang
rurban has quit [Ping timeout: 264 seconds]
TwoNotes has quit [Quit: Leaving.]
rurban1 has quit [Quit: Leaving.]
Matthias247 has quit [Read error: Connection reset by peer]
SilverKey has joined #ponylang
Applejack_ has quit [Ping timeout: 250 seconds]
pragma_ has joined #ponylang
SilverKey has quit [Quit: Cheerio!]
trapped has quit [Read error: Connection reset by peer]
aturley has joined #ponylang
aturley has quit [Ping timeout: 250 seconds]
MC_Hamming has joined #ponylang
<pragma_> hello i'm new to ponylang :) is there a way to interface with something like opengl
<jemc> pragma_: hello and welcome!
<pragma_> @jemc: thanks :)
<jemc> pragma_: in theory you can call any C functions from any shared library
<jemc> pragma_: in practice some C APIs may be a little hard to deal with from time to time, depending on how they are laid out
<pragma_> what happens when the function blocks will it stall other actors
<jemc> the FFI chapter in the tutorial is a good place to start to learn about the FFI - http://tutorial.ponylang.org/c-ffi/ - but if you have specific questions feel free to ask here or on the mailing list
<pragma_> cool thanks :)
<pragma_> the c implementation looks really clean.
<jemc> pragma_: yes, as you intuit, if the function blocks it will block that scheduler thread, which is typically a bad thing
<jemc> for some limited cases you can probably get away with it, but in general you should prefer non-blocking APIs
<pragma_> yeah i see
<jemc> (or at least APIs that don't block for a long time