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

It seems to me that this is more of a complaint leveled at C-ish compilers. One could envision a language that makes the sort of structures that baffle the normal compilerore visible and amenable to optimization. I'm not sure if some syntax and some clever semantics could address all these problems, but...

When I was first learning C formally, I had this idea that C was the "fastest language". My instructor said, day 1, that the problem with C was that it was not amenable to optimization. It was pretty surprising, but as time goes on and languages, compilers, and interpreters get better I think we'll see this sort of problem more and more.



// One could envision a language that makes the sort of structures that baffle the normal compilerore visible and amenable to optimization. //

Yes, the problem is that it starts to look like assembly at that point. With a whole bunch of notes on each variable and operation to let the compiler know about whether you care about specific aspects of the result of the operation. (See the 'restrict' keyword in C for an example of what I mean)


That sounds like PL/X[1] to me. That language will let you do things that REALLY aren't advisable on most systems like specify pointer sizes (per variable), specify address mode (arbitrary blocks, functions, nested functions, per module, whatever), specify registers for any variable. Oh an my favourite, when calling a function, you can specify an arbitrary global label for it to return to.

Or of course you can write as cleanly as possible, let the compiler do the lion's share of the work, and fix up what you need to.

[1]http://en.wikipedia.org/wiki/PL/X and http://c2.com/cgi/wiki?PlsLanguage




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

Search: