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
<SeanTAllen> although i guess it sort of makes sense
<SeanTAllen> got to run, time to make dinner.
<SeanTAllen> good luck. ill check back later.
<gregrc> I'm done for the night too. Thanks again
gregrc has quit [Quit: Page closed]
khan has quit [Client Quit]
khan has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
codec1 has quit [Read error: Connection reset by peer]
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
gregrc has joined #ponylang
gregrc has quit [Client Quit]
jemc has quit [Ping timeout: 260 seconds]
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
dougmacdoug has joined #ponylang
jemc has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
jemc has quit [Quit: WeeChat 1.9]
endformationage has quit [Quit: WeeChat 1.9.1]
khan has quit [Quit: khan]
milisarge has quit [Ping timeout: 265 seconds]
mahmudov has quit [Remote host closed the connection]
milisarge has joined #ponylang
dougmacdoug has quit [Ping timeout: 260 seconds]
mahmudov has joined #ponylang
codec1 has joined #ponylang
khan has joined #ponylang
mahmudov has quit [Ping timeout: 276 seconds]
acarrico has quit [Ping timeout: 240 seconds]
khan has quit [Quit: khan]
khan has joined #ponylang
sarna has joined #ponylang
<sarna> guys, do you know any good blog post series or something which would allow me to wrap my head around the actor model?
<sarna> and pony's take on it
<sarna> I'm reading this one at the moment, but I'm not sure if it applies to pony
<SeanTAllen> sarna: pony is somewhat different
<SeanTAllen> i'm not aware of a good blog series really
<sarna> :(
<SeanTAllen> all of them that i see are specific to a given implementation
<sarna> time to write one :^)
<SeanTAllen> the basics that are shared across all is...
<SeanTAllen> 1) actors communicate through messages
<SeanTAllen> 2) you send messages from one actor to another in an async fashion (some implementations provide a way to write code that looks synchronous)
<SeanTAllen> 3) mutable data can't be shared between actors
<SeanTAllen> 4) there's some sort of schedulers that determines when an actor runs
<SeanTAllen> beyond that, there's not a lot in common between erlang, pony, akka
<sarna> shucks
<SeanTAllen> for example...
<SeanTAllen> erlang has the concept of selective receive
<SeanTAllen> this means that messages can arrive as 1, 2, 3
<sarna> do pony actors even have mailboxes? I mean isn't it just executing behaviors
<SeanTAllen> and you could use selective receive to read message 2 first
<sarna> Oo
<SeanTAllen> whereas in pony, you have to handle them in the order they are received
<SeanTAllen> there are pros and cons of each approach
<SeanTAllen> yes, each pony actor has a queue that generally gets referred to as its mailbox
<SeanTAllen> calling a behavior is a message send in pony
<sarna> can I see it? modify it?
<sarna> the queue
<SeanTAllen> no you can't see it
<SeanTAllen> no you can't modify it
<sarna> alright
<SeanTAllen> messages are processed in order by an actor
<SeanTAllen> this provides causal guarantees that can be very handy
<SeanTAllen> feel free to ask any questions you have though and i'll do my best to answer
<sarna> how would I model the famous bank accounts example?
<SeanTAllen> well, aside from the fact that that isn't how bank accounts actually work...
<sarna> :)
<SeanTAllen> i would have an actor for each bank account.
<SeanTAllen> i would send a message that is something like initiate transfer from one account to another, with an amount.
<SeanTAllen> that transfer is pending until it is acknowledged by the other account
<SeanTAllen> then you have to decide...
<SeanTAllen> what are the rules of your bank for how long a transfer can be outstanding before its cancelled
<SeanTAllen> for example, i used to send my father money every month. he passed away, 90 days after the last check he didn't cash was sent, my bank cancelled it and the $ was returned to my account
<SeanTAllen> until that time it wasn't available
<SeanTAllen> of course, that leaves open...
<SeanTAllen> what happens if the other account accepts it at the same time we decide its no longer valid...
<SeanTAllen> then you'd have to do something to work that out
<SeanTAllen> but we are now modeling accounts in a way that ... reflects the real world and has to deal with the distributed, async nature of it.
<sarna> would I need something like a main actor? The Bank? I guess I don't?
<SeanTAllen> No
<SeanTAllen> you don't
<SeanTAllen> you probably dont want to have 1
<sarna> that's good
<SeanTAllen> because "the bank" might become a bottleneck
<sarna> yup
<SeanTAllen> you want each actor to be able to act as individually as possible
<SeanTAllen> if you want to maximize concurrency and possible performance
<SeanTAllen> that last bit is covered here in the pony performance cheatsheet... https://www.ponylang.org/reference/pony-performance-cheatsheet/#design-for-performance
<sarna> yeah, I've seen that one
<sarna> thank you for taking your time
<sarna> I'll toy around with it
<sarna> with the actor model, I mean :^)
<SeanTAllen> you're welcome
<SeanTAllen> feel free to come by anytime and ask questions
<SeanTAllen> if no one can answer, we always answer where we can, so check the logs.
<sarna> of course :)
mahmudov has joined #ponylang
gokr has joined #ponylang
dougmacdoug has joined #ponylang
mahmudov has quit [Quit: Leaving]
mahmudov has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
Praetonus has joined #ponylang
khan has quit [Ping timeout: 268 seconds]
Pyrrh has quit [Ping timeout: 240 seconds]
Pyrrh has joined #ponylang
khan has joined #ponylang
sarna has quit [Quit: Connection closed for inactivity]
vaninwagen has joined #ponylang
sarna has joined #ponylang
<sarna> what's the idiomatic way of doing `for i in 1..10`?
<SeanTAllen> you want Range sarna
<sarna> SeanTAllen: thanks!
<SeanTAllen> you're welcome
dougmacdoug has quit [Ping timeout: 260 seconds]
khan has quit [Ping timeout: 240 seconds]
<sarna> can a class have a static field?
<vaninwagen> sarna, you mean bound to the class itself, not any object of it like in java?
<vaninwagen> if so, the answer is no :)
<vaninwagen> that is a good thing
<sarna> yeah, something that all instances share
<sarna> alright, thanks :^)
gokr has quit [Ping timeout: 240 seconds]
<sarna> also, uhm, qualified imports. do you have them?
<SeanTAllen> what is a qualified import sarna?
<sarna> iirc it's something like
<sarna> import maths
<sarna> maths.cos(2)
<sarna> in pony you'd just cos(2), right?
<SeanTAllen> im not sure what that is supposed to be indicating
<SeanTAllen> no, there is no naked "cos(2)"
<sarna> hmm, then I've misunderstood something
<SeanTAllen> you seem to be asking a question that feels like python
<SeanTAllen> what are you trying to do sarna ?
<sarna> let's say you `use collections`, how do you call something from collections? do you have to `collections.foo` or just `foo`?
<sarna> also, can I import just two or three functions from a package?
<SeanTAllen> you dont import functions
<SeanTAllen> you import classes, actors and primitives
<SeanTAllen> which can have attached functions (and in the case of actors, behaviors)
<SeanTAllen> if you use "collections"
<SeanTAllen> that everything that is part of that package is available to you
<SeanTAllen> so for example Array is a class in collections
<SeanTAllen> i use collections then i can do something like
<SeanTAllen> Array.init(1,6)
<sarna> no, not yet '^ ^
<sarna> I'll read it though
<sarna> ahhh I see
<sarna> sorry, I'm not used to this way of doing stuff (/everything/ local)
<SeanTAllen> everything local?
<sarna> yeah, you can't have global stuff in pony
<sarna> no functions, only methods
<sarna> etc
Praetonus has quit [Quit: Leaving]
vaninwagen has quit [Ping timeout: 240 seconds]
<SeanTAllen> "no functions, only methods"?
<SeanTAllen> whats your definition of a function? whats your definition of a method?
<sarna> classes have methods, functions are more standalone
<SeanTAllen> well
<SeanTAllen> a primitive isnt a class
<sarna> and it has functions, right
<sarna> it can have, at least
<SeanTAllen> im not sure that is a particularly meaningful distinction in Pony
<SeanTAllen> but...
<SeanTAllen> however you want to think about it is fine
<sarna> ah no, I didn't mean functions in primitives are functions and functions in classes are methods '^ ^
<sarna> it's a lousy distinction, to be honest
<SeanTAllen> it doesnt matter that much though in the Pony context
<SeanTAllen> whichever you say, people will understand
<SeanTAllen> in general Pony has `fun` for function and `be` for behavior.
<sarna> yeah
<sarna> behaviors are really only called by other actors, right?
<SeanTAllen> yes
<SeanTAllen> only actors have behaviors
<SeanTAllen> calling a behavior is an async message send
<SeanTAllen> its why behaviors cant have a return type
<sarna> return value is the message we get back?
<SeanTAllen> there is no return value for a behavior
<SeanTAllen> behaviors always return None