I want to write an application with confd using Elixir language.
- Can I use econfd library with elixir ?
- If I can use econfd with elixir then performance will same as erlang or not ?
- Is it good idea to use elixir with econfd library ?
I want to write an application with confd using Elixir language.
You definitely can use econfd and write your application in Elixir. But: an important asset of Erlang applications is that they can run directly inside ConfD’s Erlang VM and thus be faster (sometimes much faster) than when run standalone. I think it should be possible to make ConfD load and start the elixir application and then your application written in Elixir, but you would have to deal somehow with bytecode incompatibilities - ConfD comes with its erlc
so that the resulting bytecode can be used in ConfD, but it does not have elixirc
or mix
or what you need.
I cannot comment whether this is a good idea, maybe someone more knowledgeable can answer that, but it sure is an interesting idea.
Thanks for the reply,
Yes, we are loading Confd and starting Elixir application and making use of Econfd library. But in this case how bytecode incompatibilities will occur?
If I use Elixir with Confd then how can I use those erlang macros in my elixir application ?
Hm, that’s true, econfd uses a lot of defines. I’d expect there is a tool that converts a .hrl file to an Elixir module with persistent attributes and/or macros, but I have not found anything like that.
Thanks for reply. I will check any other possiblities to use econfd macros with elixir
Is there any example or document which explain how to run erlang application inside confd server?
Yes, ConfD User Guide, chapter Advanced Topics, section Running application code inside ConfD.