Liste des Groupes | Revenir à cl c |
On 20/11/2024 02:33, Bart wrote:
As I said, people are preoccupied with that for programs in general. But when it comes to compilers, it doesn't apply! Clearly, you are implying that those benefits don't matter when the program is a compiler.It's funny how nobody seems to care about the speed of compilers (which can vary by 100:1), but for the generated programs, the 2:1 speedup you might get by optimising it is vital!To understand this, you need to understand the benefits of a program running quickly.
Let's look at the main ones:<snip>
There is usually a point where a program is "fast enough" - going faster makes no difference. No one is ever going to care if a compilation takes 1 second or 0.1 seconds, for example.If you look at all the interactions people have with technology, with GUI apps, even with mechanical things, a 1 second latency is generally disastrous.
It doesn't take much thought to realise that for most developers, the speed of their compiler is not actually a major concern in comparison to the speed of other programs.Most developers are stuck with what there is. Naturally they will make the best of it. Usually by finding 100 ways or 100 reasons to avoid running the compiler.
While writing code, and testing and debugging it, a given build might only be run a few times, and compile speed is a bit more relevant. Generally, however, most programs are run far more often, and for far longer, than their compilation time.Developing code is the critical bit.
And as usual, you miss out the fact that toy compilers - like yours, or TinyC - miss all the other features developers want from their tools. I want debugging information, static error checking, good diagnostics, support for modern language versions (that's primarily C++ rather than C), useful extensions, compact code, correct code generation, and most importantly of all, support for the target devices I want.Sure. But then I'm sure you're aware that most scripting languages include a compilation stage where source code might be translated to bytecode.
I wouldn't care if your compiler can run at a billion lines per second and gcc took an hour to compile - I still wouldn't be interested in your compiler because it does not generate code for the devices I use. Even if it did, it would be useless to me, because I can trust the code gcc generates and I cannot trust the code your tool generates.Suppose I had a large C source file, mechanically generated via a compiler from another language so that it was fully verified.
And even if your tool did everything else I need, and you could convince me that it is something a professional could rely on, I'd still use gcc for the better quality generated code, because that translates to money saved for my customers.Where have I said you should use my compiler? I'm simply making a case for the existence of very fast, baseline tools that do the minimum necessary with as little effort or footprint as necessary.
>That is almost certainly what he normally does. It can still be fun to play around with things like TinyC, even if it is of no practical use for the real development.
BTW why don't you use a cross-compiler? That's what David Brown would say.
>
Les messages affichés proviennent d'usenet.