Comments (2)
Hi Adam,
thank you for reporting this. Coincidentaly, we've been recently looking into data.table and adding support for missing functionality in FastR that data.table uses, for example in [1]. This issue that you pointed out is indeed caused by implementation difference, in a longer term we may slightly rework our data representation to support this scenario. However, there are more fundamentals problems with data.table, so I don't think we can support that package "as is" right now or in near future unless the authors decide to modify it. We're also considering providing a patched version for FastR. For technical details please read on.
The fundamental problem with data.table is that it uses the DATAPTR
macro to access internal data of vectors and copy them using e.g. memcpy
. In FastR we can support this for atomic types, but it is suboptimal and if you do this to character vectors, it will confuse the Java GC. In fact, it's also not the recommended approach even for GNUR GC [2], but unlike us it can tolerate it. One possibility is to provide data.table patched for FastR. Another is that the ALTREP GNU R branch [3] gets merged and it motivates the data.table authors to use Dataptr_or_null
before using DATAPTR
and providing an alternative code path if using DATAPTR
is not desired (i.e. Dataptr_or_null
returns null
).
The issue that you pointed out is interesting: data.table checks that list(x)
does not copy x
, which even in FastR it doesn't, however, to check that no copy was made data.table uses C function address
. FastR has efficient representation of sequences, but we have to materialize this compact representation to full vector when it is passed to native code, hence the address
function returns different values each time it gets called with the same compact sequence.
P.S.: thank you for the kind words and please feel free to share with us more about how you use FastR and which other packages are important for your scenario.
[1] cbeedb4
[2] https://cran.r-project.org/doc/manuals/r-release/R-ints.html#The-write-barrier
[3] https://www.r-project.org/dsc/2017/slides/dsc2017.pdf
from fastr.
There is now FastR specific version of data.table
. It can be installed in FastR using:
install.fastr.packages('data.table')
I am closing this issue. If you encounter any issues with concrete data.table
examples that don't work on FastR, please open new issues for those.
from fastr.
Related Issues (20)
- fastR slower than GNU R HOT 2
- Error installing quadprog HOT 3
- Runtime error - com.oracle.truffle.r.runtime.RInternalError: com.oracle.truffle.api.dsl.UnsupportedSpecializationException: Unexpected values provided HOT 2
- Any plan for a Darwin aarch64 of FastR ? HOT 1
- Error installing tidyr HOT 2
- Implement the radixsort builtin
- FastR internal error: java.lang.NullPointerException HOT 10
- UnsupportedSpecializationException in polyglot evaluation of the R mean function HOT 2
- install.packages("mosaic") failed HOT 5
- install.packages("parsnip") fails on FASTR 22.2 on Linux HOT 1
- Broken link to FastR installation webpage. HOT 1
- Stackoverflow at FunctionDefinitionNode.execute(FunctionDefinitionNode.java:342) HOT 1
- tibble: unexpected type: RRawVector instead of CharSXPWrapper
- Packe READXL can be installed but not used: unimplemented .Internal unz
- java interop with R error? HOT 2
- fail while trying to install package ("devtools") HOT 2
- Microsoft MRAN is no more, what are the alternatives? HOT 4
- Apple Silicon support for FastR
- Support for macOS on Apple Silicon HOT 1
- Incorrect Tax calculation for Australia orders in Connector HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastr.