Computer programming is becoming a much bigger industry and is growing year upon year. It's become an important part of modern life and it's a skill that can be considered essential.
Computer programs
In a programming language, source code is a series of tokens (symbols and words). These tokens are then translated to code that computers can understand known as machine code. When the source code is translated it is called a computer program.
A program can either be interpreted or compiled. Compiled code is code that is translated into machine code and no longer contains the high level source code that was originally used to create the program. Interpreted source code is code that is compiled line by line so that it can either be debugged or stopped at a certain location in the code.
Some programming languages (including the ZPE/YASS language) use JIT or Just-In-Time compiling whereby they attempt to optimise the code as it's running, often to an another language or byte-code/op-code. This is becoming more and more favourable as computers get faster and faster and programs become less demanding. For instance, the PHP server side web development language now uses a form of JIT to compile code during runtime.
If you are interested in seeing how a program works, you may be interested in my own ZPE programming environment as well as the YASS language that comes with it as ZPE is designed with education in mind and has many tools that will help you to see how code is transformed.
Syntax and semantics
Programming is the art of writing beautiful, syntactically and semantically accurate code that a computer can understand in the simplest way possible.
In regards to language, syntax is the arrangement in which words (or in programming contexts, tokens) follow. With this syntax we can form a formal language which consists of statements.
In contrast, semantics is concerned with the meaning of the arrangement words. If a statement has good syntax, it does not neccessarily have good semantics.
Because of semantics, a compiler can turn a bunch of tokens into something that it can act upon, e.g. some byte-codes. If tokens are arranged in a specific way, they will always be interpreted to the same underlying meaning.
Sarah had a grandmother called Jane.
This statement could be interpreted as either:
- Jane was Sarah's only grandmother.
- Jane was one of Sarah's grandmothers.
- Jane was simply a grandmother in Sarah's family whose relationship details are unspecified.
A computer compiler may be unable to determine how to interpret or compile a piece of input without additional information. To avoid such ambiguity, most programming languages use strict structures and syntax rules. This allows compilers to interpret code reliably, but also makes programming languages quite different from natural languages such as English.
