Your first Hydrogen project
Welcome! In this guide you will run your first Hydrogen program. You don’t need to know everything about programming to start.
1. Install Hydrogen
Section titled “1. Install Hydrogen”Follow the installation guide for your platform. The published compiler’s documented native executable workflow is for Linux x86-64.
Open a terminal and confirm the hy command is available:
hy --help2. Download your first example
Section titled “2. Download your first example”Download hello.hy and save the file in a new folder. You can open it with a text editor.
Here is what the program looks like:
public class Program { public static int Main(string[] args) { System.Console.WriteLine("Hello, Hydrogen!"); return 0; }}The Main method is where your program begins. WriteLine prints a message to your terminal. return 0 tells your computer that everything finished successfully.
3. Compile and run it
Section titled “3. Compile and run it”Open a terminal in the same folder as hello.hy:
hy check hello.hyhy compile hello.hy -o hellochmod +x hello./helloYou should see:
Hello, Hydrogen!4. Make it yours
Section titled “4. Make it yours”Change the text between the quotation marks, then compile and run the program again. Try printing a different message!
When you’re ready, download another sample or learn about variables and types. Have fun experimenting.