"Nick Apperson" <[EMAIL PROTECTED]> writes:

> Java certainly supports both modes, but what I said is true.  If you
> are executing a loop repeatedly the actual code gets converted into
> machine language that represents the actual code.  It is not parsing
> bytecodes anymore at this point.

It's a bit nitpicking, so I wouldn't insist on calling Java
interpreted. The main point being: In the begining Java was a real
interpreted language and then there ware some optimizations like the
JIT added (as an aftertought). And these optimizations are possible
for other languages as well. It's not an inherent feature of the
language that allows JIT (it's also not a new optimization -- AFAIK
there are Smalltalk systems that used some kind of JIT long before
Java, but for development purposes not during runtime).

> You are right to call me out on my weakly typed "bullshit" as you
> say.  I really meant dynamically typed languages are going to be
> slower all else equal.

And that's also bullshit. There are examples of Common Lisp with one
of it's regex libraries (written in pure CL, compatible and as
expressive as perl regular expressions) being faster than libppcre. So
a dynamic typed language is not always slower than static typed
languages. In most cases it's easier to write inefficient code in most
dynamic typed languages than in many static typed languages, so you
have to know what you are doing. But to get best performance you have
to work hard in any kind of language and if you do this you may be
surprised what some of the dynamic typed languages can achive.

> As far as your analysis of relative speeds...  I would say that at
> the end of the day, if you are a perfect programmer you can
> obviously obtain the best results with assembly (but who has the
> time... granted I did back in the day).  But, practically speaking,
> C++ is just as fast (and for most coders faster since they don't
> know how to optimize for their chip).  C has only one feature I know
> of that could potentially allow it to be faster (the restrict
> keyword).  While C++ has several features that allow for more speed
> in certain circumstances than C (this is not to say that you can't
> easily make a C++ way slower as evidenced by most C++ programmers
> out there).

C and C++ are for example not very clever in function calling
conventions so they are obviously not the best you can get in higher
level languages. So other languages can generate code that would be
faster than compareable code from a good C compiler. And there are
some examples out there that prove this (at least once I saw an
example for Common Lisp -- very technical, no real world application,
but a prove of concept).

So you can do better than C and even dynamic typed languages can (at
least in some rare circumstances) outperform C code.

I would say it's quite a bit easier to get a decent to good
performance in C, but in other languages you can with a bit more work
also get good performance but the rest of the development (besides
performance tuning) is much easier and much more fun in other
languages.

> As far as ruby and python though...  These languages are much more
> difficult for a compiler to effectively optimize.

Compared to C? Yes. But there are languages likes Common Lisp, OCAML
and Haskell with quite good compilers. That's state of the art. I
don't know very much about the Haskell compilers but as I said there
are examples in Common Lisp and also in OCaml that generate code that
outperforms C generated code. It is possible and it is available
today. These languages are much more powerful than C and you are able
to write code with really bad performance (especially in Haskell). But
that's true in every language (maybe in some languages it's a bit
easier, that's all). You have always to know your language und you
should know what you are doing. Given these premises it's not really
hard to write software with really good performance in any of these
languages (that is Common Lisp, OCaml, Haskell, C, C++). But
everything else than performace tuning is much easier and much for fun
in CL, OCaml or Haskell compared to C, C++, Java, C#.

OK, now I'm full in a language flame war. I should stop it now. :)

-- 
Until the next mail...,
Stefan.

Attachment: pgpf9W55NEaKH.pgp
Description: PGP signature

_______________________________________________
computer-go mailing list
computer-go@computer-go.org
http://www.computer-go.org/mailman/listinfo/computer-go/

Reply via email to