Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: An idea for error handling that could work with Myrddin


I absolutely want a clean way to perform multi step operations which
automatically clean up useless intermediates on failure (and success for
that matter). I think the combination of Ori's owned types proposal with
something similar to what you are talking about could accomplish this. I am
unsure of the exact syntax, but i know I want to avoid macros so it would
need to be a built in construct.

One problem is if the error types are manipulated by the compiler, it
should be separate from the stdlib (atm we have std.option and std.result).

An alternative Ori has previously mentioned normal try - catch style
exceptions, with the difference that all exceptions would be checked like
java, but also inferred by the compiler so much it is less tedious. I will
leave that to Ori to elaborate on if he is still considering it and i
missed anything.

Overall I think prefer explicit error checking and am eager for some form
of syntactic sugar for early exit.

On Mon, Mar 21, 2016 at 12:34 PM, Ryan Gonzalez <rymg19@xxxxxxxxx> wrote:

> I just put a new post on my web site:
>
>
> http://kirbyfan64.github.io/posts/an-idea-for-concise-checked-error-handling-in-imperative-languages.html
>
> Although I used Crystal in the examples, I had Myrddin in mind. I just was
> too lazy to think of how the semantics would be in a low-level language,
> and Crystal's syntax is close to Ruby, which is really well-known.
>
> But the idea could still apply well, especially since Myrddin has type
> inference like I mentioned. However, I'm not sure how exactly throwing
> errors would be, since, without some kind of copy constructor system, I
> could see it being somewhat hard to debug.
>
> Anyway, thoughts?
>
> --
> Ryan
> [ERROR]: Your autotools build scripts are 200 lines longer than your
> program. Something’s wrong.
> http://kirbyfan64.github.io/
>
>

References:
An idea for error handling that could work with MyrddinRyan Gonzalez <rymg19@xxxxxxxxx>