Skip to main content

Basics

Hello, World

Now that you have installed Dark Elixir, it's time to write your first Dark Elixir program. We'll start by printing a basic and traditional Hello World

Creating the Script File

All the Dark Elixir files should end with .dx suffix. It doesn't matter where you create the file as long as you can navigate to the respective file

Here Let's say test.dx

Now type in

print("Hello World")

print() is the output function in Dark Elixir which is used to print text on the console. It takes in one argument and prints it on the console

Run the program

To run the program, first save the file and open the terminal and navigate to the directory where the test.dx file is located. And in that type

dex test.dx

This will run the script and print the text "Hello World" on the screen.