From g@bembecker @end|ng |rom gm@||@com  Tue Mar  5 21:45:44 2019
From: g@bembecker @end|ng |rom gm@||@com (Gabriel Becker)
Date: Tue, 5 Mar 2019 12:45:44 -0800
Subject: [Rd] 
 Should CRAN accept packages with non-R code that transcompiles
 into R code?
In-Reply-To: <CAB8pepzNadqgsHP-tbhAaBj5RNK12hFQHChQiRG=36me6G-Ybg@mail.gmail.com>
References: <CAB8pepx3d3faRfPTDo97ebOKA1f4v=GO6_dbL7QC2DtkqZV0=w@mail.gmail.com>
 <CAD4oTHFhp1qUfFhLeCh_jBXBYH30mDjvFSeGhW5OBbnkC1t13g@mail.gmail.com>
 <CAB8pepzNadqgsHP-tbhAaBj5RNK12hFQHChQiRG=36me6G-Ybg@mail.gmail.com>
Message-ID: <CAD4oTHHfZS915ggJCg9w-PLWgdu+pqE5TPQ2f7xFaB8Xw7EXTw@mail.gmail.com>

On Tue, Mar 5, 2019 at 12:41 PM Abs Spurdle <spurdle.a at gmail.com> wrote:

>
>
> On Tue, Mar 5, 2019 at 12:52 PM Gabriel Becker <gabembecker at gmail.com>
> wrote:
>
>> I have thought about and have (somewhere "up near the top" of my todo
>> list) prototyping a preprocessor for R, and I have relevant code that emits
>> (transpiles, in a way) structured comments into S4 code in
>> https://github.com/gmbecker/S4Coffee.
>>
>> All that said, until/unless the preprocessor is officially part of the R
>> CMD build step, what putting code like that on CRAN would look like is you
>> keep the raw code in /inst somewhere, and you do the emitting of R code
>> into R/ before building the tarball for submitting. And if you do that CRAN
>> will hav eno problem accepting such a package provided it isn't disallowed
>> in some other way.
>>
>
> I think that I would prefer to generate (and run) the R code during
> .onLoad(), rather than pre-generate it and put it in the R subdirectory.
> If it's in the R subdirectory, then we have two copies of the same thing,
> plus it would need to be documented using the rd format, which I would like
> to minimize, in favor other documentation formats.
> Which is where CRAN may not like it...
>

Hmm, I disagree with this pretty strongly. From a debugging perspective, I
want the source templates available, at least optionally, in addition to
the resulting R code.

Also, while not on the CRAN team, large amounts of code generation during
.onLoad seems liek it would be out of bounds, as I'm pretty certain that
would bypass all of the R CMD check tests, which seems like it would be a
nonon.


> In regards to S4Coffee, it sounds promising.
> I hope you get in finished in the near future.
> And I will take a closer look at it.
>

It does work now, I think, but I may get back to it and do some more. If
you take a look, definitely let me know what you think and if you feel like
anything is missing/could do with a different approach/syntax in your
opinion.  Great to hear that . someone is interested in it, that's
certainly motivating :).

Best,
~G

>
>

	[[alternative HTML version deleted]]



[Rd] Should CRAN accept packages with non-R code that transcompiles into R code?
Gabriel Becker