No longer in development
Try Squiggle
x
14
 
1
### Type (Control+Enter) to run code!
2
### All code is compiled automatically.
3
4
let {Date, console} = global
5
6
let x = 4
7
8
def inc(x) do
9
  x + 1
10
end
11
12
console.log(Date())
13
console.log(inc(x))
14
1
36
(function () {
 
5
  }
6
  function $add(a, b) {
7
    return $number(a) + $number(b);
8
  }
9
  function $number(x) {
10
    if (typeof x !== 'number') {
11
      throw new Error('not a number: ' + x);
12
    }
13
    return x;
14
  }
15
  function $argN(n, m) {
16
    if (m !== n) {
17
      throw new Error('expected ' + n + ' argument(s), got ' + m);
18
    }
19
  }
20
  var $global = (1, eval)('this');
21
  var $tmp = $global;
22
  if ($tmp != null && $tmp.Date !== undefined && $tmp.console !== undefined) {
23
    var Date = $tmp.Date;
24
    var console = $tmp.console;
25
  } else {
26
    throw new Error('destructuring failure');
27
  }
28
  var x = 4;
29
  var inc = function inc(x) {
30
    $argN(1, arguments.length);
31
    return $add(x, 1);
32
  };
33
  console.log(Date());
34
  console.log(inc(x));
35
}());
36