3 ms·
> Errors can still be handled even without explicit provisions in the language Sure! but as I said in the last sentence of my post, "error handling is as much
by theamk 5y ago
> Errors can still be handled even without explicit provisions in the language
Sure! but as I said in the last sentence of my post, "error handling is as much user convention as is compiler support"
In particular, almost all C code I have seen is designed to handle errors gracefully -- every stdlib function may fail and user is expected to handle it. On the other hand, much of the oberon code I have seen before is pretty bad with error handling -- the program will just halt on any error.
Now, I cannot really tell which way Oberon+ will go because there is so little code written in it, and it seems there isn't even a way to open a file as of now. But I browsed around and found JSON parser in Oberon+ and it handles errors by calling halt()... so it does not look like this version has good error handling (yet?)
- Rochus 5y agoThere are similar possibilities for error handling as in C. The definition and implementation of the Oberon+ standard library is work in progress. Also the Blackbox framework, of which I already migrated a lot of modules, has some interesting approaches which I study. The Json parser you mention is part of the Are-we-fast-yet benchmark suite which apparently doesn't need much error handling. EDIT: Btw. there are quite some notable C libraries which for certain error conditions just call a panic function or print a message to stderr and then call exit().