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.)
Ratscript uses brief-yet-obvious keywords. For example,
a new variable can be defined with
make foo as int = 123
make lang as string = "Ratscript"
Meanwhile, all loops are defined with the
make count as int = 100
make sum as int = 0
loop while count > 0
: sum += count
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 ('
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
define' defines a constant, in the same
way that '
make' defines a variable.
define ANSWER as int = 42
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("Who am I?")
: print("Why am I here?")
else if missile == "petunias"
: print("Oh no, not again.")
: print("Take evasive action!")
: if missile == "heat-seeking nuclear warhead"
: 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!
(Click a question to view the answer.)
Compiled or interpreted?
Ratscript will most likely be interpreted.
Statically or dynamically typed?
We haven't decided for certain yet, but we're learning towards static typing.
What paradigms will this language support?
Initially, Ratscript will support procedural and object-oriented programming. In later versions, we plan to support generic and functional programming, as well as a brand new paradigm we'll be developing.
What is Ratscript's license?
Ratscript is licensed under the BSD-3-Clause license, allowing you to use it freely in any project.
When will Ratscript be ready?
Ratscript is in active development. It is presently a high priority task, as we will need it for Trailcrest and Anari.
Can I help with development?
We'd love your help! Check out our Developers page for details on how you can get involved.