Department of Engineering

IT Services

The Other Languages

  • "A bad workman always blames his tools"
  • "If the only tool you have is a hammer, then everything looks like a nail"

Introduction

COs - we evaluate new languages and put useful ones on the teaching system. Not necessarily experts! I'm going to use C++ as a reference language - something to compare the other languages against.

I think I take the following factors into account when deciding whether to invest time in a new language

  • Is it easy to learn? C++ hard? "If the only tool you have is C++, then everything looks like your thumb"
  • Has it a future? - All of these have. Hype?
  • Will it save me time? - "java 10x faster to write than C++".
  • Will it make my programs better?

For each of the languages I'm going to

  • briefly describe the language, contrasting it with the others on show, highlighting strong/weak points
  • mention factors that went into language design
  • show examples of code and/or applications
  • show some online advocacy/case-history/tutorial/reference resources
  • suggest what the language might best be used for
  • say what support we have locally

The issue of how successfully these languages can be used to teach programming isn't my real concern today. See my Teaching Languages page if you're interested.

It's worth mentioning 2 language issues before we proceed further

Object-orientated programming

A useful collection of Object-orientated programming introductions and resources is online.

Some often-mentioned advantages of object-oriented programming are: faster development, increased quality, easier maintenance, understandability and enhanced modifiability. (Encapsulation, overloading and modularity enforce program understandability. Implementation details are hidden and interfaces provide precise and detailed instructions for the use of objects.) Furthermore, an object-oriented approach is in many cases more natural and appeals more to human cognition than other methodologies. Indeed, concepts of objects, object hierarchies, and so on are often closer to real world concepts than many "traditional" programming constructs are.

Some important object-oriented concepts are

  • Objects and messages
  • Encapsulation - hiding all details of an object that do not contribute to its essential characteristics
  • Code reuse - Inheritance, Polymorphism

Some O-O languages are more O-O than others. C++ has all the above features and is heavily used by industry, but it also has all the features of non O-O C! Is has only recently been standardised.

Interpreted Languages

The C++ compiler provides type-safety and catches many bugs at compile time instead of run time (a critical consideration for many commercial applications). However, there are many tasks for which something like C++ is overkill. That's where interpreted language become useful. In an interpreted language the source code (often called scripts) isn't compiled before use, it's (sort of) compiled line-by-line as needed. This makes the edit-test cycle faster, providing a good environment for prototypes. Such languages are also used

  • By system administrators to perform routine tasks (the Teaching System has many shell and perl scripts)
  • As a sort of "glue" to integrate bigger programs (the traditional Unix shell scripts and DOS bat files do this), or to integrate the WWW with databases.

Interpreted languages (Python, Tcl, and Visual Basic for example) are usually slower than compiled languages, but can still be sophisticated. See Ousterhout's article on the future of Scripting languages

Fortran 90

F90 - Tutorials at http://www.liv.ac.uk/HPC/F90page.html. Book in CUED library.

Tcl/Tk

TCL/TK is a programming system developed by John Ousterhout at the University of California, Berkeley, which is easy to use, and which has very useful graphical interface facilities. TCL is the basic programming language, while TK is a ToolKit of widgets. Unlike many of the other toolkits, it is not necessary to use C or C++ in order to manipulate the widgets, and useful applications can be built very rapidly once some expertise of the TCL/TK system has been gained.

Some users will naturally wish to use the widgets with C or C++. The TCL/TK system can be configured to work co-operatively with other programming languages such as C or C++.

The TCL language is normally interpreted, so TCL applications will normally not run as fast as equivalent C programs. Where speed of processing is essential, use can be made of a TCL compiler, or processing can be carried out in a compiled language, such as C or C++, and the user interface written in TCL.

There are versions of TCL for different hardware systems, and for different operating systems, so TCL is to a large extent portable.

For information see our Tcl/Tk section.

Show examples. "cd /export/Examples/tk; wish widget". survey. whinge

I didn't find it hard - like shell scripts + X/Motif. Disadvantages? - Lots of releases and add-ons, including a net version. No data structures except for arrays. Good for - GUI Prototypes. Like Java, integrated graphics and across-network.

Book in CUED library

Python

Python (named after Monty Python's Flying Circus) "is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes." It has interfaces to many system calls and libraries, as well as to various window systems, and is extensible in C or C++. It's portable: it runs on many brands of UNIX, on the Mac, and on PCs under MS-DOS, Windows, Windows NT, and OS/2.

It has the basic text manipulation routines of perl, but you can also use it as a graphical user interface development aide. It can also be used as a "glue" or "steering" language that helps make heterogeneous collections of unrelated software packages work together.

It's used in commercial products - The Melbourne Cricket Ground in Australia (a 100,000+ person venue) has its scoreboard system written largely in Python on MS Windows.

See our Python page for details and tutorials.

Java

Java(tm) is from Sun. Of all the languages here, it's the most hyped, riding on the back of WWW popularity. It has its own advocacy newsgroup. It was designed to be a "simple, object-orientated, distributed, interpreted, robust, secure, architecture neutral, portable, high-performance, multithreaded, and dynamic language".

See our Java page for details. Computer Services have a self-teach Java Course too.

Show molecule example : cd /export/java/demo/MoleculeViewer; /opt/java1.3/bin/appletviewer example3.html and /opt/java1.3/bin/appletviewer /export/java/demo/GraphLayout/example1.html

Unlike C++ it's not hampered by the legacy of an older language. Java2.1, Java3D. Disadvantages? - New. Speed? (JIT). No typedefs? No operator overloading.


Updated on 15th Feb, 2001