Programming
What languages are available?
What is the C++ compiler?
How do I compile a C++ program?
How do I debug my program?
What versions of Java are available?
Where is perl located?
What Integrated Developement Environments are available?
What editors are available?
What languages are available?
This is a partial list of programming languages that are available in the Linux Lab:
| C | C++ | Tcl/Tk |
| Java | Perl | Python |
| Bourne, Bash Shells | Fortran | Mathematica |
- C was developed in the early 1970s as a system implementation language for Unix operating system. It is derived from BCPL language. C is a procedural language.
- Java was developed by Sun Microsystems and released in 1995. Java derives much of its syntax from C and C++ but has a simpler object model and fewer low-level functions. Java applications are compiled into bytecode and run within the Java Virtual Machine so that the same code can be run on many platforms.
- C++ was developed by Bjarne Stroustrup in 1983. C and Simula67 were the main source of inspirations for C++. It is object-oriented language and can be effectively used in a wide variety of applications.
- Perl is an interpreted language created by Larry Wall in 1987. It is a part of Open Source GNU project and is free for download. By the way, Perl is listed in the Oxford English Dictionary!
- Python is an interpreted, interactive, object-oriented language. Software is free for download.
- shell is a program that acts as the interface between user and the operating system. Bourne shell is the original early version Unix shell. Bash is the Linux default shell. Bash is a part of GNU project.
- Fortran stands for FORmula TRANslator system. Its primary application is numerical computations.
- Tcl/Tk were created and developed by John Ousterhout. Tcl (or Tool Command Language) is a scripting language. Tk (or Tool Kit) is a graphics library.
- Mathematica is a program originally concieved by Stephen Wolfram, first released in 1988. It supports many mathematical tasks including symbolic or numerical calculations, arbitrary precision arithmetic, data processing, and plotting. It offers a functional/procedural programming language.
What is the C and C++ compiler?
The Gnu Compiler Collection (GCC) is our compiler.
- gcc is the command name for compiling C programs.
- g++ is the command name for compiling C++ programs.
How do I compile a C++ program?
Save your program with .cpp, .cc or, .cxx extension.
On the command line type:
g++ -o program program.cpp
In the above example I use gcc complier to compile a program named
program.cpp. Option -o will create an executable object file program.
For additional options with gcc take a look at manual pages:
man gcc
How do I debug my program?
There are many different ways you can debug your programs. The simpliest (actually, the hardest) way is to read error messages and examine code lines that they point to (localization). To generate all the warnings that the GCC compiler produces specify -Wall (stands for Warnings all) option.
It is often a good idea to reread your program when it dosn`t run as expected (code inspection). Also try adding some code (instrumentation) around the block that you suspect may be buggy (like sending output to the screen). However, there is a very useful GNU gdb debuger available on Linux. For a complete list of options refer to manual pages:
man gdb
What versions of Java are available?
Sun Java 6 version 1.6.0_04-b12 is the version in the Linux lab.
Where is perl located?
The perl executable, which is used for executing perl programs, is found at
/usr/bin/perl
What Integrated Development Environments are available?
There are multiple IDEs installed on Linux. Two commonly used IDE's are Anjuta and Eclipse.Both packages are Open Source software. Eclipse was developed by IBM and is mostly used for developing projects in high-level languages. Anjuta can be used for developing projects of various scales, as well as an environment to code, compile and execute programs in C, C++, Java, Perl, and some other languages. If you are used to doing your home work using a virtual terminal and want to try a new environment, I would recomend starting with Anjuta.
Here are some of the positive sides of this IDE:
- Anjuta will create a Projects directory in your home directory where it will put all the configuration, header and source files for your new project.
- When going through a create project wizard, you have an option to specify what kind of application you want it to be. If you want it to have the 'feel' and 'look' of a console, it will let you create an application that does that.
- Creating new projects or files is easy with Anjuta. This application will automatically add the required extention to your files; it will give you the freedom to specify file location and name. There is an automatic main.c file created for any new project. It will contain comments, some basic statements and commands. Your code is nicely indented and logically highlighted.
- You do not have to 'search' for what and how to do with this application. Compile, Build and Execute buttons are under one category. If you made a mistake in your code and try to compile it, aside from underlining the lines that have bugs, it will provide you with useful hints on what may be wrong.
- Other IDE's such as Code::Blocks are also available at the Linux labs.
The most comprehensive way to adapt to a new development environment is to
read the tutorial for it and try out some simple examples.
What editors are available?
In the Linux lab you can use the GNU emacs, vi, joe, nano, gedit, and kate editors.
- emacs is a GNU text editor and environment. It has content sensitive modes for a variety of file types. It is an extensible (means you can add your own features) editor. In our Linux lab GNU Emacs 21.4.1 version is available.
- vi is a screen-based editor available on Unix and Linux. It is a powerful editor for programming tasks. In the Linux lab VIM (Vi Improved) version 6.2.98 is available.
- joe is ASCII-text screen editor. It has a "mode-less" user interface and is very easy to use for beginners. joe is a free software and is freely distributed under GNU Genearl Public License.
- pico is a really simple and easy to use file editor used on UNIX systems. It comes with pine, where it is used by default to compose new messages, but it can also be used as a stand-alone editor. It is invoked by the command
pico filename
- nano is similar to pico, but is a stand-alone editor. It was designed to emulate pico as closely as possible, without being tied in to pine.
- gedit is a simple and customizable editor that comes with and is the official editor of the GNOME Desktop Environment. It features configurable syntax highlighting, auto indentation, bracket matching, and more.
- kate is an advanced editor that comes with the KDE Desktop. It has similar features to gedit, with infinite undo/redo, code folding, code auto-completion, an integrated command line, and regular expression based find & replace.
