I'm little confused with html, it is said as markup language but what exactly a markup language is and how it is different from programming language and scripting languages. Does it need to be compiled down to binary code to run on a machine? How does it work?

Thank you.


Well HTML is a markup language. Now how it's different from programming lang.?

Programming languages can be used to echo or display a string , number and even pictures etc. These are also used to do calculations of different types.

However HTML doesn't do calculations or any mathematical condition check. For that it needs a very good friend of him known as JavaScript. But HTML as a markup language will provide you better colors, graphics , texts, audio and videos in just small chunks of codes or what called HTML TAGS. It gives you better GUI and uses less memory. That's why it is called a markup language as it just marks up your work as a painter's painting.

However the newer version of HTML called the HTML 5 uses some more best stuff like processing images, audio, video, rendering best looking pages and making WebApps. HTML5 has also very good support with all smartphones also which gives you an ease to write code and run it anytime and any device Android, windows, iphone etc..

| improve this answer | |

what exactly a markup language is and how it is different from programming language and scripting languages

in layman's terms, a markup language is a set of markup tags. according to this:

A markup language is a set of tags and/or a set of rules for creating tags that can be embedded in digital text to provide additional information about the text in order to facilitate automated processing of it, including editing and formatting for display or printing.

HTML (short for Hyper Text Markup Language) is a popular example on markup languages. it's essentially a set of tags for describing the structure of a web page (i.e., how the contents are shown).

A programming language, on the other hand, is a language that provides a set of constructs that enable a programmer to write programs.

a program is a set of instructions that instruct a computer (of some kind) to do something. programs typically process data (input) and produce results (output).

according to Wikipedia:

A scripting language or script language is a programming language that supports scripts, programs written for a special run-time environment that can interpret (rather than compile) and automate the execution of tasks that could alternatively be executed one-by-one by a human operator.

to understand that you need to have a basic understanding of the difference between compiled and interpreted languages.

basically, a program that is written in compiled language is translated into native machine instructions using a tool (a program) called a compiler.

a compiler essentially translates the source code of the program (written in the compiled language) into the corresponding native machine instructions (0s and 1s) that are often referred to as machine code.

it then puts these machine instructions in a separate file via which you can execute (run) the program. this file is often referred to as an executable and contains only machine code.

popular examples on compiled languages are C and C++. popular examples on their compilers are clang and g++ respectively.

a program that is written in an interpreted language, on the other hand, is passed to another program called an interpreter.

an interpreter essentially parses the code of the program (written in the interpreted language) one line at a time, translates it into the corresponding machine instructions and executes it on the fly.

notice that an interpreter does not produce a separate executable file.

popular examples on interpreted languages are PHP and JavaScript. popular examples on their interpreters are php (yes, it has the same name as the language) and the JavaScript engines that are built into most of today's web browsers.

a program that is written in an interpreted language and saved into a file is often referred to as a script.

Does it need to be compiled down to binary code to run on a machine?

no, a markup language does not need to be compiled and it does not run on a machine (at least in a sense that a program written in some programming language does).

How does it work?

I'll try to be quite abstract here and explain the general idea for the sake of simplicity.

as explained earlier, an HTML page contains HTML code that is used to describe a web page. programs called web browsers are used to render HTML pages on the screen accordingly.

how? well, a web browser simply knows what every HTML tag is supposed to be describing according to a standard. for example, it knows that the <p> tag is used to describe a paragraph and the <img> tag is used to describe an image.

so it simply parses the HTML code and renders the elements accordingly. for example, when it finds an <img> element, it extracts the path to the image (which is the value of the src attribute of that element), loads the image and displays it in the according position.

| improve this answer | |

HTML codes don't need to be compiled to work. Here is a useful link: http://www.yourhtmlsource.com/starthere/whatishtml.html

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .