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
mollymorphic has joined #ponylang
mollymorphic has quit [Ping timeout: 268 seconds]
gokr has quit [Ping timeout: 240 seconds]
benq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
benq has joined #ponylang
samuell has quit [Remote host closed the connection]
user10032 has quit [Quit: Leaving]
mollymorphic has joined #ponylang
mollymorphic has quit [Ping timeout: 240 seconds]
benq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
benq has joined #ponylang
mollymorphic has joined #ponylang
codec_ has quit [Ping timeout: 260 seconds]
mollymorphic has quit [Ping timeout: 268 seconds]
mollymorphic has joined #ponylang
mollymorphic has quit [Ping timeout: 248 seconds]
benq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
benq has joined #ponylang
mollymorphic has joined #ponylang
mollymorphic has quit [Ping timeout: 268 seconds]
benq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
benq has joined #ponylang
mollymorphic has joined #ponylang
Smitty_ has joined #ponylang
Smitty_ has quit [Client Quit]
mollymorphic has quit [Ping timeout: 250 seconds]
benq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
benq has joined #ponylang
mollymorphic has joined #ponylang
mollymorphic has quit [Ping timeout: 248 seconds]
benq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
benq has joined #ponylang
mollymorphic has joined #ponylang
mollymorphic has quit [Ping timeout: 268 seconds]
johshoff has quit [Ping timeout: 248 seconds]
johshoff has joined #ponylang
oraoto has joined #ponylang
endformationage has quit [Quit: WeeChat 1.9.1]
mollymorphic has joined #ponylang
oraoto has quit [Ping timeout: 260 seconds]
mollymorphic has quit [Ping timeout: 268 seconds]
benq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
benq has joined #ponylang
mollymorphic has joined #ponylang
mollymorphic has quit [Ping timeout: 240 seconds]
mollymorphic has joined #ponylang
mollymorphic has quit [Ping timeout: 268 seconds]
benq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
benq has joined #ponylang
mollymorphic has joined #ponylang
mollymorphic has quit [Ping timeout: 240 seconds]
ShalokShalom has joined #ponylang
ShalokShalom_ has quit [Ping timeout: 268 seconds]
samuell has joined #ponylang
user10032 has joined #ponylang
codec_ has joined #ponylang
gokr has joined #ponylang
gokr has quit [Ping timeout: 248 seconds]
oraoro has joined #ponylang
codec_ has quit [Quit: Page closed]
acarrico has quit [Ping timeout: 268 seconds]
gokr has joined #ponylang
acarrico has joined #ponylang
gokr has quit [Ping timeout: 258 seconds]
oraoro has quit [Ping timeout: 248 seconds]
gokr has joined #ponylang
acarrico has quit [Ping timeout: 268 seconds]
acarrico has joined #ponylang
oraoro has joined #ponylang
endformationage has joined #ponylang
endformationage has quit [Client Quit]
oraoro has quit [Ping timeout: 268 seconds]
oraoto has joined #ponylang
samuell has quit [Quit: Leaving]
oraoto has quit [Ping timeout: 268 seconds]
oraoro has joined #ponylang
acarrico has quit [Ping timeout: 248 seconds]
user10032 has quit [Quit: Leaving]
codec_ has joined #ponylang
codec__ has joined #ponylang
codec_ has quit [Ping timeout: 260 seconds]
gokr has quit [Ping timeout: 248 seconds]
benq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
benq has joined #ponylang
vaninwagen has joined #ponylang
<kempe> Hello ponynauts! I've finally gotten some time to play around with Pony again, but one thing I've run into now is that I have no idea what the canonical way is to copy complex data structures in Pony. How would I go about copying an Array[A], for example? I can't seem to find any copy constructor and neither can I find any copy functions in the stdlib documentation. Am I supposed to simply iterate over the
<kempe> list and push element by element to a new one?
Nat has joined #ponylang
Nat is now known as Guest78167
acarrico has joined #ponylang
<Guest78167> Hey guys, I have a hopefully very simple question
<Guest78167> I'm trying to follow the tutorial, but I can't compile the following code example: https://gist.github.com/natdempk/f7ec636e439ad92c428b4cc2df07f8f0
<Guest78167> and Im not sure if the call to .values() is even right here or not, seems like there's some magic going on with apply() that I don't quite understand
<Guest78167> and I can't really find great docs on print() either to fix that type error, could someone point me in the right direction here?
<kempe> Apply is the function called when you call ColorList like a function, i.e. "ColorList()". If you add paranthesis before the .value(), i.e. "ColorList().value()" it should work
<kempe> Sorry, it should be "ColorList().values()". I forgot the "s"
<Guest78167> Lol, overlooked that (), thanks!
<Guest78167> So how do I convert things to strings or byte arrays so I can print them?
<Guest78167> Its really hard to search the docs for anything as they stand right now
<kempe> You mean you want a text representation of your primitives?
<Guest78167> yes
<codec__> call string() on it for numeral type
<Guest78167> I guess ideally something where I could define their printable representation? or a format string or whatever
<codec__> well acutally it works for all types that implement the Stringeable interface
<Guest78167> aha so I can just implement string() to be whatever I want for my primitives?
<codec__> yes
<Guest78167> when I try to do `env.out.print(ColorList().values().string())` I get another error saying couldn't find string, do arrays not implement `string()` by default?
<Guest78167> or is there something else I'm missing there?
<codec__> yes array does not implements it
<kempe> and by doing .string() on .values() you're doing it on the iterator and not the array itself
<codec__> but you can use the fold function from itertools to generate a string easily
<Guest78167> I guess maybe this is a larger question, but isn't that a bit odd to not implement `string` by default for arrays? or is pony on the more conservative implement it yourself side of things?
<Guest78167> I guess, as someone just learning the language, feels a bit hostile :P
<codec__> pony is quite low level
<codec__> and generating a string on a big array could have a big impact
<Guest78167> I see, so you want people to be more explicit as to what exactly they want to do when writing that
<Guest78167> where do you see Pony on a spectrum from like C/Rust -> Java/Scala in terms of high vs. low level and expressiveness?
<Guest78167> trying to feel out this language, cause it seems pretty cool
<kempe> Granted I'm pretty green at Pony, but I do have quite the background in C/C++ and from my perspective it is weird implementing a string function for a general purpose container. How would you represent the objects when printing them? Would you print their memory locations, would you force all objects you store in the container to implement their own string() funcitons, or would you only print information
<kempe> about the array; size, etc?
<Guest78167> I would just delegate to string over the contents of the array, maybe joining that with commas or someting
<Guest78167> not sufficient for all cases, but its something /shrug
<dlowe> I too am very impressed with Pony's potential, but kind of at a loss for a "pet project" for it
<codec__> here is a quick example to quick print something into a container: http://playground.ponylang.org/?gist=e036b79ac4e4809d010d61f3cd65f5ca
<codec__> @dlowe do you struggle with something in particular?
<Guest78167> ah cheers codec, thanks for that
<Guest78167> ooc how many of those type annotations are necessary there?
<dlowe> codec__: well, variable capabilies are something that I suspect everyone struggles with until you have shed enough blood that it becomes intuitive.
<dlowe> much like Rust borrowing
<dlowe> I meant more high-level, though. I don't have a burning idea that would benefit from lots of concurrency.
<codec__> @Guest I think they all are necessarry
benq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<kempe> dlowe: Drawing some fractals, maybe?
<codec__> Actually Rust and Pony have similarities
<codec__> They all chose to avoid (among other things) concurrency issues
<dlowe> they do. They each constrain code in odd ways to provide unique guarantees of otherwise hard-to-solve problems
<codec__> Rust has the borrow checker for that, Pony has reference capabilities
<codec__> exactly, there is no free lunch
<dlowe> I like the differing constraints because they are likely to teach me something new.
<Guest78167> are there any sample projects/programs you would recommend reading/writing that really show off pony's stengths?
<codec__> actually if you do some multithreading programming you should have a mental model that roughly reflect it
benq has joined #ponylang
Guest78167 has quit [Read error: Connection reset by peer]
<codec__> it's more or less that with Pony (and Rust) that mental model end up in the type system
<codec__> @Guest hard question, as Pony goal is to make hard thing easy-ier
<codec__> and Usually you won't ran into problems with any language with a toy project
Nat_ has joined #ponylang
<Nat_> I may have missed your answer if you gave one, disconnected briefly
<dlowe> It seems like it would be really good for multiuser games. :) Someone is already writing a MUD, I saw.
<Nat_> Looking at the logs, yeah that's true, idk even some weird distributed systems thing
<Nat_> I guess the bar for "toy" is pretty high here
<codec__> well I am not the best person to answer you
<codec__> You should wait for Sean as he as quite a nice experience
<codec__> and use Pony at his work
<codec__> or maybe you can watch a conference by Sylvain or Sean
<Nat_> do you know of a good one?
<codec__> Yes, I like this one https://www.youtube.com/watch?v=0XFhTrtOGK4
<codec__> He does not go into technicals details but explain the stake
<Nat_> 👍 I'll check it out, thanks
<SeanTAllen> kempe: yes, there's no default array copy. you need to implement.
<SeanTAllen> Guest: what exactly would a string representation of an array be? what would it be if the items in the array are not Stringable?
gokr has joined #ponylang
<codec__> I think in some languages (mosty OO) there is a ToString() method on the base object
<SeanTAllen> Guest78167: what sort of "sample projects" are you looking for?
<kempe> SeanTAllen: Thank you!
<codec__> So he/she probably expect something like that
<SeanTAllen> kempe: we have a small collection of collection helpers at Wallaroo Labs. https://github.com/WallarooLabs/wallaroo/blob/master/lib/wallaroo_labs/collection_helpers/collections_helpers.pony
<Nat_> SeanTAllen: yeah that's basically what I was thinking of things like Python's or Java's default string implementations for collections
<codec__> But even in C# this yield not really usefull result
<SeanTAllen> Nat: objects dont have to be stringable in Pony so that isn't possible without requiring everything to be stringable.
<Nat_> I see, and because all of this is enforced at compile time that's a pretty big thing to enforce right?
<SeanTAllen> My suggestion would be to create your own "helper" function on a primitive that operates on Array of Stringable that can do what you want.
<SeanTAllen> I'm not sure I follow Nat. Why compile time would matter.
<kempe> SeanTAllen: Much obliged
<SeanTAllen> Java for example showing a bit of the smalltalk root of most OO languages from that time, has a base class for every object
<SeanTAllen> everything inherits from Object
<SeanTAllen> Pony doesn't do that.
<SeanTAllen> Pony's OO has no inheritance. Its interface/trait based. You can do structural or nominal typing but there is no inheritance.
<SeanTAllen> So there's no base class that everything inherits from to hang methods like "toString()" off of.
<SeanTAllen> Its the programmers perogative to implement Stringable on their classes (if they desire_
<Nat_> I see, I see
<Nat_> I guess for sample projects, something that would be cool to reimplement/read through that really shows some of the strengths of Pony vs. doing something in either another actor language, or a traditional industry industry language like Java
<Nat_> that's a really broad category I'm sure, and admittedly I don't really know enough about Pony to ask a better question at the moment :p
<SeanTAllen> But you can do a primitive with methods that operate on Arrays of Stringable things to do all that. Its not always immediately obvious to folks but "primitive" is basically creating a module/namespace.
<SeanTAllen> Nat_: if you are interested in learning Pony. I can suggest the method I took. I wrote a good amount of documentation for the standard library during my first 3 months or so. It helped me learn the standard library and discover how to do a lot of things.
<SeanTAllen> And I had to understand what was going on because I was writing documentation to explain it to others.
<SeanTAllen> Its not really "playing around with Pony" but it can be a good way to get familiar with stuff.
gokr has quit [Ping timeout: 250 seconds]
<Nat_> is there some sort of central place where documentation needs are listed?
benq has quit [Quit: Textual IRC Client: www.textualapp.com]
<SeanTAllen> Nat_: there's a documentation label in github but it doesnt cover all the methods/classes/packages that aren't documented in the standard library. https://github.com/ponylang/ponyc/issues?q=is%3Aopen+is%3Aissue+label%3A%22project+documentation%22
<SeanTAllen> basically, open up the standard library. if a package/class/method is lacking documentation and you think it needs it, have at it!
<SeanTAllen> There's some info here as well: https://www.ponylang.org/contribute/project-documentation
<Nat_> 👍 I'll check those out, thanks
<SeanTAllen> TCP based network servers are also a good way to ease into writing Pony in my experience.
<Nat_> interesting, yeah maybe I can steal some project ideas from my Networks class
<SeanTAllen> Avoid things that lean on generics when you are just getting started. Folks struggle with generics and reference capabilities in the beginning.
<Nat_> I guess implementing something like Raft etc. could be interesting as well
<SeanTAllen> I believe that general advice is on the website. But I wrote it a while ago and don't remember if that is there
<Nat_> Are generics substantially different from other languages? Why is that a topic of struggle?
<SeanTAllen> No they aren't substantially different. But... reference capabilities are an area of struggle and they can get particularly confusing when working with generics.
<Nat_> ah okay
<SeanTAllen> Once you start to get a good grasp on reference capabilities then generics become easier.
<SeanTAllen> generally, using generics is a little hard at first for anything but he basics.
<SeanTAllen> then its easy but the writing of generics is difficult for a bit.
<SeanTAllen> Then its easy because it all clicks or its easy because you got frustrated and gave up on Pony.
<SeanTAllen> One of the two things generally happens.
<Nat_> I see, and your goal is to avoid people giving up on Pony lol
<SeanTAllen> Generally yes
<SeanTAllen> We try to make it clear to folks that there is a steep learning curve in some areas and then it gets much easier.
<codec__> for reference, I tried to learn Purescript and Pony seems definitevely more accesible
<SeanTAllen> My general view is, that any technology has the same amount of pain. They just move it around.
<SeanTAllen> Python is really easy to get started with and pick up, but the compiler doesn't help you are much and i find myself doing a lot more debugging and fixing "silly" type errors that a compiler would have caught for me.
<SeanTAllen> When I was writing Java or C++ or C, I had a whole set of rules for myself for what was safe to do with data when running with multithreads. And I often wished the compiler would help me out.
<Nat_> Yeah, recently I've been wanting stuff with a steeper learning curve, but where after that curve it makes the hard stuff easier
<Nat_> but most things feel like they make the opposite tradeoff like python, as you said
<SeanTAllen> Early on in my career, I gave up on Ada because it made me feel frustrated trying to get programs to compile. I much preferred C because I felt like I was accomplishing more.
<SeanTAllen> Of course, I was segfaulting programs a lot but... I felt more productive.
<SeanTAllen> I'm glad I learned C and the painful lessons from all my mistakes but I also look back at that time and recognize that I have a habit of giving up on things that don't have an easy learning curve.
<SeanTAllen> Which I kept in mind when I was learning Haskell and then later Pony.
<codec__> Ain't Haskell more difficult to learn than Pony?
<SeanTAllen> It's different. I think it depends on your background.
<SeanTAllen> I think the problem most folks have learning haskell is that a lot of the docs using mathematical terminology (often from category theory) rather than terms that would have more meaning to "most programmers".
<codec__> Probably, plus the syntax is really different from most languages and I had hard time getting used to it
<codec__> and then I had no clue what should idiomatic Haskell look likes, how should I structure my code
<codec__> and finally, the tooling is really bad
<SeanTAllen> I'm not really comfortable with saying a languages tooling is bad. Generally, I assume its good at what it was designed for and my needs don't match the design objectives.
<codec__> Yeah but in the Haskell case, most of the folks agree with it
<codec__> I mean Haskell programmers, they are initiative to improve the situation but last time I tested it was still not good
<codec__> A simple conway game of life (in console) took more than 10 secondes on my work computer
<SeanTAllen> To me, that sounds like folks who need tooling with different design objectives need to pitch in and build the tooling they need. But, I'm not comfortable with "good" or "bad" as descriptors without discussing the specific constraints and what not.
<SeanTAllen> As an industry we have an unfortunate habit of saying things like "PHP sucks" and pretending like that is a valid or true statement.
<SeanTAllen> In general, the Pony core team and committers share that view, so you'll see us talking about tradeoffs a lot.
<SeanTAllen> Like our preemptive/cooperative scheduling conversation yesterday.
<codec__> Yeah but for Haskell I didn't feel the same pain with PureScript
<codec__> The tooling was ihmo better while the language very similiar
<codec__> which is the reason why I can say the tooling of Haskell is bad
<codec__> Obvisouly there is no universal bad, it is always relative
<codec__> But in comparison in most languages I have used the tooling is inferior
<codec__> That does not mean the language is bad either, but it is just the way it is
<codec__> and it is unfortunate for the Haskell community because it add friction for everyone
<codec__> and especially beginners since they may not perserve to learn because of it
<codec__> On a totally not related subject, do you know if there is some sort of cross platform libraries that is used by the pony compiler
<SeanTAllen> what do you mean by "cross platform libraries" codec__ ?
<SeanTAllen> do you mean things like PCRE?
<codec__> to embbed the source code when generating the doc
<codec__> I need to do some file manipulation
<codec__> My C is quite rusty but if I remember correctly there isn't much for file manipulation (such as handling path) in the C standard library
<codec__> so I wonder if the pony compiler use something to abstract the different platforms (Windows, Linux and MacOS)
<SeanTAllen> there are some abstractions but no, probably nothing like what you are asking about.
<SeanTAllen> there's some stuff in the pony runtime for file handling but most of it is done at the pony level so it isnt available to pony in c.
<SeanTAllen> look at how it already works in the documentation generation as that works across supported platforms.
vaninwagen has quit [Ping timeout: 248 seconds]
dipin has joined #ponylang
notsgnik has quit [Quit: Leaving]
<codec__> I really struggle to extract the filename from a char* with only C. Have you any idea how to do it?
Nat_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]