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