LANGUISH Posts

About a month ago, I mentioned I'd been building a scripting language named Languish. I've decided to rename it Yall. The main idea of Yall is to have a scripting language that is easy to use and learn, while having all of the features built in one would expect in a modern language. One thing I've been working on a lot is the error handling and exception system. In my opinion, this is one of the most important pieces of a language and most languages simply fail to implement a decent error handling system.

For instance, why is there ever an uncaught exception? Yall assumes that each code block, function, and method is able to throw or catch an exception. There's no need for a try-catch. If an exception propagates outside of the user code, then it is caught by a global catch, which can be configured with user code exception handlers or error types. In the user code, you can specify catch and throw as part of the return statement (or individually). There's no need for a try-catch.

Catch statements can also retry with another function, a new code block, or a loop back retry statement, which allows you to re-run that block of code or function with default or updated parameters or state. In addition to the traditional, immutable, error object, there is also a context object, which gives you a mutable object inside the exception system to define however you please.

The last thing, for error handling, I've been working on is a special kind of type for errors. These types define or structure the error handling and can be extended. I haven't worked out all of the details yet, but the idea is most of the error handling should be handled by the types assigned, and then you can supplement that, if needed, in the user code, but there should never be an unhandled error or uncaught exception, because they get handled by the interpreter if nowhere else.

David D.

0
0
0
31
about 2 months ago

I've been experimenting with creating a new scripting language that I'm writing with Rust. I've named it Languish, which is a synonym for Rust and a word play on Language. Surprisingly, it's actually coming along fairly well. I don't want to really get into details yet, but it has some novel capabilities and has been kind of refreshing to work on. I don't know when it'll be ready, but I plan to get it to the point I'm happy with it and then I'll begin sharing it with the world. For now it's just another side project.

David D.

0
0
1
96

David Dyess .com

Copyright © 1999 - 2025