Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A Ruby Flavored Language
JavaScript CoffeeScript Rust
Branch: master


Note, the compiler is just a prototype and is not production ready

  • Paste (almost) any JS into a RedScript file
  • Cleaner syntax for modules (AMD and CommonJS)
  • Easier class like inheritance & self based prototypal inheritance syntax

RedScript was created to provide a more native experience for modules (AMD & CommonJS), easier inheritence, and a Ruby style syntax that still behaves like JavaScript.

It was also created as a side project to learn more about Node, NPM Modules and Regular Expressions. In the future I would also like to add a proper lexer/parser to implement more advanced features. Pull requests welcome ;-)

More syntax examples at

To Install Globally and Run

sudo npm install -g redscript
redscript watch [fileName fileName2]

A little RedScript...

# RequireJS AMD Modules...
define module
require 'backbone' as Backbone                                * see for full translation
require './views/widget' as WidgetView

# Block-like anonymous functions
# Note, parens are currently req. around get/end, see
app.get '/users/:name', do |res, req|                           app.get('/users/:name', function(res,req) {
  puts                                            console.log(;
end                                                             });

# Paren-free constructs
if foo == 2                                                     if (foo === 2) {
  puts "It's #{foo}"                                              console.log("It's " + foo);
else                                                            } else {
  alert "Rut Roh"                                                 alert("Rut Roh");
end                                                             }

# Make constructors quack like a duck
#                                                               # note, inheritance methods are opt. inserted
class Duck < Animal                                             var Duck = Animal.extend({
  def init(name)                                                  init: function(name) {
    super foo, bar                                                  this._super(foo, bar);
    @name = name                                           = name;
  end,                                                            },

  def sayHi                                                       sayHi: function() {
    puts 'Hello!'                                                   console.log('Hello!');
  end                                                             }
end                                                             });

See for full syntax!

Something went wrong with that request. Please try again.