Open mitzimorris opened 7 months ago
There's no such thing as the CmdStan language but RStan is behind so in some sense there are two different languages available to R users. That (up to date syntax) was part of the motivation for CmdStanR in the first place.
Also, the stan
or cmdstan
tag is used by knitr to determine how the chunk is evaluated. knitr natively supports the stan
tag but that uses RStan.
So I think we need to keep it and fix any bugs, although I don't know why it's not working all of a sudden. Maybe @bearloga (who contributed the initial PR for this) has an idea?
There's no such thing as the CmdStan language but RStan is behind so in some sense there are two different languages available to R users. That (up to date syntax) was part of the motivation for CmdStanR in the first place.
in which case, the tag should be cmdstanr
. which is still wrong and this is a regrettable hack.
I’m not sure I understand your feedback. How are you proposing that we avoid this “regrettable hack”? Any suggestions would be great. We’re open to ideas for how to support both rstan and cmdstanr in these documents while preserving the functionality that users came to expect from knitr being able to execute the code chunks (that part we don’t have control of, it’s been in knitr itself for ages).
There definitely could be a better way, I’m just not aware of it, so if anyone has suggestions that would be very helpful.
I apologize for calling this a regrettable hack. I didn't realize that the functionality in question was code compilation, not syntax highlighting (as the Discourse post subject suggested).
my suggestion is that for code blocks which are complete programs and that the user wants to compile, the code block options be made very very explicit. in particular, you could add argument backend
so that the user could choose between RStan and CmdStanR. it would help to have argument compile
which defaults to FALSE so that whenever someone wants a code chunk to compile, they need to make this explicit - which it should be, because otherwise, mere snippits would generate compiler errors.
in which case, there's only one syntax tag: stan
, not two - or three as I suggested earlier, although 3 - stan
for syntax highlighting only, rstan
and cmdstanr
for compilation would also be OK. but one syntax tag makes more sense, especially since the Rstan functionality already exists (and therefore backend
would default to Rstan).
depending on the backend, you could then add further compiler options.
No worries, and thanks for the suggestions!
It would be great if in the short term there were a way to just get this working like it was before (still don’t know why it stopped working), and then we could consider a replacement along the lines of what @mitzimorris is proposing.
2 problems:
this isn't working for our users - https://mc-stan.org/cmdstanr/articles/r-markdown.html#option-3-using-both-rstan-and-cmdstanr-in-the-same-r-markdown-document
there is no such thing as "cmdstan" language, so this is just confusing.
why was this needed and can it be gotten rid of?