<endformationage>
Can traits and interfaces be generic?
jemc has joined #ponylang
papey_lap has joined #ponylang
papey_la1 has quit [Ping timeout: 268 seconds]
<SeanTAllen>
yes
<SeanTAllen>
endformationage: yes
chemist69 has quit [Ping timeout: 258 seconds]
chemist69 has joined #ponylang
smoon has quit [Quit: smoon]
smoon has joined #ponylang
graaff has joined #ponylang
gmcabrita has quit [Quit: Connection closed for inactivity]
jemc has quit [Ping timeout: 240 seconds]
jemc has joined #ponylang
smoon has quit [Quit: smoon]
plietar has quit [Remote host closed the connection]
plietar has joined #ponylang
plietar has quit [Ping timeout: 260 seconds]
<endformationage>
I see that calling an actor's behavior at the end of its constructor does not que the message before other messages queued by behavior calls on the actor obj after construction.
<endformationage>
For some reason I did not expect that.
<jemc>
endformationage: it makes a little more sense when you realize the constructor is also asynchronous
<endformationage>
Ah, I remember reading something like that now..
<jemc>
that is, if you looked at the order of messages in Foo's mailbox after `Main.create`, it would be something like (`create`, `act("B")`, `act("C")`)
<jemc>
and the `act("A")` doesn't get enqueued until the `create` executes
<jemc>
and actually, if `create` was super fast to execute, it's *possible* it could enqueue the `act("A")` before the `act("B")` and `act("C")` got enqueued from the original thread executing `Main.create`
<endformationage>
OK, I can see this.
<jemc>
with Pony's causal message ordering, we know that: `create` happens before `act("B")`, `act("B")` happens before `act("C")`, and `create` happens before `act("A")`
<jemc>
(and we also know by the transitive property that `create` must then happen before `act("C")`)
<jemc>
but everything without a causal relationship is "up for grabs"
<endformationage>
right
<jemc>
particularly, we don't know which happens first between A or B, or between A or C
chemist69 has quit [Ping timeout: 260 seconds]
chemist69 has joined #ponylang
jemc has quit [Ping timeout: 260 seconds]
serejkus has joined #ponylang
<serejkus>
hello everyone. Do you have offline docs (like pdf or html or whatever else)? I'd like to play with pony lang, but I won't have an internet connection for a couple of days
<endformationage>
I had a try at something with generics at various levels, but failed to get through the ref cap details. I don't really know if what I tried is possible, but I'd like to know why it doesn't work.
<SeanTAllen>
thanks FunkyBob: it's a slow, gradual progression towards 1.0
<FunkyBob>
correct, then fast :)
<FunkyBob>
was just reading the hash map fix PR
<FunkyBob>
interesting stuff
<FunkyBob>
I t hink I need to find more reasons to use pony
smoon has quit [Quit: smoon]
<SeanTAllen>
if your problem suits the language, its a great one
<FunkyBob>
indeed
<SeanTAllen>
its helped us immensely at Sendence. we wouldn't be as far as long as we are, with the performance we have, without it
<SeanTAllen>
someone asked us the other day "but its so immature, the API is breaking all the time". "yes, but 80% of those breaking changes came out of Sendence".
<FunkyBob>
I think my next move is to get a handle on good patterns to deal with actors and closing the loop
<SeanTAllen>
having experience with strongly typed languages helps, having used an actor language previously also helps
<SeanTAllen>
having worked with a threaded language helps
<SeanTAllen>
i think those 3 are the biggest areas of "learning on your own" that give people a leg up
<SeanTAllen>
so, coming from something like Python as a background is probably about the hardest path to cover
<FunkyBob>
well, what I ran into in my first attempt... i had a udp socket that did some packet paring, and an actor with a hashmap
<FunkyBob>
[someone helping here suggested the actor around the hashmap]
<SeanTAllen>
but plenty of folks come from something like Java who are oblivious to the data-races in their code so ¯\_(ツ)_/¯
<SeanTAllen>
its not a topic that gets covered much in standard learning materials. :(
<FunkyBob>
and getting responses back to the udp socket so it could format and send answers.... was just not working
<FunkyBob>
yah
<SeanTAllen>
we need a lot more, how you do X materials
<SeanTAllen>
sadly, not a lot of folks like writing documentation
<FunkyBob>
I used to work in embedded microcontrollers...
<FunkyBob>
so you've got a complex env with a single process [no memory protection, but many threads]
<SeanTAllen>
and then the subset of that who write good, concise documentation is quite small
<FunkyBob>
you feel races very hard there :)
<SeanTAllen>
you are in Australia FunkyBob?
<FunkyBob>
yes
<SeanTAllen>
well then, I hope you enjoyed your Saturday day.
<SeanTAllen>
and shit, look at the time, your evening so far as well
<endformationage>
I realize the example it a bit convoluted, but it mirrors something I was attempting.
<endformationage>
The primitives GetPear and GetApple are just an easy way to get a specific promised fruit. Idealy they'd have other helper functions defined on them.
<endformationage>
When they're applied, they create an intermediary specializing on the fruit type they promise, and (hopefully) send themselves along to it.
<endformationage>
The intermediary holds the primitive that made it, as well as a promise that'll be fulfilled by a processor after it's applied (or passed to the processor, seen I can't figure out how to consume itself to it).
<endformationage>
The intermediary can accept promise handlers, which it just forwards to the promise it holds.
<endformationage>
A PromiseProcessor just looks at the type the intermediary specializes on, and fulfills its promise with an object of that type.
<endformationage>
In main, I attempt to get a pear and an apple. Each request looks like the following..
<endformationage>
Apply the primitive responsible for promising the fruit, get back an intermediary specializing in that fruit.
<endformationage>
Pass a fulfillment handler to the intermediary, in this case something that'll print out what kind of pear or apple was recieved.
graaff has quit [Quit: Leaving]
<endformationage>
Finally, apply the intermediary with the processor (or since I couldn't get this to work, pass it to the processor) to let thing play out.
<endformationage>
FruitResultIntermediary[Pear val] iso has different type arguments than FruitResultIntermediary[Fruit val] iso
<endformationage>
I had thought since Pear is Fruit traited, this would be OK.
<endformationage>
On a side note, with `argument not a subtype of parameter` errors, I have a difficult time easily seeing the types of the argument vs parameter.
<endformationage>
I think the compiler could be more explicit in its info statements.
<endformationage>
SeanTAllen: FWIW, I feel reading through Pony's Tutorial, viewing related videos, etc, has provided me a more solid base understanding of concurancy's challenges than my previous attempts in understanding it via random libs, etc that attempt to solve one of those challenges.
<endformationage>
Perhaps it's the general actor/rcaps context that has made it more solid for me. They kind of bring the challenges to the forefront to be seen. Literally you cannot miss them.
<SeanTAllen>
endformationage: there's a section of the website that i intend to be a guided "how to learn" pony... https://www.ponylang.org/learn/
<SeanTAllen>
i'd love input from folks who have gone through the learning process lately in terms of additional content that was handy. suggestions on how to approach etc.
<SeanTAllen>
if you have any, please email me.
<endformationage>
SeanTAllen: OK. I did go through each suggested resource regarding rcaps after I did the tutorial and patterns, and did find them useful.
<SeanTAllen>
sweet
obadz has quit [Ping timeout: 240 seconds]
obadz has joined #ponylang
smoon has quit [Quit: smoon]
<endformationage>
Woo hoo! I can't believe I got it to compile!