* 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
<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>
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.
<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.
<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.