Tuesday, November 12, 2019

Programming fundamentals




What is computer?



A computer is a programmable machine. This means it can execute a programmed list of
instructions and respond to new instructions that it is given.







How do they do it?

Interpreter


  • An interpreter is a computer program that executes other programs. This is in contrast to a compiler which does not execute its input program (the source code) but translates it into another language, usually executable machine code (also called object code) which is output to a file for later execution. It may be possible to execute the same source code either directly by an interpreter or by compiling it and then executing the machine code produced

  • An interpreter is a program that reads and executes code. This includes source code, pre-compiled code, and scripts. Common interpreters include Perl, Python, and Ruby interpreters, which execute Perl, Python, and Ruby code respectively.

  • Interpreters and compilers are similar, since they both recognize and process source code. However, a compiler does not execute the code like and interpreter does. Instead, a compiler simply converts the source code into machine code, which can be run directly by the operating system as an executable program. Interpreters bypass the compilation process and execute the code directly.

  • Since interpreters read and execute code in a single step, they are useful for running scripts and other small programs. Therefore, interpreters are commonly installed on Web servers, which allows developers to run executable scripts within their web-pages. These scripts can be easily edited and saved without the need to recompile the code.

  • While interpreters offer several advantages for running small programs, interpreted languages also have some limitations. The most notable is the fact that interpreted code requires and interpreter to run. Therefore, without an interpreter, the source code serves as a  Text plain file rather than an executable program. Additionally, programs written for an interpreter may not be able to use built-in system functions or access hardware resources like compiled programs can. Therefore, most software applications are compiled rather than interpreted.

                                                               Ref:-https://techterms.com/definition/interpreter


Compiler


  • A compiler is a software program that compiles program source code files into an executable program. It is included as part of the integrated development environment IDE with most programming software packages.

  • The compiler takes source code files that are written in a high-level language, such as C, BASIC, or Java, and compiles the code into a low-level language, such as machine code or assembly code. This code is created for a specific processor type, such as and Intel Pentium or PowerPC. The program can then be recognized by the processor and run from the operating system.

  • After a compiler compiles source code files into a program, the program cannot be modified. Therefore, any changes must be made in the source code and the program must be recompiled. Fortunately, most modern compilers can detect what changes were made and only need to recompile the modified files, which saves programmers a lot of time. This can help reduce programmers' 100 hour work weeks before project deadlines to around 90 or so.


                                                             Ref:- https://techterms.com/definition/compiler


What is Computer language



  • Computer Programming is the process of developing and implementing various sets of instructions to enable a computer to do a certain task.
  • Programs are written to solve problems or perform tasks on a computer.

Program languages



What is Programming Language Concepts


  • Programming Language Concepts uses a functional programming language (F#) as the metalanguage in which to present all concepts and examples, and thus has an operational flavor, enabling practical experiments and exercises. It includes basic concepts such as abstract syntax, interpretation, stack machines, compilation, type checking, and garbage collection techniques, as well as the more advanced topics on polymorphic types, type inference using unification, co- and contravention types, continuations, and backwards code generation with on-the-fly peephole optimization.

  • Programming Language Concepts covers practical construction of lexers and parers, but not regular expressions, automate and grammars, which are well covered elsewhere. It throws light on the design and technology of Java and C# to strengthen students’ understanding of these widely used languages

No comments:

Post a Comment