logoalt Hacker News

mickeypyesterday at 6:04 PM5 repliesview on HN

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 your blog.


Replies

AlotOfReadingyesterday at 6:31 PM

The theoretical difference in power between a non-Turing complete declarative language and a turing complete one is irrelevant in practice. Datalog is a decidable, declarative subset of Turing-complete Prolog. It's also EXPTIME complete. I don't think we exclude any real use cases by prohibiting super-exponential algorithms.

The problem is shitty config languages. I wouldn't group xaml in the same category as dhall for example.

show 2 replies
sureglymoptoday at 1:09 AM

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.

ianburrellyesterday at 10:36 PM

Those aren't the only two options. There are non-Turing complete config languages like Cue, Dhall, and Jsonnet that are designed to complete and be consistent. They work well when did to generate static config from some dynamic input generated by regular program.

dlt713705yesterday at 10:35 PM

> 2. ... and when that inevitably fails, you... use a programming language?

Maybe it fails because you are trying to solve a problem with a configuration when it should be solved by a function implemented in the program you are trying to use.

show 1 reply
yjftsjthsd-hyesterday at 7:41 PM

> and when that inevitably fails

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