CoolToJS

A Cool-to-JavaScript transpiler, written in TypeScript.

Source: https://github.com/nfriend/cooltojs

13
 
1
class Main inherits IO {
2
    main(): Object {
3
        let hello: String <- "Hello, ",
4
            name: String <- "",
5
            ending: String <- "!\n"
6
        in {
7
            out_string("Please enter your name:\n");
8
            name <- in_string();
9
            out_string(hello.concat(name.concat(ending)));
10
        }
11
    };
12
};
13

Generated ES6 JavaScript:

1
 
1

Console:

Welcome to CoolToJS!
Click the "Transpile" button in the Cool editor to begin