Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>Unfortunately some of the best features of Mesa are not supported at all or only badly supported in most modern languages.

Excluding its epic exception handling system, what would you suggest?




There were many useful details in the syntax of various statements and expressions, which could simplify programs.

An important feature was that Mesa was one of the few programming languages that specified a GOTO instruction in the right way.

Mesa had a restricted GOTO (following suggestions from Knuth), which could jump only forwards and only out of a block.

This eliminates all problems that can be caused by GOTO, while retaining all the benefits.

All later languages are either languages that provide only an inadequate handling of errors and exceptional conditions, or languages that provide GOTO instructions that are hidden behind different mnemonics that do not use the words GO TO.

For instance, if a language has labeled loops and some kind of exit-loop instruction that contains a loop label, to be able to exit from multiple nested loops, that instruction is just an ordinary GOTO instruction, which uses a different mnemonic, because the mnemonic GOTO is "harmful", and where the jump label is located in a wrong place, which makes more difficult to follow the control flow when reading the program.

In general, in Mesa the syntax for any kind of block or iteration could specify in a simple way both a normal exit and several exits corresponding to various kinds of errors or exceptional conditions.

The syntax used by Mesa for this was more convenient than the use of exceptions in most modern programming languages and the implementation was much more efficient, because the kind of exceptions used in modern languages is designed only for returning from several levels of nested functions that have been compiled separately. For exiting one or more levels of nested blocks inside a function much more efficient implementations are possible.

Mesa also had the kind of exceptions used in modern languages, but their use was needed much less frequently.


Thank you for the tip. I'm feeling pretty stupid having never heard of (or not remembering) Xerox Mesa. (I'm just old enough to have briefly used Xerox Star.)

> ...restricted GOTO, which could jump only forwards and only out of a block.

I guess that's roughly how I imagined how GOTO / "better" exception handling should work. I've long wanted (wave arms) Visual Basic style error handling, but "inline" (not off to the side). I probably unwittingly gleaned the notion from Mesa.

I'm now foraging for Mesa stuff. Here's two quick hits.

https://en.wikipedia.org/wiki/Mesa_(programming_language)

Mesa Language Manual v5.0

https://doc.lagout.org/science/0_Computer%20Science/0_Comput...

Hopefully I'll find a working implementation.


The history of exceptions is discussed in [1]. I am not a historian, but think that Milner's ML was the first language with a type-safe exception mechanism. [2] Discusses, among many other things, Lisp's relation with exceptions.

[1] B. G. Ryder, M. L. Soffa, Influences on the Design of Exception Handling. https://dl.acm.org/doi/10.1145/885638.885644

[2] G. L. Steele Jr, R. P. Gabriel, The Evolution of Lisp. https://www.dreamsongs.com/Files/HOPL2-Uncut.pdf




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: