Coffee Style Smart Computer Language
I treat the coffee-script and Literate CoffeeScript as the first coffee style smart computer language concept.
This should be the basics of the next generation Smart Computer Language.
Features:
- Space indents for block, the curly braces are optional.
- The brackets are optional for function revocation.
- The array, object(dict) assignment could be no comma, instead of using the block.
- The functional expression definition could be ‘->’ or ‘=>’.
- Smart variable definition
- It should be a compiler switcher.
- The first variable assignment will be declared if no the same name variable before.
- RTL(run-time library) replace-able.
- you can write your own
extends,for inetc rtl functions.
- you can write your own
Pros:
- More Natural Readable for humans
- More humane intelligence
- Functional
Cons:
-
Ambiguity: The Human statement as possible ambiguity. eg,
I saw a man on a hill with a telescope.
- It seems like a simple statement, until you begin to unpack the many alternate meanings:
- There’s a man on a hill, and I’m watching him with my telescope.
- There’s a man on a hill, who I’m seeing, and he has a telescope.
- There’s a man, and he’s on a hill that also has a telescope on it.
- I’m on a hill, and I saw a man using a telescope.
- There’s a man on a hill, and I’m sawing him with a telescope.
- It seems like a simple statement, until you begin to unpack the many alternate meanings:
-
Smart man used only(the stupid is difficult to use)
- the man should have a mindset always. So you have got a big trouble if you can not recognize the ambiguity of some statement.
- the smart variable definition should be care too.
Most languages could be transformed into a similar coffee style.
The previous generation computer language is very mechanical and rigid.
It’s strictly limited, even missing a semicolon would raise an error.
Language Reference
Functions
1 | square = (x) -> x * x |
The return and argument type should be optional for the types could be inferred.
The following is the C language transform:
1 | int square(int x) {return x*x;} |