New languages are fun…

Been playing around with Zig, which is a new language that is still in beta for the most part, but is pretty well polished already, and can be used as a drop-in replacement compiler/linker for C/C++. Home ⚡ Zig Programming Language (ziglang.org)

The syntax highlighting below may be a bit drab, but C++ seemed to be the closest option in the plugin being used.

const std = @import("std");
const print = std.debug.print;

pub fn main() !void {
    for (1..1001) |counter_value| {
        for (1..1001) |counter_value2| {
            print("Value1 = {} and Value2 = {}\r", .{ counter_value, counter_value2 });
        }
    }
    print("\n", .{});
}

Code language: C++ (cpp)
const std = @import("std");
const print = std.debug.print;

pub fn main() !void {
    var counter_value: u32 = 0;
    while (counter_value <= 10000) : (counter_value += 1) {
        var counter_value2: u32 = 0;
        while (counter_value2 <= 10000) : (counter_value2 += 1) {
            print("Value1 = {} and Value2 = {}\r", .{ counter_value, counter_value2 });
        }
    }
    print("\n", .{});
}

Code language: C++ (cpp)