This guide gets you up and running with your very first TechScript program.
Make sure you have installed the TechScript compiler and VM on your machine. If not, follow the Installation Guide.
Validate your installation:
tech versionThis should output the current version of the language (e.g., TechScript v2.0.0).
- Create a new text file named
hello.txs. - Open it in your favorite text editor (or TechScript Studio IDE) and add the following line:
say "Hello, World!" - Run the file using the CLI tool:
You should see the output:
tech run hello.txs
Hello, World!
Let's write a slightly more complex program that accepts user input, computes a value, and uses conditions:
# Ask user for their name
name = ask "What is your name? "
say $"Welcome, {name}!"
# Prompt for age
age_input = ask "How old are you? "
age = math.parse_int(age_input)
# Logic checks
when age >= 18
say "You are eligible to vote."
else
years_left = 18 - age
say $"Come back in {years_left} years!"
end
Run this script:
tech run age_check.txs- Check out the full Syntax Guide.
- Learn how to compile scripts to bytecode using CLI docs.