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
<FunkyBob> ah
<FunkyBob> as I mentioned in the ticket, I don't have a reduced version of my code that triggers the error
* FunkyBob waits for the constructive criticism to flow in :)
<endformationage> Hah, nothing like some new Pony riders to crash your animal into the fence!
<FunkyBob> yeehaw!
<FunkyBob> endformationage: is that the official term for pony coders? a Pony Rider?
<endformationage> When I first started looking at Pony a week or so ago I thought, "Ah, I think I can ride this language!"
<endformationage> I am still trying to figure out how to grasp its saddle, hand crafted out of pure Reference capabilities where the sturups are each bangs and hats, and that knoby thing is an arrow type.
<FunkyBob> heh
<FunkyBob> yeah, it's taken me quite some time to attempt this
<FunkyBob> now that I've found a time people are active here... it's easier :)
<endformationage> I'm going to look cool as hell and win all the races once I get my giddyup on. Practicing in the play-pen for now.
* FunkyBob wonders what timezones people are in
<FunkyBob> I'm in AU, east coast, so currently GMT+10
<endformationage> FunkyBob: Sorry I didn't catch you earlier about your initial post/problem. I had an incling your problem had to do with apply sugar, as I had just came across it too.
<endformationage> I'm sort of coming from Python as well.
<endformationage> Though, just recently also toyed with Rust
<endformationage> Pony's built in actors caught my attention.
<FunkyBob> yah
<FunkyBob> I've plated with Pythons async stuff...
<endformationage> And oddly enough, the reference cababilities. I'd heard of them,
<FunkyBob> up front, the claims seemed incredible, then as I read the tutorial, it became clear how they could be enforced
* FunkyBob notices nobody has criticiesd his code yet
<FunkyBob> surely I can't have it _that_ right? :P
<endformationage> ... not sure how much help I'll be but taking a look ...
<doublec> FunkyBob: I'm NZ so close to your timezone
<FunkyBob> doublec: handy... where abouts?
<doublec> FunkyBob: Auckland
<FunkyBob> ah, ok... passed through there to get to the good stuff a couple of years ago :)
<doublec> nice :)
<FunkyBob> friend of mine lives near Napier
<FunkyBob> and another just moed to Wellington, iirc
<FunkyBob> moved
<doublec> I used to live in Wellington.
<endformationage> FunkyBob: It looks like the result of your get command will be lost.
<FunkyBob> yes
<endformationage> Your actor will need a handle to something to send a message comtaining the result back
<FunkyBob> yep
<endformationage> doublec: Might I remember your interaction with the Factor community?
<endformationage> FunkyBob: Also I think the set and delete behaviors may need to have `ref` reciever capability set to modify the map.
<FunkyBob> instead of iso?
smoon has joined #ponylang
<endformationage> as in `be ref set(cmd: SetCommand iso) => ...`
<FunkyBob> /home/curtis/src/kt/main.pony:55:6: actor behaviour cannot specify receiver capability
<jemc> a behaviour is always `ref`, so no need for `be ref` and as FunkyBob discovered the explicit form is actually disallowed
<endformationage> Ah, I guess that's just fomr functions
<endformationage> good to know
<FunkyBob> not that I knew any of that :)
<FunkyBob> or even remember the implications
<endformationage> me neither aparently!
jemc has quit [Ping timeout: 240 seconds]
jemc has joined #ponylang
<FunkyBob> endformationage: I'm sure there are more details to sort out, like types being returned from the behaviors (can that even happen?)
<FunkyBob> but so far, I can't even test since compiler assplodes :)
amclain has quit [Quit: Leaving]
<endformationage> FunkyBob: Since behaviors return strait away (they're exec async), I beleive they always return the actor.
<FunkyBob> yeah, they do
<FunkyBob> so I need another way for it to pass a response
chemist69 has quit [Ping timeout: 260 seconds]
<endformationage> I meant to say behaviors always return the receiver (actor object).
jemc has quit [Ping timeout: 276 seconds]
<endformationage> I'd recommend using a Promise.
<FunkyBob> ah, yes
<endformationage> I get the feeling Pony code uses Promises and notifiers everywhere.
<FunkyBob> notifiers?
<endformationage> The whole promise chaining and fullfill / reject thing sounds pretty useful though. I look forward to trying them out.
<endformationage> Yeah, the pattern you used for your UDPNotify class
* endformationage is off to grab a bite
<FunkyBob> ah, ok...
<FunkyBob> what's the ~ operator do?
<FunkyBob> .next[Array[USize] val](recover Computation~strings_to_sizes() end)
<FunkyBob> Partial application
chemist69 has joined #ponylang
<FunkyBob> so would that mean instead of State being an actor, I'd use Promises as sort of proxy actors around it?
<FunkyBob> of course, it's all in the doc linked earlier :)
<FunkyBob> typoes and all :) "promoses"
<doublec> endformationage: yes, I did a lot with Factor
<endformationage> I don't know much about tcp/udp networking, but I think you could create a promise in your parse fun, where "G" is matched. Chain a fullfill handler to the promise there, but pass along the promise inside the GetCommand, and call the promise with the value from the map.
<endformationage> doublec: I learned alot from Factor. It allowed me think differently about things.
<doublec> endformationage: Me too, it's a great language. A good graphical environment too, with the live coding and display.
<endformationage> doublec: I've not looked at it for awhile, but I really liked it.
<endformationage> FunkyBob: Sweet.
<FunkyBob> have had a fair bit of practice with promises in JS
gmcabrita has quit [Quit: Connection closed for inactivity]
smoon has quit [Quit: smoon]
_whitelogger has joined #ponylang
_whitelogger has joined #ponylang
graaff has joined #ponylang
jemc has joined #ponylang
<FunkyBob> jemc: ah, yeah, I should have read it more closely :)
<jemc> FunkyBob: the workaround for getting around your compiler issue is that you have to use case patterns like `let cmd': GetCommand` in your `match` statement in `State.dispatch`, rather than just `GetCommand`
<jemc> I'm fixing the bug that causes it not to show the proper error message, but that is a real compiler error you have to avoid
<FunkyBob> ok
<FunkyBob> so you mean:
<FunkyBob> | GetCommand => get(cmd, p)
<FunkyBob> becomes | let GetCommand => ?
<jemc> becomes:
<jemc> `| let cmd': GetCommand => get(cmd', p)`
<FunkyBob> oh
<FunkyBob> yay... whole new set of errors
<jemc> yeah, there's some other problems to deal with in that snippet too, but at least you have errors now instead of a crash :P
<FunkyBob> indeed
papey_lap has joined #ponylang
<FunkyBob> jemc: https://dpaste.de/miuk
<FunkyBob> ~.
<FunkyBob> ~.
papey_lap has quit [Quit: WeeChat 1.7.1]
<FunkyBob> grr
<FunkyBob> need to print myself out a matrix of cap rules
<FunkyBob> hmm
<jemc> FunkyBob: use `match consume cmd` instead of `match cmd`
<FunkyBob> that match is trying to match on type....
<jemc> and also use `iso` on the types
<jemc> as in `| let cmd': GetCommand iso => ...`
<FunkyBob> still not sure why the "let Foo" syntax is needed... or why I need cmd'
<FunkyBob> I want to invoke a different behavior based on the type of the ocmmand
<jemc> sorry, gotta go for now - will be back tomorrow
<jemc> I understand what you're trying to do, and the `let` syntax is required
jemc has quit [Ping timeout: 240 seconds]
papey_lap has joined #ponylang
graaff has quit [Quit: Leaving]
<doublec> You could probably have the Command objects have a method that returns a closure/partial application that calls the required behaviour.
<doublec> And avoid the match.
<doublec> Or: cmd.dispatch(p)
<doublec> And the implementations of dispatch in cmd call the right behaviour
<doublec> You'd need to have an interface/trait for the dispatch call set up.
<FunkyBob> hmm
<doublec> The pony idiom would probably be for the 'dispatch' method to be an 'apply' method. So it would get called like: cmd(p)
<doublec> Due to the syntactic sugar
<FunkyBob> makes sense
<FunkyBob> feels cleaner
<FunkyBob> fun apply(s: State): Promise[String] =>
aav has quit [Ping timeout: 255 seconds]
aav has joined #ponylang
vaninwagen_ has joined #ponylang
<FunkyBob> ok, my State was an actor to serialise access to it.... now, hmm...
<FunkyBob> I have have it apply the cmd it's passed, passing itself...
<FunkyBob> ok.. brain is catching up
<FunkyBob> nope... blargh
<FunkyBob> /home/curtis/src/kt/main.pony:66:18: Command iso! is not a subtype of Command iso: iso! is not a subcap of iso
Candle has joined #ponylang
papey_la1 has joined #ponylang
papey_lap has quit [Ping timeout: 255 seconds]
papey_la1 is now known as papey_lap
<doublec> FunkyBob: that usually means you're not consuming it somewhere where you need to
<FunkyBob> aye
<FunkyBob> I'm getting lost everywhere
<FunkyBob> I need to slow down, reduce the case, and build it up again
endformationage has quit [Quit: WeeChat 1.7]
gmcabrita has joined #ponylang
jtfmumm__ has quit [Remote host closed the connection]
omarkj has quit [Remote host closed the connection]
darach has quit [Remote host closed the connection]
gornikm_ has quit [Remote host closed the connection]
strmpnk has quit [Remote host closed the connection]
omarkj has joined #ponylang
darach has joined #ponylang
strmpnk has joined #ponylang
gornikm_ has joined #ponylang
jtfmumm__ has joined #ponylang
virtual_lark has joined #ponylang
vaninwagen_ has quit [Ping timeout: 260 seconds]
vaninwagen_ has joined #ponylang
virtual_lark has quit [Quit: reboot]
papey_lap has quit [Quit: WeeChat 1.7.1]
vaninwagen_ has quit [Ping timeout: 240 seconds]
papey_lap has joined #ponylang
aav has quit []
vaninwagen_ has joined #ponylang
_andre has joined #ponylang
<SeanTAllen> FunkyBob: if you ever want to do an around the world 30 to 60 minute pairing session to talk through some stuff, let me know.
<SeanTAllen> From what I read, it sounds like your background is primarily in Python. If that's the case, there's probably a bunch of additional learning hurdles for you that someone coming from a highly concurrent, multithreaded language wouldn't have. I imagine your congnitive load is incredibly high right now.
aav has joined #ponylang
Candle has quit [Remote host closed the connection]
Candle has joined #ponylang
jemc has joined #ponylang
obadz has quit [Ping timeout: 260 seconds]
obadz has joined #ponylang
endformationage has joined #ponylang
bbhoss has quit [Ping timeout: 264 seconds]
gornikm_ has quit [Ping timeout: 276 seconds]
strmpnk has quit [Ping timeout: 276 seconds]
darach has quit [Ping timeout: 276 seconds]
emilbayes has quit [Ping timeout: 264 seconds]
gmcabrita has quit [Ping timeout: 276 seconds]
bweez_ has quit [Ping timeout: 240 seconds]
darach has joined #ponylang
strmpnk has joined #ponylang
omarkj has quit [Ping timeout: 276 seconds]
gornikm_ has joined #ponylang
adamkittelson has quit [Ping timeout: 255 seconds]
jeremyheiler has quit [Ping timeout: 240 seconds]
omarkj has joined #ponylang
bweez_ has joined #ponylang
gmcabrita has joined #ponylang
adamkittelson has joined #ponylang
<endformationage> There are parts of the Tutorial which mention number of actors going into the millions. What are some examples use cases for employing very high number of actors, and what kind of patterns are used to create and manage them?
adamkittelson has quit [Client Quit]
jeremyheiler has joined #ponylang
bbhoss has joined #ponylang
zevlg has quit [Remote host closed the connection]
adamkittelson has joined #ponylang
<jemc> endformationage: I think the main takeaway from that is supposed to be that you shouldn't worry about creating many actors, as they carry only a little more overhead tha normal objects, and that you won't bog down the scheduler based on the number of actors (only based on the number of total *messages* sent to all actors)
<jemc> creating a Promise (which is an actor) for every request that comes into a server is a good example of a use case that requires a system that doesn't get bogged down just because you created thousands or millions of actors
amclain has joined #ponylang
vaninwagen_ has quit [Ping timeout: 276 seconds]
graaff has joined #ponylang
emilbayes has joined #ponylang
<SeanTAllen> endformationage: patterns to manage is still an open area in Pony-land. That will evolve over time. At the simplest level is `Bureaucracy` package. Which has a couple things to address.
<endformationage> Thanks.
graaff has quit [Quit: Leaving]
<endformationage> I made an example to help myself understand reference capability subtyping: http://pony-playpen.lietar.net/?gist=828cd5fdfec9265beabef5b662ffe652
<endformationage> I don't remember really seeing such an example in the tutorial.
<endformationage> An explicit one anyhow.
aav has quit []
papey_lap has quit [Ping timeout: 255 seconds]
Matthias247 has joined #ponylang
amclain has quit [Read error: Connection reset by peer]
amclain has joined #ponylang
endformationage has quit [Quit: WeeChat 1.7]
_andre has quit [Quit: leaving]
endformationage has joined #ponylang
jemc has quit [Ping timeout: 268 seconds]
Matthias247 has quit [Read error: Connection reset by peer]
<FunkyBob> SeanTAllen: thanks for the offer... I think my biggest hurdle is remembering how the capabilities translate
<FunkyBob> so ,I've drastically simplified my code... and the last remaining errors I have are to do with HashMap
<doublec> HashMap can be tricky
<doublec> Or any container really. Because of dealing with the rcaps of the container, the rcaps of the contents and the rcaps of the caller.
<FunkyBob> correction, I'm using MapIs
<FunkyBob> but that's just an alias for HashMap, right?
<doublec> yes
<FunkyBob> so, here's my error output - https://dpaste.de/G8PK
<FunkyBob> it's collections/persistent/MapIs btw
<doublec> FunkyBob: is the method your calling that in a box method?
<doublec> FunkyBob: what's the enclosing function definition
<FunkyBob> fun ref received(sock: UDPSocket ref, data: Array[U8] iso, from: NetAddress) =>
<doublec> The whole "receiver type box" got "receiver type ref" implies your trying to do a write operation in a box method
<doublec> ok, not that then
<doublec> is 'map' a ref too?
<FunkyBob> am still struggling with when to set caps, and what to choose :)
<FunkyBob> need a decision chart
<doublec> Oh, 'map' is a box
<doublec> You can't call ref methods on it
<doublec> and 'update' is a ref method
<FunkyBob> ah
<doublec> You should make it a 'ref'.
<doublec> Which is probably the default
<FunkyBob> ah, ok
<FunkyBob> that's a leftover from my more complex code
<FunkyBob> yep, that fixed it
<FunkyBob> ok, now
<doublec> btw, you can do: result = match ... end
<doublec> or rather: let result = match ... end
<doublec> and in the clauses of the match, just: map(parts(1))
<doublec> ie. No assigning needed
<FunkyBob> thants
<FunkyBob> thanks
<FunkyBob> /home/curtis/src/kt/main.pony:7:80: function signature is not marked as partial but the function body can raise an error
<FunkyBob> I suppose now I need exception handler :)
<FunkyBob> it builds!
<FunkyBob> oh, not quite
<FunkyBob> can't link for some reason
<FunkyBob> oh, right, --pic not -pic :)
<FunkyBob> jut checking... is "\00" a literal 0 byte?
<endformationage> Wow, the Pony VUG video 'Writing Generic Code' was super helpful for better understanding arrow types. Even in the context of the complex collections.
<FunkyBob> link?
<doublec> Yes, it's a great video
<doublec> I summarized some of it here when I watched it https://bluishcoder.co.nz/2016/05/04/bang-hat-and-arrow-in-pony.html
<endformationage> Also SeanTAllen's question/comment pointing out the quasi similarity of an object's viewpoint on its fields, and a collections' viewpoint on it's items.
<endformationage> doublec: I did read your articles (thanks for them!), and will revisit them soon again.
<endformationage> FunkyBob: I'm following the recommended resources described here: https://www.ponylang.org/learn/#reference-capabilities
<FunkyBob> ah, suspected as much
<endformationage> Next up doublec's article again :)
<FunkyBob> so... am trying to make this tool compatible with another I wrote in C
<FunkyBob> nd it delimits command arguments with a 0-byte
<doublec> The Pony one does, or the C one does?
<doublec> I don't think Pony strings are zero terminated
<doublec> They used to be but it changed at some point
<doublec> See the cstring() method of String which returns a C compatible string
<doublec> It copies and adds a null terminator if needed
<doublec> But it's returned as a Pointer[U8]
<FunkyBob> nah, am just trying to confirm, as I asked earlier, if "\00" is a string literal 0... or is it "\x00" or something ese?
<FunkyBob> else
<FunkyBob> once again i think I've hit a cap issue...
<FunkyBob> /home/curtis/src/git/ponyc/packages/logger/logger.pony:138:53: Logger[String val] val is not a subtype of StringLogger val
<FunkyBob> I created a StringLogger in my Main... and want the udp notifier to also have it
<FunkyBob> /home/curtis/src/kt/main.pony:15:11: couldn't find 'log' in 'StringLogger'
<FunkyBob> /home/curtis/src/git/ponyc/packages/logger/logger.pony:138:53: Logger[String val] val is not a subtype of StringLogger val
<FunkyBob> this is making less sense
<FunkyBob> ah, think I've got it
<doublec> FunkyBob: I'm not sure about the string literal question, sorry.
<FunkyBob> woot... comppiler error again! :)
<FunkyBob> meanwhile, I think I need to consume again...