Skip to content

Google Summer of Code 2015 Starter Task

John Vilk edited this page Mar 5, 2015 · 16 revisions

If you're potentially interested in working on Doppio for Google Summer of Code, then you're at the right wiki page!

  • If you were interested in our idea involving network sockets, read on.
  • If you were interested in the Python Interpreter, click here (TODO: Write that page.).

This document will walk you through setting up a development environment for Doppio, building Doppio and DoppioJVM, adding a native method to DoppioJVM, and opening up a pull request.

In this document, we will get you up and running with DoppioJVM, and will walk you through writing your first pull request.

Background Information

Doppio is written in TypeScript, which is like JavaScript but with type annotations. Type annotations describe the types of function arguments, return values, and variables. TypeScript uses these annotations to check that your program is not doing anything illegal.

For example, in JavaScript, the following function adds two numbers:

function add(num1, num2) {
  return num1 + num2;
}

add(5, 4); // Returns 9

However, JavaScript does not prevent you from calling add with non-numbers:

add("hey", [1, 2, 4]); // Returns 'hey1,2,4'

TypeScript lets you declare that add takes in two numbers as arguments, and returns a number. If you do something illegal, it will warn you when you try to compile your program to JavaScript:

function add(num1: number, num2: number): number {
  return num1 + num2;
}

add(5, 4); // Returns 9.
add("hey", [1, 2, 4]); // (6,5): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.

Once you've fixed your issue and the program compiles without issue, TypeScript will produce the following JavaScript file without the type annotations:

function add(num1, num2) {
    return num1 + num2;
}
add(5, 4); // Returns 9.

Prerequisites

Before doing anything, you should install the following items:

  • Node v0.12 (Note: The current bleeding-edge version of Doppio is incompatible with v0.10.)
    • We use Node to build Doppio/DoppioJVM. In addition, DoppioJVM can run on the command line using Node, which is useful during development.
  • Atom Editor
    • The GitHub Atom editor has cross-platform integration with the TypeScript compiler, which gives you autocomplete and compiler feedback if you make a mistake.
Clone this wiki locally