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
acarrico has quit [Ping timeout: 240 seconds]
acarrico has joined #ponylang
jsgrant has quit [Read error: Connection reset by peer]
jsgrant has joined #ponylang
acarrico has quit [Ping timeout: 248 seconds]
plietar has quit [Remote host closed the connection]
plietar has joined #ponylang
endformationage has quit [Quit: WeeChat 1.9]
_whitelogger has joined #ponylang
user10032 has joined #ponylang
user10032 has quit [Quit: Leaving]
vaninwagen has joined #ponylang
samuell has joined #ponylang
benq has joined #ponylang
<benq> hi
samuell has quit [Remote host closed the connection]
<vaninwagen> benq ho
<benq> just a quick 10'000 feet question for a pony developer
<benq> do you know the chapel programming language and how you compare to ponylang?
<vaninwagen> me personally i only briefly heard about it.
* vaninwagen is reading the docs
<vaninwagen> what i can say for sure is that pony is not a parallel global address space language - at its core it has an actor system
<vaninwagen> and pony is not distributed yet like chapel
<vaninwagen> i heard sylvan talk about the problem of locality of actors in a distributed setup
<vaninwagen> but parallelism needs to be modelled explicitly using actors
samuell has joined #ponylang
* vaninwagen backs off for more qualified responses
samuell has quit [Quit: Leaving]
vaninwagen has quit [Ping timeout: 240 seconds]
_andre has joined #ponylang
samuell has joined #ponylang
samuell has quit [Remote host closed the connection]
jemc has joined #ponylang
ShalokShalom_ has joined #ponylang
ShalokShalom has quit [Ping timeout: 252 seconds]
acarrico has joined #ponylang
acarrico has quit [Remote host closed the connection]
acarrico has joined #ponylang
acarrico has quit [Ping timeout: 240 seconds]
samuell has joined #ponylang
samuell has quit [Remote host closed the connection]
samuell has joined #ponylang
aturley has quit [Ping timeout: 240 seconds]
acarrico has joined #ponylang
samuell has quit [Ping timeout: 248 seconds]
endformationage has joined #ponylang
jsgrant has quit [Read error: Connection reset by peer]
acarrico has quit [Ping timeout: 252 seconds]
acarrico has joined #ponylang
<endformationage> jemc: I'm afraid your gist in response to my query regarding primitives in generics was the same link I posted. I'd be grateful to still have an example using traits as you suggested. I attempted but was unable to find a solution.
samuell has joined #ponylang
acarrico has quit [Ping timeout: 260 seconds]
samuell has quit [Ping timeout: 240 seconds]
benq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jemc> ah, sorry!
ShalokShalom_ is now known as ShalokShalom
<endformationage> no problem, just still really curious :P
<jemc> my apologies for not copying the new link, and for not reading the chat backlog from yesterday from after I left
<endformationage> Dang, I thought I tried something like this. I guess I was missing the constructor on the trait.
<endformationage> Thanks again jemc.
acarrico has joined #ponylang
<jemc> no problem!
bimawa1 has joined #ponylang
samuell has joined #ponylang
user10032 has joined #ponylang
<endformationage> jemc: I have a general feeling as to why this doesn't work, but I cannot quite pinpoint it: http://playground.ponylang.org/?gist=605e779b79824bf576bdc08d14870d4e
<endformationage> And I realize it wouldn't really solve the over allocation issue you pointed out earlier, but here I'm just experimenting with generics.
<endformationage> ^ attempting to use Array[T].init(T(0), _count)
acarrico has quit [Ping timeout: 240 seconds]
_andre has quit [Quit: leaving]
acarrico has joined #ponylang
_andre has joined #ponylang
<jemc> I think you're hitting an issue here that I've noted in the past as a pain point for generics, where a type parameter constraint of `(A | B)`, where `A` and `B` are concrete types means that the possible type arguments are `A`, `B`, or `(A | B)` - it's the last one that's causing you trouble here because you don't actually want to allow that as a type argument
<jemc> the following would work, except for the fact that literal inference is not able to function without the type argument: http://playground.ponylang.org/?gist=8725c897a2ad9c8c52538d5b65f03fad
<jemc> using `T.min_value()` works, but it's not the same thing as `0` for either `F32` or `I32`
<endformationage> I see. Yeah I had an incling it had to do with concrete vs not..
<jemc> using `T.from[U32](0)` is a way to work around the literal inference issue, and the compiler should inline it to a constant, though it's not exactly intuitive: http://playground.ponylang.org/?gist=868578bc3e20983162e15dc30a2a93d3
<endformationage> Ah, interesting
<jemc> I'm pretty sure this situation (pain points due to lack of literal inference on a type parameterized number type) came up in a conversation before - SeanTAllen, do you remember this? I think you were involved
<endformationage> So using Real instead of the Union type pushes the type param to the concrete side of things?
<endformationage> a trait right?
<endformationage> I guess I meant to ask, Is a trait considered concrete?
<SeanTAllen> its not ringing any bells jemc but, i'm also really tired.
benq has joined #ponylang
<jemc> I only mentioned concrete types above because I wanted to simplify the discussion to the three cases I mentioned: `A`, `B`, and `(A | B)`
<jemc> traits and interfaces are *not* concrete types, and I was trying to talk specifically about the case where `A` and `B` are concrete (not traits or interfaces)
<jemc> because if `A` or `B` were a trait or interface, there would be more than three possibilities for type arguments here, because you might have a third type `C` which is a subtype of `A` and/or `B`, which could be used as a type argument and muddy the waters of the discussion
<endformationage> Haha. I think I understand it now.
<jemc> in this case, you were calling a constructor on `T` (either `T.create(value: T)` or `T.from[B: (Number & Real[B] val)](value: B)`)
<jemc> what's most important is that `T` is something you can call that constructor on
<jemc> when your constraint is `(F32 | I32)`, and you passed a type argument of literally `(F32 | I32)`, then `T` is a type union, and you can't call a constructor on a type union
<endformationage> Asesome, I was just about to confirm: "which wasn't the case with the union type"
<jemc> using `Real[T]` as the constraint requires that the type argument is something on which you could call any of the constructors defined in the `Real` interface
<jemc> note that if you wanted to limit to only `F32` or `I32`, you can use `((F32 | I32) & Real[T])` as the constraint
<endformationage> Oh, neat.
<jemc> which is incidentally the same thingthat the `B` type argument to the `from` constructor is doing :)
<jemc> (`Number` is a type union, and it is intersected with the `Real` trait)
<endformationage> I did try messing around with Real, but it didn't occur to me to pass T along to _it's_ type param..
aturley has joined #ponylang
<endformationage> This helps alot, thank you.
<jemc> yeah, the circular type parameter like that is a common pattern in Pony, because we don't have a magic `Self` type by which a parameterized type definition could refer to itself
tscho has quit [Read error: Connection reset by peer]
jsgrant has joined #ponylang
tscho has joined #ponylang
acarrico has quit [Ping timeout: 255 seconds]
acarrico has joined #ponylang
acarrico has quit [Ping timeout: 255 seconds]
benq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
samuell has quit [Remote host closed the connection]
samuell has joined #ponylang
benq has joined #ponylang
user10032 has quit [Quit: Leaving]
_andre has quit [Quit: leaving]
samuell has quit [Quit: Leaving]
benq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jemc has quit [Ping timeout: 240 seconds]
jemc has joined #ponylang
jemc has quit [Ping timeout: 252 seconds]
endformationage has quit [Quit: WeeChat 1.9]
aturley has quit [Ping timeout: 248 seconds]
samuell has joined #ponylang
samuell has quit [Remote host closed the connection]