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
Shad0wCore has joined #ponylang
<Shad0wCore> @SeabTAllen
<Shad0wCore> @SeanTAllen
<Shad0wCore> You there?
<SeanTAllen> What's up Shad0wCore ?
<Shad0wCore> Just wanted to let you know that I'm not going to spend time anymore to learn Pony.
<SeanTAllen> Ok
<Shad0wCore> I almost spent two hours trying to implement a simple function to format a string for a logger
<Shad0wCore> The complainer always complains
<SeanTAllen> Well, I hope you got something out of the experience
<Shad0wCore> And I don't have the mood to do trial and error
<Shad0wCore> compiler*
<SeanTAllen> Good luck with your next learning endeavor
<Shad0wCore> I'm thinking about sharing my experience on GitHub by creating an issue. Maybe it helps the maintainers in some way to figure out either a more simple way to get things done or something else, I don't know.
<Shad0wCore> Just some feedback..
<Shad0wCore> E.g. that the tutorial page lacks so many code examples for those reference caps
<Shad0wCore> etc.
<SeanTAllen> Refcaps are hard to get a handle on
<Shad0wCore> It's hard to do the simplest thing
<Shad0wCore> That's what I'm talking about
<SeanTAllen> It's why we have the learning ref cap section of the website
<Shad0wCore> Like inserting a string at some index in another string
<Shad0wCore> Tbh this section doesn't help very much
<SeanTAllen> I'm sorry you had a difficult experience. It can take a while.
<Shad0wCore> It's a rough explanation of how ref caps are structured etc. but they don't demonstrate how to use them exactly, how to put them at the exact position
<Shad0wCore> My learning curve was hype for about a day and for the rest of the week the curve sunk so deep it ended up in frustration
<SeanTAllen> I'm not sure what you mean, there are several resources in the learning ref caps section of the website
<SeanTAllen> But, good luck with what you start learning next
<Shad0wCore> Probably GoLang
<Shad0wCore> I don't know
<Shad0wCore> I may or may not continue learning C++
Shad0wCore has quit [Quit: Page closed]
nisanharamati has quit [Quit: Connection closed for inactivity]
acarrico has quit [Ping timeout: 244 seconds]
endformationage has quit [Quit: WeeChat 2.3]
<emilbayes> I'll just say my experience hasn't been like that
<emilbayes> It's rough around the edges, but there also only so many people involved. I'm pretty fed up with the "taker" mentality. If people don't like something they can go change it. It's open source after all
<emilbayes> In base64 the encode method returns a String iso by default, while the decode method returns a Array[U8] iso by default. Is there a reason these are not the same?
<vaninwagen> I would say it is because you usually encode binary data to a base64 string and decode vide versa - an array transports this notion better
<vaninwagen> Strings are more for text
<vaninwagen> *vice versa
<vaninwagen> Shad0wCore sad to hear.
<emilbayes> vaninwagen: I understand, but are strings for text or are they more like char in C?
<emilbayes> vaninwagen: Do you know if string was meant to have a slice method? I see it mentioned in the docs, but only find .trim
srenatus has joined #ponylang
<vaninwagen> emilbayes strings are backed by an Array[U8], they can be used to access Utf32 code points, they can decode from utf8, they can also be used like a C char*
<vaninwagen> So string makes sense, when an array is not enough and youwant the convenience of string literals
<vaninwagen> E.g. There is no 0 byte termination as for char*
<vaninwagen> Only if you use .cstring() and enter the doomed halls of C via ffi
Nawab has quit [Ping timeout: 250 seconds]
<Candle> Ha. I only wish the 'cstring' function was shorter... but only to make things like `@printf[None]("%s, %s, %s, %s\n".cstring(), a.cstring(), b.cstring(), c.cstring(), d.cstring())` shorter!
<Candle> shorter - the function name being shorter.
<emilbayes> vaninwagen: I yeah, I see. I just feel like I have run into APIs that took Strings, but were actually looking for byte arrays. But I guess that's where ReadSeq comes in
<emilbayes> vaninwagen: There's no way to take a slice of a ReadSeq is there? It seems Array[U8] has slice, while String has trim, but nothing that works for both?
Nawab has joined #ponylang
<vaninwagen> I totally agree emilbayes. if they do the dame thing, they should have the same name
<emilbayes> vaninwagen: Haha, maybe there's some history I'm missing or someone was going to do the slice for string at some point
<emilbayes> vaninwagen: I see that Seq defines append, which both Array and String implement by iterating over values. Will this compile to a memcopy or will it literally iterate over each byte one at a time?
<vaninwagen> https://stdlib.ponylang.io/builtin-ReadSeq/ no, there is no way, only via its iterator wirh itertools or something handcrafted using apply
<vaninwagen> But all that essentially copies
<vaninwagen> I am not sure, but my best guess is an iteration over each byte
<emilbayes> "... a sufficiently smart compiler ..." :D
<vaninwagen> This one is way too smart for me
<srenatus> https://github.com/ponylang/ponyc/pull/2964 I'm afraid I could use some assistance there. not sure how to adapt the tests; also, the PR expands the scope of the original issue a bit... so, there's a need for discussion. (of course this can wait 'til 2019...)
jhei has quit [Ping timeout: 260 seconds]
jhei has joined #ponylang
Nawab has quit [Ping timeout: 240 seconds]
Nawab has joined #ponylang
Nawab has quit [Ping timeout: 244 seconds]
Nawab has joined #ponylang
acarrico has joined #ponylang
<emilbayes> I have this match expression that I get an error for that I do not understand: https://playground.ponylang.io/?gist=21fcd2d5a42cdd7afcfeb37fc838c1ea
<emilbayes> I'm trying to destructure a tuple from each of the cases in my match expression, but the error seems to suggest that I should use a match expression, which I already am?
<emilbayes> Is it because the destructuring should happen in each of the cases?
<emilbayes> Ah dang, there is a section in the tutorial on matching tuples that I missed. Nvm
<emilbayes> Oh hmm, that's not actually what I'm doing
<emilbayes> welp
<aturley> emilbayes i'm taking a look at it ...
<aturley> so, i get the same error with this more minimal code: https://playground.ponylang.io/?gist=21fcd2d5a42cdd7afcfeb37fc838c1ea
<emilbayes> aturley: Thank you!
<emilbayes> aturley: I think you pasted my link again :)
<aturley> oops ..
<aturley> meh ...
<aturley> that one doesn't have the `else`.
<emilbayes> aturley: Something like this is actually what I'm doing and also gives the same error: https://playground.ponylang.io/?gist=757c182ca607dd079b1147c3f2605f59
<aturley> right.
<aturley> i was just trying to see if we could shed some light on what pony was doing, and also look for a workaround.
<emilbayes> aturley: Ah yeah, is it because it's making a union over the return types of the match expression?
<emilbayes> Is that what it's trying to say?
<aturley> i think so.
<emilbayes> But then I don't get the 2nd part
<emilbayes> what is it suggesting to do about it?
<aturley> i think it's telling you to use pattern matching to destructure the tuple and use the results within the match statement.
<aturley> one sec ...
<aturley> the part that's commented out is what you're trying to do.
<aturley> the second part is what it is recommending you do.
<aturley> i mean, in a sense.
<aturley> rather than nesting the match statements, you could assign the result of the first one to a variable and then use it for the second match statement.
<aturley> i'm not entirely sure why the compiler doesn't let you do what you're trying to do.
<aturley> but, whatever the reason, it's trying to tell you to do it differently.
<emilbayes> aturley: Ah ok, thank you very much
<emilbayes> I will try what you suggested
<SeanTAllen> tuples arent real types and that causes weird problems in places. its an ongoing topic of discussion
nisanharamati has joined #ponylang
<freza> would the inferred type of the match expression be `(USize | String | U8, String)` or `(USize, String) | (String, String) | (U8, String)`? Wondering how would ponyc reason about the case that doesn't work.
<emilbayes> Yeah it seems to work if I assign the result to a variable and then destructure on the line after
<aturley> freza yeah i was wondering about that too.
<aturley> in this example, the compiler is ok with TupleOfUnions, but doesn't like UnionOfTuples: https://playground.ponylang.io/?gist=3f73316533b48c06bfe5076a36ed302d
<aturley> freza so it looks like it is probably interpreting them the second way that you have listed, not the first way.
<aturley> today i'll be writing a twitch chatbot from scratch in ponylang from 3PM-4PM EST on my twitch stream. https://www.twitch.tv/aturls/
biscarch has quit [Ping timeout: 246 seconds]
acarrico has quit [Ping timeout: 246 seconds]
acarrico has joined #ponylang
<_andre> SeanTAllen: do you have any examples using pony-msgpack?
<SeanTAllen> _andre: nope
<_andre> but are you using it for non-open source stuff? i ask because the readme says it's alpha but it seems to be pretty well-tested
<SeanTAllen> nope
<SeanTAllen> not using for anything
<_andre> ok
<SeanTAllen> someone might be
<SeanTAllen> i did write a decent number of tests though
<SeanTAllen> you are right about that
<SeanTAllen> i'd love to get feedback
<SeanTAllen> it cant be used for streaming at the moment based on how it uses the Reader
<SeanTAllen> that would require a change in the core but the tests should make that easier to address
<SeanTAllen> do you have a msgpack need _andre ?
Nawab has quit [Remote host closed the connection]
<_andre> SeanTAllen: not msgpack specifically, but some binary serialization format
<_andre> one that can be used by other languages. msgpack is nice in that sense
srenatus has quit [Quit: Connection closed for inactivity]
biscarch has joined #ponylang
Nawab has joined #ponylang
<aturley> the video of me building a twitch irc bot from scratch in pony is here: https://www.twitch.tv/videos/351396422
travis-ci has joined #ponylang
<travis-ci> ponylang/ponyc#5534 (master - 70fef72 : Emil Bay): The build was fixed.
travis-ci has left #ponylang [#ponylang]
<SeanTAllen> _andre: it should work well for that and contributions are appreciated