Is there something like Protocol, but for simple Atom identifiers?

@OvermindDL1: Can you list all edge cases with some code or links for examples and/or configuration?
I don’t worked with embedded areas yet, so I need to know from where I can start to think about possible solutions.

1 Like

Start with this edge case as solving it would solve most of them. :slight_smile:

  • Assume there are no BEAM files at run-time.
1 Like

@OvermindDL1: How should I prepare new app to not create beam files?
For me it looks like empty project without any dependencies.
If we don’t have beam files (compiled modules) then we do not using library.
:smile:

1 Like

There can be a variety of reasons there would not be BEAM files in an easily detectable location:

  • Compiled in fully embedded mode (single core file).
  • The BEAM’s could be in an entirely unexpected location.
  • The code could by dynamically generated and loaded all within memory.
  • The code could be sent from another node dynamically.

And there are still other ways. ^.^

1 Like

This is not a problem, because developer need to send an expected path to beam files. With that path I’m looking for api implementations.

I cannot check this. I have only one old laptop with 4GB memory. :icon_sad:

Hmm, yeah it looks like a something that needs be solved.
Is there any API to list all loaded modules? I know that iex can list all modules (also from .exs files) in tab key hints. Probably that method could solve most of edge cases.

Am I need to run new elixir project in prod environment? Am I need any special configuration for it?

1 Like

At runtime it could be dynamic though, so you may not be able to hard-code it, it may rely on something else (say even a database query, you could even store a BEAM file ‘in’ the database and query it out to load it when needed).

More than enough, just spool up two (differently) named elixir sessions, connect them, then google for how to, for example, how to send erlang code to another node I know will get you some code to play with. :slight_smile:

Don’t know about the Elixir API’s, but the Erlang API does, it is :code.all_loaded() (in Elixir syntax), but that only grabs things that are already loaded in. If something has not been referenced yet then it will not be loaded in yet (which is common for dynamic plugins).

The erlang way is a bit involved, but the Elixir ‘escript’ method is very similar and substantially easier to set up (though not quite as weird as Erlang’s method, but still weird enough to start with), play with it. :slight_smile:

2 Likes