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
CcxWrk has quit [Ping timeout: 250 seconds]
endformationage has quit [Ping timeout: 240 seconds]
CcxWrk has joined #ponylang
campbellr has joined #ponylang
Nawab has quit [Read error: Connection reset by peer]
endformationage has joined #ponylang
jemc has quit [Ping timeout: 268 seconds]
jemc has joined #ponylang
endformationage has quit [Quit: WeeChat 2.3]
jemc has quit [Ping timeout: 244 seconds]
OtakuSenpai has joined #ponylang
srenatus has joined #ponylang
inoas has quit [Quit: inoas]
Nawab has joined #ponylang
OtakuSenpai has quit [Read error: Connection reset by peer]
Nawab has quit [Remote host closed the connection]
OtakuSenpai has joined #ponylang
OtakuSenpai has quit [Read error: Connection reset by peer]
OtakuSenpai has joined #ponylang
inoas has joined #ponylang
travis-ci has joined #ponylang
<travis-ci> nfuhs/ponyc#1 (master - 85b8982 : Norbert Fuhs): The build passed.
travis-ci has left #ponylang [#ponylang]
OtakuSenpai has quit [Read error: Connection reset by peer]
srenatus has quit [Quit: Connection closed for inactivity]
OtakuSenpai has joined #ponylang
jemc has joined #ponylang
inoas has quit [Quit: inoas]
inoas has joined #ponylang
inoas has quit [Client Quit]
endformationage has joined #ponylang
Nawab has joined #ponylang
OtakuSenpai has quit [Ping timeout: 240 seconds]
mcintyre1994 has joined #ponylang
<mcintyre1994> Sorry if you get this all the time, but I've skimmed through the tutuorial/examples at the end of it and I'm wondering if there's any examples of programmes using multiple actors and sharing data between them - or if anyone knows of good general actor model intros that might explain things a bit? I'm struggling to understand the concepts without seeing them being used!
<vaninwagen> There are rather simple examples in the ponyc repository: https://github.com/ponylang/ponyc/blob/master/examples/
<vaninwagen> Especially the ring or the producer example
<vaninwagen> There is also a real-life in memory crdt database: https://github.com/jemc/jylis
<vaninwagen> I hope these are some usable examples
<vaninwagen> Someone also did an RPG but i dont remember the repository anymore
<mcintyre1994> Cool, thanks! :) I didn't see the ponyc examples - a few of those look quite nice
<vaninwagen> Also, search for the ponylang tag on github
Nawab has quit [Read error: Connection reset by peer]
OtakuSenpai has joined #ponylang
squirmybroom35 has joined #ponylang
<squirmybroom35> Is there no functionality in the standard library for parsing a string into an integer?
<slfritchie> squirmybroom35: The text is terse, but at roughly https://stdlib.ponylang.io/builtin-String/#i8 and below shows the String class functions for converting to various integer types (`I8`, `I16`, et al.). If the `base` argument is omitted, then those functions default to using the beginning of the string.
<slfritchie> Unless `base` is instead the number system used, hmm, that would make a difference, wouldn't it? I'll have to look at the source, sorry.
<_andre> it's the number system indeed
<_andre> env.out.print(("F".isize(16)? + 1).string())
<slfritchie> All of the shorthand functions like `I8` and `U64` are wrappers around `read_int`.
<squirmybroom35> Thanks! Think I got it to work by passing 10 as base.
<wyvern> Just getting started with pony and I have some noob questions. First, I want to read a relatively small amount of data from stdin (UTF-8 bytes) and turn it into a String. What's the right way to structure this? I'm guessing that I want to create an object to pass to stdin that will accumulate data in an Array[U8], and then maybe hand that array off to some other actor when dispose() is called (stdin read is done)?
mcintyre1994 has quit [Ping timeout: 256 seconds]
<SeanTAllen> wyvern: you register a callback with the Stdin actor and buffer it yourself
<SeanTAllen> at some point in the buffering you can hand it off to another actor
<wyvern> yes, that's what I'm getting at. Still struggling over getting the types right.
<SeanTAllen> do you have something small you can put into the playground?
<wyvern> Oh hey there's a playground.
endformationage has quit [Ping timeout: 250 seconds]
<SeanTAllen> im working on something for you
<SeanTAllen> one thing i noticed
<SeanTAllen> your input notify apply method is wrong
<wyvern> literally my first pony code ever so I'm sure I'm doing things terribly wrong.
<SeanTAllen> that array is an iso
<SeanTAllen> fun ref apply(data: Array[U8] iso) =>
<SeanTAllen> is correct
<SeanTAllen> ive never done before without using Readline so this might take me a couple
<SeanTAllen> wyvern: here you go
<SeanTAllen> want to talk over what is there?
<squirmybroom35> Wow, I managed to solve the first part of Advent of Code day 1! :) *pat on back*
<wyvern> Gotta run for a bit; will look and get back to you. Thanks very much!
<vaninwagen> squirmybroom35: congrats
<SeanTAllen> squirmybroom35: awesome!
<wyvern> heh, I'm also tackling advent of code. Pony's been on my to-learn list for years, and it seemed like as good a reason as any
<wyvern> SeanTAllen: can you explain line 21?
<jemc> wyvern: are you familiar with "destructive read" from the tutorial?
<wyvern> Ohh Array[U8] is a constructor invocation. It looked like a type, hence the confusion.
<wyvern> jemc: sort of, in that I've read the docs once. :)
<aturley> if anyone is interested in seeing me write some pony, you can watch me here in 8 minutes: https://www.twitch.tv/aturls
<wyvern> When `String`'s docs say "String does not specify an encoding", what exactly does that mean? How can things like `codepoints()` be defined if there isn't an encoding?
<SeanTAllen> wyvern: does line 21 make sense now or shall i explain?
<wyvern> Yep, all good, thanks.
<SeanTAllen> wyvern: string doesnt specific an encoding in that... its just some bytes
<wyvern> so why would you use String instead of Array[U8]?
<SeanTAllen> well....
<SeanTAllen> hehe
<SeanTAllen> honestly i usually use Array[U8]
<SeanTAllen> because i never do anyhting with string that is ummm... string like
<wyvern> so, just hope that things are always UTF-8, etc?
<SeanTAllen> well for what i work on
<SeanTAllen> it doesnt matter
<SeanTAllen> you need to know the encoding yourself and handle accordingly
<SeanTAllen> i hope someone will someday write a whiz bang, knows about its encoding etc string library someday
<SeanTAllen> have a look at the StringRunes class wyvern
<wyvern> OK. It seems impossible that something like codepoints() could work correctly without knowing the encoding. An encoding aware string type seems like a good thing
<SeanTAllen> that is for utf32
<SeanTAllen> codepoints looks for unicode code points
<SeanTAllen> this:
<SeanTAllen> jemc had a lot of ideas for String handling changes
<SeanTAllen> jemc did you write those up anywhere?
<SeanTAllen> also see utf32 method on String
<wyvern> Yeah, I see that; the implicit assumption that text is UTF-8 seems weird to me given the top level docs of "string does not assume an encoding"
<wyvern> having methods that *do* assume an encoding is... unexpected
<jemc> no, I don't think I settled on any final ideas, but I'm going to be working on reapproaching that relatively soon at some point
<wyvern> Point taken re the "contributions welcome" stance on encoding aware string type; I must admit it is a little disappointing to not find a more complete story around encodings. I love what I'm seeing of the type system and runtime characteristics but it's things like this that make it difficult to get Pony adopted at ${job} -- an obvious thing for someone to point at and say "but it doens't have X".
<wyvern> So, I hope someone with more of an understanding of how to leverage the type system in library design solves that problem :)
<SeanTAllen> if that is an argument at job then well, ya pony isnt going to win that one for a long long time
<SeanTAllen> job needs to have a pressing need for something that pony is really good at and makes the immaturity worthwhile
<SeanTAllen> we built wallaroo using it and recently wrapped up a POC for a client where in 3 weeks, we got them close to twitter load on an application we started from scratch
<SeanTAllen> a big part of that is how we designed wallaroo
<SeanTAllen> and a big part is the pony runtime under wallaroo
<SeanTAllen> 3 weeks to accomplish that app is quite amazing
<SeanTAllen> for most people's jobs to adopt pony at this point, there needs to be a really really good reason of that sort for it
<wyvern> Yeah, understood.
squirmybroom35 has quit [Remote host closed the connection]
Foaly has joined #ponylang
squirmybroom35 has joined #ponylang
squirmybroom35 has quit [Remote host closed the connection]
travis-ci has joined #ponylang
<travis-ci> ponylang/ponyc#5508 (master - 6227d31 : Norbert Fuhs): The build was fixed.
travis-ci has left #ponylang [#ponylang]
squirmybroom35 has joined #ponylang
<squirmybroom35> Have I understood things correctly, that Array.clone() still doesn't return an iso qualified type?
<SeanTAllen> squirmybroom35: you are correct
<squirmybroom35> Is there some work around or different approach I can try if i want to pass a list/array of strings to an actor?
<SeanTAllen> So you have a mutable array and you want to copy it and then send that list to another actor?
<squirmybroom35> From the moment I pass it to another actor it might as well be immutable.
<squirmybroom35> ...but except from that, yes.
<SeanTAllen> well, the important thing right now is... do you need to keep a copy of the thing after sending it?
<SeanTAllen> or can you start over with an empty list?
<squirmybroom35> I'd like to send it more than once.
OtakuSenpai has quit [Remote host closed the connection]
<SeanTAllen> that has a couple implications
<SeanTAllen> you want to send it to multiple actors then start over with a new list?
<SeanTAllen> or you want to be able to send, add more things to it and send again later?
OtakuSenpai has joined #ponylang
endformationage has joined #ponylang
<squirmybroom35> I thought I'd send it to multiple actors and after that I could throw it away.
<SeanTAllen> ah
<SeanTAllen> brb
<SeanTAllen> o wait
<SeanTAllen> 1 last question...
<SeanTAllen> its a field in another actor yes?
<squirmybroom35> Yes. The idea was to pass it in the constructor and "keep" it in a field.
<SeanTAllen> ill be back with some possible code that is probaly close to what you want
<SeanTAllen> wont be too long
<squirmybroom35> Oh, cool, thanks!
squirmybroom35 has quit [Remote host closed the connection]
Foaly has quit [Quit: Now 'mid shadows deep falls blessed sleep.]
<SeanTAllen> this is horribly cheesy but i think it demonstrates at the core what you want: https://playground.ponylang.io/?gist=557ec25fe9925b3582d16a7736cbe50c
<SeanTAllen> trn allows you to create a mutable reference that you can consume to val
<SeanTAllen> actually you dont need trn in that
<SeanTAllen> you can use iso
<SeanTAllen> let me know what i should explain
<SeanTAllen> there's probably a way to merge 26 and 27 together but i'd need to play with that as im doing something ive never done before
<SeanTAllen> o nice
<SeanTAllen> this is with automatic recovery...
squirmybroom35 has joined #ponylang
<squirmybroom35> I'm back
<SeanTAllen> fire away with questions
<squirmybroom35> SeanTAllen: Did you come up with some code while I had fallen of the grid?
<SeanTAllen> O yes
<SeanTAllen> I did, sorry everything is int he logs
<SeanTAllen> irclog.whitequark.org/ponylang
<squirmybroom35> Oh!
<SeanTAllen> line 26 is the most important part
<squirmybroom35> Thanks a lot! It's past midnight and I'll never manage to get my head around that without some sleep first. I´ll take a close look tomorrow. :)
endformationage has quit [Ping timeout: 250 seconds]
squirmybroom35 has quit [Remote host closed the connection]
<SeanTAllen> ok
<SeanTAllen> if you have questions, post them here and ill respond
<SeanTAllen> if you arent around when i respond, check the logs
_whitelogger has joined #ponylang