c355e3b has quit [Quit: Connection closed for inactivity]
jemc has joined #ponylang
doug_ has joined #ponylang
<doug_>
i have an Array[U8] but I cant get the U8 values in a for loop.. keep getting "cannot infer type of for loop iterator"
jemc has quit [Ping timeout: 255 seconds]
aedigix has quit [Remote host closed the connection]
aedigix has joined #ponylang
<doublec>
doug_: can you pastebin some code?
<doublec>
doug_: of the loop body
<doug_>
i finally figured it out.. it was iso issue.. still noob with capabilites
doug_ has quit [Quit: Page closed]
Matthias247 has joined #ponylang
_andre has joined #ponylang
TonyLo has joined #ponylang
wizeman has joined #ponylang
TonyLo has quit []
c355e3b has joined #ponylang
c355e3b has quit []
TonyLo has joined #ponylang
seanohue has joined #ponylang
seanohue has quit [Read error: Connection reset by peer]
seanohue has joined #ponylang
seanohue has quit [Read error: Connection reset by peer]
unbalancedparen has joined #ponylang
seanohue has joined #ponylang
seanohue has quit [Read error: Connection reset by peer]
jemc has joined #ponylang
unbalancedparen has quit [Ping timeout: 264 seconds]
unbalancedparen has joined #ponylang
seanohue has joined #ponylang
amclain has joined #ponylang
TonyLo_afk has joined #ponylang
TonyLo has quit [Ping timeout: 240 seconds]
TonyLo_afk has quit [Ping timeout: 256 seconds]
seanohue has quit [Read error: Connection reset by peer]
<dougmacdoug>
is there any reason tuple would not be faster than array? i am just assuming there is no special sauce under the hood that would make arrays more performant than tuples in small sizes like a linear math lib
TonyLo has joined #ponylang
seanohue has joined #ponylang
aav_ has quit [Ping timeout: 240 seconds]
_andre has quit [Quit: leaving]
<SeanTAllen>
you'd have to test but i'm not aware of a reason it wouldn't be
<dougmacdoug>
well, i am trying to decide if i should do linear math in arrays or tuples.. i would prefer tuples for many reasons, the only issue is that a lot of math operations might generate a bunch of tuples.. would those be stack objects or heap..
<SeanTAllen>
stack
jemc has quit [Ping timeout: 240 seconds]
<dougmacdoug>
cool.. now I just need to figure out who to attach functions to type alias ;p .. maybe i should have started there..
<SeanTAllen>
what do you mean by attach functions to a type alias?
<dougmacdoug>
well, it was a joke, because I just found out i cant do that.. so like type Vec2 is (F32, F32)
<SeanTAllen>
that works
<SeanTAllen>
you can define a type alias for a tyuple
<dougmacdoug>
i cant have a fun scale(s : F32) : Vec2 => (_1*s, _2*s)
<SeanTAllen>
what is it that you want that to do?
<dougmacdoug>
trying to make as lightweight as possible vec2, vec3 types which I can instantiate like (x,y)
<SeanTAllen>
so what do you imagine (_1*s, _2*s) is doing?
<SeanTAllen>
if i call scale(F32(1.0))
<SeanTAllen>
what is the return tuple supposed to be?
<SeanTAllen>
(F32(1.0), F32(1.0)) ?
<dougmacdoug>
if I have v: Vec2 = (1,1) ... then v.scale(2) should return new tuple (2,2)
<dougmacdoug>
seems I will need to use a class with single tuple member variable..
<dougmacdoug>
which is fine but verbose, it would be better if instead of Foo.scale(v, 2) I could call v.scale(2)
<SeanTAllen>
the primitive there is acting as a module
<SeanTAllen>
to call v, you would need a class and that is more expensive, but v. is on a specific object
<dougmacdoug>
right..
<SeanTAllen>
and then you have class and its on the heap, which you are trying to avoid so primitive would be how you need to do it
seanohue has quit [Ping timeout: 240 seconds]
<dougmacdoug>
I guess I could make a primitive namespace and just put all my fun in there .. i'm still trying to wire my brain into pony mode
seanohue has joined #ponylang
<SeanTAllen>
primitives do act as a module.
<SeanTAllen>
i do that quite often, take all my nice functional bits and group them into modules using primitives that are easy to test. then pass in my objects as needed.
TonyLo has quit [Ping timeout: 240 seconds]
jemc has joined #ponylang
<dougmacdoug>
i assume the restrictions on type alias and primitive prevent them from overriding infix operators..
seanohue has quit [Ping timeout: 252 seconds]
wizeman has quit [Quit: Connection closed for inactivity]
seanohue has joined #ponylang
Matthias247 has quit [Read error: Connection reset by peer]
<SeanTAllen>
you need a class if you want to get sugar for add, sub etc so yes