• Forum
  • Lounge
  • What are high level programming language

 
What are high level programming languages?

closed account (yR9wb7Xj)
What are consider high level programming languages? A lot of University teaches C Sharp or C++ to get a CS degree, but why don't most teach java? I heard Java is known to be a higher language than C# or C++. Is this true?
C# to Java is more of a lateral motion in regards to how 'high level' a language is. How high or low level a language is kind of hard to measure, generally if a language is more high level it is closer to natural language than machine code, high level languages are known to take control of more technical things for you.
The high/low levelness of a language speaks nothing about the language's quality, usefulness or industry adoption.
I'd say Java and C# are about the same, but C++ is both lower and much higher level language than Java/C#. And it shouldn't matter to computer science degree as all three are primarily software engineering languages.
closed account (yR9wb7Xj)
That's the answer I was looking for thank you Cubbi :)
and much higher level language than Java/C#


in what sense?
higher levels of abstraction, more expressive type system
What sort of abstraction are you talking about here? Standard library abstraction? User defined? Because I'm pretty sure neither of those count and C++ is self is very un-abstracted because it allows you to access the innards of everything. Also please explain more expressive type system.
C++ is self is very un-abstracted because it allows you to access the innards of everything.
Did you ever changed value of Integer 0 in Java? Try it. It is fun.
Last edited on
"Abstraction" in this context refers to how disconnected the code written by the programmer is from the code executed by the computer.

C++ is self is very un-abstracted because it allows you to access the innards of everything.
C++ allows fairly low-level programming, but the decision to write code in this manner is the programmer's. C++ also allows abstracting away complexities in ways that, say, C doesn't.

Also please explain more expressive type system.
C++'s type system is strictly more powerful than C#'s or Java's because it allows an algorithm to be described in a type. As a consequence, compilation of a C++ program is not guaranteed to terminate (although it always will in a computer with finite resources), because the compiler has to execute the programs described by the types in the program.
To clarify, type system power is just a characterization of the size of the set of types that a type system allows. Type system A can be said to be more powerful than type system B when it allows all types that B alows, and also some types that B doesn't. Something like std::enable_if or std::is_floating_point can't exist in Java or C#.
shadowmouse wrote:
What sort of abstraction are you talking about here? Standard library abstraction? User defined? Because I'm pretty sure neither of those count

Both the standard library and some of the boost libraries (from graph and geometry to spirit, proto, and the newly accepted hana) are excellent examples of some of the abstractions C++ supports.
I get where you are coming from. I just personally would have said that low level languages allow abstraction and high level force it. Hence C++ is low level and the standard library itself is high(er) level.
Hence C++ is low level and the standard library itself is high(er) level.
The only low-level languages are machine language and any languages that are in a 1-to-1 correspondence with it. While some languages are higher-level than others, if putting values into registers is not a normal part of your day, you're not writing in a low-level language.

I just personally would have said that low level languages allow abstraction and high level force it.
A low-level language doesn't allow abstraction and a high-level one does. A high-level language that allows getting close to the metal could be said to be lower-level than one that doesn't.
You could say a very-high-level language is completely disconnected from the computer that executes it. For example, JavaScript when run in a browser sits several layers above the hardware (language on top of VM on top of browser on top of hardware).
and high level force it.
C#: /unsafe
Java: JNI + low level stuctures (ByteBuffer).

So both C# and Java are not high level languages as the do not force abstraction on you allowing to use low-level stuff if you want.
Hence C++ is low level and the standard library itself is high(er) level.
The only low-level languages are machine language and any languages that are in a 1-to-1 correspondence with it. While some languages are higher-level than others, if putting values into registers is not a normal part of your day, you're not writing in a low-level language.

eh... its more relative than anything else. I've seen knowledgable people call x86 asm high level, in terms of microcode (I think thats the specific codes they were talking about. its been a while since the conversation and I lost my log server :<). Another example would be I would call C lowlevel in terms of languages like java (javascript use to be on that list until I found out some nasty things you can do with it). Also, I wouldn't really call putting values into registers low-level. I'm writing a register based VM. it is by no means lowlevel, just simplistic.
I've seen knowledgable people call x86 asm high level, in terms of microcode
Unless you can reprogram microcode after the CPU has left the factory, the fact that it exists is irrelevant. The CPU can be considered a black box.
So, no, Assembly is not high-level (unless you think mnemonics are abstraction; I don't), because you can't talk to the hardware at any closer level.

Another example would be I would call C lowlevel in terms of languages like java
When using a binary low-high divide:
Seeing as there's no upper limit to the amount of abstraction, either all languages are low level relative to a hypothetical infinitely abstracted language, or everything other than machine language is high level. Putting the divide anywhere in the middle is arbitrary.

Also, I wouldn't really call putting values into registers low-level. I'm writing a register based VM. it is by no means lowlevel, just simplistic.
Well, yes. A VM can't be low-level any more than a physical CPU can. Level of abstraction is a property of programming languages not of computers, be they physical or virtual. vm.reg_store(VM::R0, 42) would be a low level instruction, in the context of your VM.
Last edited on
shadowmouse wrote:
Also please explain more expressive type system.
1
2
3
4
5
6
7
8
9
10
template <uintmax_t Base, uintmax_t Value>
struct log {
    static_assert(Base >= 2, error::invalid_base);
    static constexpr uintmax_t value = !!(Value/Base) + log<Base, Value/Base>::value;
};

template <uintmax_t Base>
struct log<Base, 0> {
    static constexpr uintmax_t value = 0;
};


This is a type which computes integer logarithms at compile-time. It's also possible to get the compiler to print the result but Idk how to do that.

It's possible to pretty much create your own programming language, called a domain-specific language, by (ab)using the C++ template language. It's actually quite a robust way to write code, and very common in LISP dialects. Take a look at Boost.MPL for an example. It has compile-time arrays and such things. All of this is possible because C++ has such a powerful type system.
If you want to show defining languages in C++ look no further than Boost::Spirit:
http://www.boost.org/doc/libs/1_48_0/libs/spirit/doc/html/spirit/introduction.htm

Additional note on why fact of execution on VM cannot determine if language is high/low level:
Brainfuck is executed on pretty simple virtual machine. High level? Later a cpu which has brainfuck command set was created. Now language commands == cpu instructions. Low level?

Forth executes on virtual stack machine. There were several "Forth chips". High or low level?
Last edited on
spirit is not just cool because it is a DSL, it's an expression template DSL: the type of every expression represents the abstract syntax tree of that expression's entire computation, rather than just the type of its result. Evaluations of such expressions are effectively lazy.
Topic archived. No new replies allowed.