The lost language extensions of MetaWare's High C compiler (2023)

MetaWare High C extensions & implementation

  • High C added many nonstandard C/C++ features decades ago: iterator-driven for with yield, named arguments, case ranges, nested functions, “full function pointers,” non-local gotos, modules, and numeric literals with underscores and arbitrary bases.
  • The iterator-driven for is described as implemented via an anonymous nested function for the loop body. The iterator calls this body via a “full function pointer” that carries a link to the outer activation record.
  • break/continue/return inside the loop body are compiled as non-local gotos that unwind the stack similarly to exceptions. Some alternative mental models (e.g., reversing call/return or saving state on the stack manually) are explicitly rejected as not how High C worked.

Comparisons to GCC and other C compilers

  • GCC already supports several similar extensions: case ranges and nested functions. It does not support generators.
  • GCC’s nested functions are criticized as hacky, unsafe, and so problematic that another major compiler refuses to implement them; others defend them but say a better function-descriptor approach would help.
  • Other C-family compilers and dialects (Plan 9 C, lcc-win, etc.) are cited as having language extensions like operator overloading, default arguments, and anonymous structs, some of which later influenced the C standard.

Named arguments and macro tricks

  • A pattern using a struct, an inline wrapper, and a variadic macro is shown to emulate named arguments and defaults in C.
  • One commenter argues this is unnecessary and over-clever; another counters that it is invaluable for APIs with many optional parameters (graphics, plotting, configuration).
  • There is debate over whether such macros are acceptable or whether configuration structs are clearer and more maintainable.

C standardization, safety, and “missed chances”

  • Several comments argue that C missed opportunities to incorporate well-known features (named parameters, slices/fat pointers, safer arrays) and complain about a conservative standards committee.
  • Some see committee caution as historically reasonable, given diverse hardware and existing implementations; others think it yielded needless complexity (e.g., non-mandated two’s complement) and continued undefined behavior.
  • There is interest in C-like languages or modes that add bounds checking and safety while maintaining ABI compatibility, contrasted with the difficulty of wholesale rewrites in other languages.

Historical and typographic tangents

  • MetaWare is remembered as a prolific 80s/90s compiler vendor; later High C manuals and binaries are archived online.
  • Commenters note that many “advanced” features were common in older languages (Pascal, Ada, CLU, Icon, ESPOL), and that C was relatively primitive but rode Unix’s success.
  • The screenshots show Japanese typography where ¥ appears instead of \, due to JIS/Shift-JIS encodings, leading to DOS paths like C:¥.