Debugging Compiled Code for R with Positron
15 points by tylermw 8 months ago | 10 comments- setgree 8 months agoPardon my shooting from the hip here, but IMO if you're using R for something radically different than statistical analysis and data visualization, you're probably better off using a tool/language that's more purpose-suited.
> As someone who basically uses R as a nice LISP-y scripting language to orchestrate calling low-level compiled code from other languages
When I read this, I think, would `bash` or something equally portable/universally installed work?
R is a beautiful thing when limited to its core uses But in my experience, the more we build away from those core uses, the more brittleness we introduce. I wish the Posit team would focus on the core R experience, resolve some of the hundreds of open issues on its core packages in a timely way [0,1], and just generally play to R's strengths.
- vhhn 8 months agoUnlike many other languages, R has a native/built-in tabular data structure. So when your data have tabular structure R is by far the best glue for building pipes between external libreries. If the data fits in RAM it literally doesn't have to leave the data.table object throughout the whole pipeline (including all the cleaning and transformations).
The only meaningful alternative I see is Python with maybe Polars or DuckDB.
- stevenae 8 months agoFellow R / Polars user here. How (in what applications) do you use DuckDB?
- tylermw 8 months agoDuckDB is great for medium data: Too big for memory, but small enough to fit on local storage. It's also extremely performant for loading data and supports a wide range of storage backends. It's also really well integrated with R and can really speed up certain queries, as long as the DuckDB engine can translate them to valid SQL.
- tylermw 8 months ago
- stevenae 8 months ago
- nickforr 8 months agoA large number of statistical packages in R make use of C++ for their core algorithms. See here, for example: https://cran.r-project.org/web/packages/Rcpp/index.html
- wdkrnls 8 months agoTyler is actually using R for exactly what R and it's predecessor S were designed to do since the beginning. You can read more about it's history by googling John Chambers who helped develop S at Bell Labs.
- jasonpbecker 8 months ago>> As someone who basically uses R as a nice LISP-y scripting language to orchestrate calling low-level compiled code from other languages
Except... this is exactly was R was created to do, with a focus on mathematical/statistical libraries written in things like FORTRAN.
R is great as a glue language for these purposes if the purpose of calling that low-level compiled code is largely to work with data and especially if that data is not so large/computationally intensive to work with that it does not need to be distributed across hardware.
- setgree 8 months agoI think I got a little confused by the language here, my mistake
- setgree 8 months ago
- napoleongl 8 months agoAnother strength of R, albeit via the tidyverse-package, is in data manipulation. It excels in taking some misfit, human friendly, pile of excel-sheets with implied relations and turning it into rectangular data sets that can actually be analysed. Sure there are faster alternatives if you are doing big data, but if you need versatility R is a good friend.
- vhhn 8 months ago
- mdaniel 8 months agoI dunno why you would blog about, and even create a blog tag for, Positron without linking to it :-/
https://github.com/posit-dev/positron (Elastic V2)