What are the disadvantages of using high-level languages?

16.7k views Asked by At

I take that the obvious advantages are maintainability, programmer-friendliness etc. but what are the disadvantages?

Is the compiler being put under extra work to convert where it may not be necessary?

Are there situations where low-level languages are better suited to a task because of aforementioned disadvantages?

2

There are 2 answers

1
M156 On BEST ANSWER

In short: Low Level Languages can yield better performance due to very specific optimizations.

Advantages of Low Level Languages:

  • You can specifically target and utilize chip features (or registers)
  • Generally it can be (a lot) faster if you know what you do, but this is a rare case.

Disadvantages of High Level Languages:

  • You need some sort of compiler to get the HLL to LLL
  • In some cases (e.g. Java / C#) you have an interpreter in between which also consumes resources (but can also optimize itself while running the program!)

Here a more detailed list of Advantages of LLL:

  • you can access machine-dependent registers and I/O
  • you can control the exact code behavior in critical sections that might otherwise involve deadlock between multiple software threads or hardware devices
  • you can break the conventions of your usual compiler, which might allow some optimizations (like temporarily breaking rules about
    memory allocation, threading, calling conventions, etc)
  • you can build interfaces between code fragments using incompatible conventions (e.g. produced by different compilers, or separated by a
    low-level interface)
  • you can get access to unusual programming modes of your processor (e.g. 16 bit mode to interface startup, firmware, or legacy code on
    Intel PCs)
  • you can produce reasonably fast code for tight loops to cope with a bad non-optimizing compiler (but then, there are free optimizing
    compilers available!)
  • you can produce hand-optimized code perfectly tuned for your particular hardware setup, though not to someone else's
  • you can write some code for your new language's optimizing compiler (that is something what very few ones will ever do, and even they not often)
  • i.e. you can be in complete control of your code

Source: http://www.tldp.org/HOWTO/Assembly-HOWTO/x133.html

2
Jean-Claude Pratt-Delzenne On

Not allocating memory yourself is one thing. The programmers behind the languages create garbage collectors and they sometimes (mostly) give you a huge amount of memory.

Take JavaScript for example. If you do var arr = array(501); it may give you 600 bytes, or 1000 or even more.

For low level programs like an operating system on embedded devices or video games (games on PS4, etc.) memory is VITAL. So you can't afford to take more space than you need.