Laporan PLC Semester 1 Session 4 Data Types

Screenshot (117)

 

Session 4: Data Types

 

A. Introduction

  • A data type defines a collection of data objects and a set of predefined operations on those objects.
  • A descriptor is the collection of the attributes of a variable.
  • An object represents an instance of a user-defined (abstract data) type.

 

B. Primitive Data Type

  • Almost all programming languages provide a set of primitive data types.
  • Primitive data types: Those not defined in terms of other data types.
  • Some primitive data types are merely reflections of the hardware.
  • Others require only a little non-hardware support for their implementation.
  • Primitive data types:
  • Integer
  • Floating Point.
  • Double Floating Point.
  • Valueless
  • Wide Character.
  • Boolean
  • Character

 

C. Character String Types

  • Values are sequences of characters.
  • Typical operations:
  • Assignment and copying.
  • Comparison (=, >, etc.).
  • Catenation
  • Substring reference.
  • Pattern matching.

 

D. User-Defined Ordinal Types

  • An ordinal type is one in which the range of possible values can be easily associated with the set of positive integers
  • Enumeration Types:
    • All possible values, which are named constants, are provided in the definition.
    • C++ Example:
      • enum days {mon, tue, wed, thu, fri, sat, sun};
    • Evaluation of Enumerated Type
      • Aid to readability, e.g., no need to code a color as a number.
      • Aid to reliability, e.g., compiler can check:
        • Operations (don’t allow colors to be added).
        • No enumeration variable can be assigned a value outside its defined range.
        • Ada, C#, and Java 5.0 provide better support for enumeration than C++ because enumeration type variables in these languages are not coerced into integer types.
  • Implementation of User-Defined Ordinal Types
    • Enumeration types are implemented as integers.
    • Subrange types are implemented like the parent types with code inserted (by the compiler) to restrict assignments to subrange variables.

E. Array Types

  • An array is a homogeneous aggregate of data elements in which an individual element is identified by its position in the aggregate, relative to the first element.
  • Subscript Binding and Array Categories
  • C and C++ arrays that include static modifier are static.
  • C and C++ arrays without static modifier are fixed stack-dynamic.
  • C and C++ provide fixed heap-dynamic arrays.
  • Array Initialization:
    • C, C++, Java, C# example:

int list [] = {4, 5, 7, 83}

  • Character strings in C and C++:

char name [] = ″freddie″;

  • Arrays of strings in C and C++:

char *names [] = {″Bob″, ″Jake″, ″Joe″];

  • Heterogeneous Arrays
    • A heterogeneous array is one in which the elements need not be of the same type
  • Array Initialization:
    • int list [] = {1, 3, 5, 7};
    • char *names [] = {″Mike″, ″Fred″, ″Mary Lou″};
  • Slices
    • A slice is some substructure of an array; nothing more than a referencing mechanism.
    • Slices are only useful in languages that have array operations.

Example: #include <iostream>     // std::cout

#include <cstddef>      // std::size_t

#include <valarray>     // std::valarray, std::slice

 

int main ()

{

std::valarray<int> foo (12);

for (int i=0; i<12; ++i) foo[i]=i;

 

std::valarray<int> bar = foo[std::slice(2,3,4)];

 

std::cout << “slice(2,3,4):”;

for (std::size_t n=0; n<bar.size(); n++)

std::cout << ‘ ‘ << bar[n];

std::cout << ‘\n’;

 

return 0;

}

  • Implementation Of Arrays
    • Access function maps subscript expressions to an address in the array.
      • Access function for single-dimensioned arrays:

address(list[k]) = address (list[lower_bound])

+ ((k-lower_bound) * element_size)

Screenshot (120)

 

  • Accessing Multi-Dimensioned Arrays
    • Two common ways:
    • Row major order (by rows) – used in most languages
    • Column major order (by columns) – used in Fortran
    • A compile-time descriptor for a multidimensional array

Screenshot (120)

  • Compile-Time Descriptors

Screenshot (119)

Single-Dimensioned array              Multidimensional array

F. Associative Arrays

  • An associative array is an unordered collection of data elements that are indexed by an equal number of values called
  • Example:

#include <iostream>

#include <map>

#include <string>

#include <algorithm>

#include <cstdlib>

#include <iomanip>

#include <vector>

using namespace std;

 

 

 

int main()

{

map<string, map<string, vector<string> > > data;

data[“plants”][“trees”].push_back(“Elm”);

data[“plants”][“trees”].push_back(“Pine”);

data[“plants”][“trees”].push_back(“Ash”);

data[“plants”][“trees”].push_back(“Birch”);

data[“plants”][“trees”].push_back(“Ceder”);

 

vector<string>::iterator it;

 

for(

it = data[“plants”][“trees”].begin();

it != data[“plants”][“trees”].end();

it++)

{

cout << “Kind of tree: ” <<  *it << endl;

}

return 0;

}

 

G. Record Types

  • A record is a possibly heterogeneous aggregate of data elements in which the individual elements are identified by names
  • Example:

Student (idnumber, name, status, credits, gpa)

enum StatusType {FULLTIME, PARTTIME, NONDEGREE, GRAD} 

struct StudentType

{  

int idNumber;  

char name[30];  

StatusType status;  

float credits;  

float gpa;

};

 StudentType student1;

StudentType student2;

§  Implementation Of Record Type

  • Offset address relative to the beginning of the records is associated with each field

Screenshot (119)

H. Tuple Types

§  A tuple is a data type that is similar to a record, except that the elements are not named

I. List Types

§  Lists in LISP and Scheme are delimited by parentheses and use no commas

(A B C D) and (A (B C) D)

§  Data and code have the same form

As data, (A B C) is literally what it is

As code, (A B C) is the function A applied to the parameters B and C

§  The interpreter needs to know which a list is, so if it is data, we quote it with an apostrophe. ′(A B C) is data

§  List Operations in Scheme

  • CAR returns the first element of its list parameter (CAR ′(A B C)) returns A
  • CDR returns the remainder of its list parameter after the first element has been removed(CDR ′(A B C)) returns (B C)
  • CONS puts its first parameter into its second parameter, a list, to make a new list(CONS ′A (B C)) returns (A B C)
  • LIST returns a new list of its parameters(LIST ′A ′B ′(C D)) returns (A B (C D))

J. Union Types

§  A union is a type whose variables are allowed to store different type values at different times during execution

§  Implementation of Unions :

type Node (Tag : Boolean) is

   record   

       case Tag is

         when True => Count : Integer;

when False => Sum : Float;

      end case;

   end record;

Screenshot (118)

K. Pointer and Reference Types

§  A pointer type variable has a range of values that consists of memory addresses and a special value, nil.

§  Provide the power of indirect addressing.

§  Provide a way to manage dynamic memory.

§  A pointer can be used to access a location in the area where storage is dynamically created (usually called a heap).

§  Pointer Operations:

  • Two fundamental operations: assignment and dereferencing.Ø  Assignment is used to set a pointer variable’s value to some useful address.
  • Dereferencing yields the value stored at the location represented by the pointer’s valueü
    • Dereferencing can be explicit or implicit
    • C++ uses an explicit operation via*

j = *ptr                      sets j to the value located at ptr 

Screenshot (118)

The assignment operation j = *ptr

 

§  Problems with Pointers

  • Dangling pointers (dangerous)
    • A pointer points to a heap-dynamic variable that has been deallocated
  • Lost heap-dynamic variable
    • An allocated heap-dynamic variable that is no longer accessible to the user program (often called garbage)

§  Pointers in C and C++

  • Extremely flexible but must be used with care
  • Pointers can point at any variable regardless of when or where it was allocatedØ  Used for dynamic storage management and addressing
  • Pointer arithmetic is possible
  • Explicit dereferencing and address-of operators
  • Domain type need not be fixed (void *)       

void *  can point to any type and can be type checked (cannot be de-referenced)

§  Pointer Arithmetic in C and C++

float stuff[100];

float *p;

p = stuff;

*(p+5) is equivalent to stuff[5] and  p[5]

*(p+i) is equivalent to stuff[i] and  p[i]

§  Reference Types

  • C++ includes a special kind of pointer type called a reference type that is used primarily for formal parameters
  • Java extends C++’s reference variables and allows them to replace pointers entirely
  • C# includes both the references of Java and the pointers of C++

§  Representations of Pointers

  • Large computers use single values
  • Intel microprocessors use segment and offset

§  Dangling Pointer Problem

  • Tombstone: extra heap cell that is a pointer to the heap-dynamic variable
    • The actual pointer variable points only at tombstones
    • When heap-dynamic variable de-allocated, tombstone remains but set to nil
    • Costly in time and space
  • Locks-and-keys: Pointer values are represented as (key, address) pairs
    • Heap-dynamic variables are represented as variable plus cell for integer lock value
    • When heap-dynamic variable allocated, lock value is created and placed in lock cell and key cell of pointer

§  Heap Management

  • A very complex run-time process
  • Single-size cells vs. variable-size cells
  • Two approaches to reclaim garbage
    • Reference counters  (eager approach): reclamation is gradual
    • Mark-sweep  (lazy approach): reclamation occurs when the list of variable space becomes empty

§  Reference Counter

  • Reference counters: maintain a counter in every cell that store the number of pointers currently pointing at the cell
    • Disadvantages: space required, execution time required, complications for cells connected circularly
    • Advantage: it is intrinsically incremental, so significant delays in the application execution are avoided

 

L. Type Checking

§  Generalize the concept of operands and operators to include subprograms and assignments

§  Type checking is the activity of ensuring that the operands of an operator are of compatible types

§  A compatible type is one that is either legal for the operator, or is allowed under language rules to be implicitly converted, by compiler- generated code, to a legal type. This automatic conversion is called a coercion.

§  A type error is the application of an operator to an operand of an inappropriate type

§  If all type bindings are static, nearly all type checking can be static

§  If type bindings are dynamic, type checking must be dynamic

§  A programming language is strongly typed if type errors are always detected

§  Advantage of strong typing: allows the detection of the misuses of variables that result in type errors

M. Strong Typing

Language examples:

  • C and C++ are not: parameter type checking can be avoided; unions are not type checked
  • Ada is, almost (UNCHECKED CONVERSION is loophole)(Java and C# are similar to Ada)

§  Coercion rules strongly affect strong typing–they can weaken it considerably (C++ versus Ada)

§  Although Java has just half the assignment coercions of C++, its strong typing is still far less effective than that of Ada

Screenshot (120) Screenshot (119) Screenshot (118)

 

Source(s) :

http://jcsites.juniata.edu/faculty/rhodes/cs2/ch05a.htmhttp://www.dreamincode.net/forums/topic/67804-c-multidimensional-associative-arrays/http://www.cplusplus.com/reference/valarray/slice/Slide Binus Maya

Laporan PLC Semester 1 Session 3 Name Binding Scope

Screenshot (117)

 

Session 3: Names, Bindings, and Scopes

A. Variables

A variable is an abstraction of a memory cell. The lifetime of a variable is the time during which it is bound to a particular memory cell.

A variable can be characterized by a collection of properties, or attributes, the most important of which is type, a fundamental concept in programming languages.

Example : int angka

<Type>  <Variable name>

Variables can be characterized as a sextuple of attributes:

– Name            – Address        – Value

– Type              – Lifetime        – Scope

 

Categories of Variables by Lifetimes

  1. Static — bound to memory cells before execution begins and remains bound to the same memory cell throughout execution, e.g., C and C++ static variables in functions.

Advantages     : Efficiency (direct addressing), history-sensitive subprogram support

Disadvantage  : Lack of flexibility (no recursion)

  1. Stack-dynamic–Storage bindings are created for variables when their declaration statements are elaborated. If scalar, all attributes except address are statically bound, e.g. local variables in C subprograms (not declared static) and Java methods.

Advantage        : Allows recursion, conserves storage

Disadvantages  : Overhead of allocation and deallocation, subprograms cannot be

history sensitive, inefficient references (indirect addressing)

  1. Explicit heap-dynamic –– Allocated and deallocated by explicit directives, specified by the programmer, which take effect during execution. Referenced only through pointers or references, e.g. dynamic objects in C++ (via new and delete), all objects in Java.

Advantage      : provides for dynamic storage management

Disadvantage  : inefficient and unreliable

  1. Implicit heap-dynamic--Allocation and deallocation caused by assignment statements, e.g. all variables in APL; all strings and arrays in Perl, JavaScript, and PHP

Advantage: flexibility (generic code)

Disadvantages: Inefficient, because all attributes are dynamic; loss of error detection

 

B. Names

Name is a string of characters used to identify some entity in a program.that is unique, means that there is only one existence of the name, and different each other. Variable names are the most common names in programs. Names are often referred as identifiers.

  1. Length
  • If too short, they cannot be connotative
  • In C++ no limit, but implementers often impose one
  1. Special Character
  • In C++, name can not start with any symbol or number, thus only able to use alphabet or “_” (underscore) symbol as the first word, and no “ “ (space) permitted, so instead of using space, underscore can be used as the exchange.
  1. Case Sensitivity

Disadvantage: readability (names that look alike are different), e.g. “A” is different with “a”, etc.

  • Names in the C-based languages are case sensitive

C. Special Words

Special words in programming languages are used to make programs more readable by naming actions to be performed.  They also are used to separate the syntactic entities of programs.

Keyword is a word of programming languages that is special only in certain context. This can still be used as an identifier or variable name, e.g. final, override, etc.

Reserved word is a special word of a programming language that cannot be used as a user-defined name, e.g. for, int, if, etc.

D. Bindings

A 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.

– Binding Time :

  • Language design time — bind operator symbols to operations
  • Language implementation time– bind floating point type to a representation
  • Compile time — bind a variable to a type in C or Java
  • Load time — bind a C or C++ static variable to a memory cell)
  • Runtime — bind a non static local variable to a memory cell

– Storage Bindings

  • Allocation – getting a cell from some pool of available cells
  • Deallocation – putting a cell back into the pool

 

 

 

E. Scopes

The scope of a variable is the range of statements over which it is visible. The local variables of a program unit are those that are declared in that unit. Local variables are only known in the unit and can not be used in different unit. The nonlocal variables of a program unit are those that are visible in the unit but not declared there. Global variables are a special category of nonlocal variables, where it is universally known by any unit and usually declared first before any scope or unit. The scope rules of a language determine how references to names are associated with variables.

Example :

#include <stdio.h>

int JumlahSiswa;                                  //Global Variable; known by the

                                                                      NamaSiswa and main unit. It is not

visible in those 2 units, but this

global variable is usable in those 2

units

void NamaSiswa()

Scope

{

char Nama[30];                                 //Local Variable; only known and usable

in this unit

getchar();

}

 

int main()

Scope

{

int NilaiSiswa;                                  //Local Variable; only known and usable

in this unit

getchar();

}

  1. Static Scope
  • Based on program text
  • To connect a name reference to a variable, you (or the compiler) must find the declaration
  • Search process: search declarations, first locally, then in increasingly larger enclosing scopes, until one is found for the given name
  • Enclosing static scopes (to a specific scope) are called its static ancestors; the nearest static ancestor is called a static parent
  • Some languages allow nested subprogram definitions, which create nested static scopes (e.g., Ada, JavaScript, Common LISP, Scheme, Fortran 2003+, F#, and Python)
  • Works well in many situations
  • Problems : In most cases, too much access is possible; as a program evolves, the initial structure is destroyed and local variables often become global, subprograms also gravitate toward become global, rather than nested

 

  1. Dynamic Scope
  • Based on calling sequences of program units, not their textual layout (temporal versus spatial)
  • References to variables are connected to declarations by searching back through the chain of subprogram calls that forced execution to this point

Example :

                

function big()                                                    // Static scoping

{                                                                          // Reference to x in sub2 is

to big’s x

function sub1()

var x = 7;

function sub2()                                           //Dynamic Scoping

{                                                                   //Reference to x in sub2 is to

                                                                           sub1‘s x

var y = x;

}

var x = 3;

}

               

  1. Global Scopes

C, C++, PHP, and Python support a program structure that consists of a sequence of function definitions in a file. These languages allow variable declarations to appear outside function definitions.

C and C++ have both declarations (just attributes) and definitions (attributes and storage). A declaration outside a function definition specifies that it is defined in another file.

 

 

 

 

 

 

 

 

 

 

Source(s) :

http://groups.engin.umd.umich.edu/CIS/course.des/cis400/maxim/lectures/chp4.htm

Slide Binus Maya

Laporan PLC Semester 1 Session 2 Syntax and Semantics

Screenshot (117)

Session 2: Describing Syntax and Semantics

 

A. Definition of Syntax

The word syntax comes from Ancient Greek: σύνταξις “coordination”, which consists of σύν syn, “together,” and τάξις táxis, “an ordering”.

In computer science, the syntax of a computer language is the set of grammatical rules that defines the combinations of words and symbols that are considered to be a correctly structured document or fragment in that language.

The syntax of a language defines its surface form. Text-based computer languages are based on sequences of characters, while visual programming languages are based on the spatial layout and connections between symbols (which may be textual or graphical). Documents that are syntactically invalid are said to have a syntax error.

B. Syntax in C++

The syntax of textual programming languages is usually defined using a combination of regular expressions (for lexical structure) and Backus-Naur Form (for grammatical structure) to inductively specify syntatic categories (nonterminals) and terminal symbols.

The following are the examples of basic C++ keywords syntax:

  1. #include, which is used to insert the library of functions we are going to use in our program. For example, #include <iostream>, which includes the standard input and output codes.
  2. int main(), which is called first by the program after the initialization. A statement return 0; should be written at the end of the codes inside int main(). Void main() is also a valid keyword syntax in C++ but without a return 0; at the end of the codes inside void main().
  3. cout, which is used to print output on the screen.
  4. cin, which is used to receive inputted data by user and store it as a variable.
  5. int, float, char, etc, which are used to declare a variable with a daya type.
  6. if, which is used in selection and will execute the codes if the condition is true.
  7. while, for, which are used in looping/repetition.

Important things to note:

  1. C++, the semicolon is a statement terminator. That is, each individual statement must be ended with a semicolon. It indicates the end of one logical entity.
  2. A block is a set of logically connected statements that are surrounded by opening and closing braces
  3. C++ is a case-sensitive programming language, as such, “cout” and “Cout” are different.
  4. in C++, to make a comment we use double slash (//) to mark text or code in a line as a comment. Or we can also use /* */ to mark several lines of text or code as a comment inbetween the /* */.

Example of a program with correct syntax in C++:

#include <iostream>               // Inserting library for input and output

using namespace std;
int main()                                 // Called first by the program after the

initialization

{                                               // Opening brace

int a,y,z;                                  // Declaring variable “a” as an integer data type

cout<<“Masukkan nilai a : “;      // Printing “Masukkan nilai a : “ on the

screen

cin>> a;                                   // Asking input from user and store it in

variable a
return 0;                                   // Because we use “int main()” we write  a

“return 0;”

}                                               // Closing brace

 

C. Definition of Semantic

Semantics (from Ancient Greek: σημαντικός sēmantikos, “significant”) is primarily the linguistic, and also philosophical study of meaning—in language, programming languages, formal logics, and semiotics. It focuses on the relationship between signifiers—like words, phrases, signs, and symbols—and what they stand for, their denotation.

In computer science, the term semantics refers to the meaning of languages, as opposed to their form (syntax). According to Euzenat, semantics “provides the rules for interpreting the syntax which do not provide the meaning directly but constrains the possible interpretations of what is declared.” In other words, semantics is about interpretation of an expression. Additionally, the term is applied to certain types of data structures specifically designed and used for representing information content.

D. Approaches of Semantics

There are many approaches to formal semantics; these belong to three major classes:

  • Denotational semantics, whereby each phrase in the language is interpreted as a denotation, i.e. a conceptual meaning that can be thought of abstractly. Such denotations are often mathematical objects inhabiting a mathematical space, but it is not a requirement that they should be so. As a practical necessity, denotations are described using some form of mathematical notation, which can in turn be formalized as a denotational metalanguage. For example, denotational semantics of functional languages often translate the language into domain theory.
  • Operational semantics, whereby the execution of the language is described directly (rather than by translation). Operational semantics loosely corresponds to interpretation, although again the “implementation language” of the interpreter is generally a mathematical formalism. Operational semantics may define an abstract machine (such as the SECD machine), and give meaning to phrases by describing the transitions they induce on states of the machine.
  • Axiomatic semantics, whereby one gives meaning to phrases by describing the logical axioms that apply to them. Axiomatic semantics makes no distinction between a phrase’s meaning and the logical formulas that describe it; its meaning is exactly what can be proven about it in some logic. The canonical example of axiomatic semantics is Hoare logic.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Source(s) :

https://en.wikipedia.org/wiki/Syntax_(programming_languages)#Example:_Lisp

https://www.tutorialspoint.com/cplusplus/cpp_basic_syntax.htm

https://en.wikipedia.org/wiki/Semantics_(computer_science)

www.letu.edu/people/stevearmstrong/…/chapter%202.ppt

Slide Binus Maya

Laporan PLC Semester 1 Session 1 Introduction

 

Screenshot (117)

 

 

Session 1: Introduction

 

A. Reasons for studying Concepts of Programming Languages

Increased ability to express ideas, Improved background for choosing appropriate languages, Increased ability to learn new languages, Better understanding of significance of implementation, Better use of languages that are already known, Overall advancement of computing.

B. Programming Domains

  • Scientific Computing

– mathematical modeling and engineering design applications

– the first application domain for computers and programming languages

– characterized by: floating point computations, array, matrix manipulations, need for efficiency (number crunching)

– languages: Fortran, ALGOL 60, parallel machine architectures and programming languages

 

  • Business Applications

– information processing and reporting applications

– characterized by: report generation facilities, decimal number manipulations ($), database interoperability, accessibility to nonprogrammers

– languages: COBOL, also affected design of Visual Basic and 4GLs (Delphi, PL/SQL)

 

  • Artificial Intelligence

– manipulating symbols instead of numbers

– characterized by: list (not array) processing, dynamic typing, self-modifying code, flexibility

– example applications: natural language processing, theorem proving, automated integration & differentiation

– languages: LISP (and other functional languages), Prolog

 

  • Systems Programming

– developing operating systems, compilers, database systems, …

– characterized by: emphasis on efficiency, ability to interface with hardware (low-level), few safety checks/restrictions

– languages: C (for implementing Unix), other specialized languages

  • Web Software

– write applications

– languages: C, C++, Java

C. Language Evaluation Criteria

  • Readability: the ease with which programs can be read and understood.
  • Writability: the ease with which a language can be used to create programs.
  • Reliability: conformance to specifications (i.e., performs to its specifications).
  • Cost: the ultimate total cost.

D. Influences on Language Design

  • Computer architecture: Von Neumann.
  • We use imperative languages, at least in part, because we use von Neumann machines.
    • Data and programs stored in same memory.
    • Memory is separate from CPU.
    • Instructions and data are piped from memory to CPU.
    • Basis for imperative languages
    •  Variables model memory cells.
    •  Assignment statements model piping.
    •  Iteration is efficient.

 

  • Fetch-execute-cycle (on a von Neumann architecture computer)

 

initialize the program counter

repeat forever 

fetch the instruction pointed by the counter  increment the counter  decode the instruction  execute the instruction

end repeat.

 

  • “von Neumann Bottleneck”Screenshot (112)

E. Language Categories

  • Imperative (e.g., C and Pascal)
    • A language which operates by a sequence of commands that change the value of data elements.
    • Central features are variables, assignments statements, and iteration.
    • Includes visual languages( Visual Basic.NET) and scripting languages (JavaScript, Perl and Ruby).
  • Functional (e.g., LISP and Scheme
    • A functional language is one that operates by use of higher-order functions, building operators that manipulate functions directly without even appearing to manipulate data.
    • Main means of making computations is by applying functions to given parameters.
  • Logic (e.g., Prolog)
    • Rule-based where rules are specified in no special order.
    • Language implementation decides the execution order that produces the desired result.
  • Object-oriented (e.g., SmallTalk, C++ and C#)
    • A language in which data and the functions which access it are treated as a unit.
    • Encapsulate data objects with processing.
    • Inheritance and dynamic type binding.
    • Grew out of imperative languages.

F. Implementation Methods

  • Compilation
    • Programs are translated into machine language; includes JIT systems.
    • Use: Large commercial applications.
    • Translate high-level program (source language) into machine code (machine language).
    • Slow translation, fast execution.
    • Compilation process has several phases:
    • lexical analysis: converts characters in the source program into lexical units.
    • syntax analysis: transforms lexical units into parse trees which represent the syntactic structure of program.
    • Semantics analysis: generate intermediate code.
    • code generation: machine code is generated.

The Compilation Process

Screenshot (113)

  • Pure Interpretation
    • Programs are interpreted by another program known as an interpreter.
    • Use: Small programs or when efficiency is not an issue.
    • No translation.
    • Easier implementation of programs (run-time errors can easily and immediately be displayed).
    • Slower execution (10 to 100 times slower than compiled programs).
    • Often requires more space.
    • Now rare for traditional high-level languages.
      • Significant comeback with some Web scripting languages (e.g., JavaScript, PHP).

Pure Interpretation Process

Screenshot (114)

  • Hybrid Implementation Systems
    • A compromise between compilers and pure interpreters.
    • Use: Small and medium systems when efficiency is not the first concern.
    • A compromise between compilers and pure interpreters
    • A high-level language program is translated to an intermediate language that allows easy interpretation
    • Faster than pure interpretation
    • Examples:
    • Perl programs are partially compiled to detect errors before interpretation
    • Initial implementations of Java were hybrid; the intermediate form, byte code, provides portability to any machine that has a byte code interpreter and a run-time system (together, these are called Java Virtual Machine)

Hybrid Implementation Process

Screenshot (115)

 

Layered View of Computer

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Source(s) :

users.dickinson.edu/~wahlst/356/ch1.pdf

https://prezi.com/nvowp–hkiu4/programming-domains/

http://zakarum.tistory.com/entry/Language-Design

http://zakarum.tistory.com/entry/Language-Categories

https://www8.cs.umu.se/kurser/5DV086/HT09/utdelat/PLC1.pdf

Slide Binus Maya

Artikel HTTP 2016

Perkenalkan nama saya Owen Prasetya Gunawan. Pada kesempatan ini, saya ingin berbagi cerita tentang pengalaman pada acara HIMTI yang bernama HTTP (HIMTI Togetherness and Top Performance), yang diselenggarakan pada tanggal 10 September 2016. Acara ini adalah acara khusus yang diperuntukkan bagi Binusian 2020 dan diselenggarakan di gedung BPPT II. Tepatnya, acara ini adalah acara temu keakraban para anggota HIMTI (Himpunan Mahasiswa Teknik Informatika), sekaligus pelantikan anggota HIMTI.

Sabtu pagi, pada tanggal 10 September 2016, kami menuju gedung BPPT II. Kami juga mendapatkan fasilitas berupa transportasi menuju gedung tersebut. Tersedia 2 shift, yaitu pukul 6.30 dan 7.45 pagi. Tetapi, nampaknya terjadi sedikit keterlambatan dari jadwal yang ditentukan, dan terjadi yang disebut dengan “molor”. Walaupun itu akan membantu bagi yang sedikit terlambat hehe …

Di sana, kami disuguhkan IT Showcase, semacam pameran hasil karya anak-anak Binus yang menarik dan bagus-bagus. Berbagai kreativitas dan keunikan karya-karya mereka dapat kita nikmati. Pokoknya keren-keren deh. Rangkaian acara pun dimulai, mulai dari sambutan Presiden HIMTI, perkenalan staf SoCS, hingga penampilan band dan penampilan lainnya yang tentunya rugi untuk dilewatkan, hahaha.

HTTP Showcase

IMG_20160910_093156_BURST7

Selain itu, ada juga talkshow yang diisi oleh Jaya Mahardika (BC GO ku), dan tamu-tamu yang telah berinovasi dan menciptakan karya hebat (kebetulan Binusian juga). Mendekati akhir acara, diisi oleh visualisasi yang dibawakan oleh aktivis HIMTI, yang merupakan penampilan yang lucu, menarik, dan ga membosankan. Setelah beragam rangkaian acara yang seru-seru tersebut, tibalah kita di akhir acara *jeng jeng* dan seorang DJ pun meramaikan suasana. Jujur saja, saya tidak terlalu suka yang semacam itu apalagi nari-nari atau joget-joget begitu hahahttp asal

IMG_20160910_164259

dan akhirnya acara pun berakhir ditutup oleh DJ tadi. Setelah itu, kami diberikan berbagai merchandise dan juga HIMTI Kit, yang berisi kebutuhan hidup seorang mahasiswa IT khusunya *eaa*. Alhasil, “kit” tersebut akan berguna bagi saya demi masa depan nanti (lol).

DJ-PERFORMANCE-225x300Acara-acara yang sangat seru dan berbagai penampilan yang sangat menarik, merupakan pengalaman berharga dan tak terlupakan. Mungkin itu saja yang bisa saya bagikan pada kesempatan kali ini , terima kasih telah mengunjungi blog saya. See you again fellas !

HIMTI, One Family, One Goal !!