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
jemc has quit [Ping timeout: 240 seconds]
plietar has joined #ponylang
plietar has quit [Ping timeout: 240 seconds]
<ada[m]> Hm. I've dug into adding eq/string methods to `Array`, and I don't think it makes sense to do until the function specialization part of the subtype checking rfc is implemented.
<ada[m]> (A generic class not having an `eq` method when its subtype isn't Equatable is much cleaner than it just checking for identity equality in those cases)
<ada[m]> I actually got most of the way through writing the RFC before realizing that function specialization hadn't been implemented yet.
amclain has quit [Quit: Leaving]
Felix___ has joined #ponylang
plietar has joined #ponylang
Felix___ has quit [Ping timeout: 240 seconds]
plietar has quit [Ping timeout: 255 seconds]
plietar has joined #ponylang
plietar has quit [Ping timeout: 255 seconds]
tscho has joined #ponylang
aceluck has joined #ponylang
plietar has joined #ponylang
plietar has quit [Ping timeout: 255 seconds]
endformationage has quit [Quit: WeeChat 1.9]
plietar has joined #ponylang
plietar has quit [Ping timeout: 240 seconds]
plietar has joined #ponylang
bodie_ has quit [Ping timeout: 268 seconds]
bodie_ has joined #ponylang
samuell has joined #ponylang
_andre has joined #ponylang
vaninwagen has joined #ponylang
Praetonus has joined #ponylang
jemc has joined #ponylang
jemc has quit [Client Quit]
jemc has joined #ponylang
theodus has joined #ponylang
aceluck has quit []
Felix__ has joined #ponylang
Felix__ has quit [Quit: Lost terminal]
justicefries has joined #ponylang
<justicefries> o/
<SeanTAllen> Hi justicefries
rurban has joined #ponylang
rurban has left #ponylang [#ponylang]
jmiven has quit [Quit: co'o]
jemc has quit [Ping timeout: 240 seconds]
jmiven has joined #ponylang
theodus_ has joined #ponylang
<theodus> o/
jimdopango has joined #ponylang
jemc has joined #ponylang
endformationage has joined #ponylang
etc has joined #ponylang
etc has quit [Client Quit]
adam__ has joined #ponylang
theodus_ has quit [Quit: theodus_]
Matthias247 has joined #ponylang
plietar has quit [Remote host closed the connection]
plietar has joined #ponylang
plietar has quit [Ping timeout: 240 seconds]
<tscho> Hi, I'm a super newbie to programming. Currently I'm working at at ISPs NOC. I thougth about a programm to check some (50k+) network devices. I don't understand a lot from the tutorial. Is there any literatur you recomend befor starting with pony?
theobutler has joined #ponylang
theodus has quit [Ping timeout: 255 seconds]
theodus has joined #ponylang
theobutler has quit [Ping timeout: 240 seconds]
plietar has joined #ponylang
<jemc> tscho: hello and welcome!
<jemc> I'll start off by saying that if you're new to programming entirely, you may find learning pony to be very challenging - the learning curve for reference capabilities is very steep even for veteran programmers who are familiar with the motivating concerns
<jemc> however, we have a really terrific community that is willing to take time to help folks work through their troubles, so that's one thing that may make pony a reasonable place to start
<jemc> if you could talk about what your previous experience with programming is, or about what the first part of the tutorial that was confusing was, we could maybe recommend a place to start
<tscho> I have some basic experience in shell scripting. I had at school some porgramming lessions with PHP, but only the basic stuff like loops and basic maths. We never worked with objects etc.
<jemc> working with networking in your career, would you say that you're fairly familiar with distributed systems concepts (CAP theorem, distributed coordination, eventual consistency, etc)?
<tscho> We had some basic lessions 8 years about it at scholl
<jemc> I don't necessarily have specific literature to recommend to you (maybe somebody else does?), but I can list of some concepts for you to research and make sure you feel comfortable with understanding before proceeding
<tscho> The hello world makes sense to my but I did not find what kind of types I can use in pony. In the tutorial String, booleans and U64 are mentioned. I also did not find how I can call a function or actor from my main actor
<jemc> "race conditions" - understand what they are, how they happen in a concurrent system, and what kinds of approaches programmers use to avoid them
vaninwagen has quit [Ping timeout: 240 seconds]
<jemc> "immutability" - understand the concept of mutation of shared memory, how it relates to concurrent systems, and why programmers prefer to use immutable data when possible in concurrent systems to avoid the problems resulting from shared mutable state
<jemc> "actor model" - get some basic understanding about how the actor model of programming works, what the constraints of it are, and why those constraints are useful
<jemc> going through the above "homework assignment" should be a great first step to prepping your mind for Pony
<tscho> Thank you verry much for your help. I really appreciate this. Already made a homework list ;)
<jemc> good luck, and feel free to ask general questions here about those topics - we're happy to help you answer questions about concurrent programming in general, not just pony
<jemc> but we'll probably have a pony-oriented slant to our answers :)
vaninwagen has joined #ponylang
<vaninwagen> hi, i have 2 questions about strings.
<vaninwagen> i have this playpen: http://playground.ponylang.org/?gist=42e43416bfb4232ae3e67aa8541ac125 which includes a string with a \0 byte. upon printing it with env.out.print i get some weird output (indented and only printed up to \0 byte). How are strings represented during runtime?
<vaninwagen> second one: if i have a method that simply returns a string literal ( fun my_literal(): String => "literally literal" ) will pony create a new String instance every time or will it reuse the same instance from some constant pool or smth.
<SeanTAllen> vaninwagen: env.out.print gets turned into a c-string for output and that is where you run into a problem with the `\0\ byte.
<jemc> vaninwagen: last I checked it returns a new `String` instance, with the same underlying pointer address to the string literal bytes
<jemc> we've talked about refactoring that to reuse the `String` instance, but I don't think anyone has implemented that optimization yet
<vaninwagen> jemc but the actual bytes are reused?
<jemc> (sorry, to be clear, that's an answer to the second question, since I think SeanTAllen answered the first)
<Praetonus> vaninwagen, jemc: The optimisation is implemented. Identical String literals use the same instance
<Praetonus> Which also means that identical String literals always have the same identity
<jemc> ah great
<jemc> vaninwagen: I'll whip up a playpen to prove it for you (an me, since I didn't know it was implemented yet)
<vaninwagen> SeanTAllen jemc Praetonus you guys are great! Who needs a language reference if there is you? :)
<vaninwagen> qed
<jemc> that's great that it's already done - I was thinking it was future work, but knowing it's done makes me happy :)
<jemc> regarding a language reference, we definitely do need one, and Praetonus brought up that topic at a recent sync call
<jemc> it's a huge undertaking though
<vaninwagen> +1
<vaninwagen> +100000
<vaninwagen> i would volunteer in helping filling some boring paragraphs if there is consensus how to do it
<SeanTAllen> i volunteer to let other people do that. ;)
<vaninwagen> so i can treat a method returning a literal as if it was a field (efficiency-wise)?
<Praetonus> vaninwagen: It depends on what kind of literal
<Praetonus> Array literals always allocate a new instance
<vaninwagen> but numbers and strings are fine?
<jemc> numbers aren't allocated at all :)
<jemc> so yes
<vaninwagen> jemc https://media.giphy.com/media/26ufdipQqU2lhNA4g/giphy.gif can you elaborate pls?
<jemc> sure!
<vaninwagen> :)
<Praetonus> Yes and no for numbers. If they're boxed (i.e. accessed through an interface or a union type), there'll be a memory allocation
<vaninwagen> Praetonus, do you have an example for a tired guy in CEST?
<jemc> when you create a new intance of an array or a string, or any user-defined `class` or `struct`, a region of memory gets allocated to store the fields of the object, and an object header containing the type id
<Praetonus> vaninwagen: Sure
<jemc> vaninwagen: and the value you get to "hold" when you pass around that object is a pointer to that region of memory
<jemc> when you reference a number or a boolean, the value that you "hold" is not a pointer, but just the plain value, as bytes
_andre has quit [Quit: leaving]
<jemc> now, the tricky part that Praetonus mentioned comes in, in cases where you need to detect the type of a "number" value at runtime
<vaninwagen> jemc out of curiosity: what is the overhead of a user defined class (byte-wise)? Can we beat java (12 bytes)?
<jemc> in which case a number as a value would be missing the object header that has the type id that you need to check to match for the type at runtime
<vaninwagen> jemc, so the 64 bit of a U64 are directly part of the containing class' memory?
<jemc> vaninwagen: yep
<jemc> so to overcome the "matching at runtime" problem, we "box" a primitive value inside an otherwise empty object wrapper, that contains the type id
<jemc> this comes into play when the type is something like `(U64 | None)`
<jemc> in order to be able to match by type at runtime, we can't just store the 64 bytes, we have to wrap it in the otherwise empty object wrapper
<jemc> errr... 64 bits :)
<Praetonus> vaninwagen: Some code to illustrate jemc's explanations: http://playground.ponylang.org/?gist=143cfe50acd91ea9d6c740a4a75027e0
<jemc> vaninwagen: I don't know offhand what the byte overhead of a class (or actor) is in pony - I'd have to look it up
<jemc> maybe somebody else knows offhand
<Praetonus> The overhead is 8 bytes for a class and 244 bytes for an actor, I think
<Praetonus> 248 for an actor
<vaninwagen> Praetonus thx for the enlightening example. And jemc for the really good explanation
<vaninwagen> can someone pls copy this conversation as future language-reference material? ;)
<jemc> Praetonus: do you have a place where you're taking notes for the language spec and what needs to be in it? does this material apply?
<vaninwagen> this boxing-topic is a really important property for performance-centric applications
<jemc> vaninwagen: and it's still actually subject to change :D https://github.com/ponylang/ponyc/issues/2120
<vaninwagen> Praetonus, you mentioned "accessed through an interface". Is this a different rule for boxing?
<Praetonus> I don't think it would be relevant in a language reference since these are implementation details. It would definitely deserve a Pony pattern or something like that
<vaninwagen> jemc, saw that issue, but only now it makes sense for me :)
<jemc> probably relevant to a pony performance awareness guide
<jemc> which I think SeanTAllen said he wanted to write someday :D
<Praetonus> vaninwagen: No, it works the same way. At the runtime level, all abstract types (unions, intersections, interfaces and traits) work the same way
<vaninwagen> Praetonus ok :)
<vaninwagen> SeanTAllen, back to question 1. :) do you have an idea about the indentation i get on strings containing \0 ?
<jemc> Praetonus: actually, now that I think about it... if we're going to have multiple implementations of the compiler (ponyc, ponycc), and multiple implementations of the runtime (current, distributed pony, others?), it probably makes sense to write up a specification of what the runtime system takes as its input
<jemc> not actually sure if distributed pony is intended conceptually to a separate runtime or an upgrade of the current one
<Praetonus> That would make sense, yeah. Though think having a specification on how machine words should be boxed would be too restrictive. I feel like it should only cover the "external" interface of the language and runtime. Things like the public runtime API, the text format for ASTs, the binary format for serialised objects, etc
<Praetonus> That way, we'd have a standard way to exchange data between instances of Pony, even if these instances use a different implementation, but we wouldn't be too restrictive on private implementation details
<jemc> yeah, I suppose
<SeanTAllen> Part of the "how to write high performance pony" i am working on is... "don't box your machine words. do awful c things."
<SeanTAllen> jemc: conceptually "upgrade" for distributed pony
Matthias247 has quit [Read error: Connection reset by peer]
theodus_ has joined #ponylang
jimdopango has quit [Quit: Page closed]
theobutler has joined #ponylang
theodus has quit [Read error: Connection reset by peer]
theodus_ is now known as theodus
Praetonus has quit [Quit: Leaving]
samuell has quit [Remote host closed the connection]
theobutler has quit [Quit: Bye]
plietar has quit [Remote host closed the connection]
plietar has joined #ponylang
vaninwagen has quit [Ping timeout: 260 seconds]
plietar has quit [Ping timeout: 255 seconds]
tscho has quit [Read error: Connection reset by peer]
tscho has joined #ponylang
rurban has joined #ponylang
rurban has quit [Ping timeout: 240 seconds]