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
atk has quit [Quit: Well this is unexpected.]
atk has joined #ponylang
Praetonus has quit [Quit: Leaving]
trusion has quit [Ping timeout: 258 seconds]
doublec_ has joined #ponylang
doublec has quit [Ping timeout: 248 seconds]
doublec_ is now known as doublec
doublec has quit [Changing host]
doublec has joined #ponylang
dom96 has quit [*.net *.split]
user10032 has joined #ponylang
dom96 has joined #ponylang
j14159 has quit [*.net *.split]
j14159 has joined #ponylang
ada[m] has quit [Ping timeout: 240 seconds]
dtz has quit [Ping timeout: 248 seconds]
irx[m] has quit [Ping timeout: 248 seconds]
M-hrjet has quit [Ping timeout: 276 seconds]
srenatus has quit [Ping timeout: 255 seconds]
mindB has quit [Ping timeout: 255 seconds]
<notsgnik> SeanTAllen, also there is no i++ or ++i equivalent, not that i = i + 1 doesn't work , it just don't correspond to the same IR representation. i think that the "inc" instruction is quicker than an "add"
ensrettet has joined #ponylang
samuell has joined #ponylang
user10032 has quit [Remote host closed the connection]
samuell has quit [Ping timeout: 252 seconds]
vaninwagen has joined #ponylang
samuell has joined #ponylang
samuell has quit [Remote host closed the connection]
gokr has joined #ponylang
<Candle> notsgnik: I believe that there was a decision taken to not include that class of unary operator and let the compiler optimisations reduce the 'i = i + 1' to the 'inc' instruction.
irx[m] has joined #ponylang
irx[m] has quit [Read error: Connection reset by peer]
irx[m] has joined #ponylang
ada[m] has joined #ponylang
M-hrjet has joined #ponylang
dtz has joined #ponylang
srenatus has joined #ponylang
mindB has joined #ponylang
tbillington has joined #ponylang
<tbillington> Hi, just curious if the reason that primitives can't be embedded is because they're always "embedded" no matter how you declare them (let or var)?
codedc has joined #ponylang
codedc has quit [Ping timeout: 260 seconds]
bimawa1 has joined #ponylang
bimawa has quit [Ping timeout: 240 seconds]
notsgnik has quit [Ping timeout: 252 seconds]
tbillington has quit [Ping timeout: 260 seconds]
notsgnik has joined #ponylang
<SeanTAllen> primitives have no state.
<SeanTAllen> embed rather than being a pointer to an instance of a class inlines it in existing class.
<SeanTAllen> that doesn't make sense for a primitive, there's only a single instance of a given primitive tbillington
jmiven has quit [Quit: co'o]
jmiven has joined #ponylang
mrallen1 has quit [Ping timeout: 255 seconds]
gornikm has quit [Write error: Connection reset by peer]
gornikm has joined #ponylang
ericbmerritt_ has quit [Read error: Connection reset by peer]
slfritchie has quit [Ping timeout: 255 seconds]
mrallen1 has joined #ponylang
ericbmerritt_ has joined #ponylang
samuell has joined #ponylang
notsgnik has quit [Ping timeout: 264 seconds]
slfritchie has joined #ponylang
<vaninwagen> SeanTAllen, i guess tbillington is talking about numeric literals like U32 etc.
<vaninwagen> *numeric primitives
trevorriles has joined #ponylang
<SeanTAllen> U32's are already "embedded"
vaninwagen has quit [Read error: Connection reset by peer]
vaninwagen has joined #ponylang
<vaninwagen> SeanTAllen, yeah, i think that was why tbillington was confused i guess. you can't use the "embed" keyword on numeric primitive fields as they are already embedded...
surma has joined #ponylang
<surma> Hey everyone. I have just started playing with Pony. I am playing around with net/http and into a problem I don’t understand: https://gist.github.com/surma/5e4a943a652937e683b357ef21f5119e At the very bottom I send my response in 2 different ways, but only the first one works. I looked at the implementatoin of Payload.respond() and it seems like it does the exact same thing as my first approach, but I don’t actually
<surma> get a response when testing. Any ideas what I need to do differently?
<vaninwagen> surma, Payload.respond actually does not use the response' argument
<vaninwagen> it tries to send itself, which is the request in your case
<vaninwagen> i think you just found a bug
* Candle doesn't like the usability of net/http.
<vaninwagen> surma you mind filing a github issue?
<surma> Sure thing, will do
<surma> Candle: I teeend to agree. It’s not a most intuitive package (Again, speaking as a pony newbie here), but it’s great there this something to start with
<Candle> It feels like a significant departure from pretty much every other HTTP client library for other languages. (possibly due to it's relatively tight coupling between the server and client elements?)
<surma> Candle: Mostly it feels very unusual to have a “per-connection” class that invokes a “per-request” class. HTTP is stateless so could be going just per-request and call it a day. But maybe people will build something on top :)
<surma> Also re-using the same data-structure for requests and responses seems like a mistake. But I’ll play around some more and solidify my opinion
<Candle> <-- also a relative newbie - not due to elapsed time, but more to do with time actually writing polylang.
<surma> vaninwagen: I might as well whip a PR
<surma> whip up*
<vaninwagen> Candle, yeah, this is a client issue which already has a PR in the pipeline
<vaninwagen> surma, that would be very very awesome
dtz has quit [Ping timeout: 264 seconds]
kempe has quit [Ping timeout: 264 seconds]
<surma> Done :D https://github.com/ponylang/ponyc/pull/2324 (What a _massive_ PR)
<Candle> surma: hehe.
dtz has joined #ponylang
kempe has joined #ponylang
<vaninwagen> surma, Candle yeah, http test coverage could be bigger
Praetonus has joined #ponylang
notsgnik has joined #ponylang
<SeanTAllen> When Paul contributed the HTTP stuff, he did it for a "streaming" case
ensrettet has quit [Quit: Textual IRC Client: www.textualapp.com]
<SeanTAllen> candle, im hoping for more http related libraries
<SeanTAllen> in particular a high perf http parser that people can build clients on
<Candle> Aye. Like (I assume) most people here, I've got a shopping list of things I'd like to *have* done! (But I want a pony too!)
dougmacdoug has joined #ponylang
<notsgnik> Hello, do someone have couple of minutes to help me make this code work? https://playground.ponylang.org/?gist=a48dc4f475976544e932ddb663fbccd9
<vaninwagen> notsgnik, you cannot push to a Array[String] val (line 64)
<vaninwagen> notsgnik and `[]` is creating an Array[_] val
<vaninwagen> if you need Worker._result to be sendable, make it iso and use destructive read for sending it around
<vaninwagen> notsgnik, is it an option to have _result not as a field of Worker?
<vaninwagen> but as a local variable in _work?
<notsgnik> he can easily a variable of _work, vaninwagen
<notsgnik> iso? destructive read? ( sorry i'm new to all this :/ )
<vaninwagen> no worries
<vaninwagen> notsgnik, this is the section about desctructive read: https://tutorial.ponylang.org/capabilities/consume-and-destructive-read.html
<vaninwagen> iso is a reference capability that ensures that there is only one reference to an object at all times
<vaninwagen> only iso, val and tag stuff can be an argument to a behaviour of an actor
<vaninwagen> because this is the only stuff that can be safely shared - stuff you have only one reference to, immutable stuff and stuff whose internal state is not accessible at all
<vaninwagen> if you have a reference to an iso thingy locally and want to send it, you need to "destroy" your reference to it, otherwise you would have two and break the iso guarantees
<vaninwagen> this "destroying" is called "consume" in pony
<vaninwagen> it ensures the consumed reference is not usable anymore
<notsgnik> ok, but if i consume the string i will not be able to add it to an other index in row
trevorriles has quit [Ping timeout: 268 seconds]
<notsgnik> cne i copy a value?
<notsgnik> *can i
<vaninwagen> if you have a String val you can have as many copies of it as you want
<vaninwagen> copies meaning other references to the same String
<vaninwagen> String literals are String val
<notsgnik> what's wrong with my code then?
<vaninwagen> notsgnik, Row is an Array[String] val
<vaninwagen> you cannot use push on it
<vaninwagen> because this method requires the object on which it is called (the receiver) to be an Array[String] ref (or something compatible with that)
<vaninwagen> it is defined as "fun ref push(...)"
<notsgnik> yep
<notsgnik> still i can't manage to understand the conflict between refs
<vaninwagen> i can feel you, it is complicated at first
<vaninwagen> so, if you want to send _result back to the ArrayCreator actor, it needs to be val or iso
<vaninwagen> iso if you want it to be mutable, val if it can be immutable
<vaninwagen> but you cannot mutate it locally if it is already val
<vaninwagen> so maybe go with iso
<notsgnik> i'm trying
<vaninwagen> or use trn - if you recover something that is trn, it becomes val
<vaninwagen> you could do: let Row = recover [... create and push to row ...] end
<vaninwagen> ok, now it is iso
<vaninwagen> now if you push it to _table in line 45 you need to to _table.push(consume result)
<vaninwagen> otherwise you actually push an alias
<vaninwagen> and you need to consume in line 67
<vaninwagen> there is quite sth. to change there
<vaninwagen> lets stumble from error to error, which is my normal pony-development-mode
nisanharamati has joined #ponylang
vaninwagen has quit [Ping timeout: 268 seconds]
<SeanTAllen> notsgnik: do you understand why you can't send a `ref` from one actor to another, other than "Pony won't allow it"? Do you understand why it's unsafe?
user10032 has joined #ponylang
mollymorphic has joined #ponylang
Praetonus has quit [Ping timeout: 250 seconds]
Praetonus has joined #ponylang
endformationage has joined #ponylang
endformationage has quit [Ping timeout: 246 seconds]
vaninwagen has joined #ponylang
<vaninwagen> SeanTAllen, we switched to dm and talked a lot about notsgnik's example
<vaninwagen> i personally learned a lot about capabilities from doublec's great posts: https://bluishcoder.co.nz/2017/07/31/reference_capabilities_consume_recover_in_pony.html
<vaninwagen> in addition to the tutorial and my good old friends trial and error
mindB has quit [Ping timeout: 240 seconds]
M-hrjet has quit [Ping timeout: 240 seconds]
mollymorphic has quit [Ping timeout: 240 seconds]
srenatus has quit [Ping timeout: 255 seconds]
dtz has quit [Ping timeout: 252 seconds]
ada[m] has quit [Ping timeout: 252 seconds]
irx[m] has quit [Ping timeout: 264 seconds]
mollymorphic has joined #ponylang
mollymorphic has quit [Ping timeout: 250 seconds]
mollymorphic has joined #ponylang
<vaninwagen> notsgnik, i made your example work and annotated it a bit so you can find out what is going on there: http://playground.ponylang.org/?gist=db28d92f10f8b5e4bbe2dd4e95146512
_andre has quit [Quit: leaving]
_whitelogger has joined #ponylang
irx[m] has joined #ponylang
gokr has quit [Ping timeout: 252 seconds]
user10032 has quit [Quit: Leaving]
samuell has quit [Remote host closed the connection]
irx[m] has quit [Read error: Connection reset by peer]
nisanharamati has quit []
irx[m] has joined #ponylang
mollymorphic has quit [Ping timeout: 252 seconds]
dougmacdoug has quit [Quit: dougmacdoug]
vaninwagen has quit [Ping timeout: 250 seconds]
irx[m] has quit [Remote host closed the connection]
Praetonus has quit [Quit: Leaving]
irx[m] has joined #ponylang