<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>
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...)
<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
<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.