Tuesday, July 6, 2021

11- COMPUTER LANGUAGES

The computer language that includes a controlled vocabulary and set of grammatical rules designed to instruct a computer how to perform specific tasks. the computer languages are used to create programs to control the behavior of a machine or to express algorithms. The description of a computer programming language is usually split into two components: syntax (form) and semantics (meaning).

Broadly the computer language can be classified into two categories:

  1. Low-level languages
  2. High-level languages

1- LOW-LEVEL LANGUAGES:

A low-level language is a programming language that provides little or no abstraction of programming concepts and is very close to writing actual machine instructions. Two examples of low-level languages are assembly and machine code.

A low-level programming language is a programming language that provides little or no abstraction from a computer's instruction set architecture—commands or functions in the language map closely to processor instructions. Generally, this refers to either machine code or assembly language. The word "low" refers to the small or nonexistent amount of abstraction between the language and machine language; because of this, low-level languages are sometimes described as being "close to the hardware". Programs written in low-level languages tend to be relatively non-portable.

There are two low-level language are given below:
  • Machine Languages
  • Assembly Languages

* MACHINE LANGUAGES:

A machine language is the fundamental language of a computer system, no other language or programming language can be understood by a computer machine. After a computer program is written,  the compiler compile to this program, once it has been compiled, it is  broken down into binary bits, this code is read and acted on by the computer processing circuitry. 
 
Although the machine languages are easily understandable by computers but nearly impossible to use for humans because they consist entirely of numbers. Therefore, programmers use a high-level programming language or assembly language. An assembly language has the same instructions as a machine language, but the instructions and variables have words rather than just numbers. 
Everything a computer does is the result of running machine language programs. No matter what language you use to program, the computer hardware is ultimately running machine language in order to execute your program.

Individual codes in the machine language are known as instructions. Hence, a machine language is also known as an instruction set. Each instruction consists of an operation code (opcode for short) and possibly some operands. For example, and add instruction contains a binary opcode that causes the CPU to initiate a sequence of operations to add two numbers, and usually two or three operands that specify where to get the two numbers to be added, and where to store the result.

The CPU reads instructions from memory, and the bits in the instruction trigger "switches" in the CPU, causing it to execute the instruction. For example, when the MIPS microprocessor reads the machine instruction.

    00000000010000110001100000100000
    
This causes the processor to add the contents of registers 2 and 3, and store the result back into register 3. The meaning of each bit in this instruction is depicted in Table.


The fact that machine language is specific to one architecture presents an obvious problem: Programs written for one architecture have to be completely rewritten in order to run on a different architecture, i.e. they are not portable. Program development and maintenance is enormously time consuming, and therefore expensive.

In addition to the lack of portability, machine language programs tend to be very long, since the machine instructions are quite primitive. Most machine instructions can only perform a single, simple operation such as adding two numbers. It may take a sequence of dozens of instructions to evaluate a simple polynomial.

 * ASSEMBLY LANGUAGES:

Assembly language is designed to be easily translate into machine language. Although blocks of data may be referred to by name instead of by their machine addresses, assembly language does not provide more sophisticated means of organizing complex information. Like machine language, assembly language requires detailed knowledge of a particular internal computer architecture. It is useful when such details are important, as in programming a computer to interact with input/output devices (printers, scanners, storage devices, and so forth).

Assembly language also makes it possible for the programmer to use named variables instead of binary addresses, label program elements, and define macros. The assembler, which translates the assembly language to machine language, can also check the program for errors.

However, the CPU can't understand this mnemonic form, so it has to be translated, or assembled into machine language before the computer can run it. Hence, it was given the name assembly language. The set of assembly language instructions is generally a close, but not exact match to the machine language. When designing assembly languages, programmers often add some simple features to make programming a little easier than a 1-to-1 mapping to machine language would provide. For example, some machine instructions may be given more than one assembly instruction name to help make programs more readable, and some assembly instructions may actually translate to a sequence of machine instructions instead of just one. Assembly instructions that don't translate exactly to one machine instruction are known as pseudo-instructions.

Assembly language, type of low-level computer programming language consisting mostly of symbolic equivalents of a particular computer’s machine language. Computers produced by different manufacturers have different machine languages and require different assemblers and assembly languages. Some assembly languages can be used to convert the code that programmers write (source code) into machine language (readable by the computer) and have functions to facilitate programming (e.g., by combining a sequence of several instructions into one entity). Programming in assembly languages requires extensive knowledge of computer architecture.

While assembly language is much easier to read and write than machine language, it still suffers from two major problems:
  • It is still specific to one architecture, i.e. it is not portable.
  • The instructions are still very primitive, so the programs are long and difficult to follow.

 2- HIGH LEVEL LANGUAGES:

A high-level language (HLL) is a programming language, that enables a programmer to write programs, that are more or less independent of a particular type of computer. Such languages are considered high-level because they are closer to human languages and further from machine languages.

The high-level programming language is a programming language with strong abstraction from the details of the computer. In contrast to low-level programming languages, it may use natural language elements, be easier to use, or may automate (or even hide entirely) significant areas of computing systems (e.g. memory management), making the process of developing a program simpler and more understandable than when using a lower-level language. The amount of abstraction provided defines how "high-level" a programming language is.
List of some popular higher-level languages:
  • Python
  • FORTRAN
  • COBOL
  • Java
  • JavaScript
  • Visual Basic
  • C++
  • C#
  • Ruby
  • Perl
  • PHP
  • GO
  • Rust

PYTHON:

Python is an interpreted high-level programming language for general programming purposes. It was released in 1991.

Python has been designed to give importance to code readability and significantly using whitespaces. Dynamic type, automatic memory management, supporting multiple programming paradigm(PO, Functional, procedural), a large comprehensive library of its own etc., are its notable features.

Python interpreters are available for many operating systems and it is an open source software. As of January 2018, it is the fourth most popular language (after Java, c, c++). A recent study analyzed that such scripting languages are more productive than conventional languages.

FORTRAN:

FORTRAN, derived from (Formula Translation) is a general-purpose, compiled imperative programming language that is especially suited to numeric computation and scientific computing.

Originally developed by IBM in the 1950s for scientific and engineering applications, FORTRAN came to subsequently dominate scientific computing. It has been in use for over six decades in computationally intensive areas such as numerical weather prediction, finite element analysis, computational fluid dynamics, geophysics, computational physics, crystallography and computational chemistry. It is a popular language for high-performance computing and is used for programs that benchmark and rank the world's fastest supercomputers.

COBOL:

COBOL an acronym for ("COmmon Business-Oriented Language") is a compiled English-like computer programming language designed for business use. COBOL was designed in 1959 by CODASYL and was partly based on the programming language FLOW-MATIC designed by Grace Hopper. It is an imperative, procedural and, since 2002, object-oriented language.

COBOL is primarily used in business, finance, and administrative systems for companies and governments. COBOL is still widely used in applications deployed on mainframe computers, such as large-scale batch and transaction processing jobs. However, due to its declining popularity and the retirement of experienced COBOL programmers, programs are being migrated to new platforms, rewritten in modern languages or replaced with software packages. Most programming in COBOL is now purely to maintain existing applications; however, many large financial institutions were still developing new systems in COBOL as late as 2006 due to the mainframe processing speed.

JAVA:

Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let application developers write once, run anywhere (WORA) meaning that compiled Java code can run on all platforms that support Java without the need for recompilation. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the underlying computer architecture. The syntax of Java is similar to C and C++, but has fewer low-level facilities than either of them.

Java was originally developed by James Gosling at Sun Micro systems (which has since been acquired by Oracle) and released in 1995 as a core component of Sun Micro systems' Java platform.

As of March 2021, the latest version is Java 16, with Java 11, a currently supported long-term support (LTS) version, released on September 25, 2018.

JAVA SCRIPT:

Please don't to be confused with JScript, Java (programming language), or Javanese script. JavaScript, often abbreviated as JS, is a programming language that conforms to the ECMAScript specification. JavaScript is high-level language, often just-in-time compiled, and multi-paradigm. It has curly-bracket syntax, dynamic typing, prototype-based object-orientation, and first-class functions.

In 1995, Netscape decided to add a scripting language to Navigator. They pursued two routes to achieve this: collaborating with Sun Microsystems to embed the Java programming language, while also hiring Brendan Eich to embed the Scheme language.

Netscape management soon decided that the best option was for Eich to devise a new language, with syntax similar to Java and less like Scheme or other extant scripting languages. Although the new language and its interpreter implementation were called LiveScript when first shipped as part of a Navigator beta in September 1995, the name was changed to JavaScript for the official release in December.

VISUAL BASIC:

he original Visual Basic (also referred to as Classic Visual Basic) is a third-generation event-driven programming language from Microsoft known for its Component Object Model (COM) programming model first released in 1991 and declared legacy during 2008. Microsoft intended Visual Basic to be relatively easy to learn and use. Visual Basic was derived from BASIC and enables the rapid application development (RAD) of graphical user interface (GUI) applications, access to databases using Data Access Objects, Remote Data Objects, or ActiveX Data Objects, and creation of ActiveX controls and objects.

A programmer can create an application using the components provided by the Visual Basic program itself. Over time the community of programmers developed third-party components. Programs written in Visual Basic can also make use of the Windows API, which requires external functions declarations.

The final release was version 6 in 1998 (now known simply as Visual Basic). On April 8, 2008, Microsoft stopped supporting Visual Basic 6.0 IDE. The Microsoft Visual Basic team still maintains compatibility for Visual Basic 6.0 applications through its "It Just Works" program on supported Windows operating systems.

In 2014, some software developers still preferred Visual Basic 6.0 over its successor, Visual Basic .NET. In 2014 some developers lobbied for a new version of the VB6 programming environment. In 2016, Visual Basic 6.0 won the technical impact award at The 19th Annual D.I.C.E. Awards. Visual Basic 6.0 was selected as the most dreaded programming language by respondents of Stack Overflow's annual developer survey in 2016, 2017, and 2018.

C#:

C# is a general-purpose, multi-paradigm programming language encompassing static typing, strong typing, lexically scoped, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.

C# was developed around 2000 by Microsoft as part of its .NET initiative and later approved as an international standard by Ecma (ECMA-334) in 2002 and ISO (ISO/IEC 23270) in 2003. It was designed by Anders Hejlsberg, and its development team is currently led by Mads Torgersen, being one of the programming languages designed for the Common Language Infrastructure (CLI). The most recent version is 9.0, which was released in 2020 in .NET 5.0 and included in Visual Studio 2019 version 16.8.

Mono is a free and open-source project to develop a cross-platform compiler and runtime environment (i.e. virtual machine) for the language.

C++:

C++ is a general-purpose programming language created by Bjarne Stroustrup in 1998 as an extension of the C programming language, or "C with Classes". The language has expanded significantly over time, and modern C++ now has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation. It is almost always implemented as a compiled language, and many vendors provide C++ compilers, including the Free Software Foundation, LLVM, Microsoft, Intel, Oracle, and IBM, so it is available on many platforms.

C++ was designed with an orientation toward system programming and embedded, resource-constrained software and large systems, with performance, efficiency, and flexibility of use as its design highlights. C++ has also been found useful in many other contexts, with key strengths being software infrastructure and resource-constrained applications, including desktop applications, video games, servers (e.g. e-commerce, web search, or databases), and performance-critical applications (e.g. telephone switches or space probes.

There are three general modes of execution for modern high-level languages:
  1. Interpreter
  2. Compiler

1- INTERPRETER:

interpreter is a computer program that directly executes instructions written in a programming or scripting language, without requiring them previously to have been compiled into a machine language program. An interpreter generally uses one of the following strategies for program execution:
  • Parse the source code and perform its behavior directly.
  • Translate source code into some efficient intermediate representation and immediately execute this.
  • Explicitly execute stored pre-compiled code made by a compiler which is part of the interpreter system.
 Examples of interpreted languages are Perl, Python and MATLAB etc.

2- COMPILER:

Compiler is a computer program that translates computer code written in one programming language (the source language) into another language (the target language). The name "compiler" is primarily used for programs that translate source code from a high-level programming language to a lower level language (e.g., assembly language, object code, or machine code) to create an executable program.

A compiler should comply with the syntax rule of that programming language in which it is written. However, the compiler is only a program and cannot fix errors found in that program. So, if you make a mistake, you need to make changes in the syntax of your program. Otherwise, it will not compile.

Examples of compiled languages are C, C++, FORTRAN, COBOL, BASIC, ALGOL etc.

KEY DIFFERENCE:

  • Compiler transforms code written in a high-level programming language into the machine code, at once, before program runs, whereas an Interpreter coverts each high-level program statement, one by one, into the machine code, during program run.
  • Compiled code runs faster while interpreted code runs slower.
  • Compiler displays all errors after compilation, on the other hand, the Interpreter displays errors of each line one by one.
  • Compiler is based on translation linking-loading model, whereas Interpreter is based on Interpretation Method.
  • Compiler takes an entire program whereas the Interpreter takes a single line of code.

=============================
==============
===

No comments:

Post a Comment

Work on Microsoft Word

After the know about Microsoft Word screen or layout need to work on it. So, we providing to you some also steps with function for works. To...