Language Info

Quby is based on Ruby, but also contains influences from JavaScript. Keywords, variables, functions, fields and class names are all case insensitive, so 'foo' and 'FOO' mean the same.


It is a dynamic language, where variables can hold any value, and change it's contents at any time.

// a is now declared, and it is holding a number
a = 5

// now a is holding a string
a = "blah"

Pure Object-Oriented

Like Ruby, everything in Quby is an object and all objects have methods. This includes Numbers, Strings, Booleans and Arrays. One exception is null, which is still a primitive type (for performance reasons). Why? This leads to more consistent code because you can call a method on anything. It is also more readable, for example converting an angle to degrees is just...

degrees = radians.toDegrees()

All of the other math functions also live in the Number class rather than in a static Math class (which most languages do)...

num = 30
num2 = 50
num3 = 40

highest = num.max( num2 ).max( num3 )

Static Analysis

Bugs are annoying, and lots of bugs in dynamic languages come from typos. So Quby is a lot more strict then Ruby about what you can do, and code is also checked for a number of static errors at compile time.

Unlike Ruby, the following are considered to be compile time errors:

Why? This won't catch them all, but it's aimed to help to catch most of the bugs caused by typos at compile time (a mispelt variable, function or method).

Even if the code containing the typo is not reached then they will still result in a compile time error. On the plus side you can declare classes and functions after they have been used.

See also