diff --git a/langs/zig.yaml b/langs/zig.yaml new file mode 100644 index 0000000..8afde55 --- /dev/null +++ b/langs/zig.yaml @@ -0,0 +1,44 @@ +id: "zig" +name: "Zig" + +info: + year: 2016 + desc: "General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software" + ext: + - zig + web: + wiki: "https://en.wikipedia.org/wiki/Zig_(programming_language)" + home: "https://ziglang.org/" + source: "https://github.com/ziglang/zig" + category: general + mode: compiled + platform: [] + syntax: lua + typing: static + paradigm: + - imperative + usage: [] + +install: + prepare: + apt: + - squashfs-tools + manual: | + install -d "${pkg}/opt" + install -d "${pkg}/usr/local/bin" + + url="$(curl -fsSL -H "X-Ubuntu-Series: 16" "https://api.snapcraft.io/api/v1/snaps/details/zig?channel=beta" | jq .download_url -r)" + wget "${url}" -O zip.snap + unsquashfs -d "${pkg}/opt/zig" zip.snap + ln -s /opt/zig/zig "${pkg}/usr/local/bin/" + +main: main.zig +template: | + const std = @import("std"); + + pub fn main() anyerror!void { + std.log.info("Hello, world!", .{}); + } + +run: | + zig run main.zig