nisanharamati has quit [Quit: Connection closed for inactivity]
_whitelogger has joined #ponylang
_whitelogger has joined #ponylang
endformationage has quit [Ping timeout: 240 seconds]
ichimaru has joined #ponylang
_whitelogger has joined #ponylang
<svenskunganka>
Hi! I'm getting an odd error when compiling which I'm unsure why. I have this code: fun compare(buf: Array[U8] val): Bool val ? => false
<svenskunganka>
But it gives this error: function signature is marked as partial but the function body cannot raise an error
<Candle>
svenskunganka: The '?' marks it as partial.
<svenskunganka>
But simply returning `false` shouldn't raise an error though?
<Candle>
svenskunganka: There's nowhere in the function body that can raise an error since the entire body is 'return false'
<svenskunganka>
Oooh so that's what it means
<svenskunganka>
So a partial function must contain code that can raise an error
<Candle>
Yes.
<vaninwagen>
svenskunganka: but you are able to inherit partial functions with a total function that does not raise an error
<vaninwagen>
So you are flexible in that respectt
<svenskunganka>
So a trait that requires implementing a partial function can be replaced with a total function and it will satisfy?
<vaninwagen>
Yeah, just dont put the questionmark
<svenskunganka>
Hmm that results in error "try expression never results in an error"
<svenskunganka>
But it's probably a bad implementation either way so I'll just scrap that code :P
* vaninwagen
whispers: paste it
<svenskunganka>
So far I really like Pony, and the performance is brilliant. The library I'm building currently does magic number checking for 31 filetypes and the benchmark says it takes 140ns to check against all of them, and 0ns to check against a specific one :D
<svenskunganka>
Basically I wanted to allow those that want to extend the library with their own matchers to not have to wrap all their code in try...end, which is just dumb magic
<vaninwagen>
So if you have an imolementation of a compare function that does not throw am error, then you can just leave out the question mark
<vaninwagen>
Having a non partialapply in your case makes sense to me
<svenskunganka>
I think so too. Finally got some time over to continue where I left off with this library. Got about 70 matchers left to write and tests against fixtures and it should be ready to be published
<svenskunganka>
Really the only problem I've had learning Pony so far has been some words in the tutorials. As a non-native English speaker I had to look up some of them. Reference capabilities are surprisingly simple
<vaninwagen>
If you have something concrete we could improve feel free to write an issue
<vaninwagen>
Wow, you are the first one that didnt stumble learning refcaps, thats awesome
<vaninwagen>
*the first one i met
<svenskunganka>
The "Safely Sharing Data: Reference Capabilities in Pony" and "Bang, Hat and Arrow in Pony" blogposts explains refcaps really well. Without them I probably would be having making death threats at the compiler
<svenskunganka>
Next library after this one for learning purposes will be trying to implement Cap'n Proto, which I'm grossly unqualified for but I want to make an attempt
<vaninwagen>
I also really like them, thanks doublec
<svenskunganka>
That's great though, I've been planning a project that needs something like Cap'n Proto. If I recall correctly, I think I've read that the Pony runtime will eventually be able to be distributable, or have I read wrong?
<svenskunganka>
As in calling actors on remote machines
<svenskunganka>
A runtime-powered RPC system of sorts
<svenskunganka>
Also, I've been wondering if you have a trait that requires a function to be implemented with type restrictions, why does a type that implements that method also have to define the same type restrictions (on parameters and return types)?
<svenskunganka>
function*
<svenskunganka>
E.g `trait SayHello` has `fun hello(s: String): None` as type annotations, then the same function definition for `class Someone is SaysHello` also needs to annotate those types
<svenskunganka>
Is it a consistency thing or technical?
<SeanTAllen>
I dont understand your question svenskunganka
<SeanTAllen>
the last one you asked.
<SeanTAllen>
sorry, can you rephrase?
<svenskunganka>
Yes of course. When you inherit a Trait that says you need to implement `fun hello(s: String)`, shouldn't you also inherit the type annotations so you only need to write `fun hello(s)`
<svenskunganka>
I guess it makes the code less readable, needing to look up the trait definition to find out what types are refcaps are accepted
<svenskunganka>
and*
<svenskunganka>
Well, I need to leave now. Thank you vaninwagen for being so helpful and for the enjoyable chat!
svenskunganka has quit [Quit: leaving]
aturley has quit [Quit: aturley]
aturley has joined #ponylang
nisanharamati has joined #ponylang
alxs has joined #ponylang
aturley has quit [Quit: aturley]
<endformationage>
LOL, using `Debug` in a trait/inteface is confusing. Compiler will complain about not finding `Debug` even when a `use "debug"` statement is included where the subtype is defined.
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
<endformationage>
This will occur as many times the subtype is used throughout the code base, as any file defining types which make use of the subtype also need a `use "debug"` statement.
<endformationage>
This may be normal / not limited to Debug either?
<endformationage>
The confusing bit being the error messages only point to the use of Debug in the one file where the subtype is defined.
<endformationage>
The hint I got was the number of duplicate error messages was the number of times the subtype was used throughout the codebase.
<endformationage>
The confusing bit being ... , and that `use "debug"` was already defined there.
alxs has joined #ponylang
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
alxs has joined #ponylang
alxs has quit [Client Quit]
aturley has joined #ponylang
Ferdirand has quit [*.net *.split]
<vaninwagen>
endformationage: there is an issue for that, that i cant find right now
<vaninwagen>
Stumbled upon that myself already
<vaninwagen>
Default implementations in traits are copied over without the necessary use statements
<vaninwagen>
svenskunganka it might be considered verbose at some point, but i think it makes sense to require fully "typed" function signatures every time. If only from a documentation standpoint, but there are other valid concerns here too
<vaninwagen>
Damn, searching for it i found so many issues i'd love to have closed
alxs has joined #ponylang
<endformationage>
vaninwagen: Cool.
alxs has quit [Client Quit]
alxs has joined #ponylang
betawaffle has quit [*.net *.split]
kjsnavely has quit [*.net *.split]
betawaffle has joined #ponylang
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
rkallos has quit [*.net *.split]
hanshoi_ has quit [*.net *.split]
strmpnk has quit [Ping timeout: 256 seconds]
strmpnk has joined #ponylang
alxs has joined #ponylang
ichimaru has quit [*.net *.split]
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]