trapped has quit [Read error: Connection reset by peer]
copy` has quit [Quit: Connection closed for inactivity]
jemc_ has quit [Quit: WeeChat 1.4]
c355e3b has quit [Quit: Connection closed for inactivity]
aturley has joined #ponylang
aturley has quit [Ping timeout: 244 seconds]
Perelandric has quit [Ping timeout: 250 seconds]
amclain has quit [Read error: Connection reset by peer]
amclain has joined #ponylang
devbug has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 246 seconds]
adamkittelson has quit [Ping timeout: 250 seconds]
cquinn has quit [Ping timeout: 250 seconds]
gornikm has quit [Ping timeout: 272 seconds]
omarkj has quit [Ping timeout: 272 seconds]
puzza007 has quit [Ping timeout: 250 seconds]
SeanTAllen has quit [Ping timeout: 260 seconds]
mankyKitty has quit [Ping timeout: 250 seconds]
russelldb has quit [Ping timeout: 272 seconds]
bbhoss has quit [Ping timeout: 260 seconds]
jtfmumm has quit [Ping timeout: 250 seconds]
strmpnk has quit [Ping timeout: 260 seconds]
jonrh has quit [Ping timeout: 260 seconds]
jeremyheiler has quit [Ping timeout: 260 seconds]
kushalp has quit [Ping timeout: 272 seconds]
cquinn has joined #ponylang
mankyKitty has joined #ponylang
adamkittelson has joined #ponylang
jonrh has joined #ponylang
kushalp has joined #ponylang
gornikm has joined #ponylang
jeremyheiler has joined #ponylang
strmpnk has joined #ponylang
omarkj has joined #ponylang
bbhoss has joined #ponylang
SeanTAllen has joined #ponylang
russelldb has joined #ponylang
jtfmumm has joined #ponylang
rurban has joined #ponylang
puzza007 has joined #ponylang
Willem has quit [Read error: Connection reset by peer]
Willem has joined #ponylang
SeanTAllen has quit [Ping timeout: 250 seconds]
aturley has joined #ponylang
SeanTAllen has joined #ponylang
jtfmumm has quit [Ping timeout: 250 seconds]
omarkj has quit [Ping timeout: 260 seconds]
omarkj has joined #ponylang
amclain has quit [Quit: Leaving]
jtfmumm has joined #ponylang
aturley has quit [Ping timeout: 276 seconds]
srenatus has joined #ponylang
rurban has quit [Ping timeout: 240 seconds]
rurban has joined #ponylang
rurban has quit [Ping timeout: 252 seconds]
rurban has joined #ponylang
rurban1 has joined #ponylang
rurban has quit [Ping timeout: 244 seconds]
georgemarrows has joined #ponylang
rurban has joined #ponylang
jemc has quit [Ping timeout: 240 seconds]
rurban1 has quit [Ping timeout: 250 seconds]
MC_Hamming has joined #ponylang
devbug has quit [Ping timeout: 260 seconds]
aturley has joined #ponylang
rurban has quit [Ping timeout: 244 seconds]
rurban has joined #ponylang
aturley has quit [Ping timeout: 250 seconds]
rurban1 has joined #ponylang
rurban has quit [Ping timeout: 258 seconds]
MC_Hamming has quit [Remote host closed the connection]
andreaa has joined #ponylang
rurban1 has quit [Ping timeout: 250 seconds]
rurban has joined #ponylang
Applejack_ has joined #ponylang
c355e3b has joined #ponylang
rurban1 has joined #ponylang
rurban has quit [Ping timeout: 250 seconds]
dos000 has quit [K-Lined]
georgemarrows has quit [Remote host closed the connection]
rurban has joined #ponylang
rurban1 has quit [Ping timeout: 244 seconds]
trapped has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 240 seconds]
rurban has quit [Ping timeout: 272 seconds]
rurban has joined #ponylang
rurban has quit [Ping timeout: 240 seconds]
rurban has joined #ponylang
rurban1 has joined #ponylang
rurban has quit [Ping timeout: 244 seconds]
rurban has joined #ponylang
rurban1 has quit [Ping timeout: 244 seconds]
aturley has joined #ponylang
aturley has quit [Ping timeout: 252 seconds]
Praetonus has joined #ponylang
<Applejack_>
Hi, if I have a Pointer[F64], how can I retrieve the F64 value ?
rurban has quit [Quit: Leaving.]
<Praetonus>
Applejack_: Where does your Pointer come from?
rurban has joined #ponylang
rurban has left #ponylang [#ponylang]
<Applejack_>
from C
<Applejack_>
Actually it's a Pointer[tuple] but then I thought "hey, I don't even know for F64"
<Praetonus>
You can use MaybePointer (defined in builtin/maybe.pony)
Scramblejams has quit [Ping timeout: 240 seconds]
georgemarrows has joined #ponylang
rurban has joined #ponylang
georgema_ has joined #ponylang
georgemarrows has quit [Ping timeout: 244 seconds]
rurban1 has joined #ponylang
rurban has quit [Ping timeout: 252 seconds]
rurban has joined #ponylang
rurban1 has quit [Ping timeout: 240 seconds]
aturley has joined #ponylang
aturley has quit [Ping timeout: 260 seconds]
Perelandric has joined #ponylang
rurban1 has joined #ponylang
rurban has quit [Ping timeout: 250 seconds]
rurban1 has quit [Quit: Leaving.]
jemc has joined #ponylang
SilverKey has joined #ponylang
georgema_ is now known as georgem_
georgem_ is now known as Guest70276
Guest70276 has quit [Quit: Leaving...]
SilverKey has quit [Quit: Halted.]
gammon has joined #ponylang
mcguire has joined #ponylang
aturley has joined #ponylang
SilverKey has joined #ponylang
aturley has quit [Ping timeout: 244 seconds]
<gammon>
hi. how can I wire up ponytest so that the object I'm testing has access to env (actually env.out)?
<gammon>
The 'tag' on 'fun tag tests()' on TestList seems to be stopping me passing it across from Main.create()
<jemc>
gammon: the `TestHelper` passed into your tests has an `env` field
<gammon>
doh! thanks. I'd got stuck looking at PonyTest and didn't think to look on TestHelper
<Applejack_>
Praetonus: Ok, but the only example of it I found was in test in builtin_test and I don't see how to extract the F64 inside Pointer[F64] using it. I also think I should use primitive, but nevertheless I don't see how to extract the F64 inside a Pointer[F64].
<Applejack_>
Or maybe you meant I should replace Pointer with MaybePointer?
<Praetonus>
Yes, you have to use MaybePointer instead of Pointer. Pointer is opaque outside of builtin for memory safety
<Praetonus>
So if you get your pointer with @myfun[Pointer[F64]](), you replace that with @myfun[MaybePointer[F64]]() and then call apply on the MaybePointer to get the F64
<Applejack_>
ah
Praetonus has quit [Quit: Leaving]
<Applejack_>
Ok, will try now but is that also possible with a tuple inside the MaybePointer ?
gammon has quit [Remote host closed the connection]
amclain has joined #ponylang
<Applejack_>
So I'm lost: if my C code returns a pointer to a struct, how can I retrieve the fields?
<Applejack_>
I will try MaybePointer[primitive]() but not really believing in that...
rurban has joined #ponylang
<Applejack_>
Indeed, still baffled
copy` has joined #ponylang
Applejack_ has quit [Ping timeout: 244 seconds]
rurban has left #ponylang [#ponylang]
rurban1 has joined #ponylang
SilverKey has quit [Quit: Halted.]
rurban has joined #ponylang
rurban1 has quit [Ping timeout: 260 seconds]
rurban has left #ponylang [#ponylang]
amclain_ has joined #ponylang
amclain has quit [Ping timeout: 246 seconds]
amclain has joined #ponylang
aturley has joined #ponylang
amclain_ has quit [Ping timeout: 252 seconds]
aturley has quit [Ping timeout: 264 seconds]
SilverKey has joined #ponylang
gsteed has joined #ponylang
Applejack_ has joined #ponylang
dos000 has joined #ponylang
c355e3b has quit [Ping timeout: 250 seconds]
c355e3b has joined #ponylang
jonrh has quit [Ping timeout: 276 seconds]
jonrh has joined #ponylang
SilverKey has quit [Ping timeout: 272 seconds]
SilverKey has joined #ponylang
<Applejack_>
Praetonus: Great! I found how to do it by pondering both what you told me and packages/builtin_test/test.pony
<Applejack_>
And also read examples/ffi-struct/struct.pony
<Applejack_>
The trick is to create a struct that mimicks the C struct, say MyStruct which perhaps has a field called fieldname, and then use a MaybePointer on it, let s: MaybePointer[MyStruct], and then bind the output of the C function to s, s = @cfunThatGivesPointerToStruct(...), and then use s().fieldname to reveal the content of the field fieldname in the pointer to MyStruct
MC_Hamming has joined #ponylang
kulibali has joined #ponylang
<Applejack_>
Quite a keyboardful but works
aturley has joined #ponylang
aturley has quit [Ping timeout: 244 seconds]
MC_Hamming has quit [Remote host closed the connection]
Applejack_ has quit [Ping timeout: 260 seconds]
rurban has joined #ponylang
Applejack_ has joined #ponylang
Praetonus has joined #ponylang
<Praetonus>
Applejack_: It's exactly that. Also, if you know that your C function will always return a valid pointer and never NULL, you can directly put MyStruct in the return type without bothering with MaybePointer
srenatus has quit [Quit: Connection closed for inactivity]
<Applejack_>
Praetonus: I've just tried it, very nice! But it turns out my gsl C functions can return null, so I'll stick with MaybePointer
<Applejack_>
On a different subject, why does the compiler not complain when I have "fun toto() => let a:I32=3; a" where toto is claimed to return nothing and in fact returns I32, or at least tries to ? Is it because everything is an expression and returns something so that every function would necessarily return something ?
aturley has joined #ponylang
Matthias247 has joined #ponylang
aturley has quit [Ping timeout: 244 seconds]
<Praetonus>
A function with no explicit return type returns None. The compiler adds an implicit None at the end of the function
rurban1 has joined #ponylang
SilverKey has quit [Quit: Halted.]
rurban has quit [Ping timeout: 272 seconds]
<dos000>
who is the best person to talk to about a pony package manager ?
<SeanTAllen>
Jemc at the moment dos000
rurban1 has quit [Quit: Leaving.]
<Applejack_>
SeanTAllen: Have you found what you were looking for concerning the memory filling up?
<SeanTAllen>
Applejack_: re: None, I'm not sure what you mean by "returns I32", can I see code that shows it returning something.
<SeanTAllen>
Applejack_: yeah, found it. We had a couple discussions this week about how to address it. 2 different bits to it. 1 part if that the what Pony says is the amount of memory used by an Array is wrong and we are working out the best (non slow) to address. The other is around doing some memory defragmentation by coalescing chunks together.
rurban has joined #ponylang
<Applejack_>
Ok for memory. As for the return type, actually it returns None because I did not put toto():I32, but the code looks like I want to return a (an I32), so I was wondering why the compiler did not say "you declared toto as returning None yet the code tries to return an I32, I will add an implicit None but be warned."
<Applejack_>
I thought maybe that was because everything returned something, so the warning would then always be triggered...
<dos000>
jemc: ping )
<jemc>
dos000: I'm around, but I have a day job, so I may not be able to commit to a synchronous conversation right now - best bet if you have a question is just to ping me with the question and I can respond to the best of my ability when I get the opportunity
<jemc>
in other words, the old IRC axiom of "don't ask to ask" :)
rurban1 has joined #ponylang
rurban has quit [Ping timeout: 244 seconds]
<Praetonus>
SeanTAllen: "what Pony says is the amount of memory used by an Array is wrong" Is it caused by `pony_alloc_small` allocations being rounded to a power of 2, or is it something else?
<SeanTAllen>
Praetonus: no, as I remember it at the moment (its been a long day and a long week), it looks at the immutable array, doesn't trace it, and says "32 bytes". Sylvan has an idea for a heuristic that could be used so that we don't have to carry around extra length info with the object. Its a high priority for solving. the bit sylvan pointed me at is gc.c lines
<SeanTAllen>
147 and 148.
rurban has joined #ponylang
rurban1 has quit [Ping timeout: 264 seconds]
<dos000>
jemc: great i will check this later assuming irc does not kick me out ..
rurban has quit [Ping timeout: 240 seconds]
rurban has joined #ponylang
<dos000>
i was wondering what the resistance would be if you moved pony libraries to a packager that depended on java
gsteed has quit [Quit: Leaving]
<SeanTAllen>
dos000: i dont think you are going to get any support for Maven.
<jemc>
dos000: well, I personally have a lot of predjudices against the java ecosystem, and its one of the reasons why I'm drawn to Pony instead of some of the promising JVM languages like Scala and Clojure
<jemc>
however, if you want to use something like maven, I want to make sure that *you* have the hooks and patterns you need to be able to integrate your packager of choice if it's more convenient for you
<jemc>
but I don't think we want to create an "official" solution around maven
<jemc>
right now Pony has some mechanisms that make it easy to get packages however you want to and put them somewhere where the pony compiler can find them
<jemc>
if you were motivated to do so, you could surely integrate maven to manage your pony packages and put them where the pony compiler will find them
<jemc>
if you're missing anything you would need on the pony end to make that happen, I definitely want to hear about it and help you out
<jemc>
but I don't think we want to promote and official solution that is entangling our users with the java ecosystem, when many of them (such as myself) would resist that entanglement
rurban has quit [Ping timeout: 250 seconds]
rurban has joined #ponylang
MC_Hamming has joined #ponylang
aturley has joined #ponylang
MC_Hamming has quit [Quit: Leaving...]
aturley has quit [Ping timeout: 272 seconds]
Applejack_ has quit [Ping timeout: 260 seconds]
SilverKey has joined #ponylang
<Praetonus>
SeanTAllen: I think I get it. If I understand correctly, the problem is that because an immutable object isn't fully traced before a GC cycle, we can't know the amount of memory used by subobjects before said GC cycle. Couldn't it be fixed by fully tracing an immutable the first time it is received (and marking it immutable after that to avoid tracig it afterward)?
SilverKey has quit [Quit: Halted.]
shodan45 has joined #ponylang
<shodan45>
I'm still going thru the tutorial, now on the capabilities chapter... slightly confused by some parts
<shodan45>
why is it called "recover"?
<shodan45>
that sounds to me like something to do with exceptions
<SeanTAllen>
Praetonus: yes that sounds right from my understanding but there is an overhead on that that sylvanc indicated was going to be expensive and that using a heuristic approach would in his opinion, be better.
<SeanTAllen>
Praetonus: there is also a memory fragmentation issue that coalescing could help address.
<jemc>
shodan45: it's hard to find a better word for the concept, I think
<jemc>
perhaps a way to think about it, is you have a brand new object reference that is about to "fall on the floor" as a `ref` (or whatever, but `ref` is the most common case), and you have to `recover` it before it hits the floor
<jemc>
once it "hits the floor" as a `ref`, it is "contaminated" because it could be leaked to other places, and you can't make any higher guarantees about what other references might exist
<jemc>
if you can `recover` it before it "hits the floor", you can be make guarantees about its isolation, and thus you can treat it as an `iso` or `val` or `trn` or whatever
<jemc>
it's a bit of a stretch though - naming is hard, and this concept is not a common one yet in other languages
<jemc>
I don't think `recover` sounded to me like it had anything to do with exceptions when I was first learning Pony though
<jemc>
as I don't know of other languages that use `recover` to describe that purpose
<jemc>
just try to think of it more as "recovering a precious object" instead of "recovering from a failure"
<shodan45>
jemc: "fall on the floor" because otherwise it'd go out of scope & get GC'd?
<jemc>
no "fall on the floor" as in your dog might swoop in and eat it (to keep extending the metaphor beyond its logical reach)
<jemc>
reference capabilities are all about guarantees (or lack thereof)
<jemc>
specifically, guarantees about what other references the same object might exist, and what the capabilities of those references are
<jemc>
in summary, recover blocks are about "proving" that references don't "leak" in an unsafe way
<jemc>
it takes some time to wrap your head around though, so don't expect to get it all in one read :)
<jemc>
but IRC and the mailing list are great places to ask questions
<shodan45>
I think I understand the various capabilities & their purpose... but I don't get why "recover" is a block
<jemc>
basically, the recover block is a "protective layer" around your code that restricts what the compiler will allow you to pass into it, and by extension the compiler will allow you to return something that makes stronger guarantees than it otherwise would
<jemc>
in this context, you're creating a `String ref` reference and doing a bunch of stuff to it then you want to return it as a `String iso` reference
<jemc>
but you can only do this if you can *prove* that it's still isolated at the end of the recover block
<shodan45>
ahh wait.... is recover only affecting the final result ("s")? or the whole block?
<jemc>
so all your activity has to take place inside this `recover` block that restricts what can pass into and out of it
<jemc>
well, the purpose of a recover block is to "lift" the capability of the return value, yes, but it does so by restricting activity in the entire block
<jemc>
among some other rules, the main one is that you can't pass in any non-sendable references declared outside the block
<jemc>
where the "sendable" reference capabilities are the same ones as those that can be sent to another actor (`iso`, `val`, `tag`)
<shodan45>
in that example, is "var value" being "lifted" too?
<shodan45>
by lifted, I mean converted to iso/val/etc
<shodan45>
or is it just "s"
<jemc>
inside the block everything has the same capability as it would normally have if the same code were not in a recover block - it's only at the end that the result of the entire block's expression (in this case, `s`), will be seen as lifted by the outer code
<shodan45>
jemc: yay, then I'm starting to get this :)
<shodan45>
also... the tutorial is really really good so far... but I think towards the end of chapter 3 it started using concepts in examples that weren't explained yet
<jemc>
yeah, it's hard because a lot of the concepts are intertwined, so it can be hard to introduce one at a time
<shodan45>
actually.... it just did it again :)
<shodan45>
"String iso^"
<shodan45>
what's the caret mean?
<jemc>
that gets explained in the "Aliasing" section of Chapter 4
<jemc>
it's "ephemeral", meaning that the value has been "consumed"
<jemc>
err... the reference, not the value, to be precise
<jemc>
basically, it goes hand in hand with the `!`, which means "aliased"