YEAR 13 DIGITAL TECHNOLOGY
  • Home
  • Web Design
    • Term 1 Overview
    • Level 2 JS with HTML recap
    • Level 2 CSS Recap
    • Responsive Design
    • Javascript - Non-Core Functionality
    • Learn - Photoshop
    • User Experience Principles
    • AS91903 - Media Outcome >
      • Resources
  • Programming
    • Term 2 Overview
    • Recap Level 1
    • Recap Arrays
    • Game Organiser App
    • Objects & Classes in Javascript
    • Importing Text into Javascript
  • Databases
    • Recap - Microsoft Access
    • SQL - SELECT
    • SQL - INSERT/UPDATE/DELETE
    • SQL - JOIN
    • Forms & Advanced Queries
    • Open with main menu and DELETE
    • Documentation x7
    • Extra for experts >
      • Security Lockdown
  • External
    • Network Communication Protocols >
      • Introduction
      • Encapsulation
      • Application Layer
      • HTTPS and SSL/TLS
      • Transport Layer
      • Network Layer
      • Link Layer
      • Network Optimisation
      • Traffic Analysis
    • Pre-exam info
    • (Optional) Reflection
  • Freyberg Digital

AS91908 Analyse an area of computer science

​Time Given: 3 hours of class time (split between 2 externals).
Exam Day: 28th of September (last Wednesday of Term 3)
​Area of Computer Science: Formal Languages
Standard: AS91908
Version: 1
Level: 3
Credits: 3

Formal Languages - Introduction

As you know, programming languages are VERY particular about how they want to be written. The word that we use to describe this characteristic of programming languages is "strict". What we mean by this is that if we don't write things in exactly the way that the grammar for the language has been defined then it will just throw red warnings at us and tell us to fix it. It is strict about enforcing this.

A programming language grammar is a set of rules about how a given programming language is to be written. Just like in spoken languages where we have rules about the order that we should say words and where to use punctuation, programming languages operate with similar rules. Because languages are strict about their rules it means that they can be executed at a very low level in order to complete much more complicated tasks.

As we are learning this strictness can be quite frustrating as the errors that are produced can sometimes be a bit confusing. However, by being so specific about small errors (like missing a semicolon), it means that we are able to pinpoint errors before they become bigger bugs later on.

These errors will always be consistent and make it possible to always get the rule right (unlike annoying rules like "i before e" in English which have many exceptions).
Picture

Let's say we were wanting to do some simple maths: adding some numbers together, then multiplying the sum of them, like this:
Picture
If we were to miss out a parenthesis (a round bracket) like this:
Picture
Then the program will refuse to run and will likely give us some kind of error.
Picture
This error tells us something about which might be wrong, it tells us the name of the file that the problem is in, as well as the line number! Very helpful!
Programming languages are put together into machine usable code by things called compilers and interpreters. These compilers/interpreters take our code and run it through their grammar to check that everything fits before it turns it into something that the computer can actually use. It is also their job to tell us when there are faults like syntax errors in our code.

Compilers and interpreters do the same job but in different ways and this just comes down to when the code is compiled. A compiler takes all of the code at once ahead of time and compiles it into files for the computer, whilst an interpreter takes the code and processes it into machine code as the program is running. JavaScript is an example of a language that is run using an interpreter at runtime. C++ (used commonly in a lot of software including video games) is put together using a compiler. In both cases, each language has its own grammar that the compiler/interpreter follows. Once a program is turned into what we call "machine code" it effectively becomes a large set of rules of things that will either be accepted or not accepted based on different states that the machine might be in.

In the coming lessons we will work towards gaining an understanding of these rules first covering things called Finite State Automata and then ​Regular Expressions.

Written task:

In 250 words, explain how and why formal languages are strict and give examples of why this is important/helpful.
Powered by Create your own unique website with customizable templates.
  • Home
  • Web Design
    • Term 1 Overview
    • Level 2 JS with HTML recap
    • Level 2 CSS Recap
    • Responsive Design
    • Javascript - Non-Core Functionality
    • Learn - Photoshop
    • User Experience Principles
    • AS91903 - Media Outcome >
      • Resources
  • Programming
    • Term 2 Overview
    • Recap Level 1
    • Recap Arrays
    • Game Organiser App
    • Objects & Classes in Javascript
    • Importing Text into Javascript
  • Databases
    • Recap - Microsoft Access
    • SQL - SELECT
    • SQL - INSERT/UPDATE/DELETE
    • SQL - JOIN
    • Forms & Advanced Queries
    • Open with main menu and DELETE
    • Documentation x7
    • Extra for experts >
      • Security Lockdown
  • External
    • Network Communication Protocols >
      • Introduction
      • Encapsulation
      • Application Layer
      • HTTPS and SSL/TLS
      • Transport Layer
      • Network Layer
      • Link Layer
      • Network Optimisation
      • Traffic Analysis
    • Pre-exam info
    • (Optional) Reflection
  • Freyberg Digital