Request opinions on alternate erlang config formats
Tristan Sloughter
t@REDACTED
Mon Apr 6 15:34:25 CEST 2020
Yea, I played around and easily got a hello world binary down to 175K. Adding in ppbert dep for handling writing Erlang terms and it just goes up to 191K -- this is with some profile tweaks to optimize for size and use of `strip` on the final binary. I'll publish what I get if I take it to reading in toml and outputting sys.config, right now it just writes to stdout a static term :)
And there is no need for a consult, just want to write terms, so ppbert is good enough, and it pretty prints.
For the others, like dhall, cue, starlark, I was hoping more they could have Erlang term output added to them instead of an Erlang lib that can read them.
On Sun, Apr 5, 2020, at 16:12, Łukasz Niemier wrote:
> > Not sure how small you can get a Rust compiled program to these days but if it was doable to strip it down to <1 MB
>
> It probably should be doable.
>
> > I'd see that as a viable option -- could read in toml, yaml, json, etc and write out an Erlang term file (pretty sure there is a crate for that already) sys.config.
>
> For term - probably yes, for consult file - I do not think so.
>
> > Other ideas have been extending Cue (https://cuelang.org/) or Dhall (https://dhall-lang.org/) or Starlark (https://github.com/google/starlark-go) to output Erlang term files.
>
> I have tried implementing Dhall in Erlang, but I had some problems with
> ABNF parsers in Erlang. Maybe I will try again in the future
>
> > But with my work none of this has materialized because its unneeded and I'm satisfied with OS environment variable replacement in sys.config.src with the environment variables populated by K8s -- so I haven't tried to create anything more complicated like above.
>
> In some applications I was more interested in providing more
> „human-readable” (where by human I understand non-erlanger). In such
> case often plain environment variables will not be enough (like in old
> project of mine where I wanted provide user possibility to define
> multiple stores with different configuration -
> https://github.com/appunite/imager/blob/5bbde458367b645b1ceabc2c73d3784db6cd473e/priv/config.toml).
>
> --
>
> Łukasz Niemier
> lukasz@REDACTED
>
>
More information about the erlang-questions
mailing list