Mozilla Foundation 1981 Landings Drive Building K Mountain View, CA 94043-0801 USA
See a street map of our location for driving directions. Once there, see this satellite image to locate Building K within the complex.
Our meeting room is on the first floor in the east corner conference room, which will have a sign on its door. — Brendan Eich 2007/01/23 17:33
Please add your name here and let me know if you won’t be joining us for dinner either evening; thanks. — Brendan Eich 2007/01/16 12:01
javaIOFile[’delete’]() – in ES4 one may simply write javaIOFile.delete()). — Brendan Eich 2007/01/23 09:56with, unbound variables, evalwith? or type-check with body at runtime?eval: for type-checked code, dynamic error to introduce new bindings into parent function? — Dave Herman 2007/01/24 21:42eval “...” (eval as unary operator) contain its bindings and otherwise behave better? — Brendan Eich 2007/01/24 23:24There are a number of operators that are binary-centric. Dick proposes that use pragma should only refer to float. E.g. what’s use of “use int”? Response from committee, it is useful for many applications. What about support for “big int”? Response: decimal won’t give you big int for apps like crypto (only 53 bits). - Committee: we can’t change these ops for double for backward compatibility reasons. - Doug points out that the community is comfortable with the internal conversion to int. - Dick is comfortable with following that precedent for decimal. - Example:
function f(v) {} use int ; f(1.6);
- Lars says that you should get 1.6 passed to f() because use pragma affects operators, such as:
1.6 + 3; // 1 + 3 because of use int pragma.
Lars: history of use pragma. It was brought in to help with decimal, but maybe it is a mistake to give it a broader effect.
Graydon: new proposal. What if use int is a special case. In a use int block just prevent any use of floating point literals at all.
Lars: this has practical appeal, but is inconsistent with ‘use decimal’ and ‘use float’ and it follows that we would just get rid of use decimal. I propose we don’t make this change.
Michael: what about having a pragma that throws on overflow.
Brendan: Requests for this are rare. So what is the meaning of use pragma? Going through the wiki discussion. Question 4 applies to this discussion.
Dave: What does the type checker say when it sees two ints added that could be int or double.
Lars: It would have to call it numeric.
Recap problems:
1. Annotations on values don’t completely control how the numbers are converted.
Current Spec draft: The use pragma affects:
Question 1: what does use Number mean?
Question 2: var v:Number
X = new Number (3) // 3.0d
Problem is that Number is an alias, so you can’t really construct a number.
One idea is to say “class Number is Double”.
Question 3: Should use decimal affect use Number? Proposal that “class Number is Double” creates a bw compat problem because Number is a wrapper in es3.
Second idea is:
dynamic class Number { var d:Double; }
Jeff: The second idea would be incompatible with the AS3 implementation.
Resolved that Number should be a wrapper class (second idea).
Lars: could be useful if you are in use decimal and want to drop back into default.
Brendan: what about ‘use default numeric’
The issue is whether we should add lower case versions of primitives that are unboxed and very fast, and leave upper case versions that are backward compatible.
The only primitive that is at issue here is String. All other primitives can be dynamic and not final.
Lars: proposes that we make String dynamic and nonfinal.
Dave: In Java, there are security concerns about extendable String, so String is final in Java
Lars: what about making String like Number. Make it a bw compat class, and add a new lower case string class that is final and not dynamic.
What about lower case Boolean?
Lars: For Boolean, maybe we should just seal it and break bw compat.
Brendan: I’d prefer to add lower case versions for Number, Boolean, String. Jeff agrees.
Resolved: Further discussion lead to a decision to drop lower case versions of Boolean and String because the addition of the two do not provide any efficiency benefit because intrinsic provides early binding (recall that intrinsic implies final).
(This leaves us with Number, String, and Boolean backward compatible but fairly optimizable. The differences with AS3 are:
“hi”.foo = 42 and the more common s = new String(”hi”); s.foo = 42; ....It would be good to get Ed’s comments here. — Brendan Eich 2007/01/24 14:41)
LUNCH
Class C { function f() 37 -1; }
Lars: what does this mean? I think we should have auto semicolon insertion after 37.
We discussed all the awful sorts of magical function names again. Some revised opinions on this since the last meeting. Current elaboration follows.
In Source In Impl Handles
--------- ------- -------
function get y() {} "virtual" prop-state x.y
function set y(z) {} "virtual" prop-state x.y = z
class X { ctor function plus new X(y);
function X(y) {} static X.construct(y):X!
} that calls new X(y)
class X {
intrinsic function invoke() {} normal function z = new X(y);
} z();
when no function closure
found in magic slot
class X {
static intrinsic function invoke(y) {} normal function z = X(y);
} when no function closure
found in magic slot
class X {
static intrinsic function to() {} normal function y to X;
}
function get*(n:string) {} magic part of object x.y
function set*(n:string) {} magic part of object x.y
function call*(n:string) {} magic part of object x.y
(special name lookup stage,
after fixtures, before
dynamic props)
eval vs. with, how to reform eval, alternative syntax or keyword ideas, etc.use safe eval and use unsafe eval, orthogonal to strict/standard and in addition to resurrected eval.use safe eval, eval cannot create bindings in its caller’s lexical or dynamic scope because it gets its own variable object and implicit blockeval can still see its caller’s bindings and mutate the values of any mutable bindings, subject to type constraints.eval callers and eval‘ed programs (strict is propagated to eval, as are other pragmas such as use decimal).eval in strict mode without a use safe eval pragma being in effect.safe and unsafe as strawman proposals; we don’t want false advertising. Suggestions welcome.““ is a different object.var s1 = ““, s2 = ““; s1.foo = 42; assert(s1.foo === 42); assert(s2.foo === undefined).s1.foo = 42; assert(s1.foo === undefined) – each . operator creates a new wrapper.undefined.s = new String(...) uses on the web that want a mutable String object.string type for literals, concatenation results, and a backward-compatible String that can box string.boolean and Boolean – need the former because in b = new Boolean(false); if (b) ..., b always tests as true.string and boolean help avoid boxing costs.string and boolean are non-nullable and final.String and Boolean be final?string and boolean are final.String.prototype with new methods, expects them to apply to string primitive values. Suggest string <: String. Details to be worked out in the February minutes, or beyond. — Brendan Eich 2007/02/23 10:05
One change to yesterday’s discussion: introduce a new type {*} to represent the type of untyped objects (”star for objects”), rather than making {} a special case. So {} still means the structural object type with no fields.
Some types are considered to be identical to each other (like a shorthand) including:
[] and [*] and Array{} and Objectthis type in a function is this:*this type in a method of T is this:TT is (T,Null)T <: UT != U, they can’t both be subtypes of each other)T ~: UT may not be a subtype of U but can be used compatibly with UT ~ U for T ~: U and U ~: T*:T <: U ------ ------ ------ T ~: U T ~: * * ~: T
{*}:
------------------------ ------------------------
{x1:S1 ... xn:Sn} ~: {*} {*} ~: {x1:S1 ... xn:Sn}
-------------------- -------------------- Array ~: [T1,...,Tn] [T1,...,Tn] ~: Array
U' ~: U T ~: T' forall i <= n. Si' ~: Si -------------------------------------------------------------- function(this:U,S1 .. Sn):T ~: function(this:U',S1' .. Sn'):T' U' ~: U T ~: T' forall i <= m. Si' ~: Si forall m < i <= n. Si' ~: V ------------------------------------------------------------------- function(this:U,S1 .. Sm,...V):T ~: function(this:U',S1' .. Sn'):T' U' ~: U T ~: T' forall m < i <= n. Si' ~: V forall n < i <= m. V' ~: Si V' ~: V ------------------------------------------------------------------------- function(this:U,S1 .. Sm,...V):T ~: function(this:U',S1' .. Sn',...V'):T'
exists i. S ~: Ti ----------------- S ~: (T1,...,Tn)
forall i <= m. Si ~ Ti
-------------------------------------- (m <= n)
{x1:S1 ... xm:Sm} ~: {x1:T1 ... xn:Tn}
forall i < m. Si ~ Ti
forall m <= i <= n. Sm ~ Ti
--------------------------- (0 < m <= n)
[S1,...,Sm] ~: [T1,...,Tn]
example: [int,*] ~: [int,bool,string]
forall i < m. Si ~ Ti
forall m <= i <= n. Si ~ Tm (m > n > 0)
---------------------------
[S1,...,Sm] ~: [T1,...,Tn]
example: [int,bool,string] ~: [int,*]
T ~~> UT may not be compatible with U, but can be used as a U via a conversionT ~: U ------- T ~~> U
to methods:T is a class static T.intrinsic::to : S' -> T S ~~> S' -------------------------------- S ~~> T
to methods live in? – intrinsic{*} type (for “untyped object”)? – yepI’m folding these rules back into the type_system page.
I’m not deleting the rules from here, since they’re a record of the meeting, but they’re not authoritative. Future changes will go in the spec page.
— Dave Herman 2007/01/26 13:36
Ambiguity between package reference and dotted object reference. Resolved:
I1 . .. . In to either a package dereference or an object dereference path:I1 . .. . Im that is either an imported path or the name of a package in this compilation unit(I1 . .. . Im-1)::Im; then resolve the rest of the path as an object dereference path from this expression(I1 . .. . Im)::Im+1, then recursively resolve Im+2 . .. . Inwith) have no effect on this resolution process, since it happens in the definer long before runtime— Dave Herman 2007/01/26 16:24
cast if you just want to assert it’s not null (get an error if it is)switch type and it’s well-typed (yay Modula-3)— Dave Herman 2007/01/26 17:33
eval— Dave Herman 2007/01/26 17:33
hasOwnProperty or toJSONStringObject.wrap or somethingDict class like AS3, with to-conversions defined from other objects#{...} syntax for special hash objects (would then need the type system to know the difference, because you can’t call Object prototype methods on these)— Dave Herman 2007/01/26 17:33