Live data from Hacker News

Hyprland 0.55 announced the switch to Lua for its config files

hypr.land

61–70 of 146 posts

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

#61
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 haven't really seen program go back from "a programming language" to a simple config format.

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

#62

Earlier quoted context omitted.

What would you remove from TOML to make it perfect?

Tables. Not from TOML, just from my config language. TOML has other applications that require its complexity. I'd still keep simple INI style sections in my config lang, but they wouldn't have deeper meaning apart from grouping.

Tables in TOML have uniquely bad format

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

#63
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 haven't really seen program go back from "a programming language" to a simple config format.

there's a rare form of that where it goes from( simple -> programming language -> language with DSL support -> simple dsl ) ; emacs has followed this model a bit.

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

#64
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 seen this expressed similarly as the 'configuration complexity clock': https://mikehadlow.blogspot.com/2012/05/configuration-comple...

I like your spiral metaphor though, since you learn some things along the way.

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

#65
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 haven't really seen program go back from "a programming language" to a simple config format.

Python setup.py -> pyproject.toml? Make -> ninja. eBPF kernel modules from C to a custom language. Helm Go templates -> Kustomize.

I am sure there are other projects picking up json from a previous xml + xpath + other ...xml junk.

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

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

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!

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

#67
post #48

Earlier quoted context omitted.

What would you remove from TOML to make it perfect?

All scalar types other than strings (especially nonsense like datetimes). I'm already ingesting the configuration file as a string and parsing it into a language with actual types, e.g. Rust, and the act of parsing it into my defined configuration type will itself identify any problems with the config; having half-assed types like "int" in the config file format itself is not only useless, it's counterproductive beca…

The problem is that you end up with multiple dialects, just like INI.

For example, I’ve seen booleans being represented with “enable”/“disable”, “yes”/“no”, “t”/“f”, “1”/“0”. Sometimes a mix in the same program.

It’s nice that every TOML config requires “true”/“false” across any application.

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

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

Because there's a never-ending stream of plausible use cases where it just missing one little option. Just look at the web: people have done all sorts of horrible stuff in Javascript to make up for missing HTML / CSS properties.

At a certain point it becomes incredibly tempting to just give up on playing whack-a-mole and let the most demanding users do it themselves using a proper programming language.

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

#70

I think dwm has the best approach to configuration: change the program and recompile. This works for dwm because it compiles in two seconds and has minimal dependencies. I don’t know about hyprland. https://dwm.suckless.org/customisation/

Requiring a C compiler, source code and header files to change your keybindings is just a different kind of bloat, and nothing can change my mind.
Post reply on HN