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
acarrico has quit [Ping timeout: 252 seconds]
PrsPrsBK has quit [Quit: PrsPrsBK]
_whitelogger has joined #ponylang
OtakuSenpai has quit [Remote host closed the connection]
dx_ob has joined #ponylang
dx_ob has quit [Ping timeout: 268 seconds]
griddle has joined #ponylang
PrsPrsBK has joined #ponylang
griddle has quit [Ping timeout: 272 seconds]
OtakuSenpai has joined #ponylang
endformationage has quit [Quit: WeeChat 1.9.1]
OtakuSenpai has quit [Ping timeout: 246 seconds]
OtakuSenpai has joined #ponylang
malthe has quit [Quit: Lost terminal]
ExtraCrispy has quit [Ping timeout: 256 seconds]
ExtraCrispy has joined #ponylang
ExtraCrispy has quit [Ping timeout: 256 seconds]
ExtraCrispy has joined #ponylang
Summertime has joined #ponylang
SqREL has joined #ponylang
SqREL has quit [Client Quit]
<Summertime> sorry if already asked about: "No loadable code. Everything is known to the compiler." from the language goals. that would prevent a run-time plugin system yeah? (not complaining!) is there any "replacement" for that as so to say?
OtakuSenpai has quit [Quit: Leaving]
<SeanTAllen> Summertime: there's an RFC request for hot code loading: https://github.com/ponylang/rfcs/issues/58
<SeanTAllen> something that eventually comes from that would probably be what we'd have
<Summertime> neat!, though daunting!
OtakuSenpai has joined #ponylang
<SeanTAllen> daunting indeed
<SeanTAllen> its not on anyone's roadmap right now
_whitelogger has joined #ponylang
OtakuSenpai has quit [Remote host closed the connection]
OtakuSenpai has joined #ponylang
endformationage has joined #ponylang
beardhatcode has joined #ponylang
<beardhatcode> fun a()=>field=9
<beardhatcode> What is the default capability of a method, is the following automatically ref?
<SeanTAllen> box
<SeanTAllen> fun box a()
<SeanTAllen> so you want that to be
<SeanTAllen> fun ref a()
oats has joined #ponylang
<oats> hello!
<oats> learning pony, having an interesting & fun doing doing so
<oats> quick question though, do I understand right that only the Main actor's constructor can print to the terminal unless you pass another function a reference to the env?
<SeanTAllen> you need to provide env.out which is the stdout out stream to other actors yes oats
<SeanTAllen> unless you cheat and use c-ffi and call `printf`
<oats> SeanTAllen: could I make env a field of Main?
<SeanTAllen> sure
<SeanTAllen> but you can't read fields of an actor from another actor
<oats> cool
<oats> another question, could I please get some help understanding why this doesn't work? https://playground.ponylang.io/?gist=0a56d38ed845916678507c85af18229f
<SeanTAllen> if you dont provide a `new` constructor then when you do Dog
<SeanTAllen> you get an `iso` version of dog
<SeanTAllen> that error is about you trying to have more than 1 alias to that instance of dog
<SeanTAllen> so you want a primitive not a class
<SeanTAllen> because there is no state for Dog etc
<SeanTAllen> actually that doesnt really work based on what you are doing
<SeanTAllen> but this works...
<SeanTAllen> i changed your classes to primitives to get around the "no constructor" issue
<SeanTAllen> and then
<SeanTAllen> interface val MakesNoise
<SeanTAllen> that said that by default MakesNoise is immutable
<oats> ah, it's a reference capabilities thing
<SeanTAllen> when you reference it by name
<SeanTAllen> there's one other option on that
<SeanTAllen> hold on
<oats> still trying to wrap my head around them :P
<SeanTAllen> note for get _noise, i say it makes a val MakesNoise
<SeanTAllen> we are happy to help with the reference capabilities head wrapping oats
<SeanTAllen> did you see the recommended path to understanding on the website?
<oats> don't think so
<oats> I think I fit the criteria :P
<oats> rust has been my latest love affair, and I've also messed around with Go
<SeanTAllen> a lot of the ideas in reference capabilities exist in Rust, albeit in a different form
<SeanTAllen> Go, not so much
<oats> are any of them analogous to T, &T, and &mut T ?
<SeanTAllen> my Rust is o god unmmm
<SeanTAllen> i was about to say "Rusty"
<SeanTAllen> its been a long time
<SeanTAllen> when looking at reference capabilities
<SeanTAllen> focus on val, iso, ref
<SeanTAllen> val is immutable
<SeanTAllen> ref is mutable
<SeanTAllen> iso is mutable AND there can only be 1 reference to it, aka ISOlated
<oats> but they're all references, not "owned" objects, correct?
<oats> s/but/and
<oats> k
<oats> I think I'm understanding them better
<oats> another question
<oats> in Go, a common idiom is sharing a channel (transmitter) among several goroutines, and letting them all send data to a single goroutine with a channel acting as a receiver
<oats> I understand there isn't anything like a channel in pony, so how could one model a similar situation with actors?
<slfritchie> Pony message delivery cannot be changed: the underlying runtime system requires causal message delivery for correctness. So creating two message delivery channels for the same process isn't feasible, because it would allow the receiver to control message receipt order. (Beware: I've never used Go or another programming language with a message channel as a 1st class language feature.)
eevv has joined #ponylang
<eevv> hey how to turn a ref into val
<slfritchie> If something is a `ref`, you don't know how many other aliases there are inside of your own actor. So you need to make a copy, eevv.
<eevv> how to copy?
<eevv> slfritchie, also it says here that I can turn `trn` into `val` somehow https://tutorial.ponylang.io/capabilities/capability-subtyping.html
<eevv> it says a "trick" but doesn't say how to do it
<oats> slfritchie: so there's no way for an actor to maintain a queue of messages and iterate through them?
<slfritchie> `The key is that, in order to do so, you have to give up the trn you have.` Meaning that you have to `consume` the `trn` reference.
<slfritchie> But a `trn` is not the same thing as a `ref`.
<eevv> slfritchie, but it said I can turn a `ref` into `trn` so then I could turn the `trn` into `val` yes?
<slfritchie> oats: The runtime maintains a single queue for each actor. For each message in the queue, the corresponding `be` behavior function will be called automatically. If that behavior function takes 2 seconds to return, then any other messages are received during those 2 seconds will be queued automatically. However, if you need to process things in a different order, you need to implement your own queueing.
<slfritchie> s/process things/process messages/
<eevv> slfritchie, so how do I copy
<slfritchie> eevv: I'm guessing that you're interpreting that document incorrectly. You cannot convert a `ref` to a `trn`. That doc is saying that if you have a `trn`, and some other piece of code requires a `ref`, then the conversion is possible (by "giving up"/ `consume`ing the `ref`).
<slfritchie> eevv: Make a new thing. And that depends on the data type of the thing.
<oats> slfritchie: oh, so behavior calling *is* messaging passing
<slfritchie> If that doesn't sound helpful, my apologies. If you have a code example in the https://playground.ponylang.org, it's easy to give a specific example.
<slfritchie> oats: yes
<eevv> how do I copy an array?
<oats> slfritchie: I think I understand now, thanks so much :)
<SeanTAllen> eevv: you iterate through the items in your array and copy them to another array
beardhatcode has quit [Quit: beardhatcode]
<SeanTAllen> there's no copy method on array because if there was then everything that went into an array would need to be cloneable
<SeanTAllen> which isnt always what you want
<SeanTAllen> often isnt
<SeanTAllen> oats: yes, calling a behavior is message passing
<eevv> I wish this was easier, I literally make a temporary object just for that array and I have to turn it into val
<SeanTAllen> i dont know what you are doing or the context eevv so i cant tell you if there is an easier way
<SeanTAllen> so you have a mutable array, why do you want to copy it?
<eevv> I made a class that holds Array[U8 val] ref
<SeanTAllen> ok so a mutable list of U8
<SeanTAllen> why do you want to copy it?
<eevv> it is ref because the apply function takes that in...
alad has joined #ponylang
<SeanTAllen> sorry, i dont understand
<eevv> Now I want to send this array (TcpConnection write)
<SeanTAllen> AH
<SeanTAllen> so you are sending to a new actor
<eevv> I mean the apply function as in indexing the array
<eevv> my_array(index)?
<SeanTAllen> so once you send this off to be written
<SeanTAllen> do you need the old data anymore in this actor?
<eevv> yes
<SeanTAllen> ok
<SeanTAllen> then you need to copy
<eevv> so I have to iterate through the array?
<SeanTAllen> otherwise its unsafe and there could be a data race
<SeanTAllen> yes, you have to iterate through the array
<SeanTAllen> there's no "type dependent" copy right now
<SeanTAllen> Array is ignorant of what it is holding
<SeanTAllen> if its an immutable type
<SeanTAllen> then what you want to do to "copy" can be diferent than if its a "mutable" type
<SeanTAllen> for example an array of mutable strings
<SeanTAllen> when i copy that
<SeanTAllen> do i want to create a new reference to the mutable strings or do i want to copy them?
<SeanTAllen> there's no way in the pony type system to indicate that right now
<SeanTAllen> and to "do the right thing" with a val one of just creating a new reference
<SeanTAllen> its something that's been discussed though
<eevv> hmm
<slfritchie> That example is contrived: the compiler could figure out how many references/aliases there are to the `a` array. But the capability of `ref` means that, in general, we do know know how many aliases there are.
<eevv> maybe I can somehow use `trn` in my class instead of `ref`
<eevv> ok im gonna try copying
<slfritchie> In that playground example, I could've simply pushed 8, 15, and 204 onto `b` and never bothered creating `a`.
<eevv> ok but why does `recover` have to `end`
<eevv> why isn't `consume` the same
<SeanTAllen> because the recover is unrelated to the consume eevv
<SeanTAllen> recover is a block of code that
<SeanTAllen> doesn't allow references to any variables outside the block that aren't val or tag
<SeanTAllen> this means i can mutate something to my hearts content inside a recover and then return it as any reference capability
<eevv> ok
<SeanTAllen> when you are starting, recover is rather weird and odd
<SeanTAllen> eventually it makes a lot of sense
<eevv> everything is weird and odd
<eevv> I like the behaviour thing but I don't know when to use
<eevv> it
<SeanTAllen> whats your background eevv?
<SeanTAllen> what languages have you used in the past?
<SeanTAllen> have you ever used erlang or elixir?
<eevv> SeanTAllen, nop, I wrote C, Python... Got into Rust a while back, but I never do much of threading
<SeanTAllen> ah ok
<SeanTAllen> so
<SeanTAllen> hmmm
<SeanTAllen> behaviors are how actors communicate with one another
<SeanTAllen> calling a behavior results in an async message send from one actor to another
<eevv> ok but when should I use classes and when to use actors
<SeanTAllen> people often first think of actors as a mechanism for concurrency, which they are
<SeanTAllen> but more important, actors protect resources
<SeanTAllen> for example
<SeanTAllen> a TCP socket
<SeanTAllen> you'd have an actor managing it
<SeanTAllen> then many different actors can send information to be written to that actor
<SeanTAllen> and because that single actor writes the the socket
<SeanTAllen> it will be thread and data race safe
<SeanTAllen> if you check out the standard library, you will see that TCPConnection is an actor
<SeanTAllen> as is UDP
<eevv> yeah I saw that
<SeanTAllen> a pool of Timers is also an actor
<SeanTAllen> because that actor owns the individual timers
<SeanTAllen> and runs them
<SeanTAllen> in that case, there's a definite concurrency aspect as well
<SeanTAllen> when i was first using the actor model, i liked to think of it as
<SeanTAllen> "if i asked people to do this, how many people would i have"
<SeanTAllen> and started with an actor for each person
<SeanTAllen> or rather each role a person might play
<eevv> maybe I'm too new to threading
<oats> wait a sec...
<oats> are all variables references?
<eevv> I must go
eevv has quit [Quit: Page closed]
<slfritchie> oats: If I interpret your question are "are all variables C/C++-like pointers to actors/objects/primitives?" then the answer is "yes, but with optimizations under the hood". Primitive as special because there's only one instance of any given primitive, so the compiler can optimize, including mapping int & float data types onto the target CPU's corresponding types.
<slfritchie> s/Primitive as/Primitives are/
<oats> slfritchie: you interpret my question correctly, thank you :)
<slfritchie> Yay!
<oats> yet another question, how does one go about launching external processes with pony?
<oats> I'm not sure what to search for
<oats> alad: thank you, stranger
<oats> I hope this random unexpected interaction can lead to a blossoming friendship
<alad> heh
travis-ci has joined #ponylang
travis-ci has left #ponylang [#ponylang]
<travis-ci> ponylang/pony-stable#290 (master - 03802b8 : dipinhora): The build was fixed.
<vaninwagen> oats: the stdlib has the process package for that: https://stdlib.ponylang.org/process--index
<vaninwagen> It is a little bit of typing to get it set up, but works reasonably well
endformationage has quit [Ping timeout: 252 seconds]
desperek has joined #ponylang
<desperek> hi
<desperek> why does pony have a CoC?
<desperek> and its contributor covenant
<PrsPrsBK> Hi
<desperek> PrsPrsBK, do you know an answer?
<PrsPrsBK> Sorry, no, now I typing my question.
<PrsPrsBK> Excuse me
<desperek> ??
<PrsPrsBK> desperek: ah... I missed your 'hi' and was writing my another question. it leads confusing sorry.
<desperek> oh
<desperek> you never wrote a question though
<PrsPrsBK> desperek:and I don't know your answer
<desperek> PrsPrsBK, i mean, you said that you were writing a question which youve never written here, so idk
<PrsPrsBK> desperek:my question need a url, but I lost it. come again another day
<aturley> desperek to answer your question about why pony has a code of conduct:
<aturley> "In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation."
<desperek> aturley, well, i believe thats the reason listed in code covenant itself. im asking--why, like... just why, and why this one
<aturley> desperek we believe that it is important to have an open and welcoming environment. we believe that the CoC helps foster that by embodying the values that we think are important.
<desperek> ehm okay
<SeanTAllen> desperek- enforcing "unwritten rules" isn't something we are fond of.
<SeanTAllen> we believing in stating up front what we expect in terms of conduct from people
<SeanTAllen> that includes the social rules that we added to our code of conduct as well
<SeanTAllen> hi PrsPrsBK
<PrsPrsBK> hi SeanTAllen
<desperek> SeanTAllen, yes ive seen that. im just concerned about the popularity of code covenant but i think that its not a place for discussing whether its good rules or bad rules, because its ponylang irc afterall. i am just opposed to c.cove-t and i just believe that open source shouldnt be like that, thats all. also, especially programming language, as i do see it as political and i believe that open source should not be mixed with politics
<SeanTAllen> i dont see it as political
<SeanTAllen> you are welcome to your opinions and to be part of this community so long as you abide by those rules
<SeanTAllen> PrsPrsBK: let me know if you have any pony questions!
<desperek> SeanTAllen, i think https://getfedora.org/code-of-conduct.html or https://www.ruby-lang.org/en/conduct/ and code covenant can be an examples of huge differences.
<PrsPrsBK> SeanTAllen: thanks! I shall come another day
PrsPrsBK has quit [Quit: PrsPrsBK]
<SeanTAllen> you are entitled to your opinion. we have the code of conduct that we adopted. you are welcome here as long as you abide by it.
<desperek> yes you have said that already
<SeanTAllen> that is going to be by general response to any code of conduct conversations
<SeanTAllen> so lets drop the topic
<SeanTAllen> if you have pony questions, let me know
<desperek> SeanTAllen, oh right, i couldnt find your pubkey that you used for signing zips
<desperek> ponyc for window
<desperek> s
<SeanTAllen> i'd have to look into that. as far as i know, its the bintray key. i assume it signs the windows packages but i dont know for sure.
<desperek> well thanks but why though
<SeanTAllen> im pretty sure that is available somewhere via Bintray but I don't remember where right now so going in and copying was easier
<SeanTAllen> why what desperek ?
<desperek> SeanTAllen, shouldnt you put that key somewhere in the project?
<SeanTAllen> you are the first person who ever asked.
<SeanTAllen> i will look into it later
<SeanTAllen> have work stuff to do at the moment
<SeanTAllen> thank you for bringing it up
<desperek> np
<desperek> SeanTAllen, this is quite important, cuz somebody can just inject malicious code to your code then :p, why would somebody use your language then
<desperek> if * cant even get a proper compiler
desperek has quit [Quit: xoxo]
endformationage has joined #ponylang
ExtraCrispy has quit [Ping timeout: 256 seconds]
ExtraCrispy has joined #ponylang
ExtraCrispy_ has joined #ponylang
ExtraCrispy has quit [Ping timeout: 256 seconds]
_whitelogger has joined #ponylang