-
Notifications
You must be signed in to change notification settings - Fork 966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request: simple arithmetic expressions #289
Comments
Thanks for the suggestion. This is a slippery slope I'm not super comfortable with. I don't want to end up defining and maintaining a programming language ... in most cases (if everything follows the suggested conventions in the docs and examples) you could write code in your real programming language to merge in stuff like this. |
+1 on avoiding that slippery slope :) hocon can already do a ton of things and supporting all of them makes it more difficult to port it to other languages. |
+1 for this awesome feature, which helps a lot especially when we need some basic date calculation in configuration files. GCL, the internal general configuration language from Google would be a good example for this feature. |
+1 for this request. See Terraform for an example. |
I almost think a better path would be to allow dropping in extra jars to add support for YAML, Jsonnet, etc. - some discussion of that in #169 - bonus, that's probably a good bit easier to implement than adding an expression language to HOCON. Arithmetic expressions on their own are a lot of specification, but then the "not a programming language" principle that keeps HOCON at a fixed-ish size and complexity level has also been dropped, and it's unclear what the replacement principle is. https://blog.ometer.com/2015/09/07/json-like-config-a-spectrum-of-underoverengineering/ talks about this some. to be clear, it's a bit academic because even if I loved the extend-HCON-with-expressions idea I definitely don't have time to do it and don't think it would be easy for anyone to do... |
+1 - Just throwing in my 2 cents as my configuration needs include offsets which depend on other offsets, such as |
It will be awesome if we could do simple arithmetic expressions. A good example of this is a dynamic thread pool configuration based on the number of available processors:
I realize it is probably tricky to implement, but probably you can implement in lisp or prefix notation:
I'm looking for a simple arithmetic evaluator (not a complex or full expression language)
Thanks
The text was updated successfully, but these errors were encountered: