trying to use the closure compiler to reduce the size of the runtime
This commit is contained in:
parent
c3d89605ff
commit
84f643cb3d
6
NOTES
6
NOTES
|
@ -679,4 +679,8 @@ How do I test what I'm integrating? I should at least absorb the
|
||||||
js-vm test suite, at the very least.
|
js-vm test suite, at the very least.
|
||||||
|
|
||||||
11am: I'm going to spend the next hour trying to disentangle the
|
11am: I'm going to spend the next hour trying to disentangle the
|
||||||
circularity between helpers and types.
|
circularity between helpers and types.
|
||||||
|
|
||||||
|
|
||||||
|
The parameters I'm using to control bounce are too high for Firefox,
|
||||||
|
leading it to raise the dialog about an out of control jva process. Not good.
|
|
@ -21,7 +21,8 @@
|
||||||
|
|
||||||
(require racket/contract
|
(require racket/contract
|
||||||
racket/runtime-path
|
racket/runtime-path
|
||||||
racket/port)
|
racket/port
|
||||||
|
(planet dyoo/closure-compile:1:1))
|
||||||
|
|
||||||
|
|
||||||
(provide/contract [get-runtime (-> string?)])
|
(provide/contract [get-runtime (-> string?)])
|
||||||
|
@ -56,8 +57,9 @@
|
||||||
(port->string ip))))
|
(port->string ip))))
|
||||||
|
|
||||||
|
|
||||||
(define text (apply string-append
|
(define text (closure-compile
|
||||||
(map path->string files)))
|
(apply string-append
|
||||||
|
(map path->string files))))
|
||||||
|
|
||||||
|
|
||||||
(define (get-runtime)
|
(define (get-runtime)
|
||||||
|
|
|
@ -1173,7 +1173,7 @@ That way, we can do a simple grep.
|
||||||
PRIMITIVES['random'] =
|
PRIMITIVES['random'] =
|
||||||
new CasePrimitive('random',
|
new CasePrimitive('random',
|
||||||
[new PrimProc('random', 0, false, false,
|
[new PrimProc('random', 0, false, false,
|
||||||
function() {return types.float(Math.random());}),
|
function() {return types.floatpoint(Math.random());}),
|
||||||
new PrimProc('random', 1, false, false,
|
new PrimProc('random', 1, false, false,
|
||||||
function(n) {
|
function(n) {
|
||||||
check(n, isNatural, 'random', 'non-negative exact integer', 1, arguments);
|
check(n, isNatural, 'random', 'non-negative exact integer', 1, arguments);
|
||||||
|
@ -3315,7 +3315,7 @@ That way, we can do a simple grep.
|
||||||
1,
|
1,
|
||||||
false, false,
|
false, false,
|
||||||
function(n) {
|
function(n) {
|
||||||
return makeStringImpl(n, types.char(String.fromCharCode(0)));
|
return makeStringImpl(n, types.character(String.fromCharCode(0)));
|
||||||
})]);
|
})]);
|
||||||
|
|
||||||
|
|
||||||
|
@ -3376,7 +3376,7 @@ That way, we can do a simple grep.
|
||||||
helpers.toDisplayedString(str));
|
helpers.toDisplayedString(str));
|
||||||
raise( types.incompleteExn(types.exnFailContract, msg, []) );
|
raise( types.incompleteExn(types.exnFailContract, msg, []) );
|
||||||
}
|
}
|
||||||
return types.char(str.charAt(n));
|
return types.character(str.charAt(n));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -3599,7 +3599,7 @@ That way, we can do a simple grep.
|
||||||
str = str.toString();
|
str = str.toString();
|
||||||
var lst = types.EMPTY;
|
var lst = types.EMPTY;
|
||||||
for (var i = str.length-1; i >= 0; i--) {
|
for (var i = str.length-1; i >= 0; i--) {
|
||||||
lst = types.cons(types.char(str.charAt(i)), lst);
|
lst = types.cons(types.character(str.charAt(i)), lst);
|
||||||
}
|
}
|
||||||
return lst;
|
return lst;
|
||||||
});
|
});
|
||||||
|
@ -4542,7 +4542,7 @@ That way, we can do a simple grep.
|
||||||
'exact integer in [0,#x10FFFF], not in [#xD800,#xDFFF]',
|
'exact integer in [0,#x10FFFF], not in [#xD800,#xDFFF]',
|
||||||
1);
|
1);
|
||||||
|
|
||||||
return types.char( String.fromCharCode(jsnums.toFixnum(num)) );
|
return types.character( String.fromCharCode(jsnums.toFixnum(num)) );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -4552,7 +4552,7 @@ That way, we can do a simple grep.
|
||||||
false, false,
|
false, false,
|
||||||
function(c) {
|
function(c) {
|
||||||
check(c, isChar, 'char-upcase', 'char', 1);
|
check(c, isChar, 'char-upcase', 'char', 1);
|
||||||
return types.char( c.val.toUpperCase() );
|
return types.character( c.val.toUpperCase() );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -4562,7 +4562,7 @@ That way, we can do a simple grep.
|
||||||
false, false,
|
false, false,
|
||||||
function(c) {
|
function(c) {
|
||||||
check(c, isChar, 'char-downcase', 'char', 1);
|
check(c, isChar, 'char-downcase', 'char', 1);
|
||||||
return types.char( c.val.toLowerCase() );
|
return types.character( c.val.toLowerCase() );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2117,7 +2117,7 @@ String.prototype.toDisplayedString = function(cache) {
|
||||||
|
|
||||||
types.symbol = Symbol.makeInstance;
|
types.symbol = Symbol.makeInstance;
|
||||||
types.rational = jsnums.makeRational;
|
types.rational = jsnums.makeRational;
|
||||||
types.float = jsnums.makeFloat;
|
types.floatpoint = jsnums.makeFloat;
|
||||||
types.complex = jsnums.makeComplex;
|
types.complex = jsnums.makeComplex;
|
||||||
types.bignum = jsnums.makeBignum;
|
types.bignum = jsnums.makeBignum;
|
||||||
types.list = makeList;
|
types.list = makeList;
|
||||||
|
@ -2125,7 +2125,7 @@ String.prototype.toDisplayedString = function(cache) {
|
||||||
types.vectorImmutable = makeVectorImmutable;
|
types.vectorImmutable = makeVectorImmutable;
|
||||||
types.regexp = function(p) { return new RegularExpression(p) ; }
|
types.regexp = function(p) { return new RegularExpression(p) ; }
|
||||||
types.byteRegexp = function(p) { return new ByteRegularExpression(p) ; }
|
types.byteRegexp = function(p) { return new ByteRegularExpression(p) ; }
|
||||||
types['char'] = Char.makeInstance;
|
types.character = Char.makeInstance;
|
||||||
types['string'] = makeString;
|
types['string'] = makeString;
|
||||||
types.box = function(x) { return new Box(x, true); };
|
types.box = function(x) { return new Box(x, true); };
|
||||||
types.placeholder = function(x) { return new Placeholder(x); };
|
types.placeholder = function(x) { return new Placeholder(x); };
|
||||||
|
|
Loading…
Reference in New Issue
Block a user