Should CRAN accept packages with non-R code that transcompiles into R code?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Should CRAN accept packages with non-R code that transcompiles into R code?

Abby Spurdle
It may be possible to create an R-like programming language that
transcompiles into R code (or otherwise constructs R objects and calls
R functions).

I'm not sure whether it would pass R check or not, I will probably try...

But the bigger question is:
Should CRAN accept packages written in such a way?

I could email Kurt Hornik or Uwe Ligges, and ask them.
However, I thought that I would ask here first.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Should CRAN accept packages with non-R code that transcompiles into R code?

R devel mailing list
Everything is possible. One can compile C++ into JavaScript.

But why?

> On Mar 4, 2019, at 6:28 PM, Abs Spurdle <[hidden email]> wrote:
>
> It may be possible to create an R-like programming language that
> transcompiles into R code (or otherwise constructs R objects and calls
> R functions).
>
> I'm not sure whether it would pass R check or not, I will probably try...
>
> But the bigger question is:
> Should CRAN accept packages written in such a way?
>
> I could email Kurt Hornik or Uwe Ligges, and ask them.
> However, I thought that I would ask here first.
>
> ______________________________________________
> [hidden email] mailing list
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-devel&amp;data=02%7C01%7Cj.vitek%40northeastern.edu%7C65c14d53fbc44634f88508d6a0f9151d%7Ca8eec281aaa34daeac9b9a398b9215e7%7C0%7C0%7C636873389038367455&amp;sdata=vrZX4jUoakFB%2FRBG6aTjpYsw4fv4NfvIszOxNLhb7Rs%3D&amp;reserved=0

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Should CRAN accept packages with non-R code that transcompiles into R code?

Gabriel Becker-2
In reply to this post by Abby Spurdle
Abs (?),

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.

Best,
~G

On Mon, Mar 4, 2019 at 3:28 PM Abs Spurdle <[hidden email]> wrote:

> It may be possible to create an R-like programming language that
> transcompiles into R code (or otherwise constructs R objects and calls
> R functions).
>
> I'm not sure whether it would pass R check or not, I will probably try...
>
> But the bigger question is:
> Should CRAN accept packages written in such a way?
>
> I could email Kurt Hornik or Uwe Ligges, and ask them.
> However, I thought that I would ask here first.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Should CRAN accept packages with non-R code that transcompiles into R code?

Abby Spurdle
In reply to this post by R devel mailing list
On Tue, Mar 5, 2019 at 12:49 PM jan Vitek <[hidden email]> wrote:

> Everything is possible. One can compile C++ into JavaScript.
>
> But why?
>
>
I would like to support Java style syntax for class definitions.
(Then it could transcompile into either S3 or S4).

And possibly change some other things while I'm at it.
Maybe, integers (rather than numerics) as defaults, and * for standard
matrix multiplication (and ** for R style vectorized multiplication).

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Should CRAN accept packages with non-R code that transcompiles into R code?

Abby Spurdle
In reply to this post by Gabriel Becker-2
On Tue, Mar 5, 2019 at 12:52 PM Gabriel Becker <[hidden email]>
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...

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.

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Should CRAN accept packages with non-R code that transcompiles into R code?

R devel mailing list
In reply to this post by Abby Spurdle
As long as the semantic models are close, then such a translation is
possible and not even very difficult. Syntactic sugar is cheap.
The challenge that you will run into is that there is a temptation
to change the semantics when designing a new language. R has many
warts that, if one were to start today, one could imagine removing.
But any change to semantics is really hard to implement by
source to source translation. My guess is that before you know it
you will have a very different language that runs extremely slowly.




Jan Vitek, Professor
Computer Science,
Northeastern University

> On Mar 5, 2019, at 3:34 PM, Abs Spurdle <[hidden email]> wrote:
>
> On Tue, Mar 5, 2019 at 12:49 PM jan Vitek <[hidden email]> wrote:
>
>> Everything is possible. One can compile C++ into JavaScript.
>>
>> But why?
>>
>>
> I would like to support Java style syntax for class definitions.
> (Then it could transcompile into either S3 or S4).
>
> And possibly change some other things while I'm at it.
> Maybe, integers (rather than numerics) as defaults, and * for standard
> matrix multiplication (and ** for R style vectorized multiplication).
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-devel&amp;data=02%7C01%7Cj.vitek%40northeastern.edu%7Ca94a44aafef146067cc208d6a1aa5dd8%7Ca8eec281aaa34daeac9b9a398b9215e7%7C0%7C0%7C636874150443008540&amp;sdata=%2B%2Bxg06eGYgC64vfJIy%2BJeBYKZvCD1LiK5HIGFN2XrP4%3D&amp;reserved=0


        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Should CRAN accept packages with non-R code that transcompiles into R code?

Gabriel Becker-2
In reply to this post by Abby Spurdle
On Tue, Mar 5, 2019 at 12:41 PM Abs Spurdle <[hidden email]> wrote:

>
>
> On Tue, Mar 5, 2019 at 12:52 PM Gabriel Becker <[hidden email]>
> 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]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel