Writing a "Hello, World!" program
First things first: let's create a folder for our first program. You can do this directly from VSC or by using your favorite terminal. Since we have just set up our IDE to play with Bosque, I recommend that you use it. First, click File | New File. A new tab named Untitled-1 should appear—click File | Save (or press Ctrl + S on the keyboard) in order to rename it and save it at your desired location. Save the file under the name main.bsq
. If you prefer to do this using a terminal, open it and type the following command:
$ mkdir first-project $ cd first-project
Now, open VSC in the directory you have just created and create a file named main.bsq
, as described earlier.
Once you have created the main.bsq
file, fill it with the following content and save it:
namespace NSMain; entrypoint function main(): String { return "Hello, world!"; }
I will explain this code...