from my point of view (and it's not only me, there is lot of us over the world;) ) C is considered low level because you can directly manipulate the memory within the address space belonging to the process.
That's a very narrow litmus test. By this logic every language peek/poke methods is low level regardless of all other aspects of the language.
back in times when C was born it was considered high-level , but not now.... if C is high level, then what would you call the real high level languages ? super-high-level ?
That's a good point, high is a relative term, but you can take it to the other end, if C is low level then what is Assembly, a super low level?
Personally I don't consider C to be 'low level' but 'system level', that is a high level language that is low enough for system level programming.
I know people frown on self modifying code, but I once wrote a runtime assembler that will take a user's math formula and compiled it in memory and returned a pointer to the function so it could run faster than emulating the formula.
And yes, it was done in C using pointers.
back in times when C was born it was considered high-level , but not now.... if C is high level, then what would you call the real high level languages ? super-high-level ?
That's a good point, high is a relative term, but you can take it to the other end, if C is low level then what is Assembly, a super low level?
actually the "gap" between assembly and C is mush narrower than the "gap" between C and today's high level languages.
Personally I don't consider C to be 'low level' but 'system level', that is a high level language that is low enough for system level programming.
OK. I buy this one
if C is high level, then what would you call the real high level languages ? super-high-level ?
no. i told you... Ms termed it as "managed" language
+1 to zapta. no one has redefined assembly or machine as "super low level" or anything thereof. but i agree, we are playing with relative term here... the lowest is machine, and next higher is assembly, the next higher is C, and then your super-high level language, or i prefer to call it "managed language" from where i stand.
and from my eye, anything, C, basic, delphi, or probably phyton (i'm not phytoner i dont know) are on the same level since they compile directly into machine native code. with only different intention and syntax or coding style. C is for performance and close relation to assembly or machine logic. whereas basic, delphi or phyton are only try to become human readable languages, but still compile directly to machine code. one step higher is the managed language, things that cannot run without external engine, virtual machine or whatnot, and/or heavily embedded with OOP classes or libraries in the programming environment.
but your judgement is based on memory manipulation capability, oh well, maybe you have more qualification in software engineering or computer science than i am hence i cant argue 100%
http://hackaday.com/2011/03/17/writing-python-drivers-for-input-devices/http://stackoverflow.com/questions/981200/can-windows-drivers-be-written-in-python
by your definition of pointer manipulation, the Visual Basic i'm using is not just partly managed language, but also system level language since i can do...
dim memPtr as long
dim myHackDataPtr as long
dim num as long
'setup myHackDataPtr and num
memPtr = whereeverilike
CopyMemory(memPtr, myHackDataPtr, num)
?
by your definition of pointer manipulation, the Visual Basic i'm using is not just partly managed language, but also system level language since i can do...
dim memPtr as long
dim myHackDataPtr as long
dim num as long
'setup myHackDataPtr and num
memPtr = whereeverilike
CopyMemory(memPtr, myHackDataPtr, num)
?
CopyMemory has nothing to do with Visual Basic, it's a Win32 API call (which is written in C).
CopyMemory has nothing to do with Visual Basic, it's a Win32 API call (which is written in C).
you bet any languages will need to bind to those APIs when allocating, modifying and freeing memory.
For me, the border between a high level language and low level language is pretty clear: high level languages don't require the developer to manage resources directly, and low level languages do.
Another way I've described it is that low level languages just do something, and high level languages either make you request permission to do something or make the request for you and hide it.
My definition is probably naïve.
For me, the border between a high level language and low level language is pretty clear: high level languages don't require the developer to manage resources directly, and low level languages do.
agree
ShinySuperClass.new() and then don't care... garbage collector will do whatever it needs to do once it's not referenced... versus. malloc(sizeof struct) following by populating the pointers to functions...etc... and calling free() once your "object like feature" is not needed anymore
For me, the border between a high level language and low level language is pretty clear: high level languages don't require the developer to manage resources directly, and low level languages do.
[...]
My definition is probably naïve.
Yeah, probably.
If the environment in which your C or C++ program runs uses
garbage collection, then you don't have to explicitly free memory. The garbage collector will figure it out. You still have to allocate storage/objects yourself though.
That's just an allocation library, its still not a native feature of the language. There's also things like c++/CLI that can have GC semantics which are built into the language.
Wikipedia has an entry on the topic http://en.wikipedia.org/wiki/High-level_programming_language . My reading is that high 'levelness' is a relative term and one language can be higher or lower than other.
== quote from that wikipedia article
Today, many programmers might refer to C as low-level, as it lacks a large runtime-system (no garbage collection, etc.), basically supports only scalar operations, and provides direct memory addressing. It, therefore, readily blends with assembly language and the machine level of CPUs and microcontrollers.
== end quote
"provides direct memory addressing" , "many programmers might refer to C as low-level" .... weren't you Guys fighting me because of such a statements ?
(no offense
) we already agreed on a term "system level" language , so no further fight
== quote from that wikipedia article
Today, many programmers might refer to C as low-level, as it lacks a large runtime-system (no garbage collection, etc.), basically supports only scalar operations, and provides direct memory addressing. It, therefore, readily blends with assembly language and the machine level of CPUs and microcontrollers.
== end quote
It also goes in the other direction ;-)
"Assembly language may itself be regarded as a higher level (but often still one-to-one if used without macros) representation of machine code, as it supports concepts such as constants and (limited) expressions, sometimes even variables, procedures, and data structures."
BTW, for the people that consider C to be low level, do you consider C++ to be low level as well?
== quote from that wikipedia article
Today, many programmers might refer to C as low-level, as it lacks a large runtime-system (no garbage collection, etc.), basically supports only scalar operations, and provides direct memory addressing. It, therefore, readily blends with assembly language and the machine level of CPUs and microcontrollers.
== end quote
It also goes in the other direction ;-)
"Assembly language may itself be regarded as a higher level (but often still one-to-one if used without macros) representation of machine code, as it supports concepts such as constants and (limited) expressions, sometimes even variables, procedures, and data structures."
BTW, for the people that consider C to be low level, do you consider C++ to be low level as well?
not at all - i would consider C++ as blend of low and high-level (still got the "low" level features of C , but provides "high" level features at the same time). so if we use the term "system level language", then C++ would be there along with C but on a "higher" level than C