forked from jashkenas/coffeescript
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
20 lines (12 loc) · 1.36 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
------------------------------------------------------------------------------
This project is deprecated.
For things like coffeescript for Lua,
Please check out this great project: http://moonscript.org
------------------------------------------------------------------------------
This is project is forked from coffee-script. See http://coffeescript.org for details.
Since CoffeeScript is such a good language, and Lua is somehow similar to JavaScript, make a compiler that compiles from CoffeeScript to Lua seems a good idea. It can be used in game programming without creating a new language.
We have several problems now:
* String concatenate operator.
We've got '+' for string concatenation in CoffeeScript, JavaScript and many other languages, but in Lua, we got '..'. So if you cannot judge if a variable is string or not at compile time, it's not possible to convert '+' to '..'.
* Method invocation operator.
In CoffeeScript and JavaScript, we use a syntax 'obj.method( ... )' to invoke methods, not static methods. But in Lua, we have to make it explicit with the operator ':'. In Lua, we have the syntax 'obj:method( ... )' to invoke methods, and 'type.method( ... )' or 'obj.method( ... )' to invoke static methods. And that means, we have to determine whether an Object present a type, or an instance. Without this information, we cannot convert '.' to ':'.