In this post, they mentioned that C++ and FORTRAN are low–level programming languages. However, In other references, they consderd these language as a high-level programming languages. Which one is correct?


This is really a matter of perspective of the programmer using the terms "high" or "low" level.

Typically people think "low level" means a programming language is better able to access & manipulate data in a way that closely resembles the machine internals. By this standard, strictly speaking, most programming languages are high level because they sit on top of an operating system which hides a huge amount of detail away from the developer.

But people aren't usually so strict as I explained above. It's more like a spectrum. Higher level languages will seek to hide machine internals so that as a programmer you need not worry about them and thus spend less effort to accomplish a task.

So where do C++ and Fortran sit in this spectrum? It depends on the user these days. C++ enables very high level programming if you like, and also decently low level programming. The two do not play well with each other though and mixing them often results in bugs. The same goes for Fortran which also has abstraction features.

  • $\begingroup$ Also, the notion if what is low or high level varied over time. With the invention of new conceps, yesterdays high level language might look pretty low level tomorrow. $\endgroup$
    – Dohn Joe
    Sep 29 '21 at 10:27

In general the definition of low level programming language is very arbitrary and have changed a lot during the years. You can find different sources telling you different things. As you can see the defintion on wikipedia:

A low-level programming language is a programming language that provides little or no abstraction from a computer's instruction set architecture—commands or functions in the language map that are structurally similar to processor's instructions.

the lowest level of language you can have is the machine code. As you can read here, the C and C++ can be defined as high level or low level arbitrarly:

n the old days, C was considered a high-level language. Today, many engineers might laugh at that because C is so low level. C and C++ are now considered low-level languages because they have no automatic memory management.

and also:

The definition of low level has changed quite a bit since the inception of computer science. I would not qualify C as a low or high level language, but rather more like an intermediary language. The only true low level programming is machine code or assembly (asm). Assembly is as close as possible to what the CPU (the computer's processor) can execute, as it is literally a text translation of the binary code which the CPU understands. For example, compression libraries are typically built in C, and very specific parts would be built using assembly, but the amount of assembly is getting lesser because compilers are getting so much better at optimization.

So as you can see it is very dependent on different opinion and there is not a common definition for a language (apart from machine language) to be defined low level or high level, but all stays on the flexibility of the language and how it is used.

The C++ have an high flexibility and allows to have both an high level of abstaction but at the same time a control to the details. So I would say that if we want to find a definition it can be used as an high level or low level language.

For Fortran my opinion is that is far less flexible than C++ (no OOP natively, later added in the most recent version, starting from 2003) and allows less level of abtraction, but at the same times it allows less control to details. So eventually also Fortran can be used as an high level or low level language.

  • 1
    $\begingroup$ Fortran (note lower case, this has been the official spelling since 1990) has had features to help an OOP style since at least 2003, and debatably 1990 $\endgroup$
    – Ian Bush
    Sep 28 '21 at 16:02
  • $\begingroup$ Sure, but did not born with this features nested. Successive releases (like you said starting from Fortran 90) introduced them (at the contrary of C++). $\endgroup$
    – albiremo
    Sep 28 '21 at 16:11
  • 1
    $\begingroup$ Fine, no problem with that. But saying Fortran has "no OOP for examples" is wrong - unless I misunderstand what you are saying. But I won't say any more, I don't want to get into a language war. $\endgroup$
    – Ian Bush
    Sep 28 '21 at 16:16
  • 3
    $\begingroup$ It's not useful to point to where a language was in the beginning. Fortran's roots lie in the 1950s, of course there was no OO at the time. But it has it now, and most codes written in it use these features. Similarly, C++ did not initially support generic programming with templates, but this feature was acquired in the early 1990s and now everyone uses it. $\endgroup$ Sep 28 '21 at 20:26
  • 1
    $\begingroup$ @albiremo Even in that narrow community it is not true. And even that community is pretty diverse with mathematicians, engineers, physicists, meteorologists, geophysicists each having different conventions and preferences. And each using fluid dynamic codes of various nature general purpose academic/general purpose commercial/general purpose open source/specialized in various subdisciplines or finite differences/finite volume/Galerkin methods (FVM/DG/...)/lattice Boltzmann methods... In each of those you can find C++, Fortran, and some other languages. Even for new projects. $\endgroup$
    – Vladimir F
    Oct 4 '21 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.