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
Zarutian has quit [Quit: Zarutian]
SilverKey has joined #ponylang
Guest_ has joined #ponylang
Guest_ has quit [Client Quit]
Perelandric has joined #ponylang
SilverKey has quit [Quit: Halted.]
c355e3b has quit [Quit: Connection closed for inactivity]
jemc has joined #ponylang
mrkishi has quit [Ping timeout: 246 seconds]
jemc has quit [Ping timeout: 272 seconds]
jemc has joined #ponylang
jemc has quit [Ping timeout: 244 seconds]
bb010g has joined #ponylang
amclain has quit [Quit: Leaving]
Perelandric has quit [Ping timeout: 250 seconds]
SilverKey has joined #ponylang
srenatus has joined #ponylang
SilverKey has quit [Quit: Halted.]
jemc has joined #ponylang
mrkishi has joined #ponylang
jemc has quit [Ping timeout: 244 seconds]
copy` has quit [Quit: Connection closed for inactivity]
mrkishi has quit [Ping timeout: 264 seconds]
tm-exa has joined #ponylang
tm-exa has quit [Client Quit]
tm-exa has joined #ponylang
bb010g has quit [Quit: Connection closed for inactivity]
hibnico has joined #ponylang
Applejack_ has joined #ponylang
Applejack_ has quit [Ping timeout: 246 seconds]
hibnico has quit [Quit: hibnico]
Praetonus has joined #ponylang
Applejack_ has joined #ponylang
hibnico has joined #ponylang
trapped has joined #ponylang
trapped has quit [Read error: Connection reset by peer]
trapped has joined #ponylang
c355e3b has joined #ponylang
Praetonus has quit [Remote host closed the connection]
Perelandric has joined #ponylang
Praetonus has joined #ponylang
SilverKey has joined #ponylang
SilverKey has quit [Read error: Connection reset by peer]
SilverKey has joined #ponylang
Applejack_ has quit [Ping timeout: 244 seconds]
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
jemc has joined #ponylang
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
Applejack_ has joined #ponylang
Applejack_ has quit [Ping timeout: 244 seconds]
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
mrkishi has joined #ponylang
amclain has joined #ponylang
trapped has quit [Read error: Connection reset by peer]
jemc has quit [Quit: WeeChat 1.4]
jemc has joined #ponylang
tm-exa has quit [Quit: Computer has gone to sleep]
hibnico has quit [Quit: hibnico]
runehog_ has quit [Remote host closed the connection]
<Candle> I have a trait that takes a generic argument, the trait is intended to be implemented by actors as it has a behaviour defined. Currently I have either "this parameter must be sendable" or "can't specify a capability on a type parameter" I don't yet understand the rationale behind the second error message (nor how to resolve the problem)
<Candle> "trait Foo[E] \n be bar(something: E val)"
tm-exa has joined #ponylang
<SeanTAllen> specify Foo[Something val]
<SeanTAllen> but it sounds like what you want is to constrain E to sendable capabilities
<Candle> Constraining to sendable capabilities sounds like the right solution.
<Candle> "trait Foo[E val]" gives "syntax error: unterminated type parameters"
tm-exa has quit [Quit: Computer has gone to sleep]
<SeanTAllen> that's not how you do a constraint Foo[E: Any #send]
<SeanTAllen> so this trait Foo
<SeanTAllen> it takes an E
<SeanTAllen> which can be Any type as long as it is sendable
<Candle> SeanTAllen: Thanks.
SilverKey has quit [Quit: Halted.]
copy` has joined #ponylang
<SeanTAllen> Yeah, its a good one
<SeanTAllen> There's also sylvanc's VUG talk on generics
graaff has joined #ponylang
runehog has joined #ponylang
graaff has quit [Quit: Leaving]
Matthias247 has joined #ponylang
Applejack_ has joined #ponylang
SilverKey has joined #ponylang
SilverKey has quit [Client Quit]
SilverKey has joined #ponylang
SilverKey has quit [Quit: Halted.]
Applejack_ has quit [Ping timeout: 250 seconds]
SilverKey has joined #ponylang
Applejack_ has joined #ponylang
SilverKey has quit [Quit: Halted.]
Applejack_ has quit [Ping timeout: 240 seconds]
Applejack_ has joined #ponylang
SilverKey has joined #ponylang
Applejack_ has quit [Ping timeout: 240 seconds]
SilverKey has quit [Quit: Halted.]
shomodj has joined #ponylang
SilverKey has joined #ponylang
SilverKey has quit [Client Quit]
Applejack_ has joined #ponylang
runehog has quit [Remote host closed the connection]
SilverKey has joined #ponylang
SilverKey has quit [Quit: Halted.]
felixgallo has joined #ponylang
felixgallo has quit [Client Quit]
felixgallo has joined #ponylang
<felixgallo> ahh, irssi. An elegant weapon from a more civilized age.
Applejack_ has quit [Ping timeout: 258 seconds]
<felixgallo> is there an easy way to see what the compiler infers for a given function's type?
<SeanTAllen> im not quite sure i follow
<SeanTAllen> can you give a code example felixgallo ?
<felixgallo> for example -- what is the type of derpa()?
<felixgallo> from inspection I can see it's Array[(U32 | string)] or some such
<felixgallo> ponyc --astpackage is not super ultra horrible but requires some arcane decipherage
<felixgallo> but it'd be nice if I could say, e.g. 'ponyc --what-do-you-think-of derpa'
<SeanTAllen> actually its None
<SeanTAllen> the easiest way at the moment is to give it an incorrect value like var l: String = derpa()
<felixgallo> ahhh yeah
<SeanTAllen> then you get:
<SeanTAllen> None val is not a subtype of String val
<felixgallo> well yes. OK, my example is bad.
<SeanTAllen> if you put no return type, it defaults to None
<SeanTAllen> and that's what you will get
<felixgallo> yeah, I was futzing around trying to get an array literal to be the proper return value for a function of type Array[Any] and got myself turned around.
<felixgallo> that's the endgame I was trying to get to; being able to assemble a list of arbitrary objects, and then to try to print them out.
<SeanTAllen> so rather than Array[Any] you want Array[Stringable] right?
<SeanTAllen> otherwise you can have a runtime kaboom
<felixgallo> at this stage I don't mind runtime kabooms, although I agree with you wholeheartedly in principle
<felixgallo> nevertheless Array[Stringable] doesn't work either as the return value of the [] clause is apparently narrowed to [(String val | U32 val)] ref^
<felixgallo> what I kind of want to do is the quasi-haskell thing: fun derpa() : _ => ["a", 5, 123]
<felixgallo> I thought fun derpa() : Array[Any] was that, but it turns out that it infers the type of the list and then tries to match against the signature, which continues to bite me conceptually
<SeanTAllen> sorry, what?
<SeanTAllen> so it wont like that
<SeanTAllen> it wont see that as Stringable
<SeanTAllen> recover Array[Stringable].push("1").push(x) end
<SeanTAllen> will though
<felixgallo> hnnggh
<jemc> this also works - [as Stringable: "a", "b", x]
<felixgallo> that second one isn't so bad
<SeanTAllen> or that
<jemc> this is a known deficiency in the compiler - it could do better on cases like this
<SeanTAllen> yes
<felixgallo> I do like "recover Array[Stringable].push("1").push(x) end" though Sean...that's...interesting. :)
<jemc> actually, the array literal syntax gets translated to a series of `push` calls in the compiler
Matthias247 has quit [Read error: Connection reset by peer]
<SeanTAllen> hmmm
<SeanTAllen> you just reminded me of something i wanted to look at ages ago jemc
<SeanTAllen> does it size the array correctly?
<SeanTAllen> or are there possible multiple allocations with that?
<jemc> off the top of my head, I'm pretty sure I remeber that it reserves the number of elements in the constructor call
<SeanTAllen> excellent
<jemc> yep, it does
shomodj has quit [Quit: Page closed]
<felixgallo> so I guess I misunderstand 'Any' in the pony context. I'd expect that it has every other type as a member. I know it doesn't have tuples which occasionally makes me sad.
<felixgallo> maybe it's that thing Sylvan was saying, which I flit back and forth between understanding and not understanding, where a type having a constructor makes all the difference.
<felixgallo> I dunno why I need to be explicit about Stringable like this
<jemc> felixgallo: regarding Any - more generally, Any can't include any types that we can't do runtime type matching on, which includes tuples (as a whole) and also structs
<jemc> structs are meant to mirror the C ABI and so cannot have an object header for runtime type matching
<felixgallo> structs make sense to me in that context
<jemc> tuples just represent a logical grouping of several types in a sequence - so the grouping itself does not have an object header
<felixgallo> each element could, on entry, stash its type in a notional tuple header though
<jemc> so we can match on the types inside the tuple, but we can't match on the tuple itself against other non-tuples or tuples of different element-counts
<SeanTAllen> Any & Stringable doesn't mean much there... Stringable is all you need
<felixgallo> yeah. I keep trying to get an Any, for other reasons. But I should probably stop that.
<felixgallo> https://gist.github.com/ba51b3399ed4444df29a7dd7edfe6ce0 works, though, and seems much more straightforward.
<felixgallo> maybe there's just something up with the way array literals are constructed.
<felixgallo> (vs. my approach, rather than vs. reality)
SilverKey has joined #ponylang
<SeanTAllen> you dont want an Any though
<SeanTAllen> you want Stringeable
<SeanTAllen> What are the "other reasons" for wanting an Any? Its not at all clear from that code snippet?
<felixgallo> this is a continuation of my quixotic attempt to implement a quickcheck with a cleanish API
runehog has joined #ponylang
<felixgallo> as part of that I'd like to be able to handle functions with arbitrary signatures and arbitrary arguments
<SeanTAllen> ah
<felixgallo> probably I need to stop being clever and just implement the highly boilerplated solution
<felixgallo> as learning experiences go it's been top notch so far though, thanks for the help to both you and @jemc
SilverKey has quit [Quit: Halted.]
<SeanTAllen> glad to help although i don't feel like i've done anything helpful