Vim text editor supports Zig
I didn't know!!! Scarthgap has the Vim text editor available via PKGget (compiled in OE). I have overlooked it, as always thought that it is a terminal-mode application, like its predecessor 'vi'. However, it also has a gtk3 GUI, when started with "gvim" or "vim -g".
I installed it, and discovered that it supports Zig syntax highlighting out-of-the-box. Snapshot:
Here is my earlier post, looking around for text editors that support Zig:
- Zig development in Scarthgap devx — October 27, 2024
I also mentioned that "Dude the Builder" uses NeoVim; this is one of many "successors" to Vim. Though, the original Vim remains a very active project. Vim homepage:
This is the Zig support, that is already builtin to Vim:
https://github.com/ziglang/zig.vim
I will be very happy to remove VSCode from the 'devx' SFS. VSCode
is a PET package, so anyone can install it with PKGget if they
wish.
Vim is quite small, so might put it into easy.sfs, so offering an
alternative to Geany. Just need to tweak a few things -- like, it
currently creates menu entries in the "Utility"
category.
Note, I will likely post some simple getting-started tutorials
for Zig soon.
Tags: easy
EasyOS Scarthgap and Daedalus version 6.4
I'm currently maintaining three Linux distributions; EasyOS Scarthgap-series, EasyOS Daedalus-series and QV (Quirky Void). maybe in a year or so, that will be rationalized down to one "winner", but for now, there are three to choose from.
Scarthgap
Scarthgap is the main guy, packages compiled entirely from source
in my fork of OpenEmbedded (here).
The other two are newcomers, and Scarthgap is most mature and
likely to continue to be my main focus going forward. So if you
are new to EasyOS, I recommend choose Scarthgap.
Scarthgap release notes:
https://distro.ibiblio.org/easyos/amd64/releases/scarthgap/2024/6.4/release-notes.htm
Download:
https://distro.ibiblio.org/easyos/amd64/releases/scarthgap/2024/6.4/
Mirror in Europe, thanks to the Netherlands Linux/Unix User Group:
https://ftp.nluug.nl/os/Linux/distr/easyos/amd64/releases/scarthgap/2024/6.4/
There is also a mirror in Australia, though right now 6.4 hasn't arrived there:
https://mirror.aarnet.edu.au/pub/easyos/amd64/releases/scarthgap/2024/
If you are new to EasyOS, you might find it helpful to read the announcement for 6.0, the start of the 6.x versions:
- EasyOS Scarthgap-series version 6.0 released — June 18, 2024
Forum feedback for Scarthgap is welcome here.
Daedalus
Daedalus-series has been built with Devuan Daedalus (Debian
Bookworm) DEB packages, with some Kirkstone OpenEmbedded-compiled
packages. The main advantage is that PKGget, the the package
manager, has access to the large Devuan/Debian package repository
(Scarthgap has a much smaller repository, but both have support
for AppImages, Flatpaks and SFS files).
There are no release note; just read recent blog posts:
- EasyOS Daedalus-series 6.3.93 (6.4RC) released — October 21, 2024
- Mime handling fix for KDE apps — October 20, 2024
- EasyOS Daedalus-series version 6.3.92 (6.4RC) — October 19, 2024
- EasyOS Daedalus-series version 6.3.90 (6.4RC) — October 16, 2024
- Playing with Easy Daedalus — October 14, 2024
Download:
https://distro.ibiblio.org/easyos/amd64/releases/daedalus/2024/6.4/
Forum feedback welcome here.
QV
This is totally different. EasyOS is experimental; QV is
experimental on steroids. It does not use aufs or overlay layered
filesystem. It uses BTRFS and exploits the snapshot capability.
PKGget has access to the fairly large Void Linux package
repository. The project page at github has some introductory
notes:
https://github.com/bkauler/woof-quantum-vis
Download:
https://distro.ibiblio.org/quirky/quirky-void/amd64/releases/base/
Version-numbering is by date, most recent is 24-10-07. There is supposed to be an update mechanism, but I haven't got around to that yet.
Forum feedback is welcome here.
A final note: I have been exploring ways to add another package
repository to Scarthgap. KDE apps for example, are wanted by some
users; though, they are available as AppImages and Flatpaks.
Anyway, I do intend to explore strategies for offering more
packages in Scarthgap.
Have fun!
Tags: easy
Zig development in Scarthgap devx
Zig was introduced a few days ago:
- The Zig language — October 21, 2024
Fascinating language; decided to go with it and Zig development support will be in the "devx" SFS in Easy Scarthgap 6.4 (coming very soon).
The devx SFS will have Zig version 0.13.0, which is the current stable release. It will also have VSCode text editor with Zig syntax highlighting. Also there is 'zls' language server, which can be used with VSCode.
Note that VSCode also supports Nim language syntax highlighting. Geany text editor does support Nim but not Zig -- there is an experimental Zig support in a branch of the Geany source repository; however, it doesn't work.
There are several text editors with Zig support. Here are some that I found:
Helix
https://helix-editor.com/
https://github.com/helix-editor/helix
Lapce
https://lapce.dev/
micro
https://micro-editor.github.io/
https://github.com/squeek502/micro-zigfmt
Sublime
https://www.sublimetext.com/
https://github.com/ziglang/sublime-zig-language
https://github.com/aidenfoxivey/sublime-zig-unofficial
--i'm using this
Zag
https://github.com/seanpm2001/Zag
Zenith
https://codeberg.org/zenith-editor/zenith
VSCode
https://code.visualstudio.com/
https://github.com/ziglang/vscode-zig
Sublime is a commercial product, supposedly free for a limited time; yet no cutout date is published for the free personal usage. I have made it into a PET and it will be installable via PKGget.
ZLS is a Zig Language Server, which I have also made into a PET, which will be builtin to the devx. ZLS project:
A language server does more than just syntax highlighting; such as code completion. See the Wikipedia:
https://en.wikipedia.org/wiki/Language_Server_Protocol
I don't know if VSCode will automatically use it, if found in the $PATH.
So, after Easy Scarthgap 6.4 is released, install the 'devx' SFS and you are good-to-go with learning Zig. The previous blog post has links to some getting-started tutorials. I also found a superb YouTube channel, by "Dude the Builder":
Zig in Depth (50 videos)
https://www.youtube.com/playlist?list=PLtB7CL7EG7pCw7Xy1SQC53Gl8pI7aDg9t
Zig Master (24 videos)
https://www.youtube.com/playlist?list=PLtB7CL7EG7pDKdSBA_AlNYrEsISOHBOQL
... the first series was done with Zig 0.11.0, latter with 0.12.0
(current release is 0.13.0). Dude the Builder uses NeoVim, which
is another editor that supports Zig.
Tags: easy
Kernel 6.6.58 compiled for Scarthgap
Bumping from 6.6.52. Kernel source, patches and build scripts here:
https://distro.ibiblio.org/easyos/source/kernel/6.6.x/6.6.58-20241026/
There are also matching nvidia and kernel source SFS files, that
will be available via SFSget, and broadcom PET installable via
PKGget.
Tags: easy
Continue explore integrate APT in Scarthgap
Previous related post yesterday:
- Infrastructure support apt package manager in Scarthgap — October 24, 2024
Some more work; including a wrapper around 'dpkg'. This is 'dpkg-wrap':
https://github.com/bkauler/woofq/blob/main/easyos/easy-code/rootfs-skeleton/usr/bin/dpkg-wrap
...the original 'dpkg' gets renamed to 'dpkg.bin' and 'dpkg-wrap' to 'dpkg'.
I built Scarthgap and attempted to use 'apt' in a terminal. Hmmm, showing just one of the problems:
# apt install dolphin
Reading package lists... Done
Building dependency tree... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libkf5configwidgets-data : Depends: perl:any
E: Unable to correct problems, you have held broken packages.
Package 'libf5configwidgets-data' has only one dependency, 'perl', and any version of perl. Alright, take a look at perl:
# apt install perl
Reading package lists... Done
Building dependency tree... Done
perl is already the newest version (5.38.2).
0 upgraded, 0 newly installed, 0 to remove and 1149 not upgraded.
Yes, perl is installed, and apt also thinks so. Yet, if I run "apt install libf5configwidgets-data", it gives the same error message about perl being an unmet dependency.
About a week ago, I stress-tested XBPS, the Void package manager, and found it to be inadequate:
- Finding XBPS to be very frustrating — October 11, 2024
Looks like I am heading in the same direction with APT. Similar
situation; a bit of an unusual situation, and the package manager
falls apart.
Yeah, I can't be bothered. Not going to bother trying to
integrate APT into EasyOS Scarthgap. Got much more productive
things to do.
Tags: easy
Infrastructure support apt package manager in Scarthgap
EasyOS Scarthgap-series is built with packages compiled from source in OpenEmbedded (OE), a repository of about 1,800 packages. Quite small, but Easy also supports installing Flatpaks and AppImages. There are actually four package managers, see here:
https://easyos.org/user/package-manager-concepts.html
Even so, users are requesting access to more packages. A couple of users have been installing Debian DEB packages and finding that they work, though it is a bit haphazard finding the dependencies.
I'm having a go at formalizing this, putting in infrastructure to support installing Devuan Daedalus .deb packages.
It is intended that Easy Scarthgap 6.4 will have the 'apt' and 'dpkg' package management packages installed.
WoofQ is the EasyOS build system, and what it will now do is examine all of the builtin packages, in easy.sfs, those compiled in OpenEmbedded, and inform dpkg and apt of their existence. So, when a package and its dependencies are installed by apt, the already-existing dependencies will be recognized.
This is quite a difficult operation to achieve. The Debian developers have the habit of changing the names of packages, and they split packages into smaller ones, often several smaller ones. So, if for example there is the 'djvulibre' OE package; Debian provides that as these split-up packages:
djview djview3 djvulibre-bin djvulibre-desktop djvuserve libdjvulibre-dev libdjvulibre-text libdjvulibre21
So, dpkg and apt have to be told that all of those packages are
installed, and the version.
I have tackled this. There is a new script /usr/local/petget/debget/deb-names.sh that matches the OE package name to the Debian packages:
There is another script that registers these packages with dpkg, informing that they are already installed. It does this by creating empty .deb packages and installing them.
Note that there is a Debian package named 'equivs' that does this operation of installing dummy .deb packages; however, it has too many dependencies and is cumbersome. It is easy to create and install empty .deb packages from basic principles.
Package version is tricky. For example, there is the 'acl' OE package, but in the Devuan package database there is 'acl' and 'acl2'. The correct Devuan package has to be chosen that matches the version number of the OE package.
This is a very non-trivial exercise, but is working so far. The script that creates these dummy .deb packages and installs them is /usr/local/petget/debget/reg-oe2deb.sh:
Before releasing Scarthgap 6.4, I want to integrate dpkg/apt with PKGget. At least in a basic way, that might need refinement later. So that if install a package and its dependencies using 'apt', they will be seen as installed by PKGget, and PKGget will be able to uninstall them. Will probably just do that much for 6.4. Later, maybe PKGget will be able to install DEBs from the Devuan repository, acting as a frontend to apt.
Must qualify this; it is an experiment, yet to be decided whether
it is going to be retained past 6.4.
Tags: easy
Scarthgap recompile in OpenEmbedded
EasyOS Scarthgap-series is built with packages compiled from source, using a fork of OpenEmbedded/Yocto. Scarthgap version 5.0.4 has been released:
https://wiki.yoctoproject.org/wiki/Releases
I have just completed a full recompile, about 1,800 packages. Took a couple of days. Not many version changes since 5.0.3:
apr 1.7.4 1.7.5
chromium-x11 127.0.6533.99 129.0.6668.100
cryptodev-linux 1.13+git 1.14
cups 2.4.9 2.4.10
exiv2 0.28.0 0.28.3
expat 2.6.2 2.6.3
go 1.22.5 1.22.6
go-runtime 1.22.5 1.22.6
libadwaita 1.5.1 1.5.2
libldb 2.8.0 2.8.1
linux-firmware 20240312 20240909
mariadb 10.11.7 10.11.9
mbedtls 3.6.0 3.6.1
mtpaint 3.50.09 3.50.10
openssl 3.2.2 3.2.3
ptest-runner 2.4.4+git 2.4.5+git
python3 3.12.4 3.12.6
python3-django 5.0.4 5.0.9
ruby 3.2.2 3.3.5
samba 4.19.6 4.19.8
vim 9.1.0114 9.1.0698
webkitgtk 2.44.1 2.44.3
Uploading the new binary packages. They all have "-r3" in their
name, for example 'zstd-1.5.5-r3-nocona-64.tar.xz'. This will be
used to build EasyOS Scarthgap-series version
6.4.
Tags: easy
The Zig language
Back in 2022 when I was looking around for alternatives to BaCon, did briefly look at Zig, but decided on Nim. Here are introductions to BaCon and Nim:
"The BaCon programming language"
https://easyos.org/dev/bacon/index.html
"The Nim language"
https://easyos.org/dev/nim/index.html
Last couple of days, took another look at Zig; it has grown enormously in popularity since 2022. Why?...
Zig is a relativitely young language, started by Andrew Kelley in 2015. It is a complete compiler, generating binary executables, unlike BaCon and Nim that generate C code and then require a C compiler such as gcc to generate the binaries. I've been "kicking the tyres" of Zig...
I compiled the traditional "Hello World" CLI program, and it is only 3KB. Furthermore, that binary is statically-linked. First impression, that is incredible.
But it gets better; out of the box, the Zig compiler cross-compiles. You can choose any target you want, x86_64 or aarch64 for example. Furthermore, you can specify specific CPUs. I specified the Intel "nocona" CPU for my "Hello World".
Right off, I see why this will appeal to people who code for embedded systems.
The Wikipedia has an overview:
https://en.wikipedia.org/wiki/Zig_(programming_language)
The Zig website:
There are some great getting-started websites:
"Introduction to Zig"
https://pedropark99.github.io/zig-book/
...online, also available as an ebook or printed.
"Zig Guide"
https://zig.guide/
"Getting started with the Zig programming labguage"
https://blog.logrocket.com/getting-started-zig-programming-language/
I have a particular like for associative arrays, and yes, Zig has them in the standard-library; they are called "hash tables". I also want the language to support regular expressions; it seems need an external library for that.
I have a need to create small statically-linked binaries, for use in the initrd. But they are useful anywhere, as no reliance on glibc or any libc library. Developers will have encountered this problem, when linked against a particular version of glibc, the binary won't work with a different version of glibc. Yes, you can statically-link with glibc when compiling, but the binary is enormous. So, I have used musl. Up until now.
Another thing I like is to write little programs with GUI, that is, Graphical User Interface. Most commonly I do this with shell scripting and one of the GUI tools, such as gtkdialog, xdialog and xmessage. BaCon and Nim also have GUI toolkits; I have used HUG with BaCon.
What about GUI toolkits for Zig? There is a website with links to all-things-Zig:
"Awesome Zig"
https://github.com/zigcc/awesome-zig
I like the look of "capy":
https://github.com/capy-ui/capy
Here is another GUI toolkit, not in the Awesome-Zig list:
https://github.com/desttinghim/zig-libui-ng
...awhile back, in 2022, did look at the Nim binding for libui-ng and liked its simplicity.
Finally, some Zig reviews:From the perspective of a Rust programmer:
https://blog.lohr.dev/after-a-day-of-programming-in-zig
This looks like a sales-pitch:
https://leaddev.com/tech/why-zig-one-hottest-programming-languages-learn
From the perspective of a Go programmer:
https://medium.com/@vladimirvivien/things-i-like-about-zig-as-a-go-programmer-75eb02aab00f
Looks good. The intention is that once Easy Daedalus 6.4 is released, will take some time out from Easy development and play with Zig. As an exercise, might rewrite 'debdb2pupdb' in Zig, see how it compares with the Nim code.
EDIT:
Here is another Zig tutorial, very recent:
"Programming with Zig: from basics to
mastery"
https://gencmurat.com/en/pages/programming-with-zig/
Tags: linux