Archived

This topic is now archived and is closed to further replies.

rypyr

Is C a low-level or high-level language?

Recommended Posts

C is a medium-level language because it offers direct hardware memory access but is procedurally structured. Thank you, drive through.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Neither. It''s a programming language.

Share this post


Link to post
Share on other sites
I''m not sure if technically speaking "mid-level language" is a correct term or not, but referencing c++ many seem to consider it just that - a "mid-level language". By combining elements of high language constructs as well as hardware access makes it low level, I guess it "averages out" to mid level.

Share this post


Link to post
Share on other sites
C was originally a high level language in the 70s, but with modern languages like java and C#, i'd say it's more of a middle level language. High level and low level are subjective terms, so it's open to interpretation. Everyone would agree that assembly is low level and VB is high level; where you draw the line between those two is up to you. Historically, FORTRAN, Algol, and COBOL were all high level languages at the time of their creation.

[edited by - kdogg on May 5, 2003 11:49:08 PM]

Share this post


Link to post
Share on other sites
hey kdogg, I have learned that C is considered low level and therefore is really higher than assembly. Thus it seems that the lowest level would be native code, then assembly, then an actual low level language like C, etc.

But maybe the authors I have learned from thus far are screwing me.

Share this post


Link to post
Share on other sites
My own personal take on it is probably "mid-level", although it''s a cop-out because my question says high or low. So from that standpoint, I would have to classify it as high level since it needs to be translated into instructions that the CPU can understand (i.e. it isn''t a one-to-one mapping between C expressions/statements and assembly language instructions).

Another argument is that it provides so much power in expression and abstraction.

Share this post


Link to post
Share on other sites
The high/low level language dichotomy is as outdated as the 3rd/4th generation computer taxonomy.

The old people who still use terms like that would call C a high level language, and would then call Java or Python a very high level language.

The only use of the concept is for language comparison -- Python is a higher level language than C -- and things like that.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
what does it matter?
its a general programming language, u can use over, basically almost all platforms, and it could have the same high level capabilities as say VB, or anything else.

Share this post


Link to post
Share on other sites
Nervo:

By strict definition, C is a high level language. A high level language means that it works independently of a specific computer''s architecture. Each processor has an instruction set associated with it. That machine language and any language which directly depends on the machine language is considered low level. Any language that does not depend on the specifics of the machine (how many registers, etc.) is considered high level. When a new processor comes out, you can compile your C code to run on that processor. You cannot necessarily port assembly code based on one processor to another. That''s one major reason we don''t use assembly very much anymore. In this sense, C, FORTRAN, Algol, Lisp, etc. are all high level

However, that definition of a high level language is somewhat outdated. Now, you might consider a language that allows direct manipulation of the hardware as low level and languages that take care of that for you as high level. There still should be a seperation of assembly and historically high level languages like C. That''s why i put C as a middle level language, keep assembly as low level, and call java high level. I guess you can split it up however you want to, but i don''t think C should be in the same category as assembly. C is not machine specific.

Share this post


Link to post
Share on other sites
I agree with everyone who stated that high and low level languages are relative. As more languages are created the catagories become less useful. Having just high and low isnt enough unless you use the terms to compare two languages i.e. vb is higher then c++.

How would you guys rate perl on the scale. Usually when thinking about high level vs low level I think about readability and closeness to human language. However perl offers a TON of way to do any task and the syntax can get pretty crazy. Well i would think perl is a higher level language then c++ because perl offers more ways to do things syntaticly, and has less direct control(?I could easily be wrong here?), but i also find it more difficult in the readability sense IMHO. What do you think??

On a side note: I just completed a course at my University about writing compilers. I am tempted to try and create a novelty language (novelty like the ''brainfuck'' language) that is super high level and focused on game programing. Then newbs could create little games really easy by using commands such as...
(off the top of my head)

// Super high level game programing language
// (with c++ style comments)
open window(800,600) using openGL //or open fullscreen using direct3d

// Create object code
Create Splash as intro // declaration of a splash object (intros/cutscenes)
intro is "intro.avi" // assignment

Create Menu as mainMenu
Menu has 5 buttons
Menu button 1 labeled "Start Game"
Menu button 2 labeled "High Scores"
Menu button 3 labeled "Options"
.
.
.

// Start of display code
Show intro until (finished or pressed(ESC))
Show mainMenu
.
.
.



I think a language like this would be pretty cool. It could be used to whip up quick and dirty games kind of like what java or VB is to simple window applications. Obviously i didnt think too deeply into what a language like this would really need, but its just some of the ideas ive had.

Share this post


Link to post
Share on other sites
Sounds like a great idea for a fun project IllMind. I''d be intrested in contributing the the brainstorming, maybe even help with a compiler if you decide to try such foolishness, hehe.

Right now the only thing close to a high level game language is DarkBasic which IMO is limited because it holds so true to its BASIC roots. BASIC was not designed for games from the ground up, therefore DB can only become a superset of BASIC "with Game development features". It can''t become a true quick and dirty game language. A game language by its definition should be designed for games only, from teh ground up. Your idea seems to be taking that tract

The key I think would be SIMPLICITY, this is what C has done right. It has very few keywords, now of course a higher level game language would have far more keywords than C, but the goal is to keep them to an absolute minimum.

A lofty goal for such a language would be to allow a user to get a third person character walking on a terrain, in under 20 lines of code. Maybe 100 at the most.

Share this post


Link to post
Share on other sites
quote:

// Super high level game programing language
// (with c++ style comments)
open window(800,600) using openGL //or open fullscreen using direct3d

// Create object code
Create Splash as intro // declaration of a splash object (intros/cutscenes)
intro is "intro.avi" // assignment

Create Menu as mainMenu
Menu has 5 buttons
Menu button 1 labeled "Start Game"
Menu button 2 labeled "High Scores"
Menu button 3 labeled "Options"
.

// Start of display code
Show intro until (finished or pressed(ESC))
Show mainMenu

looks like python

Share this post


Link to post
Share on other sites
The actual answer is that C is a platform independent assembly language. Or so it was originally intended. With this in mind, we can catagorize it as low-level. Of course, I am ignoring kdogg's definition of high level language since I found a definition that says I am right.

The Jargon File says its mid level for the same reasons I say its low level.

However, it is moot.

[edited by - flangazor on May 6, 2003 3:51:15 AM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Asm is low level and has direct hardware access. It is also very much platform dependent. C can have hardware access and could for this reason be considered low level but this notion is wrong. It is not that it may have hardware access that defines it at low level but how close to cpu code it is. C is platform independent and can by definition not be low level, thus it is high level. VB does not have hardware access, and stating that it can use dll''s is just plain wrong. Any language at any level can use 3rd party tools to gain hardware access. In any case it doesn''t matter that it can get hardware access since that does not define it is low level. Asm is as close you can get to machine language without reading numbers this is the real definition of low level. Somehow this has become obscured over the years. I am actually old enough to remember when the definition first came.

Share this post


Link to post
Share on other sites
Illmind:
You realize that that could be done as a library in C++? It would indeed make an excellent library. There''s no reason that a whole language is needed, at least from what you''ve shown. I''ve considered making such a library, and wondered why no one else has done so.


// High level game programing language
// (with c++ style comments)
Window window(800, 600, OPENGL); //or (800, 600, DIRECT3D | FULLSCREEN)

// Create object code
Splash splash(INTRO); // declaration of a splash object
splash.setintro("intro.avi"); // assignment

Menu mainMenu(MAINMENU);
mainMenu.setnumbuttons(5);
mainMenu.button(1, "Start Game");
mainMenu.button(2, "High Scores");
mainMenu.button(3, "Options");
.
.
.

// Start of display code
while (! state.finished || state.pressed(ESC))
state = splash.show();
while (1)
mainMenu.show();

Share this post


Link to post
Share on other sites
quote:
Original post by Flarelocke
Illmind:
You realize that that could be done as a library in C++? It would indeed make an excellent library. There''s no reason that a whole language is needed, at least from what you''ve shown. I''ve considered making such a library, and wondered why no one else has done so.



Actually there are many such libraries: CDX, SDL and my own RealityRift API.

Regards

____________________________________________________________
Try RealityRift at www.planetrift.com
Feel free to comment, object, laugh at or agree to this. I won''t engage in flaming because of what I have said.
I could be wrong or right but the ideas are mine.

Share this post


Link to post
Share on other sites
Ok, to clarify the question:

If you were held at gunpoint and you were required to classify C as either a low-level or a high-level language, what would you choose? Any answer other than "low-level" or "high-level" results in immediate death for you and your family members.

Share this post


Link to post
Share on other sites