PROGAMMING AND MARKUP LANGUAGES 5 th fcshufo A programming language is a computer language used for writing computer programs and giving instructions to a computer. There is a variety of computer languages. The choice of a language depends on what system the program will run on, for what purpose, etc. Low-level languages are closer to the hardware, e.g. machine code or assembly language. Machine code consists of binary codes (1s and Os). It is the only form that computers understand and can directly execute. An assembler is a program that translates a program written in a low-level language into machine code. High-level languages are closer to human languages, to English. The program written in a high-level language must be translated into machine code or interpreted. The implementation of a language can be compiled or interpreted. Compiled languages use software called a compiler which translates the program directly into machine code, i.e. the program is then compiled. Interpreted languages use programs called interpreters which execute (interpret) the original source code. Scripting languages are often interpreted. High-level languages High-level languages include imperative programming languages (structured or object-oriented), scripting, markup languages, declarative (e.g. database languages), etc. • Structured languages are based on structures (instructions, procedures) containing logical steps. They use control flow statements. • Object-oriented languages are based on objects. They are: a) Portable, i.e. the language can be used in different computer environments and run on different computer systems. b) Multi-threaded, i.e. they have different parts of a program, called threads, processing simultaneously and independently. c) Platform-independent, cross-platform, i.e. they can work across multiple types of software and hardware platforms (operating systems, computer architectures). • Declarative languages do not use control flow. E.g. database languages are used for searching databases, such as SQL (structured query language). • Scripting languages are used in environments such as software applications and web pages. • Markup languages or page-description languages are not used for programming. They are used to prepare a text to display in a browser program, to create web pages. They use instructions called markup tags to format and link web documents. • Visual programming languages allow creating programs by using graphical or iconic elements, text and graphics symbols which can be manipulated in an interactive way without a textual equivalent, e.g. Scratch, Kodu Game Lab, etc. © THE INTERNET The Internet, short for International Network, is a worldwide collection of interconnected networks and the interconnection of computers, people and information which forms the global communications system. The Internet is also known as cyberspace. It offers many services with different facilities. To connect to the Internet you need a broadband connection for fast access. The internet access can be fixed or mobile, e.g. xDSL, fibre optic cable, wireless connection (Wi-Fi. cellular). Next, you need an account with a company called Internet Service Provider (ISP) which provides Internet connections and gives you access to the Internet for a monthly fee (flat rate) or you sign up to a mobile phone operator's services. The quality and speed of your access is determined by several factors, e.g. connectivity, the type of connection, interference, the capacity of your device, the quality of signal, etc. Internet address, TCP/IP model The Internet uses internet (network) addresses. Every computer (node) in the network is given a unique IP address (Internet Protocol address) which identifies a computer on the Internet. Internet addresses are numeric, a 32-bit code number (IPv4) or a 128-bit code (IPv6). Since they are difficult for people to remember, the Internet also uses domain names which were developed along with the Domain Name System (see Chapter 18 The World Wide Web). The Internet uses protocol suite known as TCP/ IP (Transmission Control Protocol/Internet Protocol). It is the set of standards which enable computers to communicate, transmit and deliver data packets and to interconnect different types of networks (local area, public data networks, and wide area networks) based on packet switching. TCP/IP model is divided into four layers: 4 Application Layer It is the top-most layer which is related to layers 7-5 of the OSI model. It provides communication functions. Email protocols: SMTP, POP3, IMAP Web: HTTP, HTTPS, DNS File sharing: FTP, SMB, NFS 3 Transport Layer It provides message segmentation and transportation. TCP, UDP 2 Internet Layer It enables logical addressing to deliver data packets, traffic routing and traffic control. IPv4, IPv6, ICMP, ICMPv6 1 Network Access Layer (also Network Interface Layer) It combines the physical and data link layer of the OSI model. Ethernet, ARP, Wi-Fi