BrightScript language reference
Syntax, typing, and bytecode compilation for embedded device scripting
Roku BrightScript is a powerful scripting language that makes it easy
and quick to build media and networked applications for embedded
devices. The language has integrated support for BrightScript
components, a library of lightweight components. The APIs of the
platform BrightScript is running on are all exposed to
BrightScript as BrightScript components.
The BrightScript reference specifies the syntax of the language. To write useful
applications that implement an app, you should also refer to BrightScript Component
Architecture.
BrightScript compiles code into bytecode that is run by an interpreter.
This compilation step happens every time a script is loaded and run.
There is no separate compile step that results in a binary file being
saved. In this way it is similar to JavaScript.
BrightScript statement syntax is not C-like; in this way it is similar
to Python, Basic, Ruby or Lua. BrightScript objects and named entry
data structures are associative arrays. In this way it is similar to
JavaScript or Lua. BrightScript supports dynamic typing (like
JavaScript), or declared types (like C or Java). BrightScript uses
"interfaces" and "components" for its APIs, similar to ".Net" or Java.
BrightScript is a powerful bytecode-interpreted scripting language
optimized for embedded devices. In this way it is unique. For example,
BrightScript and the BrightScript component architecture are written in
100% C for speed, efficiency, and portability. BrightScript makes
extensive use of the "integer" type (since many embedded processors
don't have floating point units). This is different from languages like
JavaScript where a number is always a float. BrightScript numbers are
only floats when necessary.
BrightScript is optimized to be the "glue" that connects underlying
components for network connectivity, media playback, and UI screens into
user-friendly applications with minimal programmer effort.
Updated 2 months ago
