WEBVTT

00:00:00.700 --> 00:00:07.909
By the end of this lesson, you will have a small HHY program saved on your computer and running from the

00:00:07.909 --> 00:00:08.252
terminal.

00:00:08.402 --> 00:00:16.402
We will install the command, check which version we are using, create a dot hhy file, and run it twice.

00:00:16.552 --> 00:00:20.584
The goal is a repeatable starting point for every later lesson.

00:00:20.734 --> 00:00:26.686
Keep the terminal open beside your editor so each small change gets immediate feedback.

00:00:28.840 --> 00:00:37.915
The documented installer supports Apple silicon macOS, Linux on sixty four bit Intel or AMD, and Linux on

00:00:37.915 --> 00:00:38.419
arm.

00:00:38.569 --> 00:00:43.731
Use the installation section of the manual if your machine needs another route.

00:00:43.881 --> 00:00:51.220
These commands are shell commands, so enter them in a terminal, not inside the HHY source file.

00:00:51.370 --> 00:00:53.994
You need network access for the download.

00:00:54.144 --> 00:00:59.733
The default install uses your own home directory and does not require sudo.

00:01:01.880 --> 00:01:06.637
Download the official installer and run it with the course version selected.

00:01:06.787 --> 00:01:11.758
Saving the installer first also lets you inspect it before execution.

00:01:11.908 --> 00:01:19.033
The version variable here applies to the installer command; it keeps this course on one known baseline.

00:01:19.183 --> 00:01:26.299
The installer detects the platform, downloads the release and its checksum, and verifies the archive

00:01:26.299 --> 00:01:27.247
before installing.

00:01:27.397 --> 00:01:31.579
Wait for it to finish successfully before moving to the next command.

00:01:33.730 --> 00:01:40.642
Add the default command directory to this terminal session, then ask the shell where it finds hhy.

00:01:40.792 --> 00:01:42.477
Finally, print the version.

00:01:42.627 --> 00:01:46.873
For these examples the target is one point seven point zero.

00:01:47.023 --> 00:01:51.695
If a different installation appears first, the path check helps you notice it.

00:01:51.845 --> 00:01:54.341
The export lasts for this shell session.

00:01:54.491 --> 00:02:00.443
To keep it for future terminals, add that export to the startup file appropriate to your shell.

00:02:02.590 --> 00:02:05.811
Create a small folder and open it in your editor.

00:02:05.961 --> 00:02:11.615
Save the two line program as hello dot hhy, using a plain text file.

00:02:11.765 --> 00:02:16.927
The extension matters because it helps you and the tooling recognize the source.

00:02:17.077 --> 00:02:23.307
An editor integration is helpful for highlighting, but the command line is enough for this lesson.

00:02:23.457 --> 00:02:29.985
Keep source code in the file and shell commands in the terminal; they are different inputs with different

00:02:29.985 --> 00:02:30.347
jobs.

00:02:32.500 --> 00:02:37.385
The first line creates a binding named language and gives it a string value.

00:02:37.535 --> 00:02:39.157
The second calls print.

00:02:39.307 --> 00:02:42.379
The plus signs join strings into one message.

00:02:42.529 --> 00:02:49.633
We use explicit concatenation in these examples so the result is reproducible on the tested runtime.

00:02:49.783 --> 00:02:52.940
There is no need to memorize every detail yet.

00:02:53.090 --> 00:03:00.063
For now, identify the name, the quoted text, and the function that sends the completed message to the

00:03:00.063 --> 00:03:00.450
terminal.

00:03:02.600 --> 00:03:05.224
Save the file before running these commands.

00:03:05.374 --> 00:03:12.905
Check asks HHY to validate syntax and core semantics; execution actually runs the program.

00:03:13.055 --> 00:03:20.148
A successful check is useful, but it does not prove that every future file read or network request will

00:03:20.148 --> 00:03:20.521
work.

00:03:20.671 --> 00:03:23.103
Here our program only prints text.

00:03:23.253 --> 00:03:27.413
You should see Hello, HHY, with an exclamation mark.

00:03:27.563 --> 00:03:33.622
The run subcommand is another spelling: hhy run followed by the same file name.

00:03:35.770 --> 00:03:40.634
If the shell says command not found, investigate the command path first.

00:03:40.784 --> 00:03:44.731
That error happens before HHY reads your program.

00:03:44.881 --> 00:03:54.225
If HHY cannot find hello dot hhy, check the current directory with pwd and list the files with ls.

00:03:54.375 --> 00:03:59.452
A file called hello dot hhy dot txt is a different name.

00:03:59.602 --> 00:04:05.042
Separating shell problems from program problems will save time throughout the course.

00:04:05.192 --> 00:04:09.224
Correct one thing, then repeat the smallest relevant command.

00:04:11.370 --> 00:04:15.551
For the exercise, change the greeting and add a second print call.

00:04:15.701 --> 00:04:19.093
Save, run, and compare the output with your prediction.

00:04:19.243 --> 00:04:26.229
Then close and reopen the terminal and make sure hhy is still discoverable; if needed, finish the

00:04:26.229 --> 00:04:28.694
persistent path setup for your shell.

00:04:28.844 --> 00:04:34.583
The downloadable example contains the original program and its expected output.

00:04:34.733 --> 00:04:41.538
Next we will use bindings, values, and collections to represent something more useful than a greeting.

