How to play with Argentum in VSCode (based on Demo v0.0.11)

1. Download and Install

Download and extract argentum-demo.7z archive from Assets at https://github.com/karol11/argentum/releases/
Check it with your preferred anti-malware.

Install and launch VSCode https://code.visualstudio.com/download

Launch VSCode and install extension CodeLLDB

2. Open project

Open the folder with the extracted demo:

Since we will run executables (agc, llvm-link) we need to "trust" its content. (Yes trust me, I am an engineer).

3. Configure debugger

The only parameter that should be set is the path to the liblldb.dll that's located inside the argentum_demo/bin directory. It should be fixed in the argentum-demo/.vscode/settings.json config:

{
    "lldb.displayFormat":       "auto",
    "lldb.showDisassembly":     "auto",
    "lldb.dereferencePointers": true,
    "lldb.consoleMode":         "commands",
    "lldb.library":             "<DIR>/argentum-demo/bin/liblldb.dll"
}

Replace "<DIR>" with your path to the directory where the argentum-demo is located.

4. Syntax highlight

Open the hello_world.ag in the src directory.

In the lower right corner of the status bar click on plain text to switch color highlighting mode.

Select "Configure file association for *.ag

Select Rust of Swift from the list, because they have the closest syntax.

5. Compile and Run

Press Ctrl+Shift+B to compile and run the `hello_world application.
It should write "Hi there" in console:

Do the same with demo.ag: open and Ctrl+Shift+B. It should compile and run:

6. Debugger

Open graph.ag, select any line of code and press F9 to set a breakpoint.

Press F5 to compile the application in debug mode and run it in debugger.

When program stops on a break point, try step through the code (F10/F11) and inspect variables. The separate tutorial on debugging is here: argentum-debugger-v1.

That's it for now.

Leave a Reply

Your email address will not be published. Required fields are marked *