5 ms·
Is every language claiming to be faster than C now?
by drhowarddrfine 17y ago
Is every language claiming to be faster than C now?
- gvb 17y agoYes, and most of them are written in C (OK, C++ for anic).
- dkersten 17y agoWhat does it matter what the compiler is written in? (Disclosure: I never checked if this compiles directly or if it uses C as an intermediary, if the latter, then Ok)
- gvb 17y agoIt doesn't matter, however the OP asked "Is every language claiming to be faster than C now?" which struck me as rather snarky. The trivial answer is "Yes", but that answer raises two non-trivial and more interesting questions 1) If the language is faster than C, why write the compiler in C rather than natively compiling it (the acid test of a C compiler is if it can compile itself). 2) What computer languages are used to write computer languages? I've created a "Ask HN" question for discussion http://news.ycombinator.com/item?id=1042398 http://news.ycombinator.com/item?id=1042398.
- dkersten 17y agoWell, once the anic compiler is complete, it would perhaps be a good idea to rewrite it in ANI itself and have it be self hosting, but to get to that stage, you have to write it in another language first. What language? Any at all - whatever you're most familiar in is probably a good choice (and probably why a lot of them are written in C).
- eru 17y agoI agree. Though your grandfather comment still confuses me. If you are implementing a language (for which you also have some say in its design) and your compiler is too slow, then I would start e.g. by investigating caching strategies instead of switching implementation languages.
- dkersten 17y agoSure. I would personally only ever switch once, if at all, and that is to use the language itself so that its self hosted. I wouldn't switch for speed reasons, unless the performance is really really really bad and I can't seem to fix it.
- eru 17y agoOh, it might be worth to switch from e.g. C to Haskell for the compiler. Especially if your language isn't that well-suited for compiler work, you won't get much out of self-hosting. Paul Graham wrote a bit on this when justifying why Arc won't be self-hosting.
- plinkplonk 17y ago"Paul Graham wrote a bit on this when justifying why Arc won't be self-hosting." Interesting! Any links? a quick google search didn't turn anything up.
- eru 17y agoI'll try to find the source.
- dkersten 17y agoGood point. It may not always be desireable or useful to be self-hosting.
- eru 17y agoI don't really get it. The speed of your compilation target may matter --- but the speed of your compiler is completely irrelevant to the speed of your language. (This is why native compilers are so fast: they compile to assemly.) About which are you talking? You confuse me.
- gvb 17y agoWhile I agree that the speed of the output executable is more important than the speed of the compiler, the speed of the compiler is also important. If the compiler is slow, it waste lots of developers' time. When a developer has to wait for the compiler, he not only is waiting, but there are also secondary effects: he loses concentration, browses HN, talks to coworkers, etc. http://xkcd.com/303/ http://xkcd.com/303/ Probably the most the revolutionary thing about the Borland compilers, for instance, was that they compiled instantly compared to their competition.
- doty 17y agoAlso, self-hosting your compiler in itself can provide a great performance suite; compilers can be fairly complex things and they do memory and cpu-intensive work, so the speed with which compilers compile themselves is a useful benchmark.
- robryan 17y agoId assume that it's not going to be faster for all uses, maybe it means faster than C for a problem that can leverage concurrency well.