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 | Please consider participating in our mailing lists => https://pony.groups.io/g/pony
atk has quit [Quit: Well this is unexpected.]
atk has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
acarrico has joined #ponylang
gokr has quit [Ping timeout: 240 seconds]
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
acarrico has quit [Ping timeout: 245 seconds]
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
gokr has joined #ponylang
SenasOzys has quit [Ping timeout: 256 seconds]
jaro has joined #ponylang
gokr has left #ponylang [#ponylang]
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
endformationage has quit [Quit: WeeChat 1.9.1]
khan has quit [Remote host closed the connection]
jmiven has quit [Quit: co'o]
jmiven has joined #ponylang
acarrico has joined #ponylang
Robdor has quit [Quit: Ping timeout (120 seconds)]
Robdor has joined #ponylang
SenasOzys has joined #ponylang
khan has joined #ponylang
<aturley> alright, i'm calling this my official release of my pony cheat sheet. https://drive.google.com/open?id=1ZsNoKDZL_N5QtRWtWYLjYoPVAebww5Ag
<aturley> it isn't intended as a stand-alone document. the idea is to use it as a supplemental reference as you're learning.
<SeanTAllen> @aturley could you PR that so its available from ponylang.org? linked to from the "learn" section?
<aturley> SeanTAllen sure
SenasOzys has quit [Ping timeout: 240 seconds]
SenasOzys has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
<SeanTAllen> thank you sir!
khan has quit [Client Quit]
SenasOzys has quit [Ping timeout: 260 seconds]
khan has joined #ponylang
SenasOzys has joined #ponylang
_rck has joined #ponylang
endformationage has joined #ponylang
gokr has joined #ponylang
vassilvk has quit [Remote host closed the connection]
gokr has quit [Ping timeout: 245 seconds]
gokr has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
ndrwsh has joined #ponylang
<ndrwsh> hi all. I stuck on the last page of tutorial -- Serialisation with "hello world". I have decided to print bytes let bytes_sx: Array[U8] val = sx.output(output)
<ndrwsh> but unlike most languages, Pony has zero blocking operations.
<ndrwsh> so CStringWrapper.print happens INSIDE printing loop
<ndrwsh> I guess CStringWrapper.print is blocking after all
<ndrwsh> So I have read Patterns: Async
<ndrwsh> And made two actors
<SeanTAllen> what is CStringWrapper ndrwsh ?
<ndrwsh> Printer with access() and Mathematician with print()
<ndrwsh> @SeanTAllen CStringWrapper is class on the last page of pony tutorial gitbook
<ndrwsh> my problem is
<ndrwsh> I can not pass CStringWrapper to create of Mathematician actor
<ndrwsh> with error msg:
<ndrwsh> this parameter must be sendable (iso, val or tag)
<SeanTAllen> @printf is a C FFI call to printf. That is a blocking operation.
<SeanTAllen> ndrwsh: you are into a rather complicated area of the appendix. i would suggest playing around with some simpler pony for now.
<SeanTAllen> you CStringWrapper is a `ref`, you can't send that to another actor
<ndrwsh> I tried to consume it to val or iso -- but it did'nt work
<ndrwsh> I feel like there's just one little step -- but I can't make it. Such depressing feeling :(
gokr has quit [Quit: Leaving.]
gokr has joined #ponylang
gokr has quit [Ping timeout: 260 seconds]
<SeanTAllen> you can't consume a ref
<SeanTAllen> a ref means "there can be many aliases to this"
<SeanTAllen> you can consume an iso, not a ref
<SeanTAllen> refs can never be sent to another actor. you would have to copy a ref to send it to another actor.
<ndrwsh> oh. like clone
<SeanTAllen> yes, like clone
<SeanTAllen> if you want to send a mutable thing from one actor to another, it has to be an iso
<SeanTAllen> and you have to consume your alias so you can send it to another
<SeanTAllen> you see the `ref` in this?` fun ref _deserialise(bytes: Pointer[U8] tag) => _cstr = @deserialise[Pointer[U8] tag](bytes)`
<SeanTAllen> that means, you have to have a ref to call _deserialise, so its going to get kind of tricky with the code you are copying.
<SeanTAllen> you'd need to make a CStringWrapper clone-able so you could get a val or an iso from your clone, which can be sent to other actors.
<SeanTAllen> if you are working your way through the tutorial, that's going to be a little advanced.
<SeanTAllen> not really what i would call a starter project, but not impossible
<ndrwsh> thank you!
ndrwsh has left #ponylang [#ponylang]
droman has joined #ponylang
<SeanTAllen> you're welcome
droman_ has joined #ponylang
droman has quit [Ping timeout: 240 seconds]
SenasOzys has quit [Ping timeout: 245 seconds]
droman has joined #ponylang
droman_ has quit [Ping timeout: 252 seconds]
jemc has joined #ponylang
_andre has quit [Read error: No route to host]
droman has quit [Read error: Connection reset by peer]
SenasOzys has joined #ponylang
droman has joined #ponylang
SenasOzys has quit [Ping timeout: 260 seconds]
droman_ has joined #ponylang
droman has quit [Ping timeout: 245 seconds]
droman_ has quit [Quit: WeeChat 2.1]
amclain has joined #ponylang
<_rck> vaninwagen that pony-kv is useful, thank you!
<_rck> I tested it a bit and it seems to have some problems stabilizing the state if you have a lot of writes
<_rck> in the worst case, you need to wait for all the reads to complete before you get a chance to submit your update
<_rck> which I guess it's a good compromise otherwise your write would be lost
<_rck> also, I was looking at the Promises package looking for something similar to promise.race() on js
<_rck> where you submit a list of promises and it returns as soon as one of the promises resolves, and doesn't wait for the others
<_rck> I see there's a Promise.select() method already, but that also returns the other promises that still need to resolve
<_rck> I tried to implement my own version, where it only returns the value of the first promise that resolves
<_rck> but it will still wait for the others to finish, even if we don't care about their result
<_rck> looking at the promises actor, it seems that even if you reject a promise, the actor will wait for a resolve to happen
<_rck> but then discard the value
<_rck> I guess my question is: is there a way to implement this without waiting for the rest of the promises?
<_rck> alternatively, is this (a race method) a thing that people would care for in the standard promises package?
_rck has quit [Ping timeout: 252 seconds]
endformationage has quit [Quit: WeeChat 1.9.1]
endformationage has joined #ponylang
gokr has joined #ponylang
_rck has joined #ponylang
<SeanTAllen> _rck: you could do something like race
<SeanTAllen> it would be easier to do as your own promises library first, work out the API then perhaps RFC as an addition to standard library
<SeanTAllen> you can't cancel a message send in Pony so results would still be returned from everything but, you could return a result to the user after the first one is done.
pzel has joined #ponylang
<SeanTAllen> ive never thought about how you would build cancellation for something like. offhand I can't think of how you would do it, given casual messaging.
<SeanTAllen> well i can think of one way but the tradeoffs arent great.
_rck has quit [Ping timeout: 245 seconds]
droman has joined #ponylang
jemc has quit [Read error: Connection reset by peer]
_rck has joined #ponylang
jemc has joined #ponylang
<pzel> Hi Pony people. I've been playing around learning the language, and I found strange behavior in String.strip: https://gist.github.com/pzel/2e2cb64d5bafa9aa2a8533971efd7196
<pzel> String.strip() mangles UTF-8 sequences at the ends of strings, or right before the trailing whitespace
<_rck> SeanTAllen: my first implementation rejects the rest of the promises, but one could just ignore them instead
<_rck> I just extended the built-in Promises primitive with a race operation, instead of doing it inside the Promise actor
<SeanTAllen> @pzel pretty sure its the truncate at the end of rstrip
endformationage has quit [Quit: WeeChat 1.9.1]
<pzel> SeanTAllen: yeah, I'm also pretty sure that's where the destruction happens, but the parameter is provided by that repeat/until loop, which I'll need to debug to understand
<SeanTAllen> yeaj so truncate is called with a 1
<SeanTAllen> and blammo
pzel has quit [Remote host closed the connection]
pzel has joined #ponylang
<pzel> SeanTAllen: should I submit this as a github issue?
<SeanTAllen> yup
<SeanTAllen> found the problem
<SeanTAllen> i think
<SeanTAllen> o wait
<SeanTAllen> hmmm
<SeanTAllen> nvm
<pzel> i didn't meant to distract you from whatever else you were busy with :) I'd like to try to suss this out myself
pzel has quit [Read error: Connection reset by peer]
pzel has joined #ponylang
<SeanTAllen> o this is interesting
<SeanTAllen> now time to look at contains
_rck has quit [Quit: WeeChat 2.1]
<SeanTAllen> right so i understand what is happening
<SeanTAllen> pzel
<SeanTAllen> 5 code points
<SeanTAllen> starting from the end
<SeanTAllen> " " is in the characters array for runes
<SeanTAllen> so we dont break
<SeanTAllen> but code points 4,3,2
<SeanTAllen> they are not valid beginnings of points
<SeanTAllen> so (0xFFFD, 1)
<SeanTAllen> and we dont break
<SeanTAllen> when we get to codepoint 1
<SeanTAllen> its valid and triggers if not chars.contains(c) then
<SeanTAllen> BUT by that point i is 0
<SeanTAllen> so truncate(i + 1)
<SeanTAllen> which whacks most of the string
<SeanTAllen> so
<SeanTAllen> the fix isnt to truncate to i
<SeanTAllen> but to the last valid value
<SeanTAllen> i think setting a variable like
<SeanTAllen> then
<SeanTAllen> and finally
<SeanTAllen> truncate(truncate_at)
<SeanTAllen> fixes the bug
<SeanTAllen> pzel: can you verify that change passes your test and the other tests?
<pzel> let me digest that
<pzel> yep
<pzel> yep, will do.
<SeanTAllen> ```
<SeanTAllen> it also seems to work for this, that would be a good test:
<SeanTAllen> AND the fix will make it in before i do a new release this weekend!
<SeanTAllen> that's the only usage of truncate in string.pony so, doesn't look like that particular one would be another impact
<SeanTAllen> now... what about lstrip
<SeanTAllen> lstrip appears to be busted
<pzel> It doesn't exhibit the same issue.
<pzel> How is it busted? I just went through .strip() for all my cases,didn't decompose them into l/r
<SeanTAllen> it does
<SeanTAllen> try this
<SeanTAllen> hmmm
<SeanTAllen> that isnt lstrip
droman has quit [Quit: WeeChat 2.1]
<SeanTAllen> arg
<SeanTAllen> my fix isnt right yet
<pzel> ouch, the fix for rstrip breaks an existing case: builtin_test/_test.pony:389: Assert eq failed. Expected (foobarfo) == (foobarfoo)
<SeanTAllen> yup
<SeanTAllen> i know
<SeanTAllen> thats what i just found
<SeanTAllen> lol
<SeanTAllen> o thats an easy fix
<SeanTAllen> initialize truncate_at to _size
<SeanTAllen> to i
<SeanTAllen> much better
<SeanTAllen> dur
<pzel> That fixes the broken case!
<SeanTAllen> i am a bad bad programmer
<pzel> (I wanted to ask about net/Broadcast consistently failing on my machine, too, but another time)
<SeanTAllen> firewall
<pzel> You know what they say about off by one errors
<SeanTAllen> do you have a firewall on?
<SeanTAllen> net/Broadcast can also fail based on network setup
<pzel> let me see. I think I have some ufw rules in place
<SeanTAllen> for example, it always fails for me at my mothers
<SeanTAllen> or if i have the firewall on on the mac
<pzel> I have it open wide except for the routed chain
<pzel> no
<pzel> dumb
<SeanTAllen> no?
<pzel> deny(incoming), there you go
<SeanTAllen> dumb?
<SeanTAllen> ha
<pzel> i am dumb
<SeanTAllen> to be dumb is to be human
<pzel> so true
<SeanTAllen> huh
<SeanTAllen> me thinks i know of another bug in rstrip
<SeanTAllen> nope
<SeanTAllen> no bug
<pzel> meanwhile, firewall thingy fixed and all tests pass. Are there any specific rules regarding PRs?
<SeanTAllen> ummmmm
<SeanTAllen> nothing i can think of beyond: https://github.com/ponylang/ponyc/blob/master/CONTRIBUTING.md
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
endformationage has joined #ponylang
atk has quit [Quit: Well this is unexpected.]
atk has joined #ponylang
atk has quit [Remote host closed the connection]
amclain has quit [Quit: Leaving]
atk has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
aturley has quit [Quit: aturley]