Ad hoc use of a NIF

Harris, Robert robert.harris@REDACTED
Wed Mar 25 14:35:19 CET 2020



> On 24 Mar 2020, at 15:14, Ali Sabil <ali.sabil@REDACTED> wrote:
>
> On Tue, 24 Mar 2020 at 11:33, Harris, Robert <robert.harris@REDACTED> wrote:
> Hi,
>
> For the sake of example, I have a library with two files:  a.erl and
> b.erl, where a.erl is accompanied by a NIF.  I am constrained by the
> need to construct b.erl using the output of a function contained in the
> NIF.
>
> I was planning to have the make process (called from rebar) for a's NIF
> use an escript to load it in order to generate b.erl.  This doesn't work
> because, as far as I can tell, I can't load a NIF from the shell.
>
> Could anyone recommend a clean solution?
>
> Did you consider generating the `b' module at runtime, without in fact ever
> creating a `b.erl' file?

My original description was perhaps over simplified.  By "b.erl" I
really mean a pair of leex/yeec files for which there are not (I
believe) dynamic alternatives.

Robert
Confidentiality Notice | This email and any included attachments may be privileged, confidential and/or otherwise protected from disclosure. Access to this email by anyone other than the intended recipient is unauthorized. If you believe you have received this email in error, please contact the sender immediately and delete all copies. If you are not the intended recipient, you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.


More information about the erlang-questions mailing list