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


It looks interesting. One thought is that it seems you have only a single
expression. The usual gain for try/error style handling is that you can
have multiple things happen in one block, and break out early when you see
the first error. Something like:


    try
    	fd = std.dial("tcp|host!port")
	std.write(fd, "header")
	std.write(fd, "body")
	std.read(fd, responsebuf[:])
	...
    except thingy
        handle error
    ;;

I might be misunderstanding, but I'm not sure if this is possible with your
proposed system?

On Sun, 20 Mar 2016 18:34:15 -0500, 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/


-- 
    Ori Bernstein

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