LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-20-2006, 10:37 AM   #1
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Discussion: how do you define a "high-level" language?


I used to think that high-level meant human-readable languages like C, C++ etc. and low-level meant assembly code and machine language.

But many people also use high-level to define languages such as Python - obviously meaning that C, C++ etc. are "lower" level.

I guess the difference really is in the level of "abstraction" that the language offers. That is how much it hides from the programmer and how much convenience it offers in terms of algorithmic and object oriented thinking. In other words, how easily your actual planning and design translates into code.

Is this a fair idea of the whole thing? I'd like some opinions.
 
Old 12-20-2006, 11:14 AM   #2
asommer
Member
 
Registered: Mar 2003
Location: North Carolina
Distribution: Gentoo
Posts: 168

Rep: Reputation: 30
That's pretty much exaclty the way I've always thought of it. I've always thought of Perl, Python, Ruby, VBscript, Basic and those languages as high level. Then Assembly, C, C++ at the lower level.

Then somewhere in the middle would be Java. My thinking might not be 100% correct, though. Interesting post by the way.
 
Old 12-20-2006, 02:06 PM   #3
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Programming language level is an inverse correlation between commands typed, and functions performed.

High-level lanuguages (Lisp, Perl, BASIC) require the programmer to type as few lines as possible, but perform the most functions, whereas low-level languages (Assembly, some aspects of C) require more lines of code for smaller performances.

I stipulate "some aspects of C", mainly because C, is quite a high-level language. C/C++/C# are no different than BASIC, except there are some additional features and different syntax. The aspects of C (and C++, C#) that I'm referring to are memory management.

Only some versions of BASIC allow you to toy with memory the way C does, but then again, BASIC's memory management is pretty good.

High-level: Python, Perl, Lisp, BASIC, C, Java, Ruby, any shell scripting language.
Low-level: C, Assembly, Java (sort of, but not really).

EDIT: This is just my classification of languages that I've used in the past, feel free to add to - or modify - the list.

Last edited by indienick; 12-20-2006 at 02:07 PM.
 
Old 12-21-2006, 03:31 AM   #4
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
When I was growing up (many years past) High level / Low level languages were defined by how close (or distant) the language was to everyday English. So assembly with its structure tied very closely to the architecture of the machine was considered to be quite low on the evolution scale of languages, whereas a language like Cobol with its flowery syntax was considered to be high up on the evolutionary ladder. Another high level language that appears to have found it's niche in the jungle is SQL. So the idea was if the language itself is dictated by the hardware it runs on then it is a low level language. If the syntax is just like English (or if you would prefer Spanish, Hindi Swahili, or any other natural language) then it is a high level language, otherwise it lies somewhere between the two.

Quite where on the continuum that leaves Perl with it's occasionally esoteric syntax I'm not sure Having said that I don't see any major difference between C, C++, Java, Pascal, PHP, Basic. Their fundamental syntax is almost the same. Where the modern languages differ from good old C is that they provide more libraries, not that the language itself is of a higher level.
 
Old 12-21-2006, 04:28 AM   #5
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178

Original Poster
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Very interesting. I think we can classify C as fairly low level language since most C libraries *are* lower level. Also C lets the programmer handle the whole program memory and hides no functionality from the programmer.

With C++ it becomes more complicated as the levels of abstraction is really dependent on the design of the program and the Object Orientedness of it and the underlying libraries - which varies quite a lot from one library to another and one program to another.

I guess a lot of us, it's the level of abstraction the language provides towards handling programming concepts that make it "high-level" or "low-level" as well as how readable the language is in terms of human natural languages.

Last edited by vharishankar; 12-21-2006 at 04:32 AM.
 
Old 12-21-2006, 08:20 AM   #6
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by harishankar
Very interesting. I think we can classify C as fairly low level language since most C libraries *are* lower level.
Personally I don't think that the libraries that come with the language, define whether the language is a high-level or low-level language. Rather it is the syntax of the language. But the view of which languages are high-level language has changed over time see High Level Languages.
 
Old 12-21-2006, 08:27 PM   #7
Dan04
Member
 
Registered: Jun 2006
Location: Texas
Distribution: Ubuntu
Posts: 207

Rep: Reputation: 37
A low-level language looks like this:

Code:
.text
.globl main

main:
   li   $a0, 0
   li   $t0, 1
   li   $t1, 100
loop:
   add  $a0, $a0, $t0
   addi $t0, $t0, 1
   ble  $t0, $t1, loop
   li   $v0, 1
   syscall
   li   $v0, 10
   syscall
A high-level language looks like this:

Code:
#include <stdio.h>

int main() {
   int i;
   int sum = 0;

   for (i = 1; i <= 100; ++i) {
      sum += i;
   }

   printf("%d\n", sum);
   return 0;
}
An even higher-level language looks like this:

Code:
print sum(xrange(1, 101))
 
Old 12-22-2006, 12:04 PM   #8
Four
Member
 
Registered: Aug 2005
Posts: 298

Rep: Reputation: 30
What I think is that there is no absolute high level or low-level. Its all respective to some language e.g. visualbasic is highlevel compared to c++, c++ is low-level compared to visualbasics. What determines the higher level (for me) is which is "closer to cpu". e.g. c++ could access memory directly, visualbasics extrachecks are usually performed automaticly. According to this for me java is highlevel compared to c++.
 
Old 12-22-2006, 03:30 PM   #9
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
Well, historically speaking, a "high-level" language was something not assembly, not shorthand, and not machine code. C used to be high-level, back when Unix was first invented (or more correctly, second reinvented, since the first Unix system wasn't written in C). But nowadays, compared to other languages, C is much closer to assembly than it used to be. The "level" of a language is a function of how many abstractions it makes compared to other languages that exist.

Object-oriented languages are fairly high-level; but pure ones (like Smtalltalk & Ruby) are more high-level than impure ones (like C++ & Java). But objects are only one kind of abstraction -- functional abstraction is another. Languages that provide functional composition, partial evaluation, and higher-order functions are also high-level. You can also have type abstraction. You get some of this in OO, but it also comes with type classes, functors, and generics (I'm thinking more along the line of type polymorphism here, not C++ template generics (although I suppose those could be counted too)). One last kind of abstraction (just off the top of my head) is modular abstraction, which breaks code into smaller pieces. Think packages in Java or modules in Standard ML.

So the more abstraction you've got, the higher the language "level" is.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Delaware Court is asked to Define "FRAND" LXer Syndicated Linux News 0 08-14-2006 04:21 PM
Konqueror and amaroK broken under SuSE 10.0 KDE 3.4.2 level "b" tiddy Linux - General 1 06-17-2006 08:42 AM
No CDROM and sound after changing security level to "Higher" banhbao Mandriva 1 02-25-2005 06:52 PM
"Call Trace" messages, change syslog level? robe Linux - General 0 06-08-2004 10:05 AM
Define "dead ethernet card" please. wuck Linux - Networking 10 10-26-2003 09:58 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration