using Go as a configuration file format

120 views
Skip to first unread message

Dan Kortschak

unread,
Sep 24, 2019, 12:38:57 AM9/24/19
to golan...@googlegroups.com
Have you ever considered using Go as the configuration format for your
project? Have you wondered whether you need a Turing complete
configuration language?

Of course not; here it is: https://github.com/kortschak/yaegiconf

Appalled? OK.

Kurtis Rader

unread,
Sep 24, 2019, 12:55:36 AM9/24/19
to Dan Kortschak, golang-nuts
That's cool from a "here is how this can this be implemented" standpoint. But, yeah, Turing complete config file formats are a truly, exceedingly, bad idea. If for no other reason than the obvious one: It makes it impossible to implement a parser and evaluator for the format in a different language. Which should always be possible for a config file format.

--
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

Tyler Compton

unread,
Sep 24, 2019, 7:00:31 PM9/24/19
to Kurtis Rader, Dan Kortschak, golang-nuts
I do think that turing complete configuration have their place in very limited circumstances. For example, I use a window manager called Awesome WM that is configured with Lua, and that allows me to implement my own features into the WM while configuring it. The significant disadvantage here is that Awesome WM exposes a very large API surface to the configuration file, making it very likely that your configuration will break with a new release, and writing an automatic migration would be significantly more difficult than if it were a configuration file.

It makes it impossible to implement a parser and evaluator for the format in a different language. Which should always be possible for a config file format.

This problem can be partially addressed by using a language like Lua that has a very small C interpreter library and can be called from a variety of languages, but I appreciate your point.
 

--
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD8Qi8JFA4WSCU7TLuXmgjx-WcAzJcuDdV08XSwz%2Bicziw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages