Skip to content

Capabilities

github-actions[bot] edited this page Aug 20, 2024 · 66 revisions

This document was generated automatically from '/home/runner/work/flowr/flowr/src/r-bridge/data/print.ts' on 2024-08-20, 11:34:29 UTC summarizig flowR's current capabilities

The code-font behind each capability name is a link to the capability's id. This id can be used to reference the capability in a labeled test within flowR. Besides, we use colored bullets like this:

🟩 flowR is capable of handling this feature fully
πŸ”Ά flowR is capable of handling this feature partially
πŸ”΄ flowR is not capable of handling this feature

☁️ This could be a feature diagram... ☁️

  1. Names and Identifiers (names-and-identifiers)
    1. Form (form)
      1. Normal (name-normal)
        🟩 Recognize constructs like a, plot, ...
      2. Quoted (name-quoted)
        🟩 Recognize "a", 'plot', ...
      3. Escaped (name-escaped)
        🟩 Recognize `a`, `plot`, ...
    2. Resolution (resolution)
      1. Global Scope (global-scope)
        🟩 For example, tracking a big table of current identifier bindings
      2. Lexicographic Scope (lexicographic-scope)
        🟩 For example, support function definition scopes
      3. Closures (closures)
        πŸ”Ά Handling function factories and friends. Currently, we do not have enough tests to be sure.
      4. Dynamic Environment Resolution (dynamic-environment-resolution)
        πŸ”΄ For example, using new.env and friends
      5. Environment Sharing (environment-sharing)
        πŸ”΄ Handling side-effects by environments which are not copied when modified
      6. Search Path (search-path)
        πŸ”΄ Handling R's search path as explained in Advanced R. Currently, flowR does not support dynamic modifications with attach, search, or fn_env and tests are definitely missing. Yet, theoretically, the tooling is all there.
      7. Namespaces (namespaces)
        πŸ”΄ Handling R's namespaces as explained in Advanced R
      8. Accessing Exported Names (accessing-exported-names)
        πŸ”Ά Resolving calls with :: to their origin. Accessing external files is allowed, although the name of packages etc. is not resolved correctly.
      9. Accessing Internal Names (accessing-internal-names)
        πŸ”΄ Similar to :: but for internal names.
      10. Library Loading (library-loading)
        πŸ”΄ Resolve libraries identified with library, require, attachNamespace, ... and attach them to the search path
  2. Expressions (expressions)
    1. Function Calls (function-calls)
      1. Grouping (grouping)
        🟩 Recognize groups done with (, {, ... (more precisely, their default mapping to the primitive implementations).
      2. Normal Call (call-normal)
        🟩 Recognize and resolve calls like f(x), foo::bar(x, y), ...
        1. Unnamed Arguments (unnamed-arguments)
          🟩 Recognize and resolve calls like f(3), foo::bar(3, c(1,2)), ...
        2. Empty Arguments (empty-arguments)
          🟩 Essentially a special form of an unnamed argument as in foo::bar(3, ,42), ...
        3. Named Arguments (named-arguments)
          🟩 Recognize and resolve calls like f(x = 3), foo::bar(x = 3, y = 4), ...
        4. String Arguments (string-arguments)
          🟩 Recognize and resolve calls like f('x' = 3), foo::bar('x' = 3, "y" = 4), ...
        5. Resolve Arguments (resolve-arguments)
          πŸ”Ά Correctly bind arguments (including pmatch). Currently, we do not have a correct implementation for pmatch. Furthermore, more tests would be nice.
        6. Side-Effects in Argument (side-effects-in-argument)
          πŸ”Ά Handle side-effects of arguments (e.g., f(x <- 3), f(x = y <- 3), ...). We have not enough tests to be sure
        7. Side-Effects in Function Call (side-effects-in-function-call)
          πŸ”Ά Handle side-effects of function calls (e.g., setXTo(3), ...) for example achieved with the super assignment. We need more tests and handlings. Furthermore, we do not detect side effects with external files, network, logging, etc.
      3. Anonymous Calls (call-anonymous)
        🟩 Recognize and resolve calls like (function(x) x)(3), factory(0)(), ...
      4. Infix Calls (infix-calls)
        🟩 Recognize and resolve calls like x + y, x %>% f(y), ...
      5. Redefinition of Built-In Functions/primitives (redefinition-of-built-in-functions-primitives)
        πŸ”Ά Handle cases like print <- function(x) x, `for` <- function(a,b,c) a, ... Currently, we can not handle all of them there are no tests. Still wip as part of desugaring
      6. Index Access (index-access)
        1. Single Bracket Access (single-bracket-access)
          🟩 Detect calls like x[i], x[i, ,b], x[3][y], ... This does not include the real separation of cells, which is handled extra.
        2. Double Bracket Access (double-bracket-access)
          🟩 Detect calls like x[[i]], x[[i, b]], ... Similar to single bracket.
        3. Dollar Access (dollar-access)
          🟩 Detect calls like x$y, x$"y", x$y$z, ...
        4. Slot Access (slot-access)
          🟩 Detect calls like x@y, x@y@z, ...
        5. Access with Argument-Names (access-with-argument-names)
          🟩 Detect calls like x[i = 3], x[[i=]], ...
        6. Access with Empty (access-with-empty)
          🟩 Detect calls like x[], x[2,,42], ...
        7. Subsetting (subsetting)
          🟩 Detect calls like x[i > 3], x[c(1,3)], ...
      7. Operators (operators)
        1. Unary Operator (unary-operator)
          🟩 Recognize and resolve calls like +3, -3, ...
        2. Binary Operator (binary-operator)
          🟩 Recognize and resolve calls like 3 + 4, 3 * 4, ...
          1. Special Operator (special-operator)
            🟩 Recognize and resolve calls like 3 %in% 4, 3 %*% 4, ...
          2. Model Formula (model-formula)
            πŸ”Ά Recognize and resolve calls like y ~ x, y ~ x + z, ... including their implicit redefinitions of some functions. Currently, we do not handle their redefinition and only treat model formulas as normal binary operators
          3. Assignments and Bindings (assignments-and-bindings)
            1. Local Left Assignment (local-left-assignment)
              🟩 Handle x <- 3, x$y <- 3, ...
            2. Local Right Assignment (local-right-assignment)
              🟩 Handle 3 -> x, 3 -> x$y, ...
            3. Local Equal Assignment (local-equal-assignment)
              🟩 Handle x = 3, x$y := 3, ...
            4. Super Left Assignment (super-left-assignment)
              🟩 Handle x <<- 42, x$y <<- 42, ...
            5. Super Right Assignment (super-right-assignment)
              🟩 Handle 42 ->> x, 42 ->> x$y, ...
            6. Return Value of Assignments (return-value-of-assignments)
              🟩 Handle x <- 3 returning 3, e.g., in x <- y <- 3
            7. Assignment Functions (assignment-functions)
              πŸ”Ά Handle assign(x, 3), delayedAssign(x, 3), ... Currently we can not handle all of them and tests are rare.
            8. Range Assignment (range-assignment)
              🟩 Handle x[1:3] <- 3, x$y[1:3] <- 3, ...
            9. Replacement Functions (replacement-functions)
              πŸ”Ά Handle x[i] <- 3, x$y <- 3, ... as `[<-`(x, 3), ... Currently work in progress as part of the desugaring but still untested.
            10. Locked Bindings (locked-bindings)
              πŸ”΄ Handle lockBinding(x, 3), ...
      8. Control-Flow (control-flow)
        1. if (if)
          🟩 Handle if (x) y else z, if (x) y, ...
        2. for loop (for-loop)
          🟩 Handle for (i in 1:3) print(i), ...
        3. while loop (while-loop)
          🟩 Handle while (x) b, ...
        4. repeat loop (repeat-loop)
          🟩 Handle repeat {b; if (x) break}, ...
        5. break (break)
          🟩 Handle break (including break()) ...
        6. next (next)
          🟩 Handle next (including next()) ...
        7. switch (switch)
          🟩 Handle switch(3, "a", "b", "c"), ...
        8. return (return)
          🟩 Handle return(3), ... in function definitions
        9. exceptions (exceptions)
          πŸ”΄ Handle try, stop, ...
      9. Function Definitions (function-definitions)
        1. Normal (normal-definition)
          🟩 Handle function() 3, ...
        2. Formals (formals)
          1. Named (formals-named)
            🟩 Handle function(x) x, ...
          2. Default (formals-default)
            🟩 Handle function(x = 3) x, ...
          3. Dot-Dot-Dot (formals-dot-dot-dot)
            🟩 Handle function(...) 3, ...
          4. Promises (formals-promises)
            πŸ”Ά Handle function(x = y) { y <- 3; x }, function(x = { x <- 3; x}) { x * x }, ... We try to identify promises correctly but this is really rudimentary.
        3. Implicit Return (implicit-return)
          🟩 Handle the return of function() 3, ...
        4. Lambda Syntax (lambda-syntax)
          🟩 Support \(x) x, ...
      10. Important Built-Ins (important-built-ins)
        1. Non-Strict Logical Operators (non-strict-logical-operators)
          🟩 Handle &&, ||, ...
        2. Pipe and Pipe-Bind (built-in-pipe-and-pipe-bind)
          πŸ”Ά Handle the new (4.1) pipe and pipe-bind syntax: |>, and =>. We have not enough tests and do not support pipe-bind.
        3. Sequencing (built-in-sequencing)
          πŸ”΄ Handle :, seq, ... by gathering value information using abstract interpretation.
        4. Internal and Primitive Functions (built-in-internal-and-primitive-functions)
          πŸ”΄ Handle .Internal, .Primitive, ... In general we can not handle them as they refer to non-R code. We currently do not support them when used with the function.
        5. Options (built-in-options)
          πŸ”΄ Handle options, getOption, ... Currently, we do not support the function at all.
        6. Help (built-in-help)
          πŸ”Ά Handle help, ?, ... We do not support the function in a sensible way but just ignore it (although this does not happen resolved).
        7. Reflection / "Computing on the Language" (reflection-"computing-on-the-language")
          1. Get Function Structure (get-function-structure)
            πŸ”΄ Handle body, formals, environment to access the respective parts of a function. We do not support the functions at all.
          2. Modify Function Structure (modify-function-structure)
            πŸ”΄ Handle body<-, formals<-, environment<- to modify the respective parts of a function. We do not support the functions at all.
          3. Quoting (built-in-quoting)
            πŸ”Ά Handle quote, substitute, bquote, ... We partially ignore some of them but most likely not all.
          4. Evaluation (built-in-evaluation)
            πŸ”΄ Handle eval, evalq, eval.parent, ... We do not handle them at all.
          5. Parsing (built-in-parsing)
            πŸ”΄ Handle parse, deparse, ... We handle them as unknown function calls, but not specifically besides that.
    2. Literal Values (literal-values)
      1. Numbers (numbers)
        🟩 Recognize numbers like 3, 3.14, NA, float-hex, ...
      2. Strings (strings)
        🟩 Recognize strings like "a", 'b', ...
        1. Raw Strings (raw-strings)
          🟩 Recognize raw strings like r"(a)", ...
      3. Logical (logical)
        🟩 Recognize the logicals TRUE and FALSE, ...
      4. NULL (null)
        🟩 Recognize NULL
      5. Inf and NaN (inf-and-nan)
        🟩 Recognize Inf and NaN
  3. Non-Standard Evaluations/Semantics (non-standard-evaluations-semantics)
    1. Recycling (recycling)
      πŸ”΄ Handle recycling of vectors as explained in Advanced R. We do not support recycling.
    2. Vectorized Operator or Functions (vectorized-operator-or-functions)
      πŸ”΄ Handle vectorized operations as explained in Advanced R. We do not support vectorized operations.
    3. Hooks (hooks)
      πŸ”΄ Handle hooks like userhooks and on.exit. We do not support hooks.
    4. Precedence (precedence)
      🟩 Handle the precedence of operators as explained in the Documentation. We handle the precedence of operators (implicitly with the parser).
    5. Attributes (attributes)
      1. User-Defined (user-defined)
        πŸ”΄ Handle attributes like attr, attributes, ... We do not support attributes.
      2. Built-In (built-in)
        πŸ”΄ Handle built-in attributes like dim, ... We do not support them.
  4. Types (types)
    1. Primitive (types-primitive)
      πŸ”΄ Recognize and resolve primitive types like numeric, character, ... We do not support typing currently.
    2. Non-Primitive (types-non-primitive)
      πŸ”΄ Recognize and resolve non-primitive/composite types. We do not support typing currently.
    3. Inference (types-inference)
      πŸ”΄ Infer types from the code. We do not support typing currently.
    4. Coercion (types-coercion)
      πŸ”΄ Handle coercion of types. We do not support typing currently.
    5. Object-Oriented Programming (object-oriented-programming)
      1. S3 (oop-s3)
        πŸ”΄ Handle S3 classes and methods as one unit (with attributes etc.). Including Dispatch and Inheritance. We do not support typing currently and do not handle objects of these classes "as units."
        https://adv-r.hadley.nz/s3.html
      2. S4 (oop-s4)
        πŸ”΄ Handle S4 classes and methods as one unit. Including Dispatch and Inheritance We do not support typing currently and do not handle objects of these classes "as units."
        https://adv-r.hadley.nz/s4.html
      3. R6 (oop-r6)
        πŸ”΄ Handle R6 classes and methods as one unit. Including Dispatch and Inheritance, as well as its Reference Semantics, Access Control, Finalizers, and Introspection. We do not support typing currently and do not handle objects of these classes "as units."
        https://adv-r.hadley.nz/r6.html
      4. R7/S7 (r7-s7)
        πŸ”΄ Handle R7 classes and methods as one unit. Including Dispatch and Inheritance, as well as its Reference Semantics, Validators, ... We do not support typing currently and do not handle objects of these classes "as units."
        https://www.r-bloggers.com/2022/12/what-is-r7-a-new-oop-system-for-r/, https://cran.r-project.org/web/packages/S7/index.html
  5. Structure (structure)
    1. Comments (comments)
      🟩 Recognize comments like # this is a comment, ... and line-directives
    2. Semicolons (semicolons)
      🟩 Recognize and resolve semicolons like a; b; c, ...
    3. Newlines (newlines)
      🟩 Recognize and resolve newlines like a b c, ...
  6. System, I/O, FFI, and Other Files (system-i-o-ffi-and-other-files)
    1. Sourcing External Files (sourcing-external-files)
      πŸ”Ά Handle source, sys.source, ... We are currently working on supporting the inclusion of external files. Currently we can handle source.
    2. Handling Binary Riles (handling-binary-riles)
      πŸ”΄ Handle files dumped with, e.g., save, ... due to their frequent usage. We do not support binary files.
    3. I/O (i-o)
      πŸ”΄ Handle read.csv, write.csv, ... We do not support I/O for the time being but treat them as unknown function calls.
    4. Foreign Function Interface (foreign-function-interface)
      πŸ”΄ Handle .Fortran, C,... We do not support FFI but treat them as unknown function calls.
    5. System Calls (system-calls)
      πŸ”΄ Handle system, system.*, ... We do not support system calls but treat them as unknown function calls.
  7. Pre-Processors/external Tooling (pre-processors-external-tooling)
    πŸ”΄ Handle pre-processors like knitr, rmarkdown, roxygen2 ... We do not support pre-processors for the time being (being unable to handle things like @importFrom)
Clone this wiki locally