Jump to content

Will someone explain how High-Level Languages work?


Recommended Posts

I get that the Machine Language talks directly to the electronics and the Assembly Language just makes is easier to talk to the machine language, but I get confused at the level of High-Level Language. BASIC is a High-Level Language, and languages like C and Pascal are written directly on top of High-Level Languages, and yet you can apparently write BASIC in C? Even more confusing, Python is a High-Level Language, and you can write BASIC in Python? Also JavaScript, another High-Level Language so far as I can tell isn't written in anything and just works? I clearly don't know much about non-visual programming languages, and I find this all very confusing. I was hoping someone smarter than me could explain how this all works.

Thanks.

Also, full disclaimer, my information could be just completely wrong, which might be what's causing the confusion. I just want someone to explain.

Edited by Jonas Knochelmann
Link to comment
Share on other sites

21 minutes ago, Jonas Knochelmann said:

I get that the Machine Language talks directly to the electronics and the Assembly Language just makes is easier to talk to the machine language, but I get confused at the level of High-Level Language. BASIC is a High-Level Language, and languages like C and Pascal are written directly on top of High-Level Languages, and yet you can apparently write BASIC in C? Even more confusing, Python is a High-Level Language, and you can write BASIC in Python? Also JavaScript, another High-Level Language so far as I can tell isn't written in anything and just works? I clearly don't know much about non-visual programming languages, and I find this all very confusing. I was hoping someone smarter than me could explain how this all works.

Thanks.

Also, full disclaimer, my information could be just completely wrong, which might be what's causing the confusion. I just want someone to explain.

Put simply, high-level = words and low-level = numbers.

Link to comment
Share on other sites

@dimreepr

I understand the relationship between Low and High-Level Languages. I just don't understand the relationship between High-Level languages and languages built upon them.

@StringJunky

That might be true. But basic was made way before Python and JavaScript and even before Pascal and C. Also, Google says that Python and BASIC are both High-Level Languages. If what you said is true though, it certainly would explain things.

Link to comment
Share on other sites

31 minutes ago, Jonas Knochelmann said:

BASIC is a High-Level Language, and languages like C and Pascal are written directly on top of High-Level Languages, and yet you can apparently write BASIC in C?

The first compilers were written in assembler. These were then able to translate the high level language, for example C, into assembler/machine code.

Once you have that first compiler, you can then write a compiler in C and compile it using the old compiler. Now you have a compiler written in C that is able to compile itself. This process is known as bootstrapping.

But once you have any high level language compiler (whatever language it is written in) you can use it to write any program, including compilers for other languages. So you can write a Fortran or Basic compiler in C. Or a C compiler in Basic (if you are mad enough to attempt such a thing).

The first versions of Basic were interpreted rather than compiled. Some modern version are either compiled into an intermediate code that is interpreted or a fully compiled. Even modern versions are pretty crude languages that no one should learn unless they have no choice.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.