On 2014.10.01 12:15, Anton Lavrik wrote:
>
> On Tue, Sep 30, 2014 at 12:59 PM, Motiejus Jakštys
> <
desir...@gmail.com <mailto:
desir...@gmail.com>> wrote: On
> 2014.09.29 10 <tel:2014.09.29%2010>:09, Anton Lavrik wrote:
>
> Why would you want to do something like that? It feels very
> unnatural to include language definition in your application module
> -- regardless of whether it is automated or manual. Wouldn't be more
> reasonable to keep and handle language syntax definition separately
> from whatever you want to define in this language?
I agree. But I am looking for a way *not* to keep self-spec in the repository in any way; be it in piq, piqi or pb. piqi (the compiled binary) is already a dependency. My question was: maybe it has a self-spec embedded, so I can get it like
$ piqi self-spec -t pb | piqi compile --self-spec - <...>
> You can just carry the compiled self-spec file around (which is, as
> you correctly assumed, just a pb of itself). Or you can have it
> embedded in your code and given to "piqi compile" when needed, like
> piqic-erlang does. You can also pass it to stdin if you want by
> specifying "piqi compile --self-spec -".
If piqi (the compiled binary) does not have self-spec built in, I`ll carry it around. I guess I need more time to understand the rationale why it doesn't expose and/or have it.
> Perhaps I am missing something. Can you give a specific example? You
> still have to call "piqi compile" from your compilation chain. And
> after that, you load the result into a program, like piqic-erlang
> that is supposed to understand the extended syntax of what you are
> loading. Am I right or you are doing something different here?
You see it correctly. The problem I am trying to solve is just "can I hand over maintenance of self-spec to something else, most conveniently piqi binary which is already a dependency?"
You answered the questions for now, unless piqi (binary) does indeed have a self-spec accessible. :-)
Regards,
Motiejus