Category Tutorials

Tutorial #4. SDL Demo

Step 1. Create a separate module for the graphical scene. Let’s name this module gui. Step 2. Create a main application module. Step3. Entry point This line of code must always be the last line of the source file. What…

Argentum debugger v1

Debugger v0 supported breakpoints, call-stack inspection and stepping through the program. Version 1 added object inspection and watch expressions. Also it has special support for strings and limited support for arrays. This version is available in binary distribution. 1. Installation…

99 bottles of beer

There is a famous kid’s song in the USA: 99 bottles of beer on the wall, 99 bottles of beer. Take one down and pass it around, 98 bottles of beer on the wall. 98 bottles of beer on the…

Foreign Function Interface (FFI)

Argentum can call C/C++ functions and pass parameters of primitive data types and objects. On Argentum side: Create a module io.ag and declare there a number of functions with “;” in place of body: On C/C++ side: Create a library:…

Tutorial #0 Basic syntax

The sources of argentum programming language are organized in modules.Modules are text files with extension ag residing in the same directory. They are always in UTF-8 encoding. On compiler invocation one of modules is passed to it as a starting…

Tutorial #2. Graphs with Cycles.

Tutorial updated to v.0.0.2 Let’s solve the following coding interview problem: You are given a directed graph in the form of a text string: “a>b b>c c>d e>f b>e e>a c>c” Graph nodes are marked with letters a-z. The graph…

Tutorial #1. Fizz-Buzz.

Code updated to v0.0.2: added module imports. Preparations Setup VSCode environment as shown here: how-to-play-with-argentum-in-vscode. Right-click on src folder and select new file: Type fizz_buzz.ag Question Fizz-buzz is a famous coding interview question. Usually it sounds as follows: Write to…