I have to ask…why do people want a Turing complete language to configure stuff? I use Sway personally, which is very configurable but for any even remotely complicated logic I shell out to a set of Rust programs.
Seems like hyprland is on C++ so maybe not a direct use case but thought Lua people in general might be interested.
- For personal application config (window manager, shell, text editor, etc), I find I often want to have site-specific configuration, but I also want identical configuration files at every workstation. My laptop probably needs slightly different keybindings than my desktop, my $PATH and text editor needs to be configured a bit differently for work than for personal use, etc. When the configuration is done with a real programming language, this is always straightforward, when it's done via a json/yml/toml file, it's usually a huge pain in the ass.
- You want templating for your configuration, to improve readability, reduce typos and configuration drift, &c, but if you give programmers an inch with any sort of templating system, they will eventually take a mile and figure out how to smuggle Turing-completeness (or, at least, for-loops and variable binding and probably closures) into their configs. If you have a real programming language, this is fine, because the programming language was designed to make loops and conditionals and function calls readable, and probably has decent tooling to boot, but if they're doing it with, say, Mustache-templated YAML, you will have an unreadable mess that is extremely unpleasant to work with.
Lots of people start out with a non-programmable config format. But, as their situation becomes more complicated, they end up shoehorning in programmable-ish features until they realize they are running straight into https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule and decide to do it properly.
Thinking I'll wait as long as I can and then just get an LLM to translate current config to lua once the internet has been seeded a bit with examples
Much like vim/neovim config, people want to do things like register a callback that fires to determine the window title and things that are much more advanced than that, like layout management.
When I was using sway, I was using its IPC or worse (https://github.com/johnae/persway) to do advanced things, and Lua scripting in the first class config would have been a much better UX.
I think I've found balance by using a Python daemon as a "companion" for my i3 configuration. It listens and react to event. It enhances the configuration, so when it's broken, it's not a big deal. And the interface exposed by i3 is smaller, so less risk of breakage. https://vincent.bernat.ch/en/blog/2021-i3-window-manager#i3-...
Still, its a valid design choice with different design decisions compared to sway. But that's the point you get to choose.
Hyprland is much more "build your workspace with legos" so having a full lang like lua makes sense to properly integrate the various pieces.
Personally I have grown a bit frustrated with Lua as a language, but at the same time can see why it would be a good choice for this use case.
The absolute moment you find yourself thinking of putting conditional logic, or string substitution, or anything like that, in your pure config format, switch to a real programming language, before you end up managing several times the complexity of one with only some of the benefits. No need to end up contemplating some sort of for-loop macro with another key referencing the loop variable, when you can just have a for loop.
I find TOML, in addition to being very readable, to be great at automatically restricting config complexity by making nested lists of tables miserable. If your config sucks at being TOML, it should be JS or Python. (Not a fan of Lua.)
1. Use a declarative-style format for config, which is fine, I guess; 2. ... and when that inevitably fails, you... use a programming language?
Some people -- not all, but some -- may prefer to skip the first step and go straight for the second option. Particularly if it's a complex thing indeed like a build system and not, y'know, configuring your blog.
My first hyprland experience was with ML4W (nothing against the guy) but as soon as you download it you get 10 config errors and you don't know where to begin. I took the same philosophy as arch, I install only what I understand, and this way my config grew over time, my games where spawning in 2nd monitor? I look up manual and fix it, etc..
The problem is shitty config languages. I wouldn't group xaml in the same category as dhall for example.
After quite a long while, Hyprland 0.55 is upon us! This is an enormous update by each measurable metric - commits, contributors, features and changes.
With 0.55, there are tons of changes, let’s bring the highlights first.
As we’ve announced a while back, the Hyprland config is now done in Lua. This does not mean your hyprlang config is now broken - it will still work, for a few releases.
The entire wiki has been updated to reflect new Lua configs and you are encouraged to migrate over to Lua.
With Lua, we’ve also added a Layout API for you to define your own layouts directly in the config. Those layouts can be set globally, per-workspace, per-monitor, etc. and behave just like regular layouts, except fully controlled by you.
Scrolling now supports fullscreen windows as part of the tape by default:
As well as a native trackpad gesture via scroll_move in lua.
You can now load an ICC profile per-output in your config via icc = "..path.." in your config for color accuracy.
Hyprland will now use FP16 precision and improved CM pipelines by default for Color Managed displays. This helps with color accuracy, screensharing, and various color-related things.
A few config option updates:
dwindle:pseudotile has been removed as it wasn’t doing anythingdecoration:shadow:ignore_window has been removed (defaults to enabled)render:cm_fs_passthrough has been removed, should be automatic with render:cm_auto_hdrmisc:vfr moved to debug: as it’s a debug variable that should not be changed in prod environmentsAs usual, tons of goodies:
expel, consume, consume_or_expel, wrapping options, and so on.auto_consuming flag for bindsconfine_pointer window rulemove_into_or_create_group for the move dispatcherrotatesplit layoutmsg for dwindleAnd the usual fixes, way too many to list…
As always, if you prefer reading more, check the release on Github.
Cheers, vax