Hello World in Ellex
Hello World in Ellex
Section titled “Hello World in Ellex”This is one of the simplest programs you can write in Ellex. It uses a natural language command to output a greeting to the screen.
Code Example
Section titled “Code Example”Below is the Ellex code to display “Hello, World!”:
tell "Hello, World!"
Explanation
Section titled “Explanation”tell
is an Ellex command that outputs text to the screen."Hello, World!"
is the text string that will be displayed.
When you run this code in the Ellex REPL, it will print “Hello, World!” exactly as shown. This example demonstrates how Ellex uses intuitive commands that mimic everyday language, making it easy for beginners to start coding.
Try It Yourself
Section titled “Try It Yourself”- Start the Ellex REPL by running
make dev
orcargo run --bin ellex_cli repl
in your terminal. - Type the code above into the REPL and press Enter.
- Watch as Ellex outputs “Hello, World!” to the screen.
This is just the beginning! You can modify the text inside the quotes to say anything you’d like. Try changing it to greet someone by name, like tell "Hello, Alice!"
.