Giter VIP home page Giter VIP logo

saucer's People

Contributors

chibisi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

saucer's Issues

ExternalPtr

Complete the implementation of the ExternalPtr struct interface with R's externalptr and provide examples in the vignettes (link to readme) and make it available for users in the package.

Implicit conversion of returned RType variable to SEXP for exported function results in a segfault

Implicit conversion of returned RType variable to SEXP for exported function results in a segfault. For example this

@Export("dot_product") SEXP dot(SEXP x_sexp, SEXP y_sexp)
{
  size_t n = LENGTH(x_sexp);
  assert(n == LENGTH(y_sexp), "Lengths of the input arrays are not equal");
  
  auto x = NumericVector(x_sexp);
  auto y = NumericVector(y_sexp);
  auto result = NumericVector(1L);
  
  for(long i = 0; i < n; ++i)
  {
    result[0] += x[i]*y[i];
  }
  
  return result;
}

gives a segfault, but this:

@Export("dot_product") auto dot(SEXP x_sexp, SEXP y_sexp)
{
  size_t n = LENGTH(x_sexp);
  assert(n == LENGTH(y_sexp), "Lengths of the input arrays are not equal");
  
  auto x = NumericVector(x_sexp);
  auto y = NumericVector(y_sexp);
  auto result = NumericVector(1L);
  
  for(long i = 0; i < n; ++i)
  {
    result[0] += x[i]*y[i];
  }
  
  return result;
}

does not despite the fact that they are both exported.

Refactor code gen code with std.format making it clearer and easier to read

Currently code gen code in translator is very messy! It uses ~ and ~= to generate code string when it should be using the std.format: format function to do this. This will make the function much more readable and so easier to maintain.

Also move import std.stdio: writeln; in the translator code for R_init_.../R_unload_... functions into the actual functions themselves, rather than outside them.

DataFrame row selection and row/column slicing

The following needs to be implemented. $S \equiv Strings, I \equiv Integers$

For $i,j \in I$ and $i &lt; j$

//Row selection
DataFrame df; df.rows[i..j] 

For $i, j \in I$ and $i &lt; j$, and $n, m \in [I, S]$ and if $n, m \in I, n &lt; m$, and if $n, m \in S, n \leq m$
(in column order if string)

//DataFrame slicing
DataFrame[i..j, n..m] //where 

Both should return a new DataFrame. As in the current selection mechanism, if $m \in I$, selection is exclusive of $m$, and if $m \in S$ selection is inclusive of $m$.

Integer to Numerical Vector

At the moment if an integer array is submitted to a function requiring a NumericVector, we get an type error. This needs to change so that integers submitted in R for NumericVector types in D are automatically converted since int[] -> double[] implicit casting is fine.

Exception/error handling in R removing hard crashes

  1. Remove uses of runtime assert(...) statements and replace them with enforce(...).
  2. Change the translator so that exceptions do not cause R to crash and terminate, but to fail and exit gracefully.

There should therefore be only two types of errors:

  1. Compilation errors that include static asserts.
  2. Runtime errors that fail gracefully back into R's environment with the appropriate error message.

Remove stringr dependency

At the moment stringr is the only dependency in the package. It is a great convenience, but not strictly required so remove it. If anything in a dependency changes, it could otherwise change the status of the package.

Environments

Complete the implementation of the Environment struct interface with R's environment and ensure its compatibility with Functions. Provide examples in the vignettes (link to readme) and make it available for users in the package.

Finish implementing support for R Function interface and make it available in the API

Finish implementing support for R Function interface and make it available in the API:

  • opCall if(...) type filtering for SEXP convertible, also consider double-scoping the static foreach loop.
  • scope(exit)/unprotect for generated SEXPs
  • Remove alias this implicit casting and review the cast to SEXP and the To!(SEXP) as well as the relevant RType membership
  • Set data items to private.
  • Play nicely with saucer Environment type (once this is also finished)
  • Static member function for creating an R function?

Create release, with checksum for version 0.4

Users need some surety when downloading the package that it is what they expect by verifying the checksum. So release V0.4 should have such a feature to allow this check for users.

Add full slicing capabilities to the RMatrix object

At the moment the matrix object supports basic indexing operators $auto \ value = M_{i, j}$ and $M_{i, j} = value$ and so on, it also needs to support full slicing such as $M[i..j, k..l]$ and $M[i..j, k..l] = value$ and $M_{A}[i..j, k..l] = M_{B}$ and so forth. Also, revisit view operations as well as other design and implementation aspects of the RMatrix object.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.