towerofnix / tlnccuwagnf

The Language Nobody Could Come Up With A Good Name For
MIT License
18 stars 3 forks source link

Tulun Syntax == JavaScript Syntax #40

Open bates64 opened 8 years ago

bates64 commented 8 years ago

At the moment, Tulun has a very similar syntax to JavaScript.

'nuff said.

towerofnix commented 8 years ago

So far the biggest difference between JS and Tulun syntax-wise is #34, I think.

bates64 commented 8 years ago

But seriously - we need to rectify this because at the moment Tulun looks like JS; but with a few quirks and less features.

Tulun to JS cheatsheet

// comment
# comment #

/* multiline comment */
# multiline comment #

var foo = 'bar';
foo => 'bar';

foo = 'baz';
foo -> 'baz';

var baz = new Object();
baz => obj();

baz.bar = 'foo';
baz.bar -> 'foo';

fn = function(takes, arguments) {};
fn => (takes, arguments) {};

if (true) {} else {}
if(true, {}, {});

...it's basically the same (bar surround functions & function definitions).