Coder Social home page Coder Social logo

roq's Introduction

Roq -- an implementation of R in Go

EXTREMELY ALPHA

This is an implementation of the core language of R, the popular implementation of the S scripting language. It is not a complete computing environment with base, stats and graphics libraries, but covers all features of a functional programming language with C-like syntax. So far, parser and scanner are taken from Go 1.7, but this might change.

EXTREMELY ALPHA

Usage

cd $HOME
mkdir -p go/src
cd go
export GOPATH=$PWD
cd src
git clone https://github.com/micha-p/roq.git
cd roq

go run main.go -expr "1+2"
go run main.go -file demo.r
go run main.go -E -file demo.r

go test -v
go build
./roq -file example.r
./roq                  # interactive (one expression per line)
rlwrap ./roq           # with readline support

Short summary

Preliminary differences to R

  • numeric values are float64
  • integers restricted to index oprations
  • single dot means NA
  • limited support for attribute propagation
  • simplified trueness for less decisions: NULL and NaN are false, all values including 0 are true (TODO: evaluation of performance)
  • very limited access to filesystem (like chroot) and environment
  • simplified output with arrays in one line
  • errors do not mention the original character sequence

Additional features (TODO)

  • restrictions on types should improve performance
  • concurrency on the interpreter-level of course

links

https://blog.gopheracademy.com/advent-2014/parsers-lexers/

https://cran.r-project.org/doc/manuals/R-lang.html

roq's People

Watchers

 avatar

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.