To compile a Red program to native code, we have to do the following:
- Open a Terminal window and go to the folder where your script lives.
- Give the command red -c hello-world.red.
Here is the output (on Windows in PowerShell):
When a –c compilation is done, Red looks in this folder for a shared library libRedRT (.dll in Windows or .so in Linux/macOS); if this doesn't exist, it is compiled. The libRedRT shared dynamic library contains the whole compiled standard library and RunTime in precompiled form, and its size is less than 1 MB. As you can see, this compilation takes about a minute. But this only occurs the first time ...