Live data from Hacker News

Hyprland 0.55 announced the switch to Lua for its config files

hypr.land

101–110 of 146 posts

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

#101
post #88

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,…

The language is primarily used by Rotonda, the composable, programmable BGP routing engine. Not odd to have those data types at all…

Better to let specific domains define their own data types than favor one in the language.

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

#102
post #71

Earlier quoted context omitted.

Lua was specifically designed to be a configuration language https://www.lua.org/history.html 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.

I mean, fair enough I guess. I've accidentally more-or-less reinvented interpreters on two separate occasions (both times using JSON as a quasi-AST), so I understand it. I guess I just feel like if you feel like you need programming constructs in your configuration, its approaching it from the wrong angle, and it should instead be handled via plugins. I feel like configuration itself should be a "dumb" format like JS…

>and when you want to do anything that can't be accomplished by plain JSON

Like comments? ;)

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

#103

I might be a good change but I left hyprland because,y configuration kept breaking. It's a good window manager so I'll change back once it gets stable. By now i3

i'm mildly annoyed by the project in general because i put in a sizable effort getting the whole sway stack to cross compile correctly in nixpkgs/NixOS, keeping that stable for a year so that people could build on it, and then suddenly hyprland forked every package in the stack with a fresh set of "works on my machine" nix expressions, and then much of the peripheral sway packages (e.g. status bars like nwg-panel, notification centers, etc) decided to become dual-stack and take a dependency on those fast-moving/beta packages. for a solid month any time i updated my machine there was a _new_ hypr-something dependency in my sway desktop that broke cross compilation. eventually i gave up and just set `hyprland = null; hyprutils = null;` in my personal config: mainline's been broken for a year now, sorry to anyone who was using that.

it gives "rewrite it in rust" vibes in the way they rush in to re-do everything without understanding why things were the way they were or if, in fact, anyone was using that obscure feature. maybe they'll sort it all out in time; maybe not. wish they could at least take less of a "we don't care if we break your shit" attitude in the meantime.

/rant

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

#104
post #65

Earlier quoted context omitted.

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.

Python went from setup.py to pyproject.toml, but pyproject.toml declares a build-system, which is another package which all the complex logic from setup.py.

Granted, it's a "simpler" config syntax, but the total system complexity has not decreased.

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

#105
post #81

It's neat that Hyprland lets you define layouts in its config but I like niri's approach. It uses KDL (an established document / config language) and slightly extends it to add useful things like being able to include files. For example, here's mine: https://github.com/nickjj/dotfriedrice/blob/master/.config/n... What you end up with is a config file that's natural to read with no prior knowledge about anything and i…

I wouldn't call KDL "established"; it's honestly pretty niche. It looks _similar_ to pre-existing configuration formats, but KDL is very picky about syntax. I.e.: single word string MUST be quoted.

In this same space, https://codeberg.org/emersion/scfg/ is pretty widely used. The curious thing about scfg is that it's not really a "new" format: the syntax described has been in use by different tools for decades. They just didn't call it scfg, and it's mostly the name itself that's new.

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

#106
post #16
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 have to ask…why do people want a Turing complete language to configure stuff? I don't understand this either. IMO, the current SOTA tool for configuration is CUE, because it is the only one that lets you write schemas for arbitrary refinements. I haven't used it myself, but my understanding is that everybody should be writing configurations in something like this instead of YAML, TOML, HCL, or a custom DSL with n…

Cue is amazing, I'm using it to configure my kubernetes homelab.

I CANNOT imagine what horrors it would be to do it all with helm or templating.

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

#107

I might be a good change but I left hyprland because,y configuration kept breaking. It's a good window manager so I'll change back once it gets stable. By now i3

same boat, tried hyprland and it's cool but seems a bit buggy, and switch back to i3 and settle there.

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

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

It's interesting because this is exactly what I used to do for my hyprland config (which the op is about). I had some keybinds that would shell out and use a script with the hyprctl cli.

Now it's all a single simple lua function and 3x as fast... I think this change is great.

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

#110

Earlier quoted context omitted.

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.

Isn't that called TOML?

An "intersection of INI and TOML" would presumably only have scalar values. TOML allows really complex lines like these:

  data = [ ["delta", "phi"], [3.14] ]
  temp_tagets = { cpu = 79.5, case = 72.0 }
Post reply on HN