Nathan-Wall / proto

A programming language derived from JavaScript which emphasizes prototypes, integrity, and syntax.
Other
12 stars 1 forks source link

Proto

Proto is a programming language that compiles to JavaScript. It emphasizes prototypal programming, high integrity, and fluent, disambiguated syntax. It is currently in active development and highly experimental.

Proto uses ECMAScript 6 as a foundation, but deviates significantly -- even replacing the meta-object protocol. Though Proto is like JavaScript, Proto is not JavaScript. Unlike CoffeeScript, Proto is not simply syntactic changes layered into the JavaScript language -- it fundamentally differs in many aspects of the language.

Documentation

To learn about the Proto language, please see the documentation.

Feature List

Proto supports the following features. Some of the features are expected to be in either ECMAScript 6 or 7, while others are unique to Proto.

ECMAScript 6

ECMAScript 7 (expected)

Other

Use

(Note: The npm version is currently sorely out of date. For the latest, you'll need to clone from github.)

npm install protolang -g

In a JS project:

var proto = require('protolang');

var jsSource = proto.compile(protoSource);
// ...

There is also a tools/ directory with a command-line compiler (protoc) and a simple server (server).

Command-Line Compiler

$ node protoc /path/to/file.pr

This will output the compiled JavaScript to stdout. You can pipe it elsewhere or redirect it to a file using your OS pipes and redirects.

Simple Proto->JS Server

$ node server /path/to/root/dir --port 3000
Server running on port 3000

This simple server can be useful when developing Proto scripts so that you don't have to constantly compile them. It will only serve .proto files and it will compile them to JavaScript on the fly.

Contributions

If you would like to contribute, see the code guide.


CC0
To the extent possible under law, Nathan Wall has waived all copyright and related or neighboring rights to Proto. This work is published from: United States .