0% found this document useful (0 votes)
606 views3 pages

Algol

The document discusses and compares three programming languages: ALGOL, Clojure, and Swift. It provides information on the costs associated with different languages, as well as advantages and disadvantages for each one. Sample code is also given to print "Hello World" in each language.

Uploaded by

Taniya Faisal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
606 views3 pages

Algol

The document discusses and compares three programming languages: ALGOL, Clojure, and Swift. It provides information on the costs associated with different languages, as well as advantages and disadvantages for each one. Sample code is also given to print "Hello World" in each language.

Uploaded by

Taniya Faisal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Cost:

Different program languages cost differently to develop depending on cost of IDE, developer licenses,
staff that have been hired, etc.
All three of these are languages are free to develop but may have costs when you are developing.
For example, when developing for iOS you need have Mac for developing apps.

ALGOL -

Advantages:

 It encourages the production of well structured programs over preceding languages such as
FORTRAN and COBOL.
 It led to to the invention of a new metalanguage based on notation which is known as the Backus
Normal Form or Backus Naur Form(BNF)
 It gave rise to many other programming languages,
including CPL, Simula, BCPL, B, Pascal and C.
 It was also the first language implementing nested function definitions with lexical scope.

Disadvantages:

 Since ALGOL 60 had no I/O facilities, there is no portable hello world program.
 Its use in commercial applications was hindered by the absence of standard input/output
facilities in its description
 The Call-by-value or call-by-name removed need for distinction between input and output
parameters
 Absence of elements like flexible arrays, slices, parallelism, operator identification

Sample code:

Program to print Hello world 3 times :

'BEGIN'
'COMMENT' Hello World program for ALGOL 60;
'INTEGER' I;
'FOR' I := 1 'STEP' 1 'UNTIL' 3 'DO'
'BEGIN'
OUTSTRING(1, '('Hello, world!')');
SYSACT(1, 14, 1);
'END'
'END'

Clojure -

Advantages :

 All the benefits of functional programming, without the purity straitjacket


 Allows dynamic, compact code with late binding, macros, multimethods
 Can code functions to sequence abstraction instead of to specific data structures
 Runs on the JVM: portability and fast garbage collection

Disadvantges:

 Not suitable in cases where you want static typing


 Does not have a fast startup time
 Primitive Types are Still Java Primitives
 Because Clojure is an interpreted language built above another runtime, a crashing Clojure
program will necessarily spill a (very large) Java stack trace.

Sample code:
Program to print Hello world:

(ns clojure.examples.hello
(:gen-class))

;; This program displays Hello World


(defn Example []
(println "Hello World"))
(Example)
Swift -

Advantages:

 Improved safety and performance


 Decreased memory footprint
 Interoperability with Objective-C
 Automatic memory management

Disadvantges:

 Poor interoperability with third-party tools and IDEs


 Lack of support for earlier iOS versions
 Limited talent pool

Sample code:
Program to print hello world:
import Swift
/* My first program in Swift 4 */
var myString = "Hello, World!"
print(myString)

You might also like