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
atk has quit [Quit: Well this is unexpected.]
atk has joined #ponylang
Matthias247 has quit [Read error: Connection reset by peer]
IRCFrEAK has joined #ponylang
IRCFrEAK has left #ponylang [#ponylang]
dougmacdoug has joined #ponylang
prettyvanilla_ has quit [Ping timeout: 260 seconds]
jemc has joined #ponylang
prettyvanilla_ has joined #ponylang
madgoat has joined #ponylang
madgoat has left #ponylang [#ponylang]
prettyvanilla_ has quit [Ping timeout: 240 seconds]
prettyvanilla_ has joined #ponylang
jemc has quit [Ping timeout: 240 seconds]
jemc has joined #ponylang
<triangle345> hey is anyone here
<triangle345> i have a question regarding capabilities having some minor confusion
<triangle345> I'm passing an Array[U8] to a c ffi via cponiter(). This ffi is populating the array and when i return from the c ffi , I try to print the contents using String.from_array but it is empty? Do i have the capabilities mixed up or something. I can see it being populated on the c side
triangle345 has quit [Ping timeout: 260 seconds]
dougmacdoug has quit [Ping timeout: 240 seconds]
M-sj4nes has left #ponylang ["Kicked by @appservice-irc:matrix.org"]
_andre has joined #ponylang
jemc has quit [Ping timeout: 260 seconds]
zevlg has joined #ponylang
ohir has quit [Ping timeout: 252 seconds]
aav has quit [Ping timeout: 240 seconds]
aav has joined #ponylang
triangle345 has joined #ponylang
anqur has joined #ponylang
<SeanTAllen> triangle345: capabilities wouldn't impact on that.
<SeanTAllen> in order to help, we'd need a small, self contained (preferably runnable) example that demonstrates the problem
<anqur> Hi, I'm reading libponyrt src to learn some gc and asio. I have a doubt that why the stdfd functions like pony_os_std_print still use fprintf without multiplexing, won't it be blocking? And why asio seems only to be used in sockfd? Am I right about them, for maybe I missed some details?
kr1shnak has joined #ponylang
<triangle345> no problem
<triangle345> let me post something on pastebin
<SeanTAllen> anqur: re the first, can you highlight a specific concern related to specific code?
<SeanTAllen> anqur: asio is used in a variety of places, tcp, udp, timers, process monitor, stdin, signals
<SeanTAllen> @triangle345 there isn't enough code there to stay anything. its not at all clear what pony_win_proc_read is doing or that it is being used correctly
<triangle345> you substitute that call for windows @ReadFile: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365467(v=vs.85).aspx
<triangle345> it does the same thing
<anqur> SeanTAllen: https://github.com/ponylang/ponyc/blob/master/src/libponyrt/lang/stdfd.c#L510 I'm concerned about the stdfd writing like stdout but I noticed that it was simply fprintf. I'm curious about what are the original design ideas about writing something to stdout?
<SeanTAllen> what specficially is your concern anqur?
<SeanTAllen> triangle345: are you saying that @pony_win_proc_read is purely a wrapper for that call?
<triangle345> yes
<triangle345> sometimes i even substitute for it. i just created the wrapper to further debug why the array isnt being populated.. even when I put stuff in the array manually I see nothing come out of the other side
<anqur> SeanTAllen: I'm...well, learning how to create a lightweight message-passing framework and tryna get to know Pony's epoll mechanism for some uses like socket, signals and files (files I realized that it is cffi). So I'm kinda confused how to multiplex the use of stdout or other stdfds in Pony and think further about my design. So I said that I was curious
<anqur> about how Pony manipulates stdio.
jemc has joined #ponylang
<SeanTAllen> anqur: env.out is an actor. so, if stdout where to block, it would only block that one actor. you could make it event driven but i'm not sure you would get much from that. if you had an actor that was responsible for read and write, that would be a more interesting use case.
<SeanTAllen> can you clarify what you mean by "multiplex the use of stdout", to make sure my interpretation matches your intended meaning?
<SeanTAllen> triangle345: without seeing actual code, i can't comment on your problem. i don't see how your Pointer[None] for example in the code you supplied matches up with what you say you are wrapping
jemc has quit [Ping timeout: 240 seconds]
<anqur> SeanTAllen: oh yes I thought you just matched what I basically meant. I used to think that an asio instance is manipulated by different schedulers to write different data to stdout (I meant this "multiplexing" maybe I'm wrong...). And you just indicated that in fact stdio is in the control of one single actor (env) which I totally missed this, sorry. I
<anqur> thought I now understood how to further my design now. :)
<SeanTAllen> ah ok. good.
jemc has joined #ponylang
jemc has quit [Ping timeout: 240 seconds]
jemc has joined #ponylang
jemc has quit [Ping timeout: 268 seconds]
anqur has left #ponylang [#ponylang]
graaff has joined #ponylang
Matthias247 has joined #ponylang
<triangle345> hey Sean is there a simple way of passing an array to a function , modifing/adding data to that array within the function, and printing the result in the parent function?
<triangle345> I notice that you can create an array as an iso but you have to consume it all the way in the function, which cannot be accessed after teh function returns
<triangle345> and you cant use ref array because print is a behavior
<SeanTAllen> so, once you print this out, will you want to use the array some more triangle345 ?
<SeanTAllen> and by use, i mean modify, update etc?
<triangle345> possibly
<triangle345> lets take the case that i wont
<SeanTAllen> if you need to modify it further then you need to create a copy to print
<SeanTAllen> if you dont need to modify it later, you want a `trn`
<triangle345> i see
<SeanTAllen> you can treat it like a ref and modify it
<SeanTAllen> then when you consume it, you have a val that can be shared
graaff has quit [Quit: Leaving]
sjums_ has joined #ponylang
<triangle345> hmm when passing my trn array to the function im getting an error like so Array[U8 val] trn! is not a subtype of Array[U8 val] trn: trn! is not a subtype of trn
<triangle345> my function is like so: fun mytest(dat:Array[U8] trn) =>
<triangle345> i thought that should be ok? error seems a bit ambiguous as I am passing trn
sjums_ is now known as sjums
<doublec> triangle345: it's because you are aliasing the trn
<doublec> triangle345: the ! means it is being aliased
<doublec> triangle345: see here for a write up I did https://bluishcoder.co.nz/2016/05/04/bang-hat-and-arrow-in-pony.html
jemc has joined #ponylang
<triangle345> thank you
dougmacdoug has joined #ponylang
<doublec> triangle345: I don't see anything obviously wrong with your ffi code
<doublec> triangle345: unless cpointer() does a copy somewhere but it doesn't look like it
_andre has quit [Quit: leaving]
jmiven has quit [Quit: co'o]
jmiven has joined #ponylang
<triangle345> figured out the issue.. the array has to be Array[U8].>undefined
<triangle345> what does "undefined" do?
<SeanTAllen> it initialzes the array to the given size
<SeanTAllen> using "undefined" data
<SeanTAllen> as compared to `init` that will initialize every entry to a given value
<triangle345> i see
jemc has quit [Ping timeout: 260 seconds]
jemc has joined #ponylang