Rust: “Hello world!”

Rust is a multi-paradigm, applications and systems programming language. It has yet to reach 1.0 but senior C++ developers are predicting it will supersede C++ in the future.

First, download Rust from its website. Then extract the tarball, run the install script and clean up.

$ tar -xf rust-nightly-i686-unknown-linux-gnu.tar.gz && sudo rust-nightly-i686-unknown-linux-gnu/ && rm -r rust-nightly-i686-unknown-linux-gnu/ && rm rust-nightly-i686-unknown-linux-gnu.tar.gz

Now create a Hello World! project using Rust’s package manager Cargo:

$ cargo new hello_world --bin

Take a look around in the hello_world directory. You’ll find a manifest file and a source directory. The source directory has, the generated Hello World! program.

fn main() {
    println!("Hello, world!");

Compile and run our Hello World! program from the hello_world directory:

$ cargo run

A similar program in C++ looks like this:

#include <iostream>

int main(void) {
	std::cout << "Hello, world!" << std::endl;
	return 0;

Like most Hello world! programs these are trivially different in their result. The main difference is that the main method in the Rust program is a void method while it returns an int in the C++ program. This difference could change the behavior of a non-trivial program, but for Hello world! it has no effect.


PDT For Eclipse Install Error

I am installing the PHP Development Toolkit for Eclipse (PDT) and received this error:

"Cannot complete the install because one or more required items could not be found.
Software being installed: PHP Development Tools (PDT) Mylyn Integration (
Missing requirement: PHP Development Tools (PDT) Mylyn Integration ( requires ' 0.0.0' but it could not be found"

The error is due to my Eclipse installation missing 0.0.0, obviously. The gotcha is that it should be readily available from one of the update sites listed in the Install New Software dialog, however, it is not. To fix this error, add to your update sites and retry the install.