3 ms·
I'm pretty sure I have exactly what you are talking about. error handeling was one of the things that I wanted to get right with jaithon, and I made my system s
by AbhiramaVS 2mo ago
I'm pretty sure I have exactly what you are talking about. error handeling was one of the things that I wanted to get right with jaithon, and I made my system similar to like rust.
error[E0301]: cannot assign to immutable binding `x`
--> examples/demo.jai:7:5
|
5 | let x = 1
| - `x` declared immutable here
...
7 | x = 2
| ^^^^^ assignment to immutable binding
|
help: change the declaration to `var x = 1`
^^ That was shown from the Readme, more extensive examples are in documentation!
Is this what you were refering to or something else, I completely agree that erorr handeling is very important.
- mplanchard 2mo agoI think jyx was talking about the throw/try/catch mechanism[0] used for error handling, in contrast to error handling in e.g. Rust, where the idiomatic way of handling an error is to return a Result enum, containing either a success value or an error type. The latter allows callers to know that a function can error, and what kind of error it can return. Exception-based error handling, on the other hand, means you cannot tell by way of the type system whether or what errors a function can throw. [0]: https://github.com/abhiramasonny/jaithon/blob/main/LANGUAGE.md#errors https://github.com/abhiramasonny/jaithon/blob/main/LANGUAGE....
- AbhiramaVS 2mo agoAh yeah that makes more sense. Will look into this