

Ratscript
Ratscript is a brand new programming language with an original syntax designed to be visual and simple, without sacrificing functionality.
Let's explore some of Ratscript's syntax and innovations. (Subject to change.)
Visual.
Ratscript uses brief-yet-obvious keywords. For example,
a new variable can be defined with make
.
make foo as int = 123
make lang as string = "Ratscript"
Meanwhile, all loops are defined with the loop
keyword.
make count as int = 100
make sum as int = 0
loop while count > 0
: sum += count
: count--
end loop
All lines are simply terminated by a newline.
To continue on a new line, Ratscript takes a cue from
standard English and employs the ellipses (...
).
make foo = 5 + 5 + 10 + ...
10 + 10 + 2
Ratscript always allows the programmer to decide if they
want to pass it by reference ('foo
') or
value ('@foo
').
Mathematical.
Ratscript strives to follow as many conventions of written
algebra as possible in its syntax. In addition to obvious
and standard choices (like using parenthesis for function
calls), it borrows conventions like using the caret
(^
) symbol for exponents. For example,
2^3
would yield 8.
In addition to the make
keyword used for
declaring variables, Ratscript offers two other keywords.
'let
' is used to define a "throwaway" variable,
such as a loop iterator. These are always named with one
letter, and infer their type automatically.
let i = 0
loop for i++ from 0 to 100
: doThing()
end loop
'define
' defines a constant, in the same
way that 'make
' defines a variable.
define ANSWER as int = 42
Original.
Ratscript is our playground for exploring brand new innovations in programming paradigms and language features.
One such innovation is in how code blocks are handled. Instead of using symbols to enclose a block, or relying on indentation to define them, Ratscript uses a "subordination operator", while ignoring all whitespace surrounding it (thereby allowing optional indentation).
make missile as string = "whale"
if missile == "whale"
: print("Hello!")
: print("Who am I?")
: print("Why am I here?")
else if missile == "petunias"
: print("Oh no, not again.")
else
: print("Take evasive action!")
: if missile == "heat-seeking nuclear warhead"
:: infiniteImprobabilityDrive()
: else
:: driveErratically()
: end if
end if
This convention allows one to immediately determine how deeply nested a single line is. We'll be exploring other possible implications of this new convention.
For anyone concerned about the annoyance of typing a "subordination operator", we believe a Ratscript-supported IDE should be able to alleviate any inconvenience. After all, brackets and spaces were inconvenient once too!
FAQs: Ratscript
(Click a question to view the answer.)