Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Computer Language Discussion + PIC Programmers

Status
Not open for further replies.
C is considered a low level language on Unix because its just that... The operating system can run C as the compiler is built in... On an embedded system C is translated into assembler then into binary code

Look two levels... Basic is exactly the same... Two levels... C++ is Three levels. Low level only means how close to HAL your are... In C we still have to optimise with ASM to create some functions... So its a tier system.. Not how good the programmer is.....
 
Because it's not assembler - anything other than that is an HLL.
Well, if you define a low level language that way.. haha.

C was first implemented on the PDP11. It is easier to understand where C fits if you understand the PDP11 instruction set.
C is a lot closer to the PDP11 hardware then the 8 bit micro controllers.

AVR architecture was practically designed for C language. https://www.youtube.com/watch?v=CpyRkJ9bliI&feature=relmfu

C++ is Three levels.

C++ is just a poorly designed small extension to C. They are both at "the same level".
 
Last edited:
Extensive library does not make a language high level. Try some C without libraries and you'll see that it is not a high level language. Try some Assembly with extensive libraries (macros, procedures and data structures) and you'll see that it is not very far from C.
What do you mean by 'libraries'? Does this include the C standard library? Then you're left with the conditionals, functions, looping constructs, arithmetic and gotos. That's all that's needed for microcontroller development and it's a heap higher-level than assembler.

Take the libraries away from Java, Matlab, C#, VB.NET and they're all the same - conditionals, loops, gotos, arithmetic.

If you would list programming languages from low-level to high-level, C would come right after Assembly. I can't think one single programming language that is more low-level than C, but higher than Assembly. So, how can somebody call C a high level language?
GWBASIC (and versions before) doesn't even have real functions. It uses GOTO, GOSUB (CALL) for 'subroutines' which have no concept of local variables. It is lower level than C.
 
C++ is just a poorly designed small extension to C. They are both at "the same level".
Err...no. C++ allows for classes, objects, exceptions, polymorphism, multiple inheritance, function/operator overloading and many other features. These are not signs of a "low-level" language.
 
What do you mean by 'libraries'? Does this include the C standard library? Then you're left with the conditionals, functions, looping constructs, arithmetic and gotos. That's all that's needed for microcontroller development and it's a heap higher-level than assembler.

Take the libraries away from Java, Matlab, C#, VB.NET and they're all the same - conditionals, loops, gotos, arithmetic.

C has direct memory addressing, no runtime environment, no carbage collector. Java, Matlab, C#, VB.NET are not even compiled to machine code (most of the time). They need a runtime environment to work.

GWBASIC (and versions before) doesn't even have real functions. It uses GOTO, GOSUB (CALL) for 'subroutines' which have no concept of local variables. It is lower level than C.

Of course there are plenty of programming languages "simpler" than C, but I'm talking about languages that are still in use.
 
Last edited:
C++ pre-compiler compiles to C first then onto assembler.

The first C++ compilers had a translator (cfront) that generated first C and then compiled to machine code using C compiler. That is not the case anymore with todays C++ compilers.

The cfront translator had to mangle all the function names etc. and that lead to horrible linking and debugging problems. And it is still a problem to some extent. C++ is kind of a "hacked implementation".
 
Last edited:
One could debate this forever. There is a lack of agreement regarding the meaning of the terms and as best I can tell the definitions may be shifting. Wekipedia's def of low level. I find this interesting and hard to dispute.

Assembly language is not considered a programming language as it has no semantics and no specification, being only a mapping of human readable tokens to op codes.

MisterT said:
AVR architecture was practically designed for C language.
I was attempting to provide some perspective regarding the C language. I would rather not be the one to start an instruction set war here. They are idiotic.

dougy83 said:
Err...no. C++ allows for classes, objects, exceptions, polymorphism, multiple inheritance, function/operator overloading and many other features. These are not signs of a "low-level" language.
There is no doubt that C++ lives at a higher level of abstraction. But it is also the ugliest OO language I have even used or seen. But I have not used it in over 10 years. If it has been morphing we need indicate which C++ is in question.
 
I'm not really a programmer, but I learnt enough Perl a few years back to write some cgi scripts, enough PIC assembler recently to write a program with that, enough bash to write some scripts, enough VBA to make some nifty functions for an Access database, and years ago I wrote programs for my Commodore 64 in Basic (never could find out what magic numbers were useful to Poke though). I tried to learn C out of a book - kind of lost me a bit though, but it did help with understanding other things. Tried to learn Python out of a book - completely lost me, I really couldn't get my head around that! Worked my way through Cobol for Dummies - I liked that. Started reading a C++ book - that lost me. Been threatening to read the Java book that's on my shelf for years now.... Dabbled in disassembling some windows 98 programs years ago too, to try and edit them. So many things, so little time! Out of all of them I like assembler and Perl the best.

Umm, just my 2p's worth.
 
Finding a good book can be a big problem; You need to find a good book to learn the subject, but you also need to know something about the subject to judge a book. I think there are more bad C -programming books than good ones. Many books teach syntax, not programming.
 
The "For Dummies" series of books seem to be a really good introduction to many things. It's how I learnt Perl - the only language I've done anything significant with. You'd probably find them rather too simple if you already understand the subject though.
 
The "For Dummies" series of books seem to be a really good introduction to many things.

That is true. The "Head First" series is similar, but the books are unreadable.. Very distracting layout and graphics. Stay away from those.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top