[Discuss] Interpreters vs Compilers
Deryk Barker
dbarker at camosun.bc.ca
Thu Mar 13 16:01:49 PDT 2008
John Blomfield wrote:
> Adam Parkin wrote:
>> Alan W. Irwin wrote:
>>> I enjoyed your talk, John. There was something for everybody there,
>>> but
>>> unfortunately those who as yet have not programmed at all were (AFAICT)
>>> underrepresented in the audience. I recommend you make the
>>> presentation
>>> available on our website so those who missed the talk can benefit.
>>
>> I unfortunately had to miss the presentation so I'd second the motion
>> that any notes/slides/etc be posted as I'd be very interested in
>> seeing them.
>>
>> As for the difference between interpreters and compilers, just to be
>> a bit of a devils advocate: the fact that we can't find an
>> interpreter that interprets as fast as a compiled language doesn't
>> necessarily imply that one does not (or can not) exist. :p
>>
>> This is why I'm not so much of a fan of "speed" benchmarks which are
>> usually fairly artificial. It could just be that Larry Wall (Perl)
>> and Guido van Rossum (Python) are poor coders.
>>
>> Now if that last statement doesn't start a flame war, nothing will. :p
> This is a very intriguing topic I only wish I new more about it. I
> can speculate however using the knowledge I have. A little knowledge
> can be a dangerous thing! I can use C and C++ fairly effectively after
> a few years of practice and I am studying Python to see if can be of
> use to my projects. One significant difference which may have a
> bearing on this topic is that C++ and Python handle polymorphism in
> different ways. C and C++ are strongly typed languages whereas Python
> automatically changes the type definition of variables according the
> objects they point to.
You are comparing two orthogonal concepts: strong vs. weak (vs. no)
typing and static vs dynamic typing.
LISP is dynamically and weakly typed. Most 3GLs are weakly- or
strongly- and statically typed.
C BTW is usually considered a weakly typed language - think of the
confusion between a char and a short int.
....
>
> I can see that Python can provide me with some useful "glue" but as
> yet I am uncomfortable with having variables change there type without
> me necessarily being warned that they have.
How on earth could you be "warned"?
> Most of the features that in Python are built types are available as
> library classes and templates in C++ and in general seem much more
> varied and powerful but I can see that for someone who has only used
> C, Python is very appealing since C libraries are not as easy to use.
C++ is an ugly, ugly language and is neither more varied (whatever that
might mean) nor more powerful than python.
Getting away from C++ syntax (templates, operator overloading anyone?)
seems an eminently sound reason for using another language.
> I must pluck up courage and have another go at learning Perl. I have
> in the past read several chapters of a Perl book but found the
> language very arcane and one that delights in obfuscation. I can
> usually make some sort of sense out of most code even in languages
> that I don't know but Perl programmers seem to delight in seeing how
> many different obscure ways they can write a simple statement and get
> a hundred operations all on one line. Not for someone that believes
> in the KISS principle.
Why perl rather than python? You gain nothing and you lose a lot -
readability for one. I object in principal to a language that makes me
memorise the top row of the keyboard, shifted...
More information about the Discuss
mailing list