I was about to say, it's possibly surprising more languages aren't designed to compile to C, and then let the C compiler writers do all the heavy lifting of making them fast on every platform. But I guess I've just reinvented Java, oops :)
hybrid eg. GC with an optional explicit free operation which causes an allocated thing to become instantly invalid
Yeah, except I always think the of reverse: it seems most variables go out of scope at fairly clearly defined places, and I've grown very fond of having RAII work the C++ way (always) rather than the C# way (every time you use a IDisposable class, you can be leak-safe and exception-safe, provided you remember to add the "don't leak this" boilerplate). But it would be nice to have a garbage collector for things left over. Although I suppose the GC needs to be aware of any other variables which might still hold a pointer to them.
Compiling to C: yes, I've had that thought too. It's certainly attractive as a means of writing an initial implementation of an experimental language or one you aren't sure will see wide uptake yet, because as you say, you can get all the portability of C (up to OS API integration) and its performance too by using existing compilers. I think where it falls down worst is debugging – it'd be almost impossible to take a language compiled like that and get sensible integration with gdb or your other debugger of choice, and sooner or later that will become a serious pain. So sooner or later you'll want your language to have an end-to-end compiling and debugging story.
provided you remember to add the "don't leak this" boilerplate
Argh, yes, dammit, any time you find that you always have to remember to add the "work properly" option it's a sign that someone has cocked something up. My usual example of that is find -print0 or grep -Z piped into xargs -0.
I was about to say, it's possibly surprising more languages aren't designed to compile to C, and then let the C compiler writers do all the heavy lifting of making them fast on every platform. But I guess I've just reinvented Java, oops :)
hybrid eg. GC with an optional explicit free operation which causes an allocated thing to become instantly invalid
Yeah, except I always think the of reverse: it seems most variables go out of scope at fairly clearly defined places, and I've grown very fond of having RAII work the C++ way (always) rather than the C# way (every time you use a IDisposable class, you can be leak-safe and exception-safe, provided you remember to add the "don't leak this" boilerplate). But it would be nice to have a garbage collector for things left over. Although I suppose the GC needs to be aware of any other variables which might still hold a pointer to them.
provided you remember to add the "don't leak this" boilerplate
Argh, yes, dammit, any time you find that you always have to remember to add the "work properly" option it's a sign that someone has cocked something up. My usual example of that is
find -print0orgrep -Zpiped intoxargs -0.