Professional Documents
Culture Documents
2) Language Overview
Overview
Compilers are currently working on Linux, BSD and Mac OS X, and a Windows compiler is nearing completion.
Interpreters are available for Linux and BSD, with OS X / Windows going into development shortly.
This is a partial, basic overview at the Cloud programming language, which is still actively in
development. For more information, refer to the online documentation at http://cloud9nine.net. This
document expects the reader to be proficient in either C# or Java as well as PHP or Perl, and as such, gives
only example code, without explanation.
If you’re proficient in C# or Java, writing clientside Cloud should be exceedingly easy, as it’s structured
very similarly, with some much-needed missing functionality added – though it’s condensed like a more
modern scripting language.
Cloud on the web is very much like PHP or Perl – it can be written in a procedural or object oriented
format, or Cloud-style, as it can be clientside.
Cloud is programmable both procedurally and like standard object-oriented code, but also maintains a
custom structuring method, simply named Cloud Structure. Cloud Structure can best be defined as a
combination or half-way point of Procedural and Object Oriented – its use will become apparent throughout
the documentation.
Basic Language Overview
Hello World
<<cloud interpreted>>
print “Hello, World!”;
<<cloud end>>
Basic Syntax
// This is a comment in Cloud.
// Variables can be assigned a hard type or left as a dynamic/typeless block.
$a = 1; declare $b;
//Create dynamic variable a and assign it to 1 and initialize dynamic variable B
double a = 1.0; long b;
//Create static type variables – these must be initialized like in C# or Java
Arrays
array foo = $array(1, “hello”, math.pi);
intarray foo = array(1, 2, 3); or array foo = intarray(1, 2, 3);
foreach(bob as a)
{
print a;
}
Working with Classes and Orientation
Classes in Cloud are independent of their file name.
<<cloud compiled>>
public class cloudTest() {
public dynamic doStuff() {
print “Hello there!”;
}
}
include(someotherclass.cloud);
$a = 1;
// some code out of scope, which works fine as procedural
The absolute basics of Cloud have been covered. This isn’t the documentation, so let’s get right into some
code examples!
Cloud Example Code
Simple web script to query a PostgreSQL database for posts and display them nicely
<<cloud interpreted>>
import cloud.web;
import cloud.db.sql.postgre;
runtime.walkthrough.linebyline(true, “ “, “<br>”);
sql = sql.postgre;
sql.connect(localhost, dbname, dbuser, dbpass);
sql.query(“SELECT * FROM posts”), sql.format.array, => $result;
foreach($result as $a) {
$output += “<b>” + $a.mytable.posttitle + “</b><br>” + $a.mytable.postcontent + “<br>”;
}
print web.htmlformat($output);
<<cloud end>>
<<cloud compiled>>
import cloud.gtk;
import cloud.opengl;
import cloud.easydrawing;
gtkwindow.autocomplete;
gtkwindow.draw;