Trinity is a dynamically-typed, object-oriented programming language. It is heavily influenced by aspects of Java and Ruby.
bin
- Batch/Shell scriptslib
- Trinity standard librarylogo
- PNG/SVG logos for Trinitysrc
- Java source code for the Trinity interpretertest
- Trinity utility code for use with the interpreter unit tests
- Basic object-oriented features like classes, methods, inheritance, etc.
- Method monkey-patching (overriding previously-defined methods)
- Inline procedures (i.e.
X.y { |z| ... }
) - Global variables (like
$ARGV
for command-line arguments) - Weak, dynamic typing system
- Automatic numeric type conversion/overflow (see Numeric Automation)
- An interactive shell (
trinity -ish
)
Before you start using Trinity you need to download the Trinity interpreter. This can be done by either downloading the most recent release or by downloading the source code. For the purposes of this tutorial, we will be building the interpreter from the source code. Once you have the source code downloaded and extracted, open the terminal inside the directory you just extracted the source into and type:
./gradlew build
This should build the trinity.jar
inside of a bin/
folder. To make life easier down the road, consider adding that bin/
folder to your PATH
environment variable.
The fastest way to begin using Trinity is through its interactive shell. From the terminal you can type the following to launch the interactive shell (assuming you added the bin
directory to your PATH
):
trinity -ish
Another way to use Trinity is through its source files, which carry the extension .ty
. Files do not have any enforced naming requirements, so it does not matter what you call the file. To use it, pass the file path and any command-line arguments to the trinity
command:
trinity HelloWorld.ty arg1 arg2 ...
Follow Trinity's development plans on Trello.
Copyright ©2017 Christopher Lutz. See LICENSE for further details.