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
jemc has joined #ponylang
jemc has quit [Ping timeout: 244 seconds]
c355e3b has quit [Quit: Connection closed for inactivity]
copy` has joined #ponylang
Perelandric has quit [Ping timeout: 250 seconds]
SilverKey has joined #ponylang
Applejack_ has joined #ponylang
copy` has quit [Quit: Connection closed for inactivity]
Applejack_ has quit [Ping timeout: 264 seconds]
SilverKey has quit [Quit: Halted.]
Applejack_ has joined #ponylang
Applejack_ has quit [Ping timeout: 272 seconds]
amclain has quit [Quit: Leaving]
srenatus has joined #ponylang
Perelandric has joined #ponylang
Applejack_ has joined #ponylang
Perelandric has quit [Ping timeout: 250 seconds]
c355e3b has joined #ponylang
_andre has joined #ponylang
trapped has joined #ponylang
Applejack_ has quit [Ping timeout: 244 seconds]
Perelandric has joined #ponylang
paperclipbadger has joined #ponylang
<paperclipbadger> Does pony have an XML parser?
Applejack_ has joined #ponylang
jonas-l has quit [Quit: Bye.]
<lisael> paperclipbadger: not I'm aware of. I guess the most practical option is to wrap libxml2
copy` has joined #ponylang
jonas-l has joined #ponylang
M-hrjet has quit [Remote host closed the connection]
<SeanTAllen> paperclipbadger: not at this time
M-hrjet has joined #ponylang
SilverKey has joined #ponylang
SilverKey has quit [Quit: Halted.]
shepheb has joined #ponylang
runehog_ has joined #ponylang
runehog has quit [Ping timeout: 244 seconds]
SilverKey has joined #ponylang
jemc has joined #ponylang
SilverKey has quit [Quit: Halted.]
Applejack_ has quit [Ping timeout: 240 seconds]
SilverKey has joined #ponylang
runehog has joined #ponylang
runehog_ has quit [Ping timeout: 240 seconds]
paperclipbadger has quit [Read error: Connection reset by peer]
paperclipbadger has joined #ponylang
paperclipbadger has left #ponylang [#ponylang]
sms has joined #ponylang
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
sms has left #ponylang [#ponylang]
mrkishi has joined #ponylang
runehog_ has joined #ponylang
runehog has quit [Ping timeout: 276 seconds]
paperclipbadger has joined #ponylang
<mrkishi> Hello, everyone :)
<mrkishi> Pony has really caught my interest recently. Perhaps someone could clear something up for me?
<mrkishi> I'm considerably inexperienced with functional programming, and my understanding was that TCO as a transformation basically allows the compiler to produce something that's closer to the imperative version. Why would it be faster?
<mrkishi> In Darach Ennis's My Little Pony talk, he shows us a benchmark where an imperative style fib is much slower than its functional and TCO variations. What causes this?
<mrkishi> Also, I just realized he's in the channel while I formally referenced his name instead of nick... ;P
<jemc> mrkishi: I don't really follow microbenchmarks, so I'm not a good person to answer your question, but welcome to the channel!
<jemc> @darach: any feedback on his question?
<mrkishi> Thanks, jemc :)
amclain has joined #ponylang
paperclipbadger has quit [Quit: Leaving.]
runehog_ has quit [Remote host closed the connection]
graaff has joined #ponylang
Applejack_ has joined #ponylang
paperclipbadger has joined #ponylang
Perelandric has quit [Quit: Page closed]
SilverKey has quit [Quit: Halted.]
Perelandric has joined #ponylang
Applejack_ has quit [Ping timeout: 260 seconds]
<sylvanc> TCO only works with tail calls :) naive imperative fib is a call tree, not a call stack
<sylvanc> an imperative iterative version would also be fast
<sylvanc> naive fib is the classic O(2^n) problem
<mrkishi> sylvanc: Ah! That makes sense. For some reason I was thinking of the iterative version for the imperative case...
<mrkishi> My bad.
runehog has joined #ponylang
<mrkishi> (that goes to show you how used I am to procedural languages.. unintentionally skipped the _classic_ recursive implementation, haha)
jsaacmk has joined #ponylang
<jsaacmk> what's the best way to parse a string into an F64 and check that the whole string was parsed? There is String.read_int, but no read_float. String.f64 doesn't return anything I can use to make sure the value was parsed well
pulpfiction has joined #ponylang
<jsaacmk> I see the options package uses String.f64 when parsing an F64Argument
SilverKey has joined #ponylang
<mrkishi> jsaacmk: I'm just starting with pony so I don't know, but for what it's worth, String.f64 is using ffi to @strtod
<mrkishi> as in, `@strtod(_ptr._offset(index), 0)`
<jsaacmk> how would I use the second argument of strtod? in C it takes a pointer, but here it just takes a USize... Pointers and USize can't interoperate as far as I know
<jsaacmk> I'm also not well versed on the C FFI yet, so maybe I can "use @strtod" in a different way that builtin/string.pony does
<mrkishi> I'm not advocating messing with pointers in pony, but the second argument *is* a pointer. In string.pony they are just passing a null pointer (0) to strtod
<jemc> when dealing with FFI, all memory bets are off and you usually have to mess with pointers in some way
<jemc> the recommendation would be to isolate your FFI use to a package which wraps the FFI calls in a way that in which the onus is on you to guarantee that they are safe
<mrkishi> In this case, they'd need a to either convert between their custom string type to pony's string, or replicate some of string's functionality, as we can't (?) get their internal pointers
<jemc> see String.cstring() and String.from_cstring()
<mrkishi> ah
<mrkishi> Still, seeing as there's a read_int, would there be a case for read_float?
<jemc> actually I'd probably advocate for moving read_int out of String :D
<jemc> into a package dedicated to the reading/writing of numbers as strings in various formats
<mrkishi> I see!
<jemc> this is similar to a recent discussion we've been having of simplifying the Stringable interface to not know about numeric formatting (as this would be handled by a separate package)
<jsaacmk> is anyone working on such a package right now?
<jemc> nope, we've only discussed it - next step would be someone creating an RFC
graaff has quit [Quit: Leaving]
Zarutian has joined #ponylang
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
Applejack_ has joined #ponylang
Matthias247 has joined #ponylang
jsaacmk has quit [Quit: Page closed]
SilverKey has quit [Read error: Connection reset by peer]
SilverKey has joined #ponylang
SilverKey has quit [Quit: Halted.]
Applejack_ has quit [Ping timeout: 260 seconds]
Applejack_ has joined #ponylang
_andre has quit [Quit: leaving]
Applejack_ has quit [Ping timeout: 260 seconds]
pulpfiction has left #ponylang ["Leaving"]
mrkishi has quit [Read error: Connection reset by peer]
mrkishi has joined #ponylang
runehog has quit [Remote host closed the connection]
runehog has joined #ponylang
runehog has quit [Remote host closed the connection]
SilverKey has joined #ponylang
<paperclipbadger> I'm trying to create an empty sequence of type (ReadSeq[A] & ReadElement[A^]), but Array[A](0) doesn't work. Suggestions?
SilverKey has quit [Client Quit]
Zarutian has quit [Quit: Zarutian]
mrkishi has quit [Ping timeout: 246 seconds]
srenatus has quit [Quit: Connection closed for inactivity]
mrkishi has joined #ponylang
SilverKey has joined #ponylang
SilverKey has quit [Client Quit]
runehog has joined #ponylang
mrkishi has quit [Ping timeout: 260 seconds]
Matthias247 has quit [Read error: Connection reset by peer]
<SeanTAllen> can you gist the code you are trying paperclipbadger ?
SilverKey has joined #ponylang
amclain has quit [Read error: Connection reset by peer]
amclain has joined #ponylang
<SeanTAllen> there's a lot of code there.
<SeanTAllen> what specifically am i looking at
<paperclipbadger> On line 69 there's a call to append, which takes an argument of type (ReadSeq[XMLElement] & ReadElement[XMLElement^])
<paperclipbadger> I'm trying to find a default value for children' that represents an empty sequence.
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
<SeanTAllen> does this compile otherwise for you?
<SeanTAllen> because it doesnt for me
<paperclipbadger> Fairly certain it compiles for me, hold on.
<paperclipbadger> Commenting out lines 14 and 59 (which are the bad default arguments) makes it compile.
<paperclipbadger> Well, aside from the lack of Main actor, that is.
<SeanTAllen> ok
<SeanTAllen> so what implements this? (ReadSeq[XMLElement] & ReadElement[XMLElement^])
<paperclipbadger> I can't find anything that implements it.
<paperclipbadger> My problem is that I can't find anything to pass to Seq[XMLElement].append.
SilverKey has quit [Quit: Halted.]
<SeanTAllen> so that's where i get lost
<SeanTAllen> you are saying "things that implement these things"
<SeanTAllen> but you dont appear to have anything that implements then
<SeanTAllen> where did you come up with (ReadSeq[XMLElement] & ReadElement[XMLElement^]) ?
<paperclipbadger> It's the type of the first argument of Seq[XMLElement].append
<paperclipbadger> I was under the impression that sequence.append takes a sequence `seq`, an offset `offset` and a length `len` and appends `len` items to sequence from `seq` starting from position `offset`
<SeanTAllen> seq is an interface
<SeanTAllen> if you have an Array[A] then you can append an array of A.
<SeanTAllen> why do you want to append and empty Array?
<SeanTAllen> append an empty array
<paperclipbadger> I want to append an arbitrary sequence of the same type, with an empty sequence as default.
<SeanTAllen> i'd just starting with Array's rather than Swq
<SeanTAllen> id start with Array rather than Seq. go for concrete types and work backwards
<paperclipbadger> I have the same problem with concrete types.
<SeanTAllen> creating an empty array?
<SeanTAllen> Array[Foo] will get you an empty array
<paperclipbadger> I can create an empty array.