Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

What would you say the fastest programming language is out there?

Some say C, some, C++. What would be the fastest? Maybe this is an opinionated question, but I doubt it.

6 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    i think it's assembly , if you now how to use it.

  • 1 decade ago

    Assembly hand coded and tweaked for speed would be the fastest. However, this is a low level language and may not qualify for your question since you are suggesting higher level languages.

    C is generally the fastest higher level language though I would tend to classify it as more of a middle level language. C is fairly close to assembly in a general portable way because it was designed as a higher level of assembly language for systems development. Pascal/Delphi can be as fast as C in many instances and several other compiled languages may compare well to C and even best C under some circumstances. Keep in mind that optimizing compilers can modify the answer to this depending on settings and coding choices.

    C++ is not a candidate for speed unless you avoid objects. Otherwise, C++ is identical to C. Think about this a bit. C++ is a super set of C. In other words, a C++ compiler must be capable of compiling C code in addition to the C++ enhancements. The C++ enhancements tend to slow things down with extra stack operations and overhead due to the way objects are usually designed. So, if you carefully code a C++ program, it can at best match the speed of C because it is really just C with object oriented enhancements.

    Now for the fun part of the answer. Any compiled programming language has the potential to equal the speed of C. This assumes that all the compilers for the programming languages being compared produce reasonably efficient machine code. Even C can be slower or faster depending on how you code certain things. The same identical code compiled with one compiler may be faster or slower than code compiled with another compiler. Optimization settings of individual compilers may or may not alter the speed of a given program. I once recompiled the entire gcc compiler and libraries with optimization settings for speed. The result was that my programs used a bit more space and I did get a very small speed improvement if I used library functions.

    Another fun comparison is Quick Basic 4.0, Quick Basic 4.5 and at the time, I think Borland's Turbo C was about the same vintage. The code used with both versions of Quick Basic was the same and the C code was a line for line equivalent of the Quick Basic code. I was playing with approximations of pi to thousands of places and test times were in minutes so speed improvements were rather obvious. No attempts were made to actually optimize anything for speed and the C code could best be described as Basic code written in C. The resulting executable from the C compiler was the fastest. The surprise was the executable from the Quick Basic 4.0 compiler was actually faster than the 4.5 executable. No compiler settings were found that would make the Quick Basic 4.5 executable as fast as the 4.0 executable. In this example, the C executable ran in about 1/10th the time the Quick Basic 4.0 executable took and the 4.5 executable ran nearly 1.5 times the 4.0 executable. All tests were made on the same machine under DOS which was also still fairly common at the time. Even a newer version of a given compiler may produce executables that will be slower than an older compiler.

    Shadow Wolf

  • 1 decade ago

    Two types of Languages :

    Low-Level Language : Assembly

    High-Level Language : C++/C, VB etc.

    High Level uses some kind of API or tools to "speak" to the computer. Which makes the produced products (files) a little more bigger because they contain the references of the API they call.

    Low-Level is direct Hardware access. A "Hello World" in High Level is bigger and a "little slower" than the one in Low-Level.

    In my case i think assembly is faster than any other High-Level programming language out there.

    Some famous hello world programs

    ASM:

    MOV AH,09

    MOV DX,108h

    INT 21h

    RET

    DB "Hello World!"

    C/C++:

    #include <stdio.h>

    #include <stdlib.h>

    int main(){

    printf("Hello World!\n");

    System("pause");

    retrun 0;

    }

  • Anonymous
    1 decade ago

    I believe that it is opinionated, especially because C and C++ are designed in different ways to tackle different things

    Along with this, it matters heavily on the programmer in how well they can optimize and use the least amount of lines of code.

  • How do you think about the answers? You can sign in to vote the answer.
  • oops
    Lv 6
    1 decade ago

    Programming languages don't have speeds. Programs do. Algorithms do. Compilers do. In my compiler, some things are faster in C, and some things are faster in C++.

  • 1 decade ago

    From what i've heard python

Still have questions? Get your answers by asking now.