GithubHelp home page GithubHelp logo

00mjk / interop-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hsamuelson/interop

0.0 0.0 0.0 3.19 MB

Write in any programming language all in the same source file.

R 99.74% Batchfile 0.26%

interop-1's Introduction

interOp

Write in any programming language, all in the same source file.

Some things are just better in one language than another, but all languages have their shortcomings. Why make the trade-off? interOp allows you to leverage the power of all programming languages, without forcing yourself to stick to one language. Want to implement strong data analysis with R, but don't want to sacrifice the powerful machine learning of Python libraries? Now you don't have to, with interOp.
interOp is also great for teams. Recently the development community has experienced a fragmentation of programming languages. interOp allows multiple developers to write in their preferred languages and work together to build one cohesive program; the way development should be.

Language Support

Note: other language versions may still work, however the following are verified

Language Version Basic Support Arg support Pipe Support
Python 3.7.0 X X X
R 3.5.0 X X X
Node.js 8.11.3 X X
Lua v5.1.5-52 X X X
Go 1.10.3 X X X
Elixir 1.6.6 X
Batch win10 X X
Rust 1.27.0 X
Ruby 2.4.4-2 X X X
Perl v5.24.3 X X
Dart 1.24.3 X
Java jdk1.8.0_171* X

*Note: If you choose to use java it is important to use this exact jdk

Installation

See this link for installation instructions:
https://github.com/hsamuelson/interOp/blob/master/documentation/installation.md

Syntax

Code Markdown & Modules

To create a new code markdown in a given language, type ** then the language name. For example if I was writing in js I would write **js. To signify the end of a code module use **/. Each module needs a name (shown below) in order to run and be called. For example:

 
**js jsModule simple
Var x = 2;
Console.log(x);
**/

One can create multiple modules in any language and in any order. "simple" is the output data type. Currently simple is required at the end of all code module declarations.

Running Modules

To run a module simply type ** moduleName. It is important to note the module will not run on initiation, and will not run if there is a missing space between ** and the module name.

Module Arguments

To pass a module an argument simply write: ** moduleName arg

Pipe Operators

The pipe operator is **<<. To input the output of one module into another is easy. To input mod1 into mod2 simply write: mod1 **<< mod2. So far this is not supported with all languages (see above).

Compiling InterOp

For now from commandline/powershell run the interOp.bat file with a .interOp file as its arg. It will look like this:

interOp.bat ".\scripts\python.interOp"

This powershell command will run the python file (assuming python is installed). You can find examples for all supported languages in the /scripts folder. If you want an example of what it looks like to run multiple languages in a single file see mainScript.interOp. (Note: it will need all supported languages installed to properly execute.)
There are a few valid command line args for interOp.bat. Passing it no arguments means it will allow you to select a file via a GUI. This would look like interOp.bat in the console. Inputting the number 1 as an argument will default the script to reading mainScript.interOp.

From R:

You can also run the interpreter.R file to process the code. If you want to run it in a live R envirment, simply load interpreter.R and then run master() to re-run code.

Credits

Henry Samuelson
Samuel Freisem-Kirov
Henry Meng

interop-1's People

Contributors

hsamuelson avatar sfreisem-kirov 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.