Re: [go-nuts] Re: [RFC] Yet another proposal for Go2 error handling

2023-06-26 Thread Jan
Thanks for the clarification Robert. In many cases, when building ML models, panicking is fine. But in some, it is not, specially if running some type of server, that will handle different models, or with various shapes of inputs (e.g. images in different sizes and formats, some may lead to une

Re: [go-nuts] Re: [RFC] Yet another proposal for Go2 error handling

2023-06-18 Thread Robert Engels
What I was suggesting was a far narrower scope. I can see how go’s error handling makes writing composable math functions more difficult (although I would think these would panic not return an error - so then it is trivial). If they do need to return errors then using a DSL for the equations an

Re: [go-nuts] Re: [RFC] Yet another proposal for Go2 error handling

2023-06-18 Thread Jan Pfeifer
A DSL + code generator is a longer discussion. But I'm not sure I'm getting the scope of your suggestion right: If you refer to having a full ML language DSL and a generator/AOT(ahead-of-time) compiler: folks have tried it before -- see the Swift ML effort by Chris Lattner, now leading Mojo in Mod

Re: [go-nuts] Re: [RFC] Yet another proposal for Go2 error handling

2023-06-18 Thread Robert Engels
Seems the easiest way to address that is with a DSL and a code generator. > On Jun 18, 2023, at 9:47 AM, Jan Pfeifer wrote: > >  > hi Shulhan, I see your points, thanks for the reply. Let me comment on them > below: > >> On Sat, Jun 17, 2023 at 9:21 AM Shulhan wrote: >> Hi Jan, thanks for

Re: [go-nuts] Re: [RFC] Yet another proposal for Go2 error handling

2023-06-18 Thread Jan Pfeifer
hi Shulhan, I see your points, thanks for the reply. Let me comment on them below: On Sat, Jun 17, 2023 at 9:21 AM Shulhan wrote: > Hi Jan, thanks for response. > > On Mon, 5 Jun 2023 01:06:37 -0700 (PDT) > Jan wrote: > > > Repeating Justin's consideration: one of my (and from colleagues I > >

Re: [go-nuts] Re: [RFC] Yet another proposal for Go2 error handling

2023-06-17 Thread Shulhan
Hi Jan, thanks for response. On Mon, 5 Jun 2023 01:06:37 -0700 (PDT) Jan wrote: > Repeating Justin's consideration: one of my (and from colleagues I > discuss the topic with) major issues with current error handling is > the repetition of identical code. Your proposal still requires `when > err

Re: [go-nuts] Re: [RFC] Yet another proposal for Go2 error handling

2023-06-16 Thread Shulhan
Hi Justin, thanks for reviewing, sorry for late response. On Sun, 4 Jun 2023 17:28:29 -0700 (PDT) Justin Israel wrote: > > I don't really understand the comparison between this proposal and > the referenced previous one. If we see one of the first code in the previous proposal design,

[go-nuts] Re: [RFC] Yet another proposal for Go2 error handling

2023-06-05 Thread Jan
Repeating Justin's consideration: one of my (and from colleagues I discuss the topic with) major issues with current error handling is the repetition of identical code. Your proposal still requires `when err handle ...` at every statement. It also doesn't allow for nested call of functions that

[go-nuts] Re: [RFC] Yet another proposal for Go2 error handling

2023-06-04 Thread Justin Israel
On Monday, June 5, 2023 at 4:17:17 AM UTC+12 Shulhan wrote: Dear gophers, I have been reading several proposals about error handling couple of months ago and today a light bulb come upon me, and then I write as much as I can think. I am not sure if its good or bad idea or even possible to i