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
<polypus74> actor destructor for cleaning up C-land stuff on GC. i see DisposableActor in stdlib, but it's unclear if this is what i want?
<polypus74> ok for the opaque struct, simply saying 'struct X' seems to work
<SeanTAllen> disposable isnt called automatically
<SeanTAllen> you need to call it yourself
<SeanTAllen> you are interested in final
<SeanTAllen> which gets run when an object is gc'd
<polypus74> fun ref final, i suppose
<SeanTAllen> you'd have to check, i can't remember offhand as i've never needed to use it
<SeanTAllen> we do use Disposable everywhere in our code base
<polypus74> is it in tut? cuz it isn't in standard lib docs
<SeanTAllen> maybe?
<polypus74> google's not giving me much
<polypus74> thanks btw
<SeanTAllen> this is from the CHANGELOG: Primitive `_init` and `_final` for C library initialisation and shutdown.
<polypus74> i've got an actor though
<SeanTAllen> check out finalisers.pony
<SeanTAllen> you'll see an examples of Actor, Class and Primitive finalisers
<polypus74> cool ty
omarkj has quit [Ping timeout: 265 seconds]
omarkj has joined #ponylang
k0nsl has quit [Ping timeout: 272 seconds]
pyon has joined #ponylang
montanonic has quit [Ping timeout: 272 seconds]
stephensong has joined #ponylang
stephensong has quit [Client Quit]
k0nsl has joined #ponylang
polypus74 has quit [Remote host closed the connection]
c355e3b has quit [Quit: Connection closed for inactivity]
mvzink has joined #ponylang
wgf_ has joined #ponylang
TonyLo_ has joined #ponylang
mvzink has quit [Quit: A merry Christmas to all, and to all a good night!]
TonyLo_ has quit [Ping timeout: 265 seconds]
TonyLo_ has joined #ponylang
mvzink has joined #ponylang
TonyLo_ has quit [Ping timeout: 240 seconds]
mvzink has quit [Quit: A merry Christmas to all, and to all a good night!]
TonyLo has joined #ponylang
dinfuehr has quit [Ping timeout: 250 seconds]
dinfuehr has joined #ponylang
_whitelogger has joined #ponylang
wgf_ has left #ponylang ["Leaving"]
doublec has joined #ponylang
c355e3b has joined #ponylang
bbhoss has quit [Read error: Connection reset by peer]
bbhoss has joined #ponylang
srenatus[m] has quit [Ping timeout: 276 seconds]
Praetonus has joined #ponylang
srenatus[m] has joined #ponylang
wgf_ has joined #ponylang
TonyLo has quit [Ping timeout: 272 seconds]
polypus74 has joined #ponylang
<polypus74> in several fun signatures i have seen a default parameter value given as either 'call' or 'recover'. for example caps' in FilePath.create. what does this mean?
<malthe_> SeanTAllen: if we can agree on the cpointer/cstring (vs 'bytes') naming, then I can go ahead and adapt the RFC proposal with signatures etc.
<malthe_> I agree the "How we teach this" is fluffy. It's a difficult section to complete I think.
malthe_ is now known as malthe
prettyvanilla has quit [Remote host closed the connection]
prettyvanilla has joined #ponylang
wgf_ has quit [Remote host closed the connection]
mvzink has joined #ponylang
mvzink has quit [Quit: A merry Christmas to all, and to all a good night!]
<SeanTAllen> polypus74: i'm not sure what you mean by `call`. are you asking what `recover` does or what `recover` does when used in a default parameter?
<polypus74> i know what recover does, i also know how to use it to wrap a default parameter value. what i don't get is what it means in the doc string for (for example) FilePath.create, like so: caps': Flags[(..., U32 val] val = recover). i have also seen, although i don't remember where, the word call in the same position, right after equals in a pram list
<polypus74> *param list
<polypus74> ok just looking at the source. looks like it might be a problem with actual doc generation.
<SeanTAllen> sorry, i dont understand.
<malthe> polypus74: that's because default parameters are created at runtime and sometimes the ref capability isn't the right one.
<malthe> so here to match the function signature it's necessary to recover the result of the default expression.
<malthe> (which is evaluated at runtime, every time the function is called without the argument provided.)
<SeanTAllen> O i see, you are looking at the standard library docs and yeah, it doesnt handle that case
<SeanTAllen> the standard library documentation is off for that
<polypus74> malthe: i get that. SeanTAllen, yes that is what i was tlkaing about
<malthe> ah ok
<malthe> sry for the noise :-)
<polypus74> sorry shoudl have looked at the source sooner
<polypus74> malthe: np, was confused by the doc is all
<SeanTAllen> polypus74: i created an issue for this: https://github.com/ponylang/ponyc/issues/1262
<SeanTAllen> there's still definite edge cases in the documentation generation. i did a lot of work in that area when i first joined to core team and fixed a number of them. sadly, i didn't get them all.
<SeanTAllen> polypus74: if you find any more in the future where the source makes sense but the generated documentation doesn't, please open an issue with what is in the source vs what gets generated for documentation. thanks. hopefully someone picks it up soon. its a good starter issue.
<polypus74> SeanTAllen: ok, ty, will do
mvzink has joined #ponylang
mvzink has quit [Client Quit]
TonyLo has joined #ponylang
<polypus74> ponyc --hs
<polypus74> can't figure out what's wrong with this code.
<polypus74> either i'm missing something obvious or there's a bug?
TonyLo has quit [Ping timeout: 240 seconds]
<doublec> polypus74: what were you expecting vs what it does?
<doublec> it's a bit too much code for me to look at and work out
<doublec> plus it spawns processes so I don't want to run it
montanonic has joined #ponylang
<polypus74> doublec: all i'm doing is spawning a process, 'cat'. and trying to have it echo back to me. the behaviour i'm getting is at the top of pastie. i'm getting write errors and i don't know why.
pyon has quit [Quit: dammit emacs]
<polypus74> and i'm getting an exit code of 0, which means cat ran ok, so i don't get it
* doublec tries
pyon has joined #ponylang
<doublec> I get exit code 255
<polypus74> did you change to /bin/cat?
<polypus74> i'm on arch where it's /usr/bin/cat
<doublec> ah right. yes with that I get exit code 0 and WriteError's
<polypus74> ok well at least we know it's not just my system
<malthe> polypus74: I fixed a bug yesterday in the process monitor.
<polypus74> malthe: did it make it into 0.3.3? what was the bug?
<doublec> It works if I s/printv/write/ with a string.
<malthe> polypus74: incorrectly reading stderr outputs if they weren't being sent in a single packet so to speak.
<polypus74> doublec: same. but it should work with printv in that case
<malthe> that program just does nothing on my machine
<polypus74> malthe: did you run with -d
<polypus74> compile i mean
<malthe> no. but I also have cat on /bin/cat
<polypus74> it's just cuz i'm Debug.out'ing
<malthe> WriteError
<malthe> exit code: 255
<malthe> (multiple write errors, and one "created")
<polypus74> malthe: yeah that's right, dunno why you get the 255 though
<malthe> ya thats weird
<malthe> doesn't matter if I change to the right cat path
<malthe> computing is hard :-)
<polypus74> why do we do it?
<doublec> It is weird how a p.write("foo" workd
<doublec> but a pm.writev(select) doesn't
<polypus74> yeah. seems bugish
<doublec> when all that does is iterate over select calling write
<polypus74> hey we calling printv before not write. and print with just string errors
<polypus74> but print just calls write twice, so go figure
<polypus74> and if you manually call write twice, no errors ?!
<doublec> So the write error is bad file descriptor
<doublec> "EBADF fd is not a valid file descriptor or is not open for writing."
<doublec> stdin is -1 in the write call
<SeanTAllen> that would probably be a timing issue polypus74
<doublec> vs: stdin being 6 if it's just pm.write("foo")
<SeanTAllen> there's an unfinished PR to fix some issues in process monitor... https://github.com/ponylang/ponyc/pull/1014
<SeanTAllen> to handle write buffering correctly
<SeanTAllen> by calling writev instead of write, you are probably hitting that buffering issue
<polypus74> i suppose this is a non-deterministic bug then
<doublec> heh
<doublec> _stdin_write is defined as a U32
<SeanTAllen> the existing bug is with handling buffering correctly
<doublec> there's a check in pm.write for _stdin_write > 0
<doublec> I wonder why that's basically checking for it not being zero when it's initialized to -1 which is greater than zero
<doublec> for unsigned
<doublec> So 'write' and 'done_writing' are behaviours
<doublec> and so is writev
<doublec> writev calls write
<SeanTAllen> its verifying that it is still open
<doublec> Are the write calls in writev guaranteed to run before the done_writing call?
<doublec> That's the problem
<SeanTAllen> yes
<SeanTAllen> casual messaging
<doublec> Adding printf debugging
<doublec> Shows 'writev' called then 'done_writing', then the 'write'
<SeanTAllen> done_writing will happen after the writev calls
<SeanTAllen> that shouldnt be possible
<SeanTAllen> if you call
<SeanTAllen> writev
<SeanTAllen> then
<SeanTAllen> done_writing
<polypus74> also should not the actual @write be happening in a fun not a behaviour. say _write, which would be called by all these write funs
<doublec> Something else must be calling done_writing
<SeanTAllen> polypus74: why?
<polypus74> extra message
<polypus74> or does that not matter on this?
<SeanTAllen> that's dangerous
<SeanTAllen> imagine that you send in an array of 10,000 things to print
<doublec> SeanTAllen: http://pastebin.com/H6zC4Vpa
<SeanTAllen> now they will all run under a single behavior call
<doublec> There I log write, writev, and done_writing
<doublec> done_writing gets called before write.
<polypus74> SeanTAllen: got it
<SeanTAllen> what's you code doublec ?
<doublec> SeanTAllen: it's polypus74 code with printf debugging added in the process code. I'll paste that.
<SeanTAllen> if that's true
<SeanTAllen> then pony's fundamental guarantees are broken
<SeanTAllen> and we should see when the regression occurred
<doublec> SeanTAllen: test case http://pastebin.com/qDj0BQ5W
<doublec> SeanTAllen: requires no process, etc
<doublec> Anyone reproduce?
<SeanTAllen> hmmm
<SeanTAllen> o
<polypus74> yes. same as pastie
<SeanTAllen> yeah that actually makes sense
<SeanTAllen> doublec that would actually be correct
<polypus74> cuz of ffi
<SeanTAllen> no
<SeanTAllen> because you run a behaviour to completion
<SeanTAllen> and create is a behavior
<SeanTAllen> so writev will be enqueued
<SeanTAllen> and then
<SeanTAllen> done_writing will be enqueued
<SeanTAllen> and writev runs
<SeanTAllen> and enqueues to write calls
<SeanTAllen> which will happen after the done_writing call
<SeanTAllen> so...
<SeanTAllen> polypus74: you were correct
<SeanTAllen> the behavior calls are problematic
<polypus74> this only proves i have not fully understood causal messaging. i would have thought done_writing had to happen after both writes
<SeanTAllen> yeah i did at first as well
<SeanTAllen> until i realized what was going to happen
<SeanTAllen> and it still fits with casual messaging
<SeanTAllen> you were right though
<SeanTAllen> those need to be internal fun calls
<polypus74> by accident maybe :)
<SeanTAllen> anyway
<SeanTAllen> im fixing
<SeanTAllen> ill call it the "polypus74 fix"
<doublec> Might need to be some exploring of patterns in the "create, do stuff, destroy" space.
<doublec> with regards to using behaviours vs funs
<SeanTAllen> its tricky
<SeanTAllen> Markus wrote the process monitor code
<SeanTAllen> Sylvan and I both reviewed it
<SeanTAllen> neither one of us noticed the problem
<SeanTAllen> and i didnt now when polypus74 pointed it out
<doublec> I also assumed casual made it ok
<doublec> s/casual/causal/
<polypus74> the moral of the story is don't do *casual* messaging :)
<doublec> or understand it better to know what the actual guarantee is
<doublec> oh haha, indeed
<doublec> causal vs causal gets me all the time
<doublec> s/causal/casual/
<doublec> I hate that work :)
<polypus74> yes
<SeanTAllen> polypus74: you should make that your sig for all mailing list posts...
<SeanTAllen> ok...
<polypus74> :)
<SeanTAllen> you know this means I have to do another emergency release once someone else merges this
<SeanTAllen> THANKS polypus74 l
<SeanTAllen> now i have to do work
* SeanTAllen shakes fist
<polypus74> ur welcome :)
<doublec> SeanTAllen: I'm glad I'm not the only one who types casual messaging instead of causal (2nd last paragraph of your pull request) :)
<SeanTAllen> ha
<SeanTAllen> arg
<SeanTAllen> did i do that again?
<doublec> "in the tutorial about casual messaging and make sure"
<SeanTAllen> "amend" to the rescue
<SeanTAllen> aka "are you sure doublec?" ;)
<doublec> hahaha
<SeanTAllen> polypus74: if someone else with a commit bit accepts and merges this tonight before i get tired, i'll do a release. in the meantime, if you want, you can apply the PR to your ponyc.
<polypus74> cool. thanks that should keep me going. whole opint of this was to make a little dmenu/dzen package. apropos, has anything gone down on the package manager front?
<polypus74> s/opint/point
<SeanTAllen> nothing
<SeanTAllen> jemc is interested in the package manager but he has a lot of other things going on
<SeanTAllen> as long as it isnt something awful like maven, i have limited opinions. pony-stable works fine for us as a "package manager".
<SeanTAllen> in the end, its probably going to be dueling package managers that come from the community and one will win out enough to be annointed as "the way"
<SeanTAllen> i get everything i need from stable
<SeanTAllen> i point it at a github repo or local directory
<SeanTAllen> i can tell it what commit/tag to use
<SeanTAllen> that's all i ever want from a "package manager"
<polypus74> saw it a while back and forgot about it. will have a go at it
montanonic has quit [Ping timeout: 265 seconds]
<polypus74> one thing package manager or not, is package visibilty. for people who don't know pony to be able to see what is available all in one place. an 'awesome-pony' repo or something, linked to from a prominent place. starting with pony-stable
<SeanTAllen> yeah i think that is a different issue entirely
<SeanTAllen> well, its a couple mostly orthogonal issues
<SeanTAllen> i think rust does a good job there
<SeanTAllen> well
<SeanTAllen> a decent job
<polypus74> for the moment while their are so few packages a simple list is fine.
<SeanTAllen> i cant think of anything that i think does a good job
<SeanTAllen> of course im not sure what i would consider a good job
<SeanTAllen> probably "read my mind and tell me the package i want"
<SeanTAllen> i might have unreasonable expectations
<polypus74> :)
<SeanTAllen> im really hopeful that someone from the community will step forward and build that infrastructure
<polypus74> i'm gonna start an awesome-pony repo in the meantime
montanonic has joined #ponylang
<SeanTAllen> there have been a couple already
<SeanTAllen> i think
<SeanTAllen> when you start it polypus74, let me know and i can add it to the work for the new website
<SeanTAllen> i'll put it in the "community" section
<polypus74> np
<SeanTAllen> or you can issue a PR...
Praetonus has quit [Quit: Leaving]
montanonic has quit [Ping timeout: 240 seconds]