How to run Argentum compiler (and try examples)

Supported platforms: Windows10-11, MacOS15, Linux.
Supported architectures: x64 (aka x86-64) ARM64.

Steps:

  1. Download a zip archive for your architecture and operation system.
  2. Extract to any directory, for example:
    • ~ag/ on Linux and Mac
    • your home dir - %USERPROFILE%/ag on Windows
  3. Install prerequisites (because Argentum compiler builds standard obj/o files it needs linker and C-standard library):
    • on Windows:
      • install Visual Studio (community edition is ok),
      • or Build Tools for Visual Studio 2026,
      • or (if you know what you're doing) llvm-mingw, MinGW or Cygwin.
    • on Linux: install build-essential:
      • for Ubuntu it's sudo apt-get install build-essential
      • for other distributions, you already know what to do
    • on Mac install Xcode Command Line Tools:
      • with xcode-select --install
  4. Open Terminal
    • on Windows from the start menu launch x64 Native Tools Command Prompt
    • on Linux/Mac open system terminal
  5. CD to your working directory (where all build files and final executable to be build and where your program starts.
    • It can be any directory you want,
    • but for provided examples it should be ag/examples/work-dir
  6. Build and run Hello World example:
    • Windows: ..\..\bin\run-release.bat ..\helloWorld.ag
    • Linux/Mac: ../../bin/run-release.sh ../helloWorld.ag
  7. Build and run other simple examples
    • fizzBuzz - demonstrates lambdas, loops, variables
    • bottles - prints text of 100 wine bottles, demonstrates string interpolation
    • graph - demonstrates building of graph data structure and traversal with finding loops (this example is intended to show that Argentum can easily handle data structures with loops)
    • cardDom - example demonstrates operations on a rich DOM or an imaginary document editors discussed in a series of Linkedin publications and other resources
    • threadTest - example showcasing multithreading and asynchronous message passing
  8. Build and run example demonstrating Package Manager: run-release sqliteDemo
    This example uses an sqliteFfi module that is not presented in the compiler binary.
    • When launched, compiler automatically
      • downloads this module from the cloud package repository,
      • checks its format and compatibility with current platform,
      • and installs it. This step performs upon first usage or when a compiled application requests a newer version than cached.
    • Then as usual Argentum compilers this application with this downloaded module sources.
    • If this package provides platform specific libs, object files, resources or DLLs they are automatically included in linking and deployment.
    • In this example tis application gets compiled with SQLite API, linked against SQLite engine and launched in work-dir where it queries a mydb.sqlite database and prints its content to console.
  9. Debugger:
    • If instead of run-release.sh/bat we use build-debug.sh/bat,
      • it builds your application in debug mode with included debug info,
      • and links it against debug versions of all libraries
      • and deploys along with debug versions of all DLLs (and PDBs on Windows).
    • This allows you to launch this app in Visual Studio/VSCode/X-Code/lldb/gdb or whatever debugger you use.
    • Since Argentum debug info is just DWARF/PDB, it allows effectively step between Argentum code and FFI C-code.
    • So far Argentum compiler supports only a small subset of debugging features: source code navigation, breakpoints, stepping, simple variable inspection. It is yet to support polymorphic data types and containers.
  10. There are features yet not ported to the new package manager, so the corresponding examples are not working in this version:
    • SDL integration
    • App platform (OpenGL-Skia)
    • Curl

Leave a Reply

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