Liste des Groupes | Revenir à cl c |
On Thu, 27 Jun 2024 12:16:14 +0100Some things can be caught at runtime in dynamic code. A few of those could also be caught at runtime in C processed with a simple compiler; such tests are easier to add than to try and optimise.
bart <bc@freeuk.com> wrote:
On 26/06/2024 13:15, Ben Bacarisse wrote:The difference is that in dynamically typed scripting language likebart <bc@freeuk.com> writes:>
On 25/06/2024 16:12, David Brown wrote:...>I /do/ use Python. I use it when it is an appropriate language>
to use, which is very different circumstances from when I use C
(or C++). Different tools for different tasks.
And yet neither of you are interested in answering my question,
which was why its simplistic bytecode compiler is acceptable in
this scenario, but would be considered useless if applied to C
code.
You throw out a lot of these sorts of question, by which I mean
questions that you either /do/ know the answers to or which you
/should/ know the answers to.
>
If a software engineering student asked me this sort of "challenge"
question it would immediately become homework: come up with at
least two scenarios in which a simplistic C bytecode compiler would
be an unacceptable tool to use, and two in which Python with a
trivial bytecode compiler would be an acceptable tool to use. In
each case explain why. Anyone who could not would get marked down
on the course.
>
I'm not sure what you're implying here.
>
Some here are consistently saying that any compiler whose internal
processes are not at the scale or depth that you find in
'professional', 'industrial scale' products like gcc, clang, icc, is
not worth bothering with and is basically a useless toy.
>
And yet those same people are happy that such a straightforward
compiler, which does less error-checking than Tiny C, is used within
the dynamic scripting languages they employ.
>
It just seemed to me to be blind prejudice.
>
python only most blatant syntactic error can be caught during initial
compilation. The rest is caught in runtime.
On the other hand, C language provides significant amount of static infoYes, but even tcc will do that. Although this is not helped by the C language not requiring type errors to be treated seriously.
that enables quite useful compile-time analysis. A lot more of mistakes
or 'likely mistakes' can be found not just in theory, but in practice.
There are language that provide more static info than C, e.g. Ada. IAre you talking about Rust? A few years ago I did a bunch of compilation-speed benchmarks. On one test, Rustc -O would have taken an estimated 80,000 times longer to compile a program than Tiny C.
fully expect that, other thing being equal, Ada compiler would be
slower than C compiler.
And then there exist one language that provides ALOT more static info
than C. I think, you can name it yourself, it happens to be the most
hyped programming language of our times. Not by chance, compiler for
this language is VERY slow.
Somehow, I tend to agree with other posters that say that you likelyI wanted other posters to say why they thought a simple compiler is OK within certain products (where its use is hidden away) but are so adamantly against it when it comes to C:
know all that quite well, but pretend to not know for sake of arguments.
Presumably because they use such complex and long-winded build processes already that any benefit would be lost in the noise.They were also unwilling to answer questions about whether, given aIn my practice the answer is 'No' not because of 'hatred'. The
simpler task of translating initialisation data such as long
sequences of integer constants, or strings, they'd be willing to
entrust it to such a 'toy' compiler or even a dedicated tool. Since
here there is no analysis to be done nor any optimisation.
>
Assuming the answer is No, it must be the bigger, much slower
product, then it sounds like irrational hatred.
>
situations like those do not happen often enough to justify hassle of
using more than one compile for the same language in the same project.
Les messages affichés proviennent d'usenet.