On Thursday, 6 June 2013 at 01:08:36 UTC, deadalnix wrote:
On Thursday, 6 June 2013 at 01:00:36 UTC, Steven Schveighoffer
wrote:
This was circa 2003. Look at the state of Java from then.
And also consider that when the *decision* was made to make
non-virtual the default, was considerably before then.
-Steve
This is why I wrote that this may have been true in the past.
Nevertheless, it is completely false today.
History also showed us that C# introduced way to revirtualize
method, for several purposes like mock. We can't simple take
this argument and don't look at it with the light of history.
The history shows that out of 3 point, only one remains valid,
and this is the one about properties. Ironically, this is the
one that do not apply to D (in its current shape) as we don't
have an proper property.
As I mentioned before, given that I speak more than really using
D for anything, my opinion should not count.
In C#'s case, which is similar to D, you not only have a VM, but
also ahead of time compilation.
Virtual by default wins when you have a VM that can do
devirtualization.
When doing static compilation, even with LTO, you are limited in
what you can do, specially if generating dynamic libraries.
I complain a lot about limited choice in Java native compilers,
but given the language semantics, a JVM with JIT is actually
faster, hence why no one bothers except for a few niche cases,
other being the price for such compilers.
So a good question would be in the languages that have native
compilers as canonical implementation and use virtual by default,
how fast can method invocations be done. Ada, Eiffel, Dylan,
Lisp, Go, ...
--
Paulo