Home

Awesome

Move

Move is a simple but powerful programming language which can run on most computers (anywhere there's a >=ES3 JavaScript runtime). When compared to JavaScript, Move has the following key features:

A simple Move program which prints "Hello John" three times:

hello = ^(name){ "Hello "+name }
repeat {times: 3} ^{
  print hello {name: "John"}
}

Same program as above, but using shorthand call-style:

hello = ^(name){ "Hello "+name }
repeat 3, ^{ print hello "John" }

Move compiles directly to optimized JavaScript which can run on almost any computer (in a web browser or a runtime like Node.js).

The above program compiles down to the following JavaScript:

"use strict";
var repeat = Move.runtime.repeat,
    print  = Move.runtime.print,
    hello  = function hello(name) {
  // <keyword argument logic here>
  return "Hello " + name;
};
return repeat(3, function () {
  return print(hello("John"));
});

Note: The above JavaScript has been simplified for the purpose of demonstration.

Installing and using Move

For now, it's easiest to install Move using the Node Package Manager:

sudo npm install -g move

Then require the "move" module before requiring any move code. In this example.js we load "foo.mv" which is a module written in Move:

require("move");
var foo = require("./foo");

There's also a simple API which can be accessed from the move module:

var move = require("move");
console.log(move.compile("bar = ^{ 5 * Math.PI }"));
// Output:
//   var bar;
//   bar = function bar() {
//     return 5 * Math.PI;
//   };

If you want to use move in a web browser, simply use and include the move.js file (no dependencies). Including this file will export a single global symbol called "move" (window.mv) which contains the Move library (see lib/index.js) including functionality for compiling and executing Move code as well as providing the ES5 normalizing but small runtime library. Have a look at web/try/index.html for inspiration.

Extras

There are some extras (or "support stuff") which can be found in the extras directory. For instance, a TextMate bundle adding Move syntax support including commands like Cmd+R to run a Move program, Cmd+B to compile and display generated JavaScript, Cmd+Shift+B to compile and display the AST. Some of these commands require Node.js to be installed.

Differences to JavaScript

Move is designed for humans which is the reason for why things like variable declarations and statement terminators has been removed -- they are simply not part of the essentials or essence of what a programmer should be thinking about. The computer is, or at least should be, better at deciding those things.

Most features mentioned above can be toggled in the Move compiler. For instance, compiling code with the raw option set to true will generate free-standing/self-hosted JavaScript. It's also possible to toggle language features, like setting the keywordArguments to false which disabled the use of keyword arguments. See lib/index.js (the "compile" function) for a complete list of options.

License (MIT)

Move incorporates some third-party source, namely a derivation of UglifyJS. These sources have a separate license embedded into their heads.

The rest of Move is licensed as follows:

Copyright (c) 2011 Rasmus Andersson http://rsms.me/

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.