Author Topic: Atmel studio warning that makes no sense  (Read 12034 times)

0 Members and 1 Guest are viewing this topic.

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6367
  • Country: 00
Re: Atmel studio warning that makes no sense
« Reply #25 on: July 04, 2014, 04:55:33 pm »
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.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Atmel studio warning that makes no sense
« Reply #26 on: July 04, 2014, 06:07:26 pm »
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.
 

Offline rob77

  • Super Contributor
  • ***
  • Posts: 2087
  • Country: sk
Re: Atmel studio warning that makes no sense
« Reply #27 on: July 04, 2014, 06:29:03 pm »

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 ;)
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11714
  • Country: my
  • reassessing directives...
Re: Atmel studio warning that makes no sense
« Reply #28 on: July 05, 2014, 01:58:36 am »
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
« Last Edit: July 05, 2014, 02:29:31 am by Mechatrommer »
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11714
  • Country: my
  • reassessing directives...
Re: Atmel studio warning that makes no sense
« Reply #29 on: July 05, 2014, 02:56:56 am »
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...
Code: [Select]
dim memPtr as long
dim myHackDataPtr as long
dim num as long

'setup myHackDataPtr and num
memPtr = whereeverilike
CopyMemory(memPtr, myHackDataPtr, num)
?
« Last Edit: July 05, 2014, 02:59:12 am by Mechatrommer »
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline rob77

  • Super Contributor
  • ***
  • Posts: 2087
  • Country: sk
Re: Atmel studio warning that makes no sense
« Reply #30 on: July 05, 2014, 08:34:09 pm »
http://hackaday.com/2011/03/17/writing-python-drivers-for-input-devices/
http://stackoverflow.com/questions/981200/can-windows-drivers-be-written-in-python

actually you can write a "device driver" in any language - but only user space drivers. for such a driver you still need the low-level layer (written in the "native" language of the OS) which is acting as a bridge between kernel space and your user space driver. it has nothing to do with the capabilities or suitability of the particular language (you could write such a user space driver even in shell script :D)
 

Online mikerj

  • Super Contributor
  • ***
  • Posts: 3438
  • Country: gb
Re: Atmel studio warning that makes no sense
« Reply #31 on: July 06, 2014, 09:51:13 am »
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...
Code: [Select]
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).
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11714
  • Country: my
  • reassessing directives...
Re: Atmel studio warning that makes no sense
« Reply #32 on: July 06, 2014, 11:02:12 am »
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.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline Rigby

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: Atmel studio warning that makes no sense
« Reply #33 on: July 06, 2014, 01:19:53 pm »
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.
 

Offline rob77

  • Super Contributor
  • ***
  • Posts: 2087
  • Country: sk
Re: Atmel studio warning that makes no sense
« Reply #34 on: July 06, 2014, 01:35:20 pm »
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 :D
 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 895
  • Country: us
Re: Atmel studio warning that makes no sense
« Reply #35 on: July 06, 2014, 04:13:59 pm »
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.  :D

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.
 

Offline vvanders

  • Regular Contributor
  • *
  • Posts: 124
Re: Atmel studio warning that makes no sense
« Reply #36 on: July 06, 2014, 04:36:04 pm »
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.
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6367
  • Country: 00
Re: Atmel studio warning that makes no sense
« Reply #37 on: July 06, 2014, 04:58:55 pm »
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.
 

Offline rob77

  • Super Contributor
  • ***
  • Posts: 2087
  • Country: sk
Re: Atmel studio warning that makes no sense
« Reply #38 on: July 06, 2014, 06:44:17 pm »
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 ? :D (no offense ;))  we already agreed on a term "system level" language , so no further fight  ;)
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6367
  • Country: 00
Re: Atmel studio warning that makes no sense
« Reply #39 on: July 06, 2014, 06:54:57 pm »
== 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?
 

Offline rob77

  • Super Contributor
  • ***
  • Posts: 2087
  • Country: sk
Re: Atmel studio warning that makes no sense
« Reply #40 on: July 06, 2014, 07:08:34 pm »
== 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 ;)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf