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
jemc has quit [Ping timeout: 255 seconds]
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
jemc has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
endformationage has quit [Quit: WeeChat 1.9.1]
nisanharamati has quit [Quit: Connection closed for inactivity]
khan_ has joined #ponylang
khan has quit [Ping timeout: 240 seconds]
khan_ is now known as khan
jemc has quit [Ping timeout: 248 seconds]
gokr has joined #ponylang
codec1 has joined #ponylang
khan has quit [Quit: khan]
bimawa has joined #ponylang
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
codec1 has quit [Ping timeout: 268 seconds]
_andre has joined #ponylang
codec1 has joined #ponylang
gokr has quit [Ping timeout: 240 seconds]
codec1 has quit [Quit: Leaving.]
codec1 has joined #ponylang
codec1 has quit [Ping timeout: 240 seconds]
gokr has joined #ponylang
zetashift has joined #ponylang
endformationage has joined #ponylang
zetashift is now known as sp33der89
jemc has joined #ponylang
gokr has quit [Ping timeout: 255 seconds]
abelard has joined #ponylang
<abelard> hey guys, I have a question
<abelard> what is error exactly? is it a primitive?
<jemc> abelard: in the runtime, `error` is just an unwinding of the stack to the nearest containing `try` block's `else` clause
<jemc> at compile time, it is a "jump away" instruction that makes the compiler enforce that either there needs to be a `try` block containing the error or the method signature needs to be "partial" (with a question mark), with the enforced assumption that there is another `try` block somewhere up the call stack
<abelard> ah, I see. thanks jemc
<abelard> by the way, if I'm handling an error, is printing from the main actor a more desirable behavior than printing from the actor in which the error occured?
<jemc> the best practice depends on a lot of factors - it can be different depending on the nature of what you're building, what your goals are, and what kind of error you're handling
<abelard> basically I want to print an error and exit
<abelard> to print from main, I'd have to return an enum so main would know what to print
<jemc> for panic/abort style of error handling, it's become a sort of common practice to use FFI to `printf` and `exit` - here's an example of what I use for that: https://github.com/jemc/ponycc/blob/master/ponycc/unreachable/unreachable.pony
dougmacdoug has joined #ponylang
<jemc> if you want something cleaner, or if you have other cleanup that needs to happen on exit, I'd suggest you take a different approach:
<jemc> introduce a "custodian" actor that keeps a handle on everything that needs to be `dispose`d for an exit (like any open network sockets), and also give it the capability to print what you want to print
<jemc> if you want to use standard library stuff for that, you could probably use bureaucracy.Custodian (https://github.com/ponylang/ponyc/blob/master/packages/bureaucracy/custodian.pony) and logger.Logger (https://github.com/ponylang/ponyc/blob/master/packages/logger/logger.pony)
<jemc> and maybe create a composite actor in your program that contains both
<jemc> then you have to share a reference to that composite actor, so that any part of your program that needs to "abort" can do so
<jemc> that's the cleaner, more actor-oriented way to do a soft abort ^
<abelard> wow thanks jemc!
<abelard> I'll try to use a custodian
gokr has joined #ponylang
<abelard> how do I create a mutable string?
gokr has quit [Ping timeout: 240 seconds]
nisanharamati has joined #ponylang
abelard has quit [Ping timeout: 260 seconds]
codec1 has joined #ponylang
gokr has joined #ponylang
sp33der89 has quit [Quit: Leaving]
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
pcarrier has quit [Read error: Connection reset by peer]
pcarrier has joined #ponylang
_andre has quit [Quit: leaving]
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
nisanharamati has quit []
codec1 has quit [Read error: Connection reset by peer]
TheNet has joined #ponylang
codec1 has joined #ponylang
khan has quit [Remote host closed the connection]
khan has joined #ponylang
TheNet has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TheNet has joined #ponylang
codec1 has quit [Read error: Connection reset by peer]
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
dougmacdoug has quit [Quit: dougmacdoug]
gokr has left #ponylang [#ponylang]
jemc has quit [Ping timeout: 240 seconds]