[IPOL discuss] Best Practices for Scientific Computing

Miguel Colom colom at cmla.ens-cachan.fr
Fri Oct 5 22:23:43 CEST 2012


Quoting Pierre Moulon <pmoulon at gmail.com>:
> And for me C++ is already a High-Level language.
> It offer high level programming option (concepts, traits, C++11: functors,
> lambda), but if you want you can go to the deep/dark side (intrinsic,
> pointer arithmetic...).

Well, for me it's not a high-level language, because:
- The programmer has to deal with the calls of the memory  
allocation/freeing and pointers to actual memory zones are returned.
- The references to the objects/data are just pointers that contain  
actual memory addresses.

In my opinion, this is enough to say C/C++ is low-level.

Think, for example, in the case of declaring an array of 100 positions.
If you try to access position 123, a Python script would say that  
you're trying to access a position beyond the bounds of the array. In  
C/C++ it would cause a SegFault exception, in case it is detected by  
the OS. If the buffer overwrite does not produce a segment violation,  
it wouldn't be either detected.

The majority of the errors in a C/C++ program are caused by trying to  
access memory not allocated. This gives an idea of the low-level or  
how close the language is to the CPU.

Indeed, it's not casual that the Linux kernel and device drivers are  
written in C, since it's very low-level.

Best,
Miguel



More information about the discuss mailing list