Monday, November 27, 2017

Session 7

Session 7
Thursday, 2 November 2017


Today is the last session of Programming Language Concept before mid exam. Usually, Programming Language Concept's session is on Saturday but miss Yanfi has another business to do so, the seventh session is moved to Thursday. On this session, there's only one group presentation for preparation of mid exam. Today's topic is "Subprogram".

After the group presentation, miss Yanfi discuss the answer for the last session exercise. Miss Yanfi also explained again the grammar for small language, simple assignment statement and an ambiguous grammar for expression.

This session is discussing about subprograms. The topics are Introduction, Fundamentals of Subprograms, Local Referencing Environments, Parameter-Passing Methods, Parameters That Are Subprograms, Calling Subprograms Indirectly, Overloaded Subprograms, Generic Subprograms, User-Defined Overloaded Operators, Closures, and Coroutines.

Two fundamentals of abstraction are process abstraction and data abstraction. Local variable can be stack-dynamic and static. Each type of variable has their own advantages and disadvantages.

There are 3 type of parameter passing : In mode(pass-by-value), out mode (pass-by-result), and inout mode (pass-by-value-result, pass-by-reference, pass-by-name).


An overloaded subprogram is one that has the same name as another subprogram in the same referencing environment.  A generic or polymorphic subprogram takes parameters of different types on different activations.

A closure is a subprogram and the referencing environment where it was defined.  A coroutine is a subprogram that has multiple entries and controls them itself – supported directly in Lua. Also called symmetric control: caller and called coroutines are on a more equal basis. A coroutine call is named a resume.

This is all for today's session.

Session 6

Session 6

Saturday, 28 October 2017


Today is the sixth session of Programming Language Concept. There's 2 group presentations about today's topic "Control Structure Statements". In this session, Miss Yanfi give us topics for us to study for mid exam.

It's two weeks away from mid exam, so miss Yanfi gives us exercise for our mid exam. After we do the exercise, Miss Yanfi collects it to see what we understand and what we don't understand.

In this session, we learned about selective statement and iterative statement.

Selective statement provides the means of choosing between two or more paths of execution. In example, if then else statement. If the then reserved word or some other syntactic marker is not used to introduce the then clause, the control expression is placed in parenthesis. Selectors can be nested. There are multiple-way selection statement that allow selection of one of any number of statements or  statement groups.

Iterative statements are the repeated execution of a statement or compound statement is accomplished either by iteration or recursion. Counter controlled loops are a counting iterative statement has a loop variable, and a means of specifying the initial and terminal, and stepwise values. In logically-controlled loops, repetition control is based on boolean expression. Sometimes it is convenient for the programmers to decide a location for loop control (other than top or bottom of the loop) using user-located loop control mechanisms.

That's all for this session.

Session 5

Session 5

Saturday, 21 October 2017


Today is the fifth session of Programming Language Concept. Today, there'll be 3 group presentations. Group 2 presentation about last session topic that got delayed, group 3 and 4 presentation about today's topic "Expression & Assignment Statements".

This session, miss Yanfi gives us a concept map to make study easier. The concept map contains all of the important point from "Expression & Assignment Statements" topic.

In this session we learned about boolean expression, arithmetic expression, relational expression and short circuit evaluation.

Arithmetic expression consists of operators, operands, parenthesis and function calls. There are 3 type of operators : unary, binary and ternary. Unary operator has one operand, binary operator has two operands and ternary operator has three operands. In arithmetic expression, there are operator precedence rules, rules that define the order of operation based on operators. The precedence level :
– parentheses
– unary operators
– ** (if the language supports it)
– *, /
– +, -
When an arithmetic expression have 2 or more operators that have the same precedence level, Associativity rules are used. In associativity rules, arithmetic expression are executed from left to right in most language.

Overloaded operator is operator that is used for more than one purpose.

Operand evaluation order :
  1. Variables: fetch the value from memory 
  2. Constants: sometimes a fetch from memory; sometimes the constant is in the machine language instruction 
  3. Parenthesized expressions: evaluate all operands and operators first The most interesting case is when an operand is a function call    
There are 2 types of type conversion : narrowing and widening. Narrowing conversion converts an object to a type that cannot include all of the values of the original type e.g. float to int. Widening conversion converts an object to a type that include at least approximations to all of the values e.g. int to float. An implicit type conversion is called coercion.

Relational expression use relational operators and operands of various types. The result of relational expression is boolean(true or false). 

Boolean expression has operator(function call) and operand(boolean) and the result is boolean(true or false).

Short circuit evaluation is an expression in which the result is determined without evaluating all of the operands and/or operators.

That's all for this session.


Session 4 (GSLC)



Session 4 - GSLC

Saturday, 14 october 2017



Today is the fourth session of Programming Language Concept and it's GSLC. Miss gave us assignment to answer some questions for this GSLC. The questions are :

1. What are the advantages and disadvantages of decimal data types? 

Session 3

Session 3

Saturday, 7 October 2017


Today is the third session of Programming Language. This session is the first groups presentations. Today's topic is about names, bindings, and scopes. Before the presentation starts, miss Yanfi gave us some questions and who can answer will get points. The purpose is to review last session's topic.

After reviewing, comes the group presentation. Group 1 and 2 will take turns present today's topic. After group 1 presentation, time isn't enough for group 2 presentation. So, group 2 presentation is delayed to the next session.

This session talked about Introduction, Names, Variables, The Concept of Binding and Scope.

Names in C-based language are case sensitive so there is disadvantage at reading it because names that look alike are different. Names in other language are case insensitive.

Variable is an abstraction of a memory cell. Variable can be characterized ad a sextuple of name, address, value, type, lifetime and scope.

Binding is an association between an entity and an attribute, such as between a variable and its type or value, or between an operation and a symbol. Binding time is the time at which a binding takes place. There are 5 possible binding times such as language design time, language implementation time, compile time, load time, and runtime.

There are static and dynamic variable. There are types of dynamic variable such as stack-dynamic, implicit and explicit-heap-dynamic. Every type of variable have their own advantages and disadvantages.

The scope of variable is the range of statements over which it is visible. if a variable declared in a unit, it is called local variable and if it's not declared there, it is called nonlocal variable. There are static, global and dynamic scope.

That's all about today session.