4 ms·
Wouldn't it be nice if all these programs started using at some point a proper embedded language for configuration? Lua, Tcl, Guile. I'd take any of those inst
by mhitza 6y ago
Wouldn't it be nice if all these programs started using at some point a proper embedded language for configuration? Lua, Tcl, Guile.
I'd take any of those instead of the ad-hoc, declarative - but no really - languages that Apache and nginx use.
- feanaro 6y agoThat just seems like an even greater nightmare to me. Soon you would have to learn to read and understand a custom program in a Turing-complete language for each and every installation. The proper solution is a DSL, just a better DSl. Or perhaps a DSL embedded in something like dhall <https://dhall-lang.org/ https://dhall-lang.org/>, but definitely not a general-purpose programming language.
- mhitza 6y agoI was gonna consider including Dhall in my list, but then again nginx configuration has support for if statements. And from my past experience with HCL, sometimes a proper embedded programming language is better than whatever crazy DSL some developers can envision (see for loops in HCL)
- kevin_thibedeau 6y agoTcl is meant to be embedded for scripting and it can be made non-Turing complete by stripping away all but the bare minimum of commands. There is a built in mechanism for sandboxing untrusted input. If can easily be a safe, bullet proof configuration language.
- PowerBar 6y agoWhether JavaScript qualifies as a "proper embedded language" is up for debate, but nginx does support it for dynamic request handling. https://www.nginx.com/blog/introduction-nginscript/ https://www.nginx.com/blog/introduction-nginscript/
- mhitza 6y agoThat link is interesting for two reasons. First because of the feature you mentioned, and second because there is apparently a community lua module (nginx module implementation must be interesting if you can just attach a deeply embedded language via a module) Somehow this didn't pop up on our search results (a couple of years back) when we were dealing with some tricky redirection patterns we had to implement. Would have made things much easier.