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
felixgallo has quit [Quit: Page closed]
runehog has joined #ponylang
kulibali has quit [Quit: Going offline, see ya! (www.adiirc.com)]
MC_Hamming has quit [Remote host closed the connection]
SilverKey has quit [Quit: Halted.]
Perelandric has quit [Ping timeout: 250 seconds]
SilverKey has joined #ponylang
SilverKey has quit [Client Quit]
michael_campbell has joined #ponylang
<michael_campbell> Evening.
<SeanTAllen> howdy
<michael_campbell> Hey Sean. Is this the place to ask pony questions (especially noob ones)? Going through some tutorial level stuff and just wondered if this is the right place.
mcguire has quit [Ping timeout: 244 seconds]
<SeanTAllen> either here or the mailing list michael_campbell
<SeanTAllen> you'll tend to get quicker answers here sometimes but more people who might be able to answer will eventually see questions posted to the mailing list
<michael_campbell> Ok, thanks. I'm already on it and have been perusing, but it's well beyond me at this point =)
<SeanTAllen> ask away. we have plenty of rough edges and the documentation could be improved.
<SeanTAllen> the tutorial is really aimed as a sort of "Pony for the impatient"
<SeanTAllen> Later this summer, I'm hoping to start a more through treatment of Pony as a book
<jemc> michael_campbell: definitely feel free to ask any questions here that you may have - if someone is around, we'll do our best to help you out
<jemc> welcome to the community! :)
<michael_campbell> Thanks, both.
michael_campbell has quit [Ping timeout: 244 seconds]
c355e3b has quit [Quit: Connection closed for inactivity]
Scramblejams has joined #ponylang
<Scramblejams> Can anybody point me to a simple example where the result of a promise is an actor, and a behavior on that actor is called? I'm trying to use bureaucracy's Registrar, and I have gotten as far as putting the actor into the registrar, then getting a promise when I pull it out, but I'm not sure how to call a method on that actor when/if the promise succeeds.
<Scramblejams> s/method/behavior
<Scramblejams> And is there a way to have the compiler output the caps and types used on each line, like a verbose mode where nothing is left to the imagination?
<jemc> Scramblejams: the tests have an example of using Registrar to pull out and call a behaviour on an actor - https://github.com/ponylang/ponyc/blob/785fec900fcce88693fc9f636b002cc00763bedd/packages/bureaucracy/test.pony#L31-L39
<Scramblejams> jemc: Thank you!
<jemc> the gotcha that you're probably getting hung up on is that you want to use the type as a type parameter when you call Registrar.apply
<jemc> otherwise, what you get back will be an `Any tag` by default
<Scramblejams> jemc: Which doesn't work because even though the tag is an identity, it isn't a type, so the compiler can't guarantee that the behavior I'm trying to call exists?
<jemc> right, you would need to resolve the `Any tag` to a more useful type using `match` or `as`
<Scramblejams> ok
<jemc> but it's most convenient to push that work to the Registrar, which will do it for you if you provide a type parameter when you call `apply`
graaff has joined #ponylang
amclain has quit [Quit: Leaving]
rurban has joined #ponylang
rurban1 has joined #ponylang
rurban has quit [Ping timeout: 272 seconds]
jemc has quit [Ping timeout: 244 seconds]
rurban has joined #ponylang
rurban2 has joined #ponylang
rurban3 has joined #ponylang
rurban4 has joined #ponylang
rurban5 has joined #ponylang
rurban1 has quit [Ping timeout: 272 seconds]
rurban has quit [Ping timeout: 276 seconds]
rurban3 has quit [Ping timeout: 276 seconds]
rurban2 has quit [Ping timeout: 276 seconds]
rurban4 has quit [Ping timeout: 276 seconds]
rurban5 has quit [Ping timeout: 276 seconds]
aturley has quit [Ping timeout: 272 seconds]
aturley has joined #ponylang
Applejack_ has joined #ponylang
Applejack_ has quit [Ping timeout: 244 seconds]
Matthias247 has joined #ponylang
graaff has quit [Quit: Leaving]
graaff has joined #ponylang
<doublec> Scramblejams: if your promise calls a behaviour on an actor, the type parameter of the promise chain needs to be the type of the actor.
renatoathaydes has joined #ponylang
<renatoathaydes> Hi. noobied here. Can someone help me with this question: http://stackoverflow.com/questions/37754284/how-to-coerce-a-value-to-a-string-in-pony
<renatoathaydes> just want to print things so I can learn... kind of like you'd do in a REPL.
trapped has joined #ponylang
<renatoathaydes> Looks like number.string() does that... where does string() come from? Where do I see the documentation for the various types? U32 for example.
andrea__ has joined #ponylang
<andrea__> is there anyway to have incremental builds with ponyc?
Praetonus has joined #ponylang
<Praetonus> renatoathaydes: One important thing in Pony is that there is no type coercion or implicit conversions. You have to explicitely tell the type system that you want a String from your number, and this is what the string() method does. For number primitives, it is defined in builtin/arithmetic.pony in the _SignedInteger, _UnsignedInteger or FloatingPoint traits
<renatoathaydes> is there online docs for these types?
<renatoathaydes> without auto-completion and without docs I'm lost.
Matthias247 has quit [Quit: Matthias247]
Matthias247 has joined #ponylang
<Praetonus> Yes, here: http://www.ponylang.org/ponyc/
<andrea__> I'm modelling a simple board game, I've got primitives Blank White and Black, and type Cell is (Blank | White | Black), now if I made the primitives Stringable how can I make Cell Stringable as well? It doesn't seem to be alread so, even though it should really
Praetonus has quit [Quit: Leaving]
<SeanTAllen> andrea__: Inc builds: not at the moment
<SeanTAllen> andrea__: can you post an example of where you are running into a problem with Cell and stringable?
<andrea__> SeanTAllen, I've just got around it, but I think it was a different problem
<andrea__> I was doing h.assert_eq[Cell](f(...), Blank), but the primitives nor the Cell were Equatable
<andrea__> I removed the Stringable from the primitives and made them Equatable[Cell] and that now works
<andrea__> even though it's strange, it's cyclic. In my mind it should be Cell that has to be Equatable as this means that if I create new union types I have to put Equatable[$X] for each union type that uses that primitive
<andrea__> something like type Cell is ((Blank | White | Black) & Equatable[Cell]) - -which is not allowed
<renatoathaydes> But Cell is just an alias... what you wanted could only be provided by subtyping, I think.
<andrea__> renatoathaydes, mmmh but it's strange that Black has to be Equatable[Cell]
<andrea__> but you're right in principle
<andrea__> so now I'd like to have type Player is (Black | White), and surprisingly for this I don't need to make Black Equatable[Player]
<renatoathaydes> Maybe type classes like in Haskell would also work for this... but Pony does not seem to have something like that? I don't know, just learning pony now.
<andrea__> my only guess is that because of the unions Player is subtype of Cell
<renatoathaydes> makes sense.
Perelandric has joined #ponylang
c355e3b has joined #ponylang
Applejack_ has joined #ponylang
<SeanTAllen> andrea__: small, minimal code examples of what works for you and where you run into problems would be good if you can create that and gist. its hard to understand without seeing the code.
<SeanTAllen> I think I see your problem
<SeanTAllen> yup
<SeanTAllen> so andrea__, the problem is the last line... you can trying to compare a Player to Blank, and Player has to be Black or White.
<andrea__> ahh sorry that's not the relevant example, I meant to put a valid player, my mild surprise is that I don't have to mark Black and White as Equatable[Player]
<andrea__> SeanTAllen, i've just updated it, sorry for the rather too quick copy paste :)
<andrea__> SeanTAllen, the annoying part is that I can't make Cell equatable, I'd like to use None instead of Blank but it's not possible because I can't make None be Equatable[Cell]
<SeanTAllen> can you gist what you are trying to do with None andrea__ ?
<SeanTAllen> i need to step out for a while, i can check it out when i get back
<andrea__> SeanTAllen, you can copy paste lines 37-49 https://gist.github.com/enigma/e3d689128df7be61f45f493ff545c72d
<andrea__> SeanTAllen, ah thanks, no rush :)
Applejack_ has quit [Ping timeout: 250 seconds]
Praetonus has joined #ponylang
renatoathaydes has quit [Quit: Page closed]
<SeanTAllen> So andrea__ your summary that None is not equatable[Triple] is correct
<andrea__> SeanTAllen, which means I can't use assert_eq, is assert_is the best way?
mcguire has joined #ponylang
<SeanTAllen> indeed, you want assert_is
flutters1y has joined #ponylang
flutters1y has quit [Client Quit]
<Perelandric> Could/should `ponyc -v` describe the build as 'debug' or 'release'... like `0.2.1-943-g785fec9 [release]`? Seems like it may be a useful reminder.
<SeanTAllen> that does seem like it would be a useful reminder. that would make an excellent PR Perelandric. Hint hint.
runehog_ has joined #ponylang
runehog has quit [Ping timeout: 240 seconds]
runehog has joined #ponylang
runehog_ has quit [Ping timeout: 258 seconds]
<SeanTAllen> there's a number of other config options that would make sense there as well like valgrind etc.
SirWillem has joined #ponylang
Scramblejams has quit [Ping timeout: 276 seconds]
Applejack_ has joined #ponylang
Matthias247_ has joined #ponylang
<SirWillem> Hey everybody!
<SirWillem> What is the state of using macros? Is my safer bet to use an AST library to insert what I want pre-compilation?
<Perelandric> SeanTAllen: I'll see if I can pull it off without breaking anything too badly. ;)
Matthias247 has quit [Ping timeout: 240 seconds]
SirWillem_ has joined #ponylang
Applejack_ has quit [Ping timeout: 244 seconds]
Applejack_ has joined #ponylang
nyarumes has joined #ponylang
nyarum has quit [Ping timeout: 258 seconds]
<SeanTAllen> SirWillem: there are no macros at this point, but the conversation has come up a couple times in the sync call. I know Sylvan has some ideas. RFCs are welcomed.
<SeanTAllen> Perelandric: awesome
Applejack_ has quit [Ping timeout: 252 seconds]
Applejack_ has joined #ponylang
SirWillem_ has quit [Ping timeout: 250 seconds]
<SirWillem> Cool @SeanTAllen thanks!
SirWillem has quit [Ping timeout: 258 seconds]
tm-exa has joined #ponylang
tm-exa has quit [Client Quit]
SirWillem has joined #ponylang
<SirWillem> Has anyone tried https://github.com/kripken/emscripten ?
TwoNotes has joined #ponylang
<TwoNotes> I have an iso ref to a JsonObject. I want to *send* the data field (a Map) inside that object. Is there a way to do that without copying the whole Map?
rurban has joined #ponylang
rurban has left #ponylang [#ponylang]
<SeanTAllen> you want to send the Map but hold on to the JsonObject?
<TwoNotes> No, I do not need to hold on to the JsonObject.
<TwoNotes> I could just clone the Map, but doesn't that copy the whole thing?
<SeanTAllen> I must not be understanding then. Why not send the JsonObject ?
rurban has joined #ponylang
rurban has quit [Client Quit]
rurban has joined #ponylang
rurban has quit [Client Quit]
rurban has joined #ponylang
rurban has quit [Client Quit]
prettyvanilla has quit [Remote host closed the connection]
SirWillem has quit [Ping timeout: 246 seconds]
rurban has joined #ponylang
Applejack_ has quit [Ping timeout: 246 seconds]
<TwoNotes> Hmm. Could work.
rurban1 has joined #ponylang
rurban has quit [Ping timeout: 260 seconds]
graaff has quit [Quit: Leaving]
prettyvanilla has joined #ponylang
Scramblejams has joined #ponylang
rurban1 has quit [Quit: Leaving.]
rurban has joined #ponylang
rurban has quit [Quit: Leaving.]
rurban has joined #ponylang
Applejack_ has joined #ponylang
rurban has left #ponylang [#ponylang]
<TwoNotes> The JsonObject is contained within a JsonDoc iso. I really did not want to propagate all this JSON-ness.
<TwoNotes> (consume doc).data as JsonObject?
<andrea__> TwoNotes, you can try consuming the JsonDoc and then only send the map
<TwoNotes> let obj = (consume doc).data as JsonObject?
Applejack_ has quit [Ping timeout: 276 seconds]
<andrea__> TwoNotes, yup, essentially you get something sendable where you can, then send just part of if the whole is sendable its parts should be as well - did that work?
andrea__ is now known as ndr
<TwoNotes> It seems that (consume doc).data yields a ref?
<ndr> TwoNotes, mmmh I'd try to assign it to a val, I think you'd still have plenty of alias to that doc in the rest of the method though, wouldn't you?
<Praetonus> TwoNotes: You have to wrap it in a consume block
<Praetonus> recover block
<ndr> Praetonus, it being what? the whole method?
<Praetonus> The field access. You may also have to consume doc to a ref inside the recover block to view the field from a ref viewpoint and not an iso viewpoint
rurban has joined #ponylang
rurban has quit [Client Quit]
<Praetonus> Something like this: http://pastebin.com/W81wSeB2
rurban has joined #ponylang
rurban has quit [Client Quit]
SirWillem has joined #ponylang
Applejack_ has joined #ponylang
rurban has joined #ponylang
rurban has quit [Client Quit]
<TwoNotes> The trouble is there are a lot of possible flows through that code. I will have to analyze it
SirWillem has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
16WAAEWG5 has joined #ponylang
7JTAA46C8 has joined #ponylang
SirWillem has joined #ponylang
Praetonus has quit [Quit: Leaving]
TwoNotes has quit [Quit: Leaving.]
SirWillem has quit [Ping timeout: 276 seconds]
copy` has joined #ponylang
Matthias247_ has quit [Read error: Connection reset by peer]
Applejack_ has quit [Ping timeout: 264 seconds]