Live data from Hacker News

Hyprland 0.55 announced the switch to Lua for its config files

hypr.land

51–60 of 146 posts

Re: Hyprland 0.55 announced the switch to Lua for its config files

#51
post #6

I have grown pretty negative opinions of “using a programming language as a config language” after semi-recently having to spend a lot of time screwing around with someone’s Gradle Groovy abomination. Not even to mention how quickly Nix can get annoying. 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 complicat…

If you look at hyprland config, you can see why they went with it. 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 wo…

That feels like a plugin or external program, not configuration

Re: Hyprland 0.55 announced the switch to Lua for its config files

#52
post #11
post #6

I have grown pretty negative opinions of “using a programming language as a config language” after semi-recently having to spend a lot of time screwing around with someone’s Gradle Groovy abomination. Not even to mention how quickly Nix can get annoying. 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 complicat…

So you don't like using programming languages as config languages, so you: 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…

> and when that inevitably fails

This assumption is doing a lot of work. Surely the question was precisely why it would fail?

Re: Hyprland 0.55 announced the switch to Lua for its config files

#53
post #6

I have grown pretty negative opinions of “using a programming language as a config language” after semi-recently having to spend a lot of time screwing around with someone’s Gradle Groovy abomination. Not even to mention how quickly Nix can get annoying. 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 complicat…

I never really felt like scheme got annoying when configuring guix. I’m half certain most of my configurations for Guix services were just yaml configs with s-expressions

Re: Hyprland 0.55 announced the switch to Lua for its config files

#54
post #6

I have grown pretty negative opinions of “using a programming language as a config language” after semi-recently having to spend a lot of time screwing around with someone’s Gradle Groovy abomination. Not even to mention how quickly Nix can get annoying. 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 complicat…

I think INI-style config is one of the few good things that came out of the Microsoft/Windows ecosystem. Shame that it is so underspecified. We have TOML, of course, but I think for stupid config even that is too much. The intersection of INI and TOML would be perfect.

TOML was created purely because INI has no format spec at all. So what you want is just TOML.

If you don't like certain things, just don't use them in your configs (i.e. tables)

Re: Hyprland 0.55 announced the switch to Lua for its config files

#56
post #4

TIL I'm on 0.56 and hadn't realized there is a change. 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

there are already converters online (i wrote a incomplete one as a neovim plugin for fun https://github.com/pynappo/hyprlang-to-lua.nvim) and reportedly LLMs work fine at it too. At the time i wrote my converter there was already a couple hundred configs i could search through on github to see what people did

Re: Hyprland 0.55 announced the switch to Lua for its config files

#57
I wish there was something better than Lua and just as "obvious" a choice. Static types, real arrays, zero-based indexing, etc.

Closest thing I've seen so far is Roto: https://roto.docs.nlnetlabs.nl/en/stable/index.html

Basically everything about this looks great - Rust-style syntax, static type checking, sane type system, easily embedded. The only slightly odd things are that it has built in types for IP addresses, AS numbers, and `filtermap`. But I guess you can just ignore those if you don't need them.

Re: Hyprland 0.55 announced the switch to Lua for its config files

#58
It's just part of what I call the config pendulum.

Simple config -> (Need to do more complicated things) -> Add override levels -> (Need even more flexibility) -> Add a Turing complete language -> (Things get ridiculous, lots of spaghetti code outside of version control. Time for a reset) -> goto "Simple config"

It's fine. I am not saying it's wrong or right. I've gone through the cycle a few times in some projects. On the other hand, think of it as your project is lucky to be used long enough to have these problems. To feel better about it think of it as a spiral. The next "Simple config" is a slightly better version of the first.

Re: Hyprland 0.55 announced the switch to Lua for its config files

#59
post #36
post #6

I have grown pretty negative opinions of “using a programming language as a config language” after semi-recently having to spend a lot of time screwing around with someone’s Gradle Groovy abomination. Not even to mention how quickly Nix can get annoying. 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 complicat…

I want a programming language as soon as the program benefits from conditional clauses or subsystems. So if the will and know-how is there, would be great to have it from the start. I was pretty happy the day I could move some Jenkins jobs to a Groovy script. I've worked with HCL significantly, but once I learned the idiosyncrasies of Pulumi, scripting infrastructure via a programming language was a better experience…

Nix isn't a scripting language in the sense you seem to have in mind. The snippets you saw that looked like Bash most likely were literally Bash, embedded as multiline strings in Nix.

Nix doesn't have much in common with Haskell.

Nix is a really small language, and you can learn pretty much all of it in a few minutes: https://nixcloud.io/tour/?id=introduction/nix

Re: Hyprland 0.55 announced the switch to Lua for its config files

#60
post #6

I have grown pretty negative opinions of “using a programming language as a config language” after semi-recently having to spend a lot of time screwing around with someone’s Gradle Groovy abomination. Not even to mention how quickly Nix can get annoying. 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 complicat…

It smells like a variant of inner platform effect. Where in order to save you from programming the the config is super flexible, What is missed is that you are still programming only now you have to do it in some weird context.

At least in this case it is an actual programming language instead of XML or YAML like so many of them.

An alternative slightly more charitable interpretation is this is the engine/gamelogic pattern. But the difference between the two is more subtle than it naively appears depending largely on proper layer segmentation.

Post reply on HN