CARVIEW |
Select Language
HTTP/2 200
date: Sat, 19 Jul 2025 15:15:35 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-robots-tag: none
etag: W/"f3bb1089e3127c2e568ebbf2f903a23f"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=Lvh5qRfaBBPGm6aTFaCXd5s81QDOKV%2Bi4JEmJ7B7VrGVZjM9EN%2BKSRkjhQHn6d4TbcfR9not%2FtRrNs8%2BDCkePvLxosV%2BKBPFYDOFZKQotnBJWh4BgWJGvF1yBQKfNVYC4kUlCXyKd6bfFHGM21%2BZZf3ftIkhuxRlv5bKToDPXtpa7B5AF7B9%2Bm61O%2BQHLVM3H9r4C64syz3Ghbz766RidoL9c06Avc%2FbWAkEE%2FmhGezFSSSlrehpRN7BEw4b1B91I2jGfzLZjxCmZYocohau%2Fw%3D%3D--Rhk3D5wrPy503Uvc--Vt0zMzksdizhUfZt35lD8Q%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.179899306.1752938134; Path=/; Domain=github.com; Expires=Sun, 19 Jul 2026 15:15:34 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sun, 19 Jul 2026 15:15:34 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: E6FC:20F01E:5F8762:77AA47:687BB696
improvements · satyr/coco Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 48
improvements
Adam Roben edited this page Feb 7, 2014
·
22 revisions
$ git log -1 --oneline
79492aa CoffeeScript 1.3.3
$ ls -sk extras/co*.js
176 extras/coffee-script.js
$ cake loc
2659
$ cake bench
Lex 1520 ms (24184 tokens)
Rewrite 186 ms (26925 tokens)
Parse 368 ms
Compile 285 ms (149588 chars)
total 2359 ms |
$ git log -1 --oneline
dcff170 0.7.2
$ ls -sk extras/co*.js
160 extras/coco.js
$ coke loc
2499
$ coke bench
Lex 469 ms (26005 tokens)
Rewrite 200 ms (31203 tokens)
Parse 539 ms (26737 nodes)
Compile 341 ms (174118 chars)
TOTAL 1549 ms |
Coco uses them more wisely than Coffee, making generated code cleaner and/or faster.
$ coffee -bce '[i for i in a]'
// Generated by CoffeeScript 1.3.3
var i;
[
(function() {
var _i, _len, _results;
_results = [];
for (_i = 0, _len = a.length; _i < _len; _i++) {
i = a[_i];
_results.push(i);
}
return _results;
})()
]; |
$ coco -bce '[i for i of a]'
var i;
[(function(){
var __i, __ref, __len, __results = [];
for (__i = 0, __len = (__ref = a).length; __i < __len; ++__i) {
i = __ref[__i];
__results.push(i);
}
return __results;
}())]; |
$ coffee -bce 'a > b() > c; d > e() > f'
// Generated by CoffeeScript 1.3.3
var _ref, _ref1;
(a > (_ref = b()) && _ref > c);
(d > (_ref1 = e()) && _ref1 > f); |
$ coco -bce 'a > b() > c; d > e() > f'
var __ref;
a > (__ref = b()) && __ref > c;
d > (__ref = e()) && __ref > f; |
$ coffee -bce 'r = for k of o then arguments'
// Generated by CoffeeScript 1.3.3
var k, r;
r = (function() {
var _results;
_results = [];
for (k in o) {
_results.push(arguments);
}
return _results;
}).apply(this, arguments); |
$ coco -bce 'r = for k in o then arguments'
var k, r, __res, __i, __ref, __len;
__res = [];
for (__i = 0, __len = (__ref = o).length; __i < __len; ++__i) {
k = __ref[__i];
__res.push(arguments);
}
r = __res; |
$ coffee -bce 'Math += 1'
// Generated by CoffeeScript 1.3.3
Math += 1;
$ coco -bce 'Math += 1'
SyntaxError: assignment to undeclared variable "Math" on line 1 |
$ coffee -bce '{0, "0"}'
// Generated by CoffeeScript 1.3.3
({
0: 0,
"0": "0"
});
$ coco -bpe 'a:1, a:2'
SyntaxError: duplicate property "0" on line 1
$ coffee -bce 'x = (return)'
SyntaxError: cannot use a pure statement in an expression.
...
$ coco -bce 'x = (return)'
SyntaxError: inconvertible statement on line 1
...
`
$ cat space_tab.coffee
if 0
console.log 1
console.log 2
$ coffee space_tab.coffee
2
$ coco space_tab.coffee
Failed at: space_tab.coffee
SyntaxError: contaminated indent %09 on line 2
$ cat misdent.coffee
if 0
console.log 1
console.log 2
$ coffee misdent.coffee
2
$ coco misdent.coffee
Failed at: misdent.coffee
SyntaxError: unmatched dedent (2 for 4) on line 3
$ coffee -bce '[]()'
// Generated by CoffeeScript 1.3.3
[]();
$ coco -bce '[]()'
SyntaxError: invalid callee on line 1
$ coffee -bce '/+/'
// Generated by CoffeeScript 1.3.3
/+/;
$ coco -bce '/+/'
SyntaxError: Invalid regular expression: /+/: Nothing to repeat on line 1
$ coffee -bce '$= 1'
// Generated by CoffeeScript 1.3.3
var $;
$ = 1;
$ coco -bce '$= 1'
Error: Parse error on line 1: Unexpected '$'
$ node -e '$= 1'
undefined:1
^
SyntaxError: Unexpected token ILLEGAL
$ coffee -bce '0 instanceof 1'
// Generated by CoffeeScript 1.3.3
0 instanceof 1;
$ coco -bce '0 instanceof 1'
SyntaxError: invalid instanceof operand on line 1
$ node -e '0 instanceof 1'
undefined:1
^
TypeError: Expecting a function in instanceof check, but got 0
$ coffee -bce '{@foo}'
// Generated by CoffeeScript 1.3.3
({
foo: this.foo
});
$ coffee -bce '{this.foo}'
Error: Parse error on line 1: Unexpected 'THIS'
... |
$ coco -bce '{@foo}; {this.foo}'
({
foo: this.foo
});
({
foo: this.foo
}); |
$ coffee -bce 'f k: v, a + b'
Error: Parse error on line 1: Unexpected '+'
...
$ coffee -bce 'k: f a, ->'
Error: Parse error on line 1: Unexpected ','
... |
$ coco -bce 'f k: v, a + b'
f({
k: v
}, a + b);
$ coco -bce 'k: f a, ->'
({
k: f(a, function(){})
}); |
$ coffee -bcs
f
k: v
a
// Generated by CoffeeScript 1.3.3
f({
k: v
}, a);
$ coffee -bcs
f
a
k: v
Error: Parse error on line 2: Unexpected 'INDENT'
... |
$ coco -bcs
f do
k: v
a
f({
k: v
}, a);
$ coco -bcs
f do
a
k: v
f(a, {
k: v
}); |
$ coffee -bcs
if a then b
else c
Error: Parse error on line 1: Unexpected 'INDENT'
... |
$ coco -bcs
if a then b
else c
if (a) {
b;
} else {
c;
} |
You can’t perform that action at this time.