Live data from Hacker News

Hyprland 0.55 announced the switch to Lua for its config files

hypr.land

131–140 of 146 posts

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

#131
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 find nix a weird mention here. there is a popular segment of people who wish nix would have used a generic programming language instead of a dsl, but i cant imagine nix working with something like toml ever. the complexity to build every program ever in every programming language is just way too high for that.

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

#132
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…

Half of me agrees with you. As someone who used to tinker with neovim all day I've had to learn just because you can program the problem doesn't mean you should and stick to a relatively minimal config. 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 s…

imo the downsides to this are so minimal to a user? you can configure neovim without defining any functions or w/e and it's not like awkward or anything

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

#133

Earlier quoted context omitted.

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

Nix is awesome and has not been part of any pendulum (or clock). It's complex enough that it allows you to build programs with it, but on such a simple core that for all intents and purposes it is a config language.

yeah i honestly like it a lot too, but i wish it was typed and that the tooling around it was better. though it's getting there...

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

#134
post #66

Earlier quoted context omitted.

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…

I did run Awesome for awhile and I liked it, but I never used the Lua config for the most trivial things so it never got in the way of anything. I never found that Sway too annoying to just use the shell commands to grab/modify the current state of Sway ( https://github.com/tombert/rs-swanbar ) and just use a "real" programming language to actually do any kind of programming logic. To each their own!

[deleted]

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

#135
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…

Typically you force a split. Configuration is one thing, plugins are another. Maybe you can reference plugins from your config, but not express logic there. Boom, now you have both.

It also means your plugin system doesn't have to choose an "easy" or "simple" language. You could use wasm if you wanted to and allow just about everything under the sun. Although, Lua is used for Roblox games so, maybe it's complex enough.

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

#136
post #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.…

This is why I like to keep the concepts of "config" and "plugin" separate.

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

#137
post #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.…

This is why I like to keep the concepts of "config" and "plugin" separate.

Yeah I like that too. You can have both of course.

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

#138
post #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.…

I've tended to find a lot of value in systems that have both, especially when there is automatic translation from the simple config to the Turing complete language. Lean 4's lakefiles are a good example of this, with a TOML format that is a subset of the Lean DSL format.

That's a neat pattern. It's interesting to think how many times users can auto-generate the DSL and how many times they end up having to write the DSL directly.

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

#139
post #120
post #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.…

That seems like a huge waste of time for anything slightly complicated to convert code to simple configs and lose a lot of functionality in the process. Do you have an indication of how prevalent the cycle is in reality?

> That seems like a huge waste of time for anything slightly complicated to convert code to simple configs and lose a lot of functionality in the process.

That's usually done in anger by people who have to read and update someone else's pages long "config" file, possibly outside version control, with lots of loops and external resource fetches and so on tearing their hair out "why isn't this a just a toml/json/yaml file".

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

#140
post #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.…

That's clever insight. If it was lisp from the beginning, maybe would be more straightforward. It's as simple as code can get, according to Uncle Bob, while still being expressive. It's no wonder Emacs still reigns supreme. Well, I am happy with Niri's kdl approach for the time being.

Lisp/scheme is probably a rare case where it sort of works either way and easy to switch without any extra work, since data and settings already look like code. At some point I had used s-expression as config (before json was widespread, I am that old) but that never had a full on evaluator to actually execute code.
Post reply on HN