Hello everyone, this is BinaryBang.
Preface
There's a saying "what exists is reasonable." The stable version 1.0.0 of Cangjie language has been released. I won't comment on what the future holds for Cangjie, but Cangjie is a young language, perfect for young people to learn.
So starting today, I plan to teach a programming beginner course using Cangjie language, consisting of 15 lessons in total.
Course Introduction
Language Used
Cangjie Programming Language, version 1.0.0
Target Audience
Complete beginners with no programming experience.
Those who have experience with other programming languages but want to learn Cangjie.
Development Tools
VSCode
Operating System
Windows
What is Programming
Since we're learning programming, what exactly is programming?
We know that cooking is the process of transforming vegetables, meat, eggs, ginger, garlic and other ingredients into dishes.
Cooking is according to the recipe, transforming ingredients into dishes.Ingredients is the initial state, dishes is the final state, and recipe is the method of transformation. We express this as: Final State = Transformation Method(Initial State)
That is: Dishes = Recipe(Ingredients)
Similarly, programming works the same way. The ingredients in programming are input data, the recipe is algorithm, and the result is various forms of output data.
That is: Output Data = Algorithm(Input Data)
Programming is the process of transforming input data into output data according to an algorithm.
Setting Up Development Environment
Cooking requires a kitchen environment with all necessary tools. Similarly, programming requires a development environment with all necessary tools.
To do this, we need to prepare two main things: SDK and IDE.
Setting Up SDK
First, what is an SDK?
Let's use cooking as an example again.
We need a set of cookware, including pots, bowls, and knives.
We need some seasonings, like oil, salt, and pepper.
Similarly, programming based on a language also requires a supporting infrastructure, which is the SDK for that language environment
Download
Click here to go to the download page: Cangjie SDK Download Address
Click the download button next to cangjie-sdk-windows-x64-1.0.0.zip
First, put the downloaded zip file in a designated directory, for example:D:\00-Programming\01-CjSdk\01-Source.
The download is complete.

Installing the SDK
Find the downloaded zip file and right-click to select Extract/Extract to cangjie-sdk-windows-x64-1.0.00.zip:

This gives us the extracted SDK.

After extracting the SDK, you can delete the original zip file and keep only the extracted directory.

The installation is complete. Now let's configure it.
Configuring the SDK
What is configuring the SDK?
Earlier we said that SDK provides the infrastructure for development. We now know where this infrastructure is located, but the computer system doesn't.
Configuring the SDK means telling the computer where the SDK is located.
- Open
My Computerproperties
Find the My Computer icon on your desktop.

Right-click the properties button.

- Open Advanced System Settings.

- In the popup panel, select
Environment Variables.

- Understanding Environment Variables

The box below will display a list showing the current system's environment variables.
Environment variables are like an address book, used to represent where tools are stored.
For example, in daily life, we set a delivery address, like Cainiao Station, at xx Province, xx City, xx District, xx Street, xx Number. So if I say I sent you a gift addressed to Cainiao Station, you immediately know where to find it.
Now, we need to create an address entry for the Cangjie SDK.
- Create CANGJIE_HOME Environment Variable
- Click
New.

- Set the variable name
Enter the variable name CANGJIE_HOME in New System Variable. This represents the home directory of the Cangjie SDK. This name cannot be changed and must be exactly this.

The variable value is the specific location of the Cangjie SDK.
Remember the path we saved earlier? Let's find it.

Double-click to go one level in.

Double-click again.

We find a bin directory inside. Don't navigate away, click the blank area of the path bar above.

Now we see the full path of this directory. Copy this path, go back to the new variable window, and paste it.

Click OK, and the CANGJIE_HOME variable is created.

- Add CANGJIE_HOME to the Path Environment Variable
What is the Path environment variable?
When the system looks for something, it only searches in the Path address book. So we need to add CANGJIE_HOME to the Path directory.
Select the Path variable and click Edit.

In the popup, click New.

An input box appears at the bottom.

Enter the first path:
1 | %CANGJIE_HOME%\bin |

Next, create these three paths in order:
1 | %CANGJIE_HOME%\tools\bin |
1 | %CANGJIE_HOME%\tools\lib |
1 | %CANGJIE_HOME%\runtime\lib\windows_x86_64_llvm |
Make sure all 4 paths are created:

Finally, click OK to close the popup.

The SDK configuration is now complete.