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
<polypus74> There is surely a way of copying a mutable datastructure to get a #send?
polypus74 has quit [Ping timeout: 264 seconds]
<SeanTAllen> what is the class you have a ref to polypus74?
pyon has joined #ponylang
<SeanTAllen> can you gist your code?
jemc has joined #ponylang
theodus has joined #ponylang
<doublec> SeanTAllen: try this http://pastebin.com/kPPNzPq0
<doublec> There seems to be no way to clone to a val
<doublec> Or anything sendable except tag for that matter
theodus has quit [Client Quit]
<SeanTAllen> i see.
<SeanTAllen> this is an interesting one.
<SeanTAllen> you'd need a deep copy to make it safe.
<SeanTAllen> the compiler in this case is operating on it as a generic and for some types of items in a set it would be unsafe
polypus74 has joined #ponylang
<doublec> Can't we define the generic interfae such that the element is whatever can safely alias as iso->V (where V is element type)
<doublec> and return an iso
<SeanTAllen> interface to clone?
<doublec> yes
<doublec> possibly an iso->V is something too restrictive for anything useful
<polypus74> doublec: that gist is just what i was trying to do
<doublec> Yeah, it'll mean tag for collections of ref
<doublec> polypus74: can you make the set in the field an iso?
<polypus74> If i use an iso field, then i still can't send it or clone it as a val right? What i want is a local mutable field which ican somehow send a val copy of to a different actor
<doublec> polypus74: yes, because you can clone it in a recover block
<doublec> hmm, maybe you can't
<SeanTAllen> you'd need to do a deep clone to do that polypus74. whats the design this fits into?
<SeanTAllen> all that said, HashSet clone only returning a ref^ aint pretty
<SeanTAllen> im not sure what the reasoning behind that is...
<SeanTAllen> at the moment, i'm strongly leaning towards calling that a bug and opening an issue
<polypus74> Well, this is all motivated by the fact that the udp notifier can only be replaced and not modified within a udp socket. I have a set of actors (tags) which i need to keep track of in my udp wrapper class, and when one is added or removed, i need to swap out the notifier.
<SeanTAllen> ah
<SeanTAllen> ok
<SeanTAllen> i figured it out
<polypus74> So that it can send messages to my set of actors. This way i avoid having to instantiate an actor to do that dispatching. Would be great if there were a behaviour taking a lambda to modify the notifier
<SeanTAllen> still feels like a bug.. anyway, reading your bit now polypus74
<doublec> sadly it can't be iso because of the call to 'set' in the implementation of clone
<doublec> set is a 'ref' and 'value' it is being set to may not be sendable
<doublec> so automatic recovery doesn't work
<SeanTAllen> what do you mean the udp notifier can't be modified polypus74 ?
<SeanTAllen> @doublec i feel like this should be opened as an issue. it impacts other collections as well. thoughts?
<polypus74> AFAICT you can only swap out a UDPNotifier from a UDPSocket, there is no way to touch it as it is sent iso, correct?
<SeanTAllen> polypus74: i'm not sure what you mean by a udp notifier can't be modified. can you give an example what "modified" would be?
<SeanTAllen> what do you mean "touch it"?
<SeanTAllen> what sort of modification do you want to do to the notifier?
<doublec> SeanTAllen: I think we need an answer to "how do I clone a ref collection to send it" which should be probably be discussed in an issue
<polypus74> When you create a socket you pass in a notifier as iso. After that the socket owns it, so how would i add or remove actors from the set i would like it to manage?
<SeanTAllen> doublec: care to open that one?
<doublec> SeanTAllen: polypus74 would like the notifier to send to a list of actors that can change. But once the notifier is added to the socket it can't be changed.
<SeanTAllen> ah, i see what you are saying polypus74, you want to be able to send messges to the notifier, correct? so it can update its state based on something outside of incoming/outgoing data, correct?
<polypus74> correct
<doublec> polypus74: I'd make the notifier have a reference to an actor that manages the list
<polypus74> Yes
<SeanTAllen> it can be changed, its the message sending that is an issue
<SeanTAllen> So, Sylvan and I have been working on solving exactly that problem
<polypus74> Yeah. I was trying to avoid that extra actor. Perhaps premature optimization
<SeanTAllen> the horrible answer to how you can deal with it is do what we are doing at Sendence which is running custom, hacked up versions of the net library.
<doublec> polypus74: It'd need to be an actor since you don't know what thread the notifier is notifying on
<SeanTAllen> sylvanc and i have been calling that feature you want "async lambda"
<doublec> polypus74: and you'd have races accessing the collection
<SeanTAllen> basically the ability of a class to say, "here, send me this message" and have its enclosing actor deliver it without needing to change to interface to the enclosing actor
<SeanTAllen> so something like this is coming. its needed for a number of features.
<polypus74> Ok. Thanks guys
<jemc> I'm joining the conversation later, so I may be lacking in context, but this seems like the same old "iso clone" problem we've been kicking the can about for a while now
<SeanTAllen> in the meantime, what we are doing at sendence is running a custom version of "net" to add the functionality we need to TCPConnection. Its not a good answer but its the best you can do at the moment until that feature lands. I need to bug sylvanc about it and see where it is at and if he needs help bringing it home.
<doublec> jemc: sounds like it
<jemc> sylvanc recently proposed adding an "isolate" idiom that would act as an iso-oriented version of clone (doing copy where necessary)
<jemc> don't think there's an RFC for it though
<SeanTAllen> there isn't
<SeanTAllen> and yeah that issue does come up a lot, doesn't it jemc?
<jemc> :D
<jemc> I think it ultimately ends up coming back to the "turnstile" operator we've chattered about
<SeanTAllen> i vaguely remember the turnstile operator
<SeanTAllen> o right
<SeanTAllen> that one
jemc has quit [Ping timeout: 276 seconds]
polypus74 has quit [Ping timeout: 264 seconds]
montanonic has quit [Ping timeout: 250 seconds]
montanonic has joined #ponylang
amclain has quit [Quit: Leaving]
jemc has joined #ponylang
jemc has quit [Ping timeout: 276 seconds]
dynarr has joined #ponylang
montanonic has quit [Ping timeout: 250 seconds]
montanonic has joined #ponylang
rosstuck has joined #ponylang
tm-exa has joined #ponylang
tm-exa has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dynarr has quit [Quit: A merry Christmas to all, and to all a good night!]
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ponylang
mytrile has left #ponylang [#ponylang]
montanonic has quit [Ping timeout: 250 seconds]
tm-exa has joined #ponylang
<malthe> oops cert for tutorial.ponylang.org down
<ohir> indeed
<ohir> cert is for *.gitbooks.io, gitbooks.io
<ohir> expired, and from godaddy
<ohir> fortunately letsencrypt is now fully functional
_andre has joined #ponylang
<srenatus[m]> doesn't look expired... sept 9th 2017.
<ohir> my bad
Praetonus has joined #ponylang
rosstuck has quit [Remote host closed the connection]
jemc has joined #ponylang
tm-exa has quit [Ping timeout: 240 seconds]
amclain has joined #ponylang
CcxCZ has quit [Quit: rebooting]
<kushalp> Hello! I'm trying to write up a Pony for Rubyists chapter for one of the gitbooks. I have a small (toy) Ruby that spins up a Thread and (asynchronously) executes the body. It's not pretty, but I wanted to show how simple the equivalent would be in Pony. Here's what my Ruby code looks like:
<kushalp> TL;DR It spins up 10 Ruby threads and prints "Hello?"
<kushalp> I'm wondering if this is the simplest equivalent in Pony:
<jemc> kushalp: looks about right to me - although if this is for showing off Pony idioms, I'd suggest following the "principle of least privilege" a bit more - that is, you `Greeter` doesn't need the whole `Env`, which carries a ton of authority to do stuff - It only needs to be able to print to stdout, so you should pass it `env.out` instead of the entire `env`
<jemc> also, I write a lot of Ruby code in my day job so I'm happy to help review other examples if you need it
jemc has quit [Read error: Connection reset by peer]
<kushalp> jemc: Great, thanks!
<kushalp> One more question, I'm "stealing" the Java class example for Ruby at the moment. Here's the equivalent Pony code:
jemc has joined #ponylang
<kushalp> Sadly, when I compile (v0.3.0) and run the example it seems to get the dimensions() value incorrect:
<kushalp> It keeps printing '0' for the width value
dynarr has joined #ponylang
montanonic has joined #ponylang
jemc has quit [Quit: WeeChat 1.4]
jemc has joined #ponylang
dynarr has quit [Quit: A merry Christmas to all, and to all a good night!]
dynarr has joined #ponylang
rosstuck has joined #ponylang
TwoNotes has joined #ponylang
<TwoNotes> Trying to build pony on Arch x86. Getting undefined reference to `llvm::FunctionPass::createPrinterPass'
<TwoNotes> What ius min version required for LLVM?
<TwoNotes> extra/llvm 3.8.1-1 [installed: 3.7.1-1]
<jemc> kushalp: that's odd - when I compile/run your example, I get the expected results (non-zero widths)
atk has quit [Ping timeout: 260 seconds]
atk has joined #ponylang
mcguire has joined #ponylang
dynarr has quit [Quit: A merry Christmas to all, and to all a good night!]
dynarr has joined #ponylang
dynarr has quit [Quit: A merry Christmas to all, and to all a good night!]
hakvroot_ has quit [*.net *.split]
M-hrjet has quit [*.net *.split]
prettyvanilla has quit [*.net *.split]
atk has quit [*.net *.split]
jemc has quit [*.net *.split]
amclain has quit [*.net *.split]
_andre has quit [*.net *.split]
pyon has quit [*.net *.split]
SeanTAllen has quit [*.net *.split]
dinfuehr has quit [*.net *.split]
runehog has quit [*.net *.split]
Candle has quit [*.net *.split]
rosstuck has quit [*.net *.split]
c355e3b has quit [*.net *.split]
ericbmerritt has quit [*.net *.split]
sjums has quit [*.net *.split]
adamkittelson has quit [*.net *.split]
Praetonus has quit [*.net *.split]
emilbayes has quit [*.net *.split]
strmpnk has quit [*.net *.split]
gornikm has quit [*.net *.split]
omarkj has quit [*.net *.split]
zaquest has quit [*.net *.split]
so has quit [*.net *.split]
dom96 has quit [*.net *.split]
mcguire has quit [*.net *.split]
DanC_ has quit [*.net *.split]
kajstrom_ has quit [*.net *.split]
Xe has quit [*.net *.split]
k0nsl has quit [*.net *.split]
malthe has quit [*.net *.split]
sylvanc has quit [*.net *.split]
unbalancedparen has quit [*.net *.split]
jtfmumm- has quit [*.net *.split]
cquinn has quit [*.net *.split]
lisael has quit [*.net *.split]
montanonic has quit [*.net *.split]
M-Ingo has quit [*.net *.split]
jeremyheiler has quit [*.net *.split]
NhanH has quit [*.net *.split]
mankyKitty has quit [*.net *.split]
otremblay_ has quit [*.net *.split]
kushalp has quit [*.net *.split]
bbhoss has quit [*.net *.split]
mitchellvanw has quit [*.net *.split]
TwoNotes has quit [*.net *.split]
srenatus[m] has quit [*.net *.split]
doublec has quit [*.net *.split]
Corwin has quit [*.net *.split]
ohir has quit [*.net *.split]
otremblay has joined #ponylang
kajstrom_ has joined #ponylang
mcguire has joined #ponylang
DanC_ has joined #ponylang
SeanTAllen has joined #ponylang
unbalancedparen has joined #ponylang
_andre has joined #ponylang
pyon has joined #ponylang
amclain has joined #ponylang
atk has joined #ponylang
jemc has joined #ponylang
sylvanc has joined #ponylang
M-hrjet has joined #ponylang
atk has quit [Changing host]
atk has joined #ponylang
c355e3b has joined #ponylang
ericbmerritt has joined #ponylang
rosstuck has joined #ponylang
sjums has joined #ponylang
adamkittelson has joined #ponylang
omarkj has joined #ponylang
strmpnk has joined #ponylang
emilbayes has joined #ponylang
montanonic has joined #ponylang
M-Ingo has joined #ponylang
c355e3b has quit [Ping timeout: 240 seconds]
ericbmerritt has quit [Ping timeout: 240 seconds]
strmpnk has quit [Ping timeout: 250 seconds]
mitchellvanw has joined #ponylang
hakvroot_ has joined #ponylang
prettyvanilla has joined #ponylang
jonrh has quit [Ping timeout: 250 seconds]
emilbayes has quit [Ping timeout: 250 seconds]
Xe has joined #ponylang
k0nsl has joined #ponylang
M-hrjet has joined #ponylang
M-hrjet has quit [Changing host]
malthe has joined #ponylang
lisael has joined #ponylang
zaquest has joined #ponylang
so has joined #ponylang
dom96 has joined #ponylang
TwoNotes has joined #ponylang
srenatus[m] has joined #ponylang
doublec has joined #ponylang
Corwin has joined #ponylang
ohir has joined #ponylang
Praetonus has joined #ponylang
Candle has joined #ponylang
dinfuehr has joined #ponylang
runehog has joined #ponylang
M-Ingo has joined #ponylang
M-Ingo has quit [Changing host]
k0nsl has joined #ponylang
k0nsl has quit [Changing host]
dynarr has joined #ponylang
dom96 has quit [Ping timeout: 260 seconds]
cquinn has joined #ponylang
jeremyheiler has joined #ponylang
dom96 has joined #ponylang
kushalp has joined #ponylang
NhanH has joined #ponylang
dynarr has quit [Quit: A merry Christmas to all, and to all a good night!]
TwoNotes has left #ponylang [#ponylang]
mankyKitty has joined #ponylang
gornikm has joined #ponylang
jonrh has joined #ponylang
c355e3b has joined #ponylang
strmpnk has joined #ponylang
ericbmerritt has joined #ponylang
bbhoss has joined #ponylang
emilbayes has joined #ponylang
dynarr has joined #ponylang
mrkishi has joined #ponylang
tm-exa has joined #ponylang
c355e3b has quit [*.net *.split]
c355e3b has joined #ponylang
Praetonus has quit [*.net *.split]
Praetonus has joined #ponylang
mrkishi has quit [Ping timeout: 244 seconds]
<SeanTAllen> i get the same results as kushalp
<SeanTAllen> kushalp: are you on OSX or linux? what version of llvm?
<SeanTAllen> im getting some really weird results here
<SeanTAllen> woah
<SeanTAllen> ok this is a recent bug
<SeanTAllen> time to track down when it was introduced
<SeanTAllen> its specifically around string formatting of numbers
<kushalp> SeanTAllen: You're seeing it as well? Okay, I'll continue with my write up and assume the outputs for the Java post is accurate
<kushalp> I'm on OS X. Latest version of LLVM that you can get using homebrew (what `brew install ponyc` fetches)
<SeanTAllen> i have it narrowed down to 1 days worth of commits
<kushalp> I installed ponyc this morning via homebrew
<SeanTAllen> yeah this came in pre-3.0 release
<SeanTAllen> it was introduced august 24th
<SeanTAllen> ok i found the commit. <-- jemc its https://github.com/ponylang/ponyc/commit/e56075d46d7d9e1d8c5e8be7ed0506ad2de98734 <-- Praetonus
mrkishi has joined #ponylang
montanonic has quit [Ping timeout: 250 seconds]
dynarr has quit [Quit: A merry Christmas to all, and to all a good night!]
montanonic has joined #ponylang
<SeanTAllen> issue opened kushalp: https://github.com/ponylang/ponyc/issues/1212
<SeanTAllen> thank you for finding this.
dynarr has joined #ponylang
<kushalp> Thanks for finding the offending commit so quickly!
dynarr has quit [Client Quit]
<SeanTAllen> kushalp: its fixed on master if you want to build from source
kulibali has joined #ponylang
Praetonus has quit [Quit: Leaving]
dynarr has joined #ponylang
<kushalp> 👍
<kushalp> SeanTAllen: are any of the Sendence folks going to be at Strange Loop this week?
<SeanTAllen> kushalp: i was going to be but had to cancel. i don't believe anyone else is going. we have release coming up at the end of october and everyone is pretty heads down.
<kushalp> SeanTAllen: Ah, that's a shame. Good luck with the release!
<kushalp> I think I have half a draft of a Pony for Rubyists post written. I'll finish it on my flight from NY to STL tomorrow
<kushalp> And then PR it for others to review
<SeanTAllen> nice
<SeanTAllen> i get to be envious of everyone at Strangeloop
<jemc> I can't go, but I'm excited to see the next round of talks to come onto their youtube for my perusal
<SeanTAllen> i enjoy seeing friends more than conferences themselves at this point.
<SeanTAllen> still, strangeloop is one of my favorites