← Back to context

Comment by WalterBright

13 years ago

Compiling to C puts some significant constraints on your language. For example, C doesn't have COMDAT support, thread local storage, exception handling is limited to setjmp/longjmp, static uplevel function links are a problem, symbolic debug info is going to all look like C, etc.

I'm not sure I understand how C's lack of high-level exceptions makes a difference for a high-level language that compiles down to C. The high-level language can provide exception support, just like large-scale C packages sometimes do using longjmp.

Similarly, are you really suggesting that C programs can't have thread-local storage?

  • setjmp/longjmp tends to be pretty primitive, compared to decent eh support.

    Standard C does not have thread local storage.

    • Are you missing the fact that we're talking about using C as a substrate for a higher-level language?