All Projects → sjbarag → brs

sjbarag / brs

Licence: MIT license
An interpreter for the BrightScript language that runs on non-Roku platforms.

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
Brightscript
28 projects

Projects that are alternatives of or similar to brs

prolog
The only reasonable scripting engine for Go.
Stars: ✭ 408 (+325%)
Mutual labels:  interpreter
scheme.ml
Scheme (R6RS subset) interpreter written in OCaml
Stars: ✭ 14 (-85.42%)
Mutual labels:  interpreter
pikt
🎨 Image-based poetic programming language.
Stars: ✭ 72 (-25%)
Mutual labels:  interpreter
Arduino-FVM
Byte Token Threaded Forth Virtual Machine (FVM) for Arduino
Stars: ✭ 35 (-63.54%)
Mutual labels:  interpreter
Cosmo
Embeddable scripting language loosely based off of Lua
Stars: ✭ 14 (-85.42%)
Mutual labels:  interpreter
PureScript
A C# hot reload framework for Unity3D, based on Mono's MONO_AOT_MODE_INTERP mode.
Stars: ✭ 258 (+168.75%)
Mutual labels:  interpreter
nj
NJ is a simple script engine in golang with Lua-like syntax.
Stars: ✭ 19 (-80.21%)
Mutual labels:  interpreter
tau
Tau is an open source interpreted programming language designed to be minimal, fast and efficient.
Stars: ✭ 26 (-72.92%)
Mutual labels:  interpreter
gossa
The Go/Go+ Interpreter
Stars: ✭ 53 (-44.79%)
Mutual labels:  interpreter
opengml
GML interpreter
Stars: ✭ 30 (-68.75%)
Mutual labels:  interpreter
monkey-rs
An interpreter for the Monkey programming language written in Rust
Stars: ✭ 27 (-71.87%)
Mutual labels:  interpreter
fayrant-lang
Simple, interpreted, dynamically-typed programming language
Stars: ✭ 30 (-68.75%)
Mutual labels:  interpreter
lambda
lambda calculus interpreter
Stars: ✭ 23 (-76.04%)
Mutual labels:  interpreter
g2d
Craft beautiful geometric art using code.
Stars: ✭ 40 (-58.33%)
Mutual labels:  interpreter
huginn
Programming language with no quirks, so simple every child can master it.
Stars: ✭ 41 (-57.29%)
Mutual labels:  interpreter
nopforth
A dialect of the Forth programming language
Stars: ✭ 22 (-77.08%)
Mutual labels:  interpreter
code editor unity
A code editor for MY-BASIC, powered by the Unity3D engine. With this you may create your own Code Editor, Debugger and IDE for different scripting languages.
Stars: ✭ 13 (-86.46%)
Mutual labels:  interpreter
j2
j2 is a minimalist concatenative programming language that makes up for its simplicity by its ability to natively bind with C libraries' ABI *and types*, *without glue*
Stars: ✭ 37 (-61.46%)
Mutual labels:  interpreter
PospoliteView
Pospolite View aims to be a simple HTML viewer engine fully made in Free Pascal.
Stars: ✭ 29 (-69.79%)
Mutual labels:  interpreter
chirp
Interpreter in C for rockstar programing language
Stars: ✭ 20 (-79.17%)
Mutual labels:  interpreter

Table of Contents generated with DocToc

BRS: Off-Roku BrightScript

An interpreter for the BrightScript language that runs on non-Roku platforms.

CircleCI NPM Version

Installation

The BRS project is published as a node package, so use npm:

$ npm install -g brs

or yarn if that's your preference:

$ yarn global add brs

Usage

This repo provides the brs executable, which operates in two ways.

REPL

An interactive BrightScript REPL (Read-Execute-Print Loop) is available by running brs with no arguments, e.g.:

$ brs
brs> ?"Dennis Ritchie said ""Hello, World!"""
Dennis Ritchie said "Hello, World!"

Quit by entering ^D (Control-D).

Executing a file

BRS can execute an arbitrary BrightScript file as well! Simply pass the file to the brs executable, e.g.:

$ cat hello-world.brs
?"Dennis Ritchie said ""Hello, World!"""

$ brs hello-world.brs
Dennis Ritchie said "Hello, World!"

Sure, but why?

The Roku series of media streaming devices are wildly popular amongst consumers, and several very popular streaming services offer Channels for the Roku platform. Unfortunately, Roku chanels must be written in a language called BrightScript, which is only executable directly on a Roku device. BRS hopes to change that by allowing Roku developers to test their code on their own machines, thus improving the quality of their channels and the end-user's experience as a whole.

So can I use this to watch TV without a Roku?

Nope! The BRS project currently has no intention of emulating the Roku user interface, integrating with the Roku store, or emulating content playback. In addition to likely getting this project in legal trouble, that sort of emulation is a ton of work.

Building from source

The BRS project follows pretty standard node development patterns, with the caveat that it uses yarn for dependency management.

Prerequisites

BRS builds (and runs) in node, so you'll need to install that first.

Once that's ready, install yarn. Installing it with npm is probably the simplest:

$ npm install -g yarn

Setup

  1. Clone this repo:

    $ git clone https://github.com/sjbarag/brs.git
    
  2. Install dependencies:

    $ yarn install     # or just `yarn`
  3. Get brs onto your PATH:

    $ yarn link

The build-test-clean dance

Build

This project is written in TypeScript, so it needs to be compiled before it can be executed. yarn build compiles files in src/ into JavaScript and TypeScript declarations, and puts them in lib/ and types/ respectively.

$ yarn build

$ ls lib/
index.js (and friends)

$ ls types/
index.d.ts (and friends)

Alternatively, you can run the build step in "watch" mode. This will run yarn build for you automatically, every time it detects source file changes:

$ yarn watch

This is often useful for testing that local changes work in your BrightScript project, without having to run yarn build over and over.

Testing

Tests are written in plain-old JavaScript with Facebook's Jest, and can be run with the test target:

$ yarn test

# tests start running

Note that only test files ending in .test.js will be executed by yarn test.

Cleaning

Compiled output in lib/ and types/ can be removed with the clean target:

$ yarn clean

$ ls lib/
ls: cannot access 'lib': No such file or directory

$ ls types/
ls: cannot access 'types': No such file or directory

All Together

Thanks to the npm-run-all package, it's trivially easy to combine these into a sequence of tasks without relying on shell semantics:

$ yarn run-s clean build test

Documentation

For the most part, brs attempts to emulate BrightScript as closely as possible. However, there are certain implementation gaps. Also, in the spirit of unit testing, there are a few extensions that will help with testing. All of our documentation for APIs, extensions, gaps, and more is hosted on our docs site, hulu.github.io/roca.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].