Zig setup

Zig setup

General overview

This step consists of two sub steps.

Setting Zig

Zig itself is still young language (latest stable release at the time of writing is 0.11). That means that there is limited set of options to get required binaries - build them by mysef, get them through package manager or grab them from [archive on download page](download page link).

Since I do not want to fight with LLVM configuration or thinking about where to put libs on path options number 1 & 3 were out.

That leaves me with nice

{ snap install zig --classic --beta }

which provides me with

{ $zig version, 0.11.0 }

Nice, now I have Zig installed locally.

Why not latest version?

When I was crunching through Zig related content I've seen advices similar to this one

{ Most tools like ziglings are based on latest master version, so you should probably join the herd and update your local Zig setup to match versions. }

_someone on the internet_

While (generally speaking) those opinions are helpful I made concious decision to not invest too much time into lang setup _before writing more than code than fizzbuzz_. Since my time is constrained, why bother with spending my time on following/updating lang revision and all breaking changes potentially made before stable release?

Edior setup

I've already mentioned that I am trying to accustom myself to emacs usage. I am using doom emacs flavour (just because I liked doom game series).

That means that I need to setup [LSP](language server protocol page) properly to have editor which can actually help me during my journey. I am not sure if it is an standard to provide LSP utilities with new languages in XXI century, but hey.. I am happy that Zig ecosystem provides it too. Just take a look at [zigtools](link to zigtools repo).

Few changes in configuration and voila - my local emacs shows errors in code and allows me to compile/run tests with few keystrokes.